info.bioinfweb.treegraph.document
Class TreeSerializer
java.lang.Object
info.bioinfweb.treegraph.document.TreeSerializer
public class TreeSerializer
- extends java.lang.Object
|
Method Summary |
private static void |
addLabelBlock(java.util.Vector<PaintableElement> list,
Labels labels,
boolean above)
|
private static void |
addLabelsWithID(java.util.Vector<Label> list,
Node root,
java.lang.String id)
|
private static void |
addLeafNodesBetween(java.util.Vector<Node> list,
Node root,
int level,
TreePath upperPath,
TreePath lowerPath)
|
private static void |
addSubtree(java.util.Vector<PaintableElement> list,
Node root,
boolean leafsOnly,
boolean node,
boolean branch,
boolean label)
|
static Branch[] |
getBranches(Node root)
|
static
|
getElements(Node root,
T[] array,
boolean leafsOnly,
boolean node,
boolean branch,
boolean label)
|
static
|
getElementsOfType(Node root,
PaintableElement typeElement,
T[] array,
boolean leafsOnly)
|
static Label[] |
getLabels(Labels labels)
Returns all labels of this labels-object. |
static Label[] |
getLabels(Node root)
Returns all labels in the subtree under root. |
static Label[] |
getLabelsWithID(Node root,
java.lang.String id)
|
private static void |
getLabelsWithIDInBlock(java.util.Vector<Label> list,
Labels labels,
boolean above,
java.lang.String id)
|
static Node[] |
getLeafNodes(Node root)
|
static Node[] |
getLeafNodesBetween(Node upperLeaf,
Node lowerLeaf)
|
static Legend[] |
getLegendsInSubtree(Tree tree,
Node root)
Returns an array of all legends which are completely anchored inside the subtree under
root. |
static LineElement[] |
getLineElements(Node root)
|
static Node[] |
getNodes(Node root)
|
static ConcretePaintableElement[] |
getPaintableElements(Node root)
|
static TextElement[] |
getTextElements(Node root)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TreeSerializer
public TreeSerializer()
addLabelBlock
private static void addLabelBlock(java.util.Vector<PaintableElement> list,
Labels labels,
boolean above)
addSubtree
private static void addSubtree(java.util.Vector<PaintableElement> list,
Node root,
boolean leafsOnly,
boolean node,
boolean branch,
boolean label)
getElements
public static <T> T[] getElements(Node root,
T[] array,
boolean leafsOnly,
boolean node,
boolean branch,
boolean label)
getElementsOfType
public static <T> T[] getElementsOfType(Node root,
PaintableElement typeElement,
T[] array,
boolean leafsOnly)
getPaintableElements
public static ConcretePaintableElement[] getPaintableElements(Node root)
getLineElements
public static LineElement[] getLineElements(Node root)
getTextElements
public static TextElement[] getTextElements(Node root)
getNodes
public static Node[] getNodes(Node root)
getBranches
public static Branch[] getBranches(Node root)
getLabels
public static Label[] getLabels(Node root)
- Returns all labels in the subtree under root.
- Parameters:
root -
- Returns:
getLabels
public static Label[] getLabels(Labels labels)
- Returns all labels of this labels-object. (No labels from the subtree under the holding branch are
returned.)
- Parameters:
labels -
- Returns:
getLeafNodes
public static Node[] getLeafNodes(Node root)
addLeafNodesBetween
private static void addLeafNodesBetween(java.util.Vector<Node> list,
Node root,
int level,
TreePath upperPath,
TreePath lowerPath)
getLeafNodesBetween
public static Node[] getLeafNodesBetween(Node upperLeaf,
Node lowerLeaf)
getLabelsWithIDInBlock
private static void getLabelsWithIDInBlock(java.util.Vector<Label> list,
Labels labels,
boolean above,
java.lang.String id)
addLabelsWithID
private static void addLabelsWithID(java.util.Vector<Label> list,
Node root,
java.lang.String id)
getLabelsWithID
public static Label[] getLabelsWithID(Node root,
java.lang.String id)
getLegendsInSubtree
public static Legend[] getLegendsInSubtree(Tree tree,
Node root)
- Returns an array of all legends which are completely anchored inside the subtree under
root.
- Parameters:
tree - - the tree that cotains the legends and rootroot - - the root node of the subtree
- Returns:
- an array of the legends (possibly with the length 0)
- Throws:
java.lang.IllegalArgumentException - if root is not contained in tree.- See Also:
Node.containedInSubtree(ConcretePaintableElement)