|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.bioinfweb.treegraph.document.IDManager
public class IDManager
Field Summary | |
---|---|
static String |
RAND_CHARS
|
static int |
RAND_LENGTH
|
private static Comparator<String> |
STRING_COMPARATOR
|
Constructor Summary | |
---|---|
IDManager()
|
Method Summary | |
---|---|
static boolean |
containsIDElements(Node root)
Test whether the subtree under root contains at least one ID element (label or
hidden data) |
static TextElementData |
getDataByID(Node node,
String id)
Returns the text element data specified by the given ID which is linked to this node (either from a text label, hidden node data or hidden branch data). |
static IconLabel |
getFirstIconLabel(Node root,
String id)
Returns the first icon label with the specified ID to be found in the subtree under root . |
static Label |
getFirstLabel(Node root,
String id)
Returns the first label with the specified ID to be found in the subtree under root . |
static TextLabel |
getFirstTextLabel(Node root,
String id)
Returns the first text label with the specified ID to be found in the subtree under root . |
static String[] |
getHiddenBranchDataIDs(Node root)
Searches for all the IDs of hidden data that is assigned to a branch present in the subtree under root. |
static Vector<String> |
getHiddenBranchDataIDVector(Node root)
|
static String[] |
getHiddenNodeDataIDs(Node root)
Searches for all the IDs of hidden data that is assigned to a node present in the subtree under root. |
static Vector<String> |
getHiddenNodeDataIDVector(Node root)
|
static Vector<String> |
getIconLabelIDVector(Node root)
|
static String[] |
getIDs(Node root)
Searches for all IDs (hidden data and label IDs) present in the subtree under root. |
static Vector<String> |
getIDVector(Node root)
Searches for all IDs present in the subtree under root. |
static String[] |
getLabelIDs(Node root)
Searches for all label IDs present in the subtree under root. |
static Vector<String> |
getLabelIDVector(Node root)
|
static String[] |
getTextLabelIDs(Node root)
|
static Vector<String> |
getTextLabelIDVector(Node root)
|
private static Vector<String> |
getVector(Node root,
boolean includeTextLabels,
boolean includeIconLabels,
boolean includeNodeHiddenData,
boolean includeBranchHiddenData)
Returns a vector of IDs which is sorted alphabetically. |
static boolean |
idExists(Node root,
String id)
|
static String |
newID(Vector<String> ids)
|
private static void |
renameHiddenDataID(HiddenDataElement element,
String oldName,
String newName)
|
static void |
renameID(String oldName,
String newName,
Tree tree)
Renames a data ID in the specified tree and updates possible links to this ID in pie chart labels. |
private static void |
renameIDSubtree(String oldName,
String newName,
Node root)
Changes all occurrences of the given ID in the subtree under root. |
private static void |
renameLabelIDInLabelBlock(String oldName,
String newName,
Labels labels,
boolean above)
|
private static void |
searchHiddenDataIDs(HiddenDataElement element,
Vector<String> list)
|
private static void |
searchIDsInSubtree(Node root,
Vector<String> list,
boolean includeTextLabels,
boolean includeIconLabels,
boolean includeNodeHiddenData,
boolean includeBranchHiddenData)
|
private static void |
searchLabelIDsInLabelBlock(Labels labels,
boolean above,
boolean includeTextLabels,
boolean includeIconLabels,
Vector<String> list)
Adds all label IDs to the specified list. |
private static void |
updatePieChartLabels(String oldName,
String newName,
Node root)
Updates the renamed ID if it is referenced by pie chart label in the subtree under root . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String RAND_CHARS
public static final int RAND_LENGTH
private static final Comparator<String> STRING_COMPARATOR
Constructor Detail |
---|
public IDManager()
Method Detail |
---|
private static void searchLabelIDsInLabelBlock(Labels labels, boolean above, boolean includeTextLabels, boolean includeIconLabels, Vector<String> list)
labels
- above
- list
- private static void searchHiddenDataIDs(HiddenDataElement element, Vector<String> list)
private static void searchIDsInSubtree(Node root, Vector<String> list, boolean includeTextLabels, boolean includeIconLabels, boolean includeNodeHiddenData, boolean includeBranchHiddenData)
public static String[] getIDs(Node root)
root
- the root node of the subtree to be searched.
public static boolean containsIDElements(Node root)
root
contains at least one ID element (label or
hidden data)
root
-
true
if an ID element was foundpublic static String[] getLabelIDs(Node root)
root
- the root node of the subtree to be searched.
public static String[] getTextLabelIDs(Node root)
public static String[] getHiddenBranchDataIDs(Node root)
root
- the root node of the subtree to be searched.
public static String[] getHiddenNodeDataIDs(Node root)
root
- the root node of the subtree to be searched.
private static Vector<String> getVector(Node root, boolean includeTextLabels, boolean includeIconLabels, boolean includeNodeHiddenData, boolean includeBranchHiddenData)
root
- includeLabels
- includeNodeHiddenData
- includeBranchHiddenData
-
public static Vector<String> getIDVector(Node root)
root
- the root node of the subtree to be searched.
public static Vector<String> getLabelIDVector(Node root)
public static Vector<String> getTextLabelIDVector(Node root)
public static Vector<String> getIconLabelIDVector(Node root)
public static Vector<String> getHiddenBranchDataIDVector(Node root)
public static Vector<String> getHiddenNodeDataIDVector(Node root)
private static void renameLabelIDInLabelBlock(String oldName, String newName, Labels labels, boolean above)
private static void renameHiddenDataID(HiddenDataElement element, String oldName, String newName)
private static void renameIDSubtree(String oldName, String newName, Node root)
root
- the root node of the subtree where the renaming should take placeprivate static void updatePieChartLabels(String oldName, String newName, Node root)
root
.
oldName
- the current IDnewName
- the new IDroot
- the root of the subtree to be updatedpublic static void renameID(String oldName, String newName, Tree tree)
oldName
- the current IDnewName
- the new IDtree
- the tree to rename the IDs inpublic static String newID(Vector<String> ids)
public static TextElementData getDataByID(Node node, String id)
node
- the node to which the returned value is linked
null
of the specified ID is not presentpublic static Label getFirstLabel(Node root, String id)
root
.
root
- id
-
public static TextLabel getFirstTextLabel(Node root, String id)
root
.
root
- id
-
public static IconLabel getFirstIconLabel(Node root, String id)
root
.
root
- id
-
public static boolean idExists(Node root, String id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |