Home / Development / Documentation / 2.0.44 / TreeClipboard
TreeGraph 2
 


info.bioinfweb.treegraph.document.clipboard
Class TreeClipboard

java.lang.Object
  extended by info.bioinfweb.treegraph.document.clipboard.TreeClipboard

public class TreeClipboard
extends Object

This class is a clipboard for tree elements. It can store a single label, a list of labels or a node with its subtree. Note that only one of the three types of elements can be stored at one time.

Author:
Ben Stöver

Field Summary
private  Label label
           
private  Vector<Label> labelList
           
private  Legend legend
           
private  Legend[] subtreeLegends
           
private  Node subtreeRoot
           
 
Constructor Summary
TreeClipboard()
           
 
Method Summary
 void clear()
          Clears all stored data (labelList, label, subtree).
 void copyLabel(Label label)
           
private  void copyLabelBlock(Labels labels, boolean above)
           
 void copyLabels(Labels labels)
           
 void copyLegend(Legend legend)
           
 void copySubtree(Tree tree, Node root)
           
 ClipboardContentType getContentType()
           
 Label getLabel()
          Returns a deep copy of the label in the clipboard.
 Label[] getLabelList()
          Returns a deep copy of the label list in the clipboard.
 Legend getLegend()
          Returns a deep copy of the legend in the clipboard.
 Node getSubtree()
          Returns a deep copy of the subtree in the clipboard.
 Legend[] getSubtreeLegends()
          Returns deep copies of the legends attached to the subtree in the clipboard.
 boolean isEmpty()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subtreeRoot

private Node subtreeRoot

subtreeLegends

private Legend[] subtreeLegends

labelList

private Vector<Label> labelList

label

private Label label

legend

private Legend legend
Constructor Detail

TreeClipboard

public TreeClipboard()
Method Detail

copySubtree

public void copySubtree(Tree tree,
                        Node root)

copyLabel

public void copyLabel(Label label)

copyLabelBlock

private void copyLabelBlock(Labels labels,
                            boolean above)

copyLabels

public void copyLabels(Labels labels)

copyLegend

public void copyLegend(Legend legend)

getLabel

public Label getLabel()
Returns a deep copy of the label in the clipboard.

Throws:
TreeClipboardException - if no label is stored.

getLabelList

public Label[] getLabelList()
Returns a deep copy of the label list in the clipboard.

Throws:
TreeClipboardException - if no label list is stored.

getSubtree

public Node getSubtree()
Returns a deep copy of the subtree in the clipboard. Note that the returned nodes have the same unique names as the original nodes had.

Throws:
TreeClipboardException - if no subtree is stored.

getSubtreeLegends

public Legend[] getSubtreeLegends()
Returns deep copies of the legends attached to the subtree in the clipboard.

Returns:
the legends or an empty array if the subtree contains no legends
Throws:
TreeClipboardException - if no subtree is stored.

getLegend

public Legend getLegend()
Returns a deep copy of the legend in the clipboard.

Throws:
TreeClipboardException - if no label is stored.

clear

public void clear()
Clears all stored data (labelList, label, subtree).


isEmpty

public boolean isEmpty()

getContentType

public ClipboardContentType getContentType()