Package likelihoodDetectionModule
Class TreeTableModel
java.lang.Object
likelihoodDetectionModule.TreeTableModel
- All Implemented Interfaces:
 TreeModel
The TreeTableModel represents a LikelihoodDetectionParameters object
 (which contains module parameters and an ArrayList of TargetConfiguration objects)
 as a node-based tree for use with a JTree. This model is intended to be
 placed within a JTable to represent a tree within the first column of a
 table (specifically, the first column of the TreeTable). It implements
 the standard Java TreeModel interface.
 
 The JTree that this model is used for is the TreeTableCellRenderer that
 is embedded within the TreeTable.
- See Also:
 
- 
Constructor Summary
ConstructorsConstructorDescriptionTreeTableModel(AcquisitionSettings acquisitionSettings, int channelMap) Instantiates a new tree table model. - 
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the target configuration.voidAdds a listener for TreeModel events.voidcreateNewGuardBand(String bandId, String configId) Creates a new guard band for the target configuration specified.voidcreateNewSignalBand(String bandId, String configId) Creates a new signal band for the target configuration specified.voidcreateNewTargetConfiguration(String identifier) Creates a new target configuration using the identifier specified.voiddeleteGuardBandFrom(String bandName, String configName) Delete the specified guard band from the target configuration indicated.voiddeleteSignalBandFrom(String bandName, String configName) Delete the specified signal band from the indicated target configuration.voiddeleteTargetConfiguration(String identifier) Delete the target configuration specified by the identifier.protected voidfireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children) Implements fireTreeNodesChanged from the TreeModel interface.protected voidfireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children) Implements the fireTreeNodesInserted method from the TreeModel interface.protected voidfireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children) Implements the fireTreeNodesRemoved method from the TreeModel interface.protected voidfireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) Implements the fireTreeStructureChanged method from the TreeModel interface.Gets the acquisition settings that are associated with the parameters.Gets the band names used.intGets the channel map that the user has selected.Implementation of getChild from the TreeModel interface.intgetChildCount(Object node) Implementation of getChildCount from the TreeModel interface.getColumnClass(int column) Implementation of TreeModel.getColumnClass.intImplementation of TreeModel.getColumnCount().getColumnName(int column) Implementation of TreeModel.getColumnName.Gets the dialog settings.intgetIndexOfChild(Object parent, Object child) Implementation of TreeModel.getIndexOfChild()TreeNode[]getPathToRoot(TreeNode aNode) Builds the parents of node up to and including the root node, where the original node is the last element in the returned array.protected TreeNode[]getPathToRoot(TreeNode aNode, int depth) Builds the parents of node up to and including the root node, where the original node is the last element in the returned array.getRoot()Implementation of getRoot from the TreeModel interface.getSignalBandNames(String configIdentifier) Gets the signal band names in use for the specified target configuration identifier.getTargetConfiguration(String identifier) Gets the target configuration identified by the string.getTargetConfigurationNameForAssociatedBandNode(likelihoodDetectionModule.AssociatedBandNode n) Gets the target configuration name for associated band node.Returns the current state of the internal representation of the configuration data as an ArrayList of TargetConfiguration objects.getValueAt(Object node, int column) Implementation of TreeModel.getValueAt().booleanisCellEditable(Object node, int column) Implementation of TreeModel.isCellEditable.booleanImplementation of isLeaf from the TreeModel interface.voidRemoves a listener for TreeModel events.voidsetAcquisitionSettings(AcquisitionSettings acquisitionSettings) voidSets the configuration dialog expanded state.voidSets the configuration dialog settings that are to be preserved with the LikelihoodDetectionParameters.voidSets the TargetConfigurations that are being managed by the model.voidsetValueAt(Object aValue, Object node, int column) Implementation of TreeModel.setValueAt().Returns an ArrayList of the target configuration names.voidvalueForPathChanged(TreePath path, Object newValue) Empty implementation of valueForPathChanged from the TreeModel interface. 
- 
Constructor Details
- 
TreeTableModel
Instantiates a new tree table model. This constructor only takes in the acquisition settings and the channel map because those are static with respect to configuration while the dialog is open. The actual likelihood detection parameters that the dialog is to represent will be set via the setTargetConfigurations() method.- Parameters:
 acquisitionSettings- the acquisition settingschannelMap- the channel map
 
 - 
 - 
Method Details
- 
getAcquisitionSettings
Gets the acquisition settings that are associated with the parameters.- Returns:
 - the acquisition settings
 
 - 
setAcquisitionSettings
 - 
getChannelMap
public int getChannelMap()Gets the channel map that the user has selected.- Returns:
 - the channel map
 
 - 
targetConfigurationNames
Returns an ArrayList of the target configuration names.- Returns:
 - the array listinvalid input: '<' string>
 
 - 
createNewTargetConfiguration
Creates a new target configuration using the identifier specified. This identifier should be unique to the module. Note that this object does not enforce the uniqueness.- Parameters:
 identifier- the identifier string
 - 
deleteTargetConfiguration
Delete the target configuration specified by the identifier. If the configuration is not found, this method is a no-op.- Parameters:
 identifier- the identifier
 - 
getTargetConfiguration
Gets the target configuration identified by the string. This will return null if the configuration is not found.- Parameters:
 identifier- the identifier- Returns:
 - the target configuration
 
 - 
addTargetConfiguration
Adds the target configuration.- Parameters:
 config- the config
 - 
getBandNames
Gets the band names used.- Returns:
 - the band names
 
 - 
createNewSignalBand
Creates a new signal band for the target configuration specified. The signal band name should be unique for this target configuration. The object does not enforce the uniqueness.- Parameters:
 bandId- The band's unique identifier.configId- The target configuration's unique identifier.
 - 
createNewGuardBand
Creates a new guard band for the target configuration specified. The guard band name should be unique for this target configuration. The object does not enforce the uniqueness.- Parameters:
 bandId- The guard band's unique identifier.configId- The target configuration's unique identifier.
 - 
deleteGuardBandFrom
Delete the specified guard band from the target configuration indicated. If the target configuration or the guard band is not found, this function does nothing.- Parameters:
 bandName- The guard band's unique identifier.configName- The target configuration's unique identifier.
 - 
deleteSignalBandFrom
Delete the specified signal band from the indicated target configuration. If the target configuration or the signal band are not found, this function does nothing.- Parameters:
 bandName- The signal band's unique identifier.configName- The target configuration's unique identifier.
 - 
setTargetConfigurations
Sets the TargetConfigurations that are being managed by the model.- Parameters:
 configs- An ArrayList of TargetConfigurations.
 - 
getPathToRoot
Builds the parents of node up to and including the root node, where the original node is the last element in the returned array. The length of the returned array gives the node's depth in the tree.- Parameters:
 aNode- the TreeNode to get the path for- Returns:
 - the path to root
 
 - 
getPathToRoot
Builds the parents of node up to and including the root node, where the original node is the last element in the returned array. The length of the returned array gives the node's depth in the tree.- Parameters:
 aNode- the TreeNode to get the path fordepth- an int giving the number of steps already taken towards the root (on recursive calls), used to size the returned array- Returns:
 - an array of TreeNodes giving the path from the root to the specified node
 
 - 
setConfigurationDialogSettings
Sets the configuration dialog settings that are to be preserved with the LikelihoodDetectionParameters.- Parameters:
 settings- The new configuration dialog settings.
 - 
getDialogSettings
Gets the dialog settings.- Returns:
 - the dialog settings
 
 - 
setConfigurationDialogExpandedState
Sets the configuration dialog expanded state.- Parameters:
 state- the new configuration dialog expanded state
 - 
getTargetConfigurations
Returns the current state of the internal representation of the configuration data as an ArrayList of TargetConfiguration objects.- Returns:
 - the target configurations
 
 - 
getSignalBandNames
Gets the signal band names in use for the specified target configuration identifier. If the identifier is not found, the resulting vector will be empty.- Parameters:
 configIdentifier- The target configuration's unique identifier.- Returns:
 - the signal band names
 
 - 
getTargetConfigurationNameForAssociatedBandNode
public String getTargetConfigurationNameForAssociatedBandNode(likelihoodDetectionModule.AssociatedBandNode n) Gets the target configuration name for associated band node. This is used when trying to figure out what signal band names are available to be associated with. If a match is not found, null is returned.- Parameters:
 n- The associated band node in the internal representation.- Returns:
 - the target configuration name that contains this associated band node
 
 - 
getChildCount
Implementation of getChildCount from the TreeModel interface.- Specified by:
 getChildCountin interfaceTreeModel- Parameters:
 node- the node- Returns:
 - the child count
 - See Also:
 
 - 
getChild
Implementation of getChild from the TreeModel interface. - 
getRoot
Implementation of getRoot from the TreeModel interface. - 
isLeaf
Implementation of isLeaf from the TreeModel interface. - 
valueForPathChanged
Empty implementation of valueForPathChanged from the TreeModel interface.- Specified by:
 valueForPathChangedin interfaceTreeModel- Parameters:
 path- the pathnewValue- the new value- See Also:
 
 - 
getIndexOfChild
Implementation of TreeModel.getIndexOfChild()- Specified by:
 getIndexOfChildin interfaceTreeModel- Parameters:
 parent- the parentchild- the child- Returns:
 - the index of child
 - See Also:
 
 - 
addTreeModelListener
Adds a listener for TreeModel events.- Specified by:
 addTreeModelListenerin interfaceTreeModel- Parameters:
 l- the l
 - 
removeTreeModelListener
Removes a listener for TreeModel events.- Specified by:
 removeTreeModelListenerin interfaceTreeModel- Parameters:
 l- the l
 - 
fireTreeNodesChanged
protected void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children) Implements fireTreeNodesChanged from the TreeModel interface. This notifies all registered listeners that there is a TreeModelEvent when a node changes.- Parameters:
 source- the sourcepath- the pathchildIndices- the child indiceschildren- the children- See Also:
 
 - 
fireTreeNodesInserted
protected void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children) Implements the fireTreeNodesInserted method from the TreeModel interface. This notifies all registered listeners that a new node has been inserted into the tree.- Parameters:
 source- the sourcepath- the pathchildIndices- the child indiceschildren- the children- See Also:
 
 - 
fireTreeNodesRemoved
protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children) Implements the fireTreeNodesRemoved method from the TreeModel interface. This notifies all registered listeners that a node has been removed from the tree.- Parameters:
 source- the sourcepath- the pathchildIndices- the child indiceschildren- the children- See Also:
 
 - 
fireTreeStructureChanged
protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) Implements the fireTreeStructureChanged method from the TreeModel interface. This notifies all registered listeners that a node has moved position in the tree.- Parameters:
 source- the sourcepath- the pathchildIndices- the child indiceschildren- the children- See Also:
 
 - 
getColumnClass
Implementation of TreeModel.getColumnClass.- Parameters:
 column- the column- Returns:
 - the column class
 - See Also:
 
 - 
isCellEditable
Implementation of TreeModel.isCellEditable.- Parameters:
 node- the nodecolumn- the column- Returns:
 - true, if checks if is cell editable
 - See Also:
 
 - 
setValueAt
Implementation of TreeModel.setValueAt(). This changes the value of a node.- Parameters:
 aValue- the a valuenode- the nodecolumn- the column- See Also:
 
 - 
getColumnCount
public int getColumnCount()Implementation of TreeModel.getColumnCount(). For the purposes of the Likelihood detection configuration widget, the TreeModel is always two columns.- Returns:
 - the column count
 
 - 
getColumnName
Implementation of TreeModel.getColumnName.- Parameters:
 column- the column- Returns:
 - the column name
 - See Also:
 
 - 
getValueAt
Implementation of TreeModel.getValueAt(). The value that gets returned depends on the type of node in the representation being queried about.- Parameters:
 node- the nodecolumn- the column- Returns:
 - the value at
 - See Also:
 
 
 -