Home / Development / Documentation / 2.0.44 / NodeDataComboBoxModel
TreeGraph 2
 


info.bioinfweb.treegraph.gui.dialogs.nodebranchdatainput
Class NodeDataComboBoxModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by info.bioinfweb.treegraph.gui.dialogs.nodebranchdatainput.NodeDataComboBoxModel
All Implemented Interfaces:
Serializable, ComboBoxModel, ListModel

public class NodeDataComboBoxModel
extends AbstractListModel
implements ComboBoxModel

See Also:
Serialized Form

Field Summary
private  Vector<NodeBranchDataAdapter> adapters
           
private  NodeBranchDataAdapter selected
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
NodeDataComboBoxModel()
           
 
Method Summary
private  void addNewAdapters()
           
 NodeBranchDataAdapter getElementAt(int pos)
           
 NodeBranchDataAdapter getSelectedItem()
           
 int getSize()
           
 void setAdapters(Tree tree)
          Equvilent to a call of setAdapters(tree, true, false, false).
 void setAdapters(Tree tree, boolean nodeNamesSelectable, boolean branchLengthSelectable, boolean decimalOnly, boolean newIDSelectable)
           
 void setOnlyNewAdapters()
           
 boolean setSelectedAdapter(Class<? extends NodeBranchDataAdapter> adapterClass)
          Selects the adapter which is an instance (not instance of a subclass) of the given class.
 boolean setSelectedAdapter(NodeBranchDataAdapter adapter)
          Selects the adapter which is an instance (not instance of a subclass) of same class as the given adapter and has the same ID (if it is an adapter for ID elements).
 void setSelectedItem(Object item)
           
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Field Detail

adapters

private Vector<NodeBranchDataAdapter> adapters

selected

private NodeBranchDataAdapter selected
Constructor Detail

NodeDataComboBoxModel

public NodeDataComboBoxModel()
Method Detail

setAdapters

public void setAdapters(Tree tree)
Equvilent to a call of setAdapters(tree, true, false, false).

Parameters:
tree -
See Also:
info.bioinfweb.treegraph.gui.dialogs.nodebranchdatainput.NodeDataComboBoxModel#setAdapters(Tree, boolean, boolean)

addNewAdapters

private void addNewAdapters()

setOnlyNewAdapters

public void setOnlyNewAdapters()

setAdapters

public void setAdapters(Tree tree,
                        boolean nodeNamesSelectable,
                        boolean branchLengthSelectable,
                        boolean decimalOnly,
                        boolean newIDSelectable)
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
decimalOnly - only adapters for node/branch data columns that contain at least one decimal element are included (This flag overwrites nodeNamesSelectable and branchLengthSelectable.)
newIDSelectable - If true an adaptor for a new user defined label ID is added. Note that ths label ID has still to be set. This adapters are also added if decimalOnly is true.

setSelectedAdapter

public boolean setSelectedAdapter(Class<? extends NodeBranchDataAdapter> 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

setSelectedAdapter

public boolean setSelectedAdapter(NodeBranchDataAdapter adapter)
Selects the adapter which is an instance (not instance of a subclass) of same class as the given adapter and has the same ID (if it is an adapter for ID elements).

Parameters:
adapter -
Returns:
true, if one adapter was selected, false, if no adapter of the given class (with the given ID) was found

getSelectedItem

public NodeBranchDataAdapter getSelectedItem()
Specified by:
getSelectedItem in interface ComboBoxModel

setSelectedItem

public void setSelectedItem(Object item)
Specified by:
setSelectedItem in interface ComboBoxModel

getElementAt

public NodeBranchDataAdapter getElementAt(int pos)
Specified by:
getElementAt in interface ListModel

getSize

public int getSize()
Specified by:
getSize in interface ListModel