Class TreeTableModelAdapter

java.lang.Object
javax.swing.table.AbstractTableModel
likelihoodDetectionModule.TreeTableModelAdapter
All Implemented Interfaces:
Serializable, TableModel

public class TreeTableModelAdapter extends AbstractTableModel
The class TreeTableModelAdapter is a necessary part of the TreeTable implementation because it serves as a bridge between the JTable that forms part of the widget and the JTree that forms another part (the table cell renderer). The Swing JTable uses a TableModel class as its backend representation in the MVC paradigm. In this case, the AbstractTableModel interface is extended. However the JTree uses a TreeModel representation, and there is no common hierarchy between the two separate representations. In order for the mouse events (et al) coming from the JTable part of the TreeTable to reach the embedded JTree (and hence the actual model) they need to be routed through a TableModel adapter. The adapter provides the JTable with the proper backend interface and then translates the methods into JTree ones.
See Also:
  • Constructor Details

    • TreeTableModelAdapter

      public TreeTableModelAdapter(TreeTableModel treeTableModel, JTree tree)
      Instantiates a new tree table model adapter.
      Parameters:
      treeTableModel - The tree table model for the TreeTable that is being wrapped by the adapter.
      tree - The actual JTree implementation that is internal to the TreeTable.
  • Method Details

    • getTargetConfigurationNameForAssociatedBandNode

      public String getTargetConfigurationNameForAssociatedBandNode(likelihoodDetectionModule.AssociatedBandNode n)
      Gets the target configuration name for associated band node.
      Parameters:
      n - the n
      Returns:
      the target configuration name for associated band node
    • getSignalBandNames

      public Vector<String> getSignalBandNames(String configIdentifier)
      Gets the signal band names.
      Parameters:
      configIdentifier - the config identifier
      Returns:
      the signal band names
    • getTargetConfigurationNames

      public ArrayList<String> getTargetConfigurationNames()
      Gets the target configuration names.
      Returns:
      the target configuration names
    • createNewTargetConfiguration

      public void createNewTargetConfiguration(String identifier)
      Creates the new target configuration.
      Parameters:
      identifier - the identifier
    • addTargetConfiguration

      public void addTargetConfiguration(TargetConfiguration config)
      Adds the target configuration.
      Parameters:
      config - the config
    • deleteTargetConfiguration

      public void deleteTargetConfiguration(String identifier)
      Delete target configuration.
      Parameters:
      identifier - the identifier
    • getBandNames

      public ArrayList<String> getBandNames()
      Gets the band names.
      Returns:
      the band names
    • createNewSignalBand

      public void createNewSignalBand(String bandIdentifier, String configurationIdentifier)
      Creates the new signal band.
      Parameters:
      bandIdentifier - the band identifier
      configurationIdentifier - the configuration identifier
    • createNewGuardBand

      public void createNewGuardBand(String bandIdentifier, String configurationIdentifier)
      Creates the new guard band.
      Parameters:
      bandIdentifier - the band identifier
      configurationIdentifier - the configuration identifier
    • deleteGuardBandFrom

      public void deleteGuardBandFrom(String identifier, String targetConfigurationName)
      Delete guard band from.
      Parameters:
      identifier - the identifier
      targetConfigurationName - the target configuration name
    • deleteSignalBandFrom

      public void deleteSignalBandFrom(String id, String configName)
      Delete signal band from.
      Parameters:
      id - the id
      configName - the config name
    • getTargetConfiguration

      public TargetConfiguration getTargetConfiguration(String identifier)
      Gets the target configuration.
      Parameters:
      identifier - the identifier
      Returns:
      the target configuration
    • getAcquisitionSettings

      public AcquisitionSettings getAcquisitionSettings()
      Gets the acquisition settings.
      Returns:
      the acquisition settings
    • getTargetConfigurations

      public ArrayList<TargetConfiguration> getTargetConfigurations()
    • getChannelMap

      public int getChannelMap()
      Gets the channel map.
      Returns:
      the channel map
    • setConfigurationDialogSettings

      public void setConfigurationDialogSettings(ConfigurationDialogSettings settings)
      Sets the configuration dialog settings.
      Parameters:
      settings - the new configuration dialog settings
    • getConfigurationDialogSettings

      public ConfigurationDialogSettings getConfigurationDialogSettings()
      Gets the configuration dialog settings.
      Returns:
      the configuration dialog settings
    • setConfigurationDialogExpandedState

      public void setConfigurationDialogExpandedState(String state)
      Sets the configuration dialog expanded state.
      Parameters:
      state - the new configuration dialog expanded state
    • getColumnCount

      public int getColumnCount()
    • getColumnName

      public String getColumnName(int column)
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
    • getColumnClass

      public Class getColumnClass(int column)
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
    • getRowCount

      public int getRowCount()
    • nodeForRow

      public Object nodeForRow(int row)
      Node for row.
      Parameters:
      row - the row
      Returns:
      the object
    • getValueAt

      public Object getValueAt(int row, int column)
    • isCellEditable

      public boolean isCellEditable(int row, int column)
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
    • setValueAt

      public void setValueAt(Object value, int row, int column)
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class AbstractTableModel