info.bioinfweb.treegraph.gui.dialogs.nodebranchdatainput
Class NodeDataComboBoxModel
java.lang.Object
javax.swing.AbstractListModel
info.bioinfweb.treegraph.gui.dialogs.nodebranchdatainput.NodeDataComboBoxModel
- All Implemented Interfaces:
- Serializable, ComboBoxModel, ListModel
public class NodeDataComboBoxModel
- extends AbstractListModel
- implements ComboBoxModel
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
adapters
private Vector<NodeBranchDataAdapter> adapters
selected
private NodeBranchDataAdapter selected
NodeDataComboBoxModel
public NodeDataComboBoxModel()
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 selectedbranchLengthSelectable - determines whether the branch length adapter can be
selecteddecimalOnly - 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