Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## info.bioinfweb.treegraph.document.io.xtg
Class XTGReader

    java.lang.Object
      info.bioinfweb.treegraph.document.io.AbstractDocumentReader
          info.bioinfweb.treegraph.document.io.xtg.XTGReader

All Implemented Interfaces:
  DocumentReader, XTGConstants

    public class XTGReader

extends AbstractDocumentReader
implements XTGConstants

Reads the TreeGraph 2 specific XML format (*.xtg).
If the document contains additional (not defined tags) they are ignored. Note that they can not transfered to the internal data structure and therefor a not written back to a document generated with TreeGraph 2.
If defined attributes are missing in the document, standard values are used.

Author:
  Ben Stöver

Field Summary
`private XMLEventReader` | `reader`

Fields inherited from class info.bioinfweb.treegraph.document.io.AbstractDocumentReader
`document, loadLogger`

Fields inherited from interface info.bioinfweb.treegraph.document.io.xtg.XTGConstants
`ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TREE_WIDTH, ATTR_ALIGN_TO_SUBTREE, ATTR_BG_COLOR, ATTR_BOTTOM, ATTR_BRANCH_LENGTH, ATTR_BRANCH_LENGTH_SCALE, ATTR_CONSTANT_WIDTH, ATTR_DECIMAL_FORMAT, ATTR_EDGE_RADIUS, ATTR_FONT_FAMILY, ATTR_HEIGHT, ATTR_ICON, ATTR_ICON_FILLED, ATTR_ICON_HEIGHT, ATTR_ICON_WIDTH, ATTR_ID, ATTR_LABEL_ABOVE, ATTR_LABEL_HEIGHT, ATTR_LABEL_SPACING, ATTR_LABEL_WIDTH, ATTR_LEFT, ATTR_LEGEND_POS, ATTR_LEGEND_SPACING, ATTR_LEGEND_STYLE, ATTR_LINE_COLOR, ATTR_LINE_NO, ATTR_LINE_POS, ATTR_LINE_WIDTH, ATTR_LOCALE_COUNTRY, ATTR_LOCALE_LANG, ATTR_LOCALE_VARIANT, ATTR_LONG_INTERVAL, ATTR_MIN_BRANCH_LENGTH, ATTR_MIN_SPACE_ABOVE, ATTR_MIN_SPACE_BELOW, ATTR_MIN_TREE_DISTANCE, ATTR_POSITION_LABELS_TO_LEFT, ATTR_RIGHT, ATTR_SCALE_BAR_ALIGN, ATTR_SCALE_BAR_DISTANCE, ATTR_SCALE_BAR_HEIGHT, ATTR_SCALE_BAR_INCREASE, ATTR_SCALE_BAR_START, ATTR_SCALE_BAR_WIDTH, ATTR_SHOW_INTERNAL_LINES, ATTR_SHOW_NULL_LINES, ATTR_SHOW_ROOTED, ATTR_SHOW_SCALE_BAR, ATTR_SMALL_INTERVAL, ATTR_TEXT, ATTR_TEXT_COLOR, ATTR_TEXT_HEIGHT, ATTR_TEXT_IS_DECIMAL, ATTR_TEXT_ORIENTATION, ATTR_TEXT_STYLE, ATTR_TOP, ATTR_UNIQUE_NAME, ATTR_WIDTH, BRANCH_LENGTH_UNITS, FULL_SCHEMA_LOCATION, MILLIMETERS, NAMESPACE_URI, ORIENT_DOWN, ORIENT_HORIZONTAL, ORIENT_UP, PRE_LEGEND_ANCHOR, STYLE_BOLD, STYLE_BRACE, STYLE_BRACKET, STYLE_ITALIC, STYLE_UNDERLINE, TAG_BRANCH, TAG_DOC_MARGIN, TAG_GLOBAL_FORMATS, TAG_HIDDEN_DATA, TAG_ICON_LABEL, TAG_LABEL_MARGIN, TAG_LEAF_MARGIN, TAG_LEGEND, TAG_LEGEND_MARGIN, TAG_NODE, TAG_PIE_CHART_ID, TAG_PIE_CHART_IDS, TAG_PIE_CHART_LABEL, TAG_ROOT, TAG_SCALE_BAR, TAG_TEXT_LABEL, TAG_TREE, VERSION`

Constructor Summary
`XTGReader()`

Method Summary
`private void` | `checkNameSpace(StartElement element)` Outputs warnings about the XML namespace and sets the version of `document`.
`Document` | `read(File file, LoadLogger loadLogger, NodeBranchDataAdapter internalAdapter, NodeBranchDataAdapter branchLengthsAdapter, TreeSelector selector, boolean translateInternalNodes)` If you want to implement file specific functionalities you should override this method.
`Document` | `read(InputStream stream, LoadLogger loadLogger, NodeBranchDataAdapter internalAdapter, NodeBranchDataAdapter branchLengthsAdapter, TreeSelector selector, boolean translateInternalNodes)`
`private void` | `readAnchor(StartElement rootElement, Legend l, int no)`
`private void` | `readBranch(StartElement rootElement, Branch b)`
`private void` | `readDecimalFormat(TextFormats f, StartElement element, String prefix)`
`private void` | `readDistanceDimensionAttr(DistanceDimension d, StartElement element)`
`private void` | `readDistanceValueAttr(DistanceValue value, StartElement element, QName name)`
`private void` | `readDocument(StartElement rootElement)`
`private void` | `readGlobalFormats(StartElement rootElement)`
`private void` | `readGraphicalLabelDimensions(GraphicalLabelFormats f, StartElement element)`
`private void` | `readHiddenData(StartElement element, HiddenDataMap list)`
`private void` | `readIconLabel(StartElement rootElement, Labels labels)`
`private void` | `readLabelData(StartElement rootElement, Label l)` This method also reads the subelements of the root element.
`private void` | `readLegend(StartElement rootElement, Legends legends)`
`private void` | `readLineAttr(LineFormats f, StartElement element)`
`private void` | `readMargin(Margin m, StartElement element)`
`private void` | `readPieChartIDs(PieChartLabel l)`
`private void` | `readPieChartLabel(StartElement rootElement, Labels labels)`
`private void` | `readScaleBar(StartElement element, ScaleBar s)`
`private void` | `readScaleValueAttr(ScaleValue value, StartElement element, QName name)`
`private Node` | `readSubtree(StartElement rootElement)`
`private void` | `readTextElementDataAttr(TextElementData data, StartElement element)`
`private void` | `readTextFormatsAttr(TextFormats f, StartElement element, String prefix)`
`private void` | `readTextLabel(StartElement rootElement, Labels labels)`
`private void` | `readTextStyleAttr(TextFormats f, StartElement element)`
`private void` | `readTree(StartElement rootElement)`

Methods inherited from class info.bioinfweb.treegraph.document.io.AbstractDocumentReader
`reachElementEnd, reachElementEnd, read, read, read, read`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### reader

    private XMLEventReader reader

Constructor Detail

### XTGReader

    public XTGReader()

Method Detail

### readDistanceValueAttr

    private void readDistanceValueAttr(DistanceValue value,
                                       StartElement element,
                                       QName name)

### readTextElementDataAttr

    private void readTextElementDataAttr(TextElementData data,
                                         StartElement element)

### readDistanceDimensionAttr

    private void readDistanceDimensionAttr(DistanceDimension d,
                                           StartElement element)

### readMargin

    private void readMargin(Margin m,
                            StartElement element)
                     throws XMLStreamException

  Parameters:
    `m` -
    `element` -
  Throws:
    `XMLStreamException`
  Since:
    2.0.41

### readGlobalFormats

    private void readGlobalFormats(StartElement rootElement)
                            throws XMLStreamException

  Throws:
    `XMLStreamException`

### readTextStyleAttr

    private void readTextStyleAttr(TextFormats f,
                                   StartElement element)

### readDecimalFormat

    private void readDecimalFormat(TextFormats f,
                                   StartElement element,
                                   String prefix)

### readTextFormatsAttr

    private void readTextFormatsAttr(TextFormats f,
                                     StartElement element,
                                     String prefix)

### readLineAttr

    private void readLineAttr(LineFormats f,
                              StartElement element)

### readBranch

    private void readBranch(StartElement rootElement,
                            Branch b)
                     throws XMLStreamException

  Throws:
    `XMLStreamException`

### readPieChartIDs

    private void readPieChartIDs(PieChartLabel l)
                          throws XMLStreamException

  Throws:
    `XMLStreamException`

### readLabelData

    private void readLabelData(StartElement rootElement,
                               Label l)
                        throws XMLStreamException

  This method also reads the subelements of the root element. Therefor no more attributes can be read after the call of this method.

  Parameters:
    `rootElement` -
    `label` -
  Throws:
    `XMLStreamException`

### readTextLabel

    private void readTextLabel(StartElement rootElement,
                               Labels labels)
                        throws XMLStreamException

  Throws:
    `XMLStreamException`

### readGraphicalLabelDimensions

    private void readGraphicalLabelDimensions(GraphicalLabelFormats f,
                                              StartElement element)

### readIconLabel

    private void readIconLabel(StartElement rootElement,
                               Labels labels)
                        throws XMLStreamException

  Throws:
    `XMLStreamException`

### readPieChartLabel

    private void readPieChartLabel(StartElement rootElement,
                                   Labels labels)
                            throws XMLStreamException

  Throws:
    `XMLStreamException`

### readHiddenData

    private void readHiddenData(StartElement element,
                                HiddenDataMap list)
                         throws XMLStreamException

  Throws:
    `XMLStreamException`

### readSubtree

    private Node readSubtree(StartElement rootElement)
                      throws XMLStreamException

  Throws:
    `XMLStreamException`

### readScaleValueAttr

    private void readScaleValueAttr(ScaleValue value,
                                    StartElement element,
                                    QName name)

### readScaleBar

    private void readScaleBar(StartElement element,
                              ScaleBar s)
                       throws XMLStreamException

  Throws:
    `XMLStreamException`

### readAnchor

    private void readAnchor(StartElement rootElement,
                            Legend l,
                            int no)

### readLegend

    private void readLegend(StartElement rootElement,
                            Legends legends)
                     throws XMLStreamException

  Throws:
    `XMLStreamException`

### readTree

    private void readTree(StartElement rootElement)
                   throws XMLStreamException

  Throws:
    `XMLStreamException`

### readDocument

    private void readDocument(StartElement rootElement)
                       throws XMLStreamException

  Throws:
    `XMLStreamException`

### checkNameSpace

    private void checkNameSpace(StartElement element)

  Outputs warnings about the XML namespace and sets the version of `document`.

  Parameters:
    `element` -

### read

    public Document read(InputStream stream,
                         LoadLogger loadLogger,
                         NodeBranchDataAdapter internalAdapter,
                         NodeBranchDataAdapter branchLengthsAdapter,
                         TreeSelector selector,
                         boolean translateInternalNodes)
                  throws Exception

  Specified by:
    `read` in interface `DocumentReader`
  Throws:
    `Exception`

### read

    public Document read(File file,
                         LoadLogger loadLogger,
                         NodeBranchDataAdapter internalAdapter,
                         NodeBranchDataAdapter branchLengthsAdapter,
                         TreeSelector selector,
                         boolean translateInternalNodes)
                  throws Exception

  Description copied from class: `AbstractDocumentReader`
  If you want to implement file specific functionalities you should override this method. It is called by all other `read`-methods with a file as parameter.

  Specified by:
    `read` in interface `DocumentReader`
  Overrides:
    `read` in class `AbstractDocumentReader`
  Throws:
    `Exception`
  See Also:
    `info.bioinfweb.treegraph.document.io.DocumentReader#read(java.io.File, NodeBranchDataAdapter, int)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD