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.
-
Constructor Summary
ConstructorDescriptionTreeTableModel
(AcquisitionSettings acquisitionSettings, int channelMap) Instantiates a new tree table model. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the target configuration.void
Adds a listener for TreeModel events.void
createNewGuardBand
(String bandId, String configId) Creates a new guard band for the target configuration specified.void
createNewSignalBand
(String bandId, String configId) Creates a new signal band for the target configuration specified.void
createNewTargetConfiguration
(String identifier) Creates a new target configuration using the identifier specified.void
deleteGuardBandFrom
(String bandName, String configName) Delete the specified guard band from the target configuration indicated.void
deleteSignalBandFrom
(String bandName, String configName) Delete the specified signal band from the indicated target configuration.void
deleteTargetConfiguration
(String identifier) Delete the target configuration specified by the identifier.Gets the acquisition settings that are associated with the parameters.Gets the band names used.int
Gets the channel map that the user has selected.Implementation of getChild from the TreeModel interface.int
getChildCount
(Object node) Implementation of getChildCount from the TreeModel interface.getColumnClass
(int column) Implementation of TreeModel.getColumnClass.int
Implementation of TreeModel.getColumnCount().getColumnName
(int column) Implementation of TreeModel.getColumnName.Gets the dialog settings.int
getIndexOfChild
(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.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().boolean
isCellEditable
(Object node, int column) Implementation of TreeModel.isCellEditable.boolean
Implementation of isLeaf from the TreeModel interface.void
Removes a listener for TreeModel events.void
setAcquisitionSettings
(AcquisitionSettings acquisitionSettings) void
Sets the configuration dialog expanded state.void
Sets the configuration dialog settings that are to be preserved with the LikelihoodDetectionParameters.void
Sets the TargetConfigurations that are being managed by the model.void
setValueAt
(Object aValue, Object node, int column) Implementation of TreeModel.setValueAt().Returns an ArrayList of the target configuration names.void
valueForPathChanged
(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
-
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:
getChildCount
in 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:
valueForPathChanged
in interfaceTreeModel
- Parameters:
path
- the pathnewValue
- the new value- See Also:
-
getIndexOfChild
Implementation of TreeModel.getIndexOfChild()- Specified by:
getIndexOfChild
in interfaceTreeModel
- Parameters:
parent
- the parentchild
- the child- Returns:
- the index of child
- See Also:
-
addTreeModelListener
Adds a listener for TreeModel events.- Specified by:
addTreeModelListener
in interfaceTreeModel
- Parameters:
l
- the l
-
removeTreeModelListener
Removes a listener for TreeModel events.- Specified by:
removeTreeModelListener
in interfaceTreeModel
- Parameters:
l
- the l
-
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:
-