info.bioinfweb.treegraph.gui.dialogs.nodedatainput
Class NodeDataInput

java.lang.Object
  extended by info.bioinfweb.treegraph.gui.dialogs.nodedatainput.NodeDataInput
Direct Known Subclasses:
NewNodeDataInput

public class NodeDataInput
extends Object


Field Summary
protected  JComboBox comboBox
           
 
Constructor Summary
NodeDataInput(JPanel panel, int x, int y)
           
 
Method Summary
protected  JComboBox getComboBox()
           
 NodeDataComboBoxModel getModel()
           
 NodeDataAdapter selectedAdapter()
          Returns the currently selected adapter.
 void setAdapters(Tree tree)
          Refeshs the selectable node data adapters.
 void setAdapters(Tree tree, boolean nodeNamesSelectable, boolean branchLengthSelectable, boolean decimalOnly, boolean newIDSelectable)
          Refeshs the selectable node data adapters.
 void setEnabled(boolean enabled)
           
 void setOnlyNewAdapters()
          After the call of this method only adapters which create new data will be available.
 boolean setSelectedAdapter(Class<? extends NodeDataAdapter> adapterClass)
          Selects the adapter which is an instance (not instance of a subclass) of the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comboBox

protected JComboBox comboBox
Constructor Detail

NodeDataInput

public NodeDataInput(JPanel panel,
                     int x,
                     int y)
Method Detail

getModel

public NodeDataComboBoxModel getModel()

getComboBox

protected JComboBox getComboBox()

setEnabled

public void setEnabled(boolean enabled)

setOnlyNewAdapters

public void setOnlyNewAdapters()
After the call of this method only adapters which create new data will be available.


setAdapters

public void setAdapters(Tree tree)
Refeshs the selectable node data adapters.

Parameters:
tree - - the tree which contains the data

setAdapters

public void setAdapters(Tree tree,
                        boolean nodeNamesSelectable,
                        boolean branchLengthSelectable,
                        boolean decimalOnly,
                        boolean newIDSelectable)
Refeshs the selectable node data adapters.

Parameters:
tree - - the tree to obtain the IDs from (Can also be null.)
nodeNamesSelectable - - determines whether the node names adapter can be selected
branchLengthSelectable - - determines whether the branch length adapter can be selected
newIDSelectable - - if true the combo box includes the options "Label with new ID" and "Branch data with new ID"

setSelectedAdapter

public boolean setSelectedAdapter(Class<? extends NodeDataAdapter> adapterClass)
Selects the adapter which is an instance (not instance of a subclass) of the given class.

Parameters:
adapterClass -
Returns:
true, if one adapter was selected, false, if no adapter of the given class was found

selectedAdapter

public NodeDataAdapter selectedAdapter()
Returns the currently selected adapter.

Returns:
the selected adapter (not a copy of it)