|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.bioinfweb.treegraph.document.Tree
public class Tree
Intances of this class provide an enviroment for the rcursive data-structure of tree-elements without their formats.
| Field Summary | |
|---|---|
private GlobalFormats |
formats
|
private Legends |
legends
|
private java.util.EnumMap<PositionPaintType,DistanceDimension> |
paintDimensions
|
private Node |
paintStart
|
private ScaleBar |
scaleBar
|
static java.lang.String |
UNIQUE_NAME_CHARS
|
static int |
UNIQUE_NAME_LENGTH
|
| Constructor Summary | |
|---|---|
Tree()
|
|
| Method Summary | |
|---|---|
void |
assignUniqueNames()
Assigns unique names to all nodes in the tree currently without one. |
private void |
assignUniqueNamesToSubtree(Node root)
Assigns unique names to all nodes in the subtree under root currently without one. |
void |
clear()
Removes all tree elements including all legends from this object. |
boolean |
contains(ConcretePaintableElement element)
Tests if the given element is present in the tree. |
boolean |
containsDecimal(NodeDataAdapter adapter)
Tests if the tree contains a node which would be able to return a decimal value to the given adapter. |
static boolean |
containsDecimal(NodeDataAdapter adapter,
Node root)
Tests if the subtree unter root contains a node which would be
able to return a decimal value to the given adapter. |
GlobalFormats |
getFormats()
|
Legends |
getLegends()
|
static Node |
getLinkedNode(PaintableElement element)
Returns the linked node to the given element. |
static Node |
getNodeByUniqueName(Node root,
java.lang.String uniqueName)
Searches for a node with the given unique name in the subtree under root. |
Node |
getNodeByUniqueName(java.lang.String uniqueName)
Searches for a node with the given unique name in this tree. |
DistanceDimension |
getPaintDimension(PositionPaintType type)
Returnes the stored paint dimension (the size of the document) for the given painter ID. |
Node |
getPaintStart()
|
ScaleBar |
getScaleBar()
|
boolean |
hasAllBranchLengths()
Tests is there are any branches without a defined length in the tree. |
static boolean |
hasAllBranchLengths(Node root)
Tests is there are any branches without a defined length in the subtree under root. |
boolean |
isEmpty()
Tests if there are tree elements present. |
private java.lang.String |
newUniqueName()
Generates a random unique name for a node which is currently not present in this tree. |
void |
setPaintStart(Node paintStart)
|
void |
setScaleBar(ScaleBar scaleBar)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String UNIQUE_NAME_CHARS
public static final int UNIQUE_NAME_LENGTH
private Node paintStart
private ScaleBar scaleBar
private Legends legends
private java.util.EnumMap<PositionPaintType,DistanceDimension> paintDimensions
private GlobalFormats formats
| Constructor Detail |
|---|
public Tree()
| Method Detail |
|---|
public Node getPaintStart()
public void setPaintStart(Node paintStart)
public ScaleBar getScaleBar()
public void setScaleBar(ScaleBar scaleBar)
public Legends getLegends()
public GlobalFormats getFormats()
public boolean isEmpty()
public void clear()
public boolean contains(ConcretePaintableElement element)
element - the element to search for
public DistanceDimension getPaintDimension(PositionPaintType type)
Distancedimension is stored
for this ID and returned.
id - - the painter ID
private java.lang.String newUniqueName()
abcdefghijklmnopqrstuvwxyz01234567890. This means that
there are 2710 ≈ 2 • 1014 different names
possible.
private void assignUniqueNamesToSubtree(Node root)
info.webinsel.treegraph.document.Tree.assignUniqueNames().
root - - the root node of the subtreepublic void assignUniqueNames()
public Node getNodeByUniqueName(java.lang.String uniqueName)
uniqueName - - the searched unique name
public static Node getNodeByUniqueName(Node root,
java.lang.String uniqueName)
root- - the root of the subtree to be searcheduniqueName - - the searched unique name
public static Node getLinkedNode(PaintableElement element)
PaintableElement as follows:
Node: The node itsselfBranch: The target node of this branchLabel: The target node of the holding branchLegend: null
element - - the element which linked node shall be returned
public static boolean hasAllBranchLengths(Node root)
root.
true, if there a no lengths missingpublic boolean hasAllBranchLengths()
hasAllBranchLengths(getPaintStart())
true, if there a no lengths missing
public static boolean containsDecimal(NodeDataAdapter adapter,
Node root)
root contains a node which would be
able to return a decimal value to the given adapter.
adapter - - the adapter to obtain the decimal valueroot - - the root of the subtree to be checked
true if at least one decimal value could be returnedpublic boolean containsDecimal(NodeDataAdapter adapter)
adapter - - the adapter to obtain the decimal value
true if at least one decimal value could be returned
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||