Package jmri.jmrit.beantable
Class SensorTableAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrit.beantable.AbstractTableAction<Sensor>
-
- jmri.jmrit.beantable.SensorTableAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class SensorTableAction extends AbstractTableAction<Sensor>
Swing action to create and register a SensorTable GUI.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.beantable.AbstractTableAction
AbstractTableAction.TableItem<E extends NamedBean>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JButton
addButton
(package private) JmriJFrame
addFrame
(package private) Manager<Sensor>
connectionChoice
(package private) javax.swing.JTextField
hardwareAddressTextField
(package private) SystemNameValidator
hardwareAddressValidator
(package private) javax.swing.JLabel
hwAddressLabel
(package private) javax.swing.JSpinner
numberToAddSpinner
(package private) UserPreferencesManager
p
(package private) ManagerComboBox<Sensor>
prefixBox
(package private) javax.swing.JCheckBox
rangeBox
(package private) javax.swing.SpinnerNumberModel
rangeSpinner
protected SensorManager
sensorManager
(package private) javax.swing.JLabel
statusBarLabel
(package private) java.lang.String
systemSelectionCombo
(package private) javax.swing.JTextField
userNameField
(package private) javax.swing.JLabel
userNameLabel
-
Fields inherited from class jmri.jmrit.beantable.AbstractTableAction
f, includeAddButton, m
-
-
Constructor Summary
Constructors Constructor Description SensorTableAction()
SensorTableAction(java.lang.String actionName)
Create an action with a specific title.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPressed(java.awt.event.ActionEvent e)
void
addToFrame(BeanTableFrame<Sensor> f)
Allow subclasses to add to the frame without having to actually subclass the BeanTableDataFrame.void
addToPanel(AbstractTableTabAction<Sensor> f)
If the subClass is being included in a greater tabbed frame, then this method is used to add the details to the tabbed frame.(package private) void
cancelPressed(java.awt.event.ActionEvent e)
protected void
columnsVisibleUpdated(boolean[] colsVisible)
Override to update showDebounceBox, showPullUpBox, showStateForgetAndQueryBox.protected void
configureTable(javax.swing.JTable table)
Perform configuration of the JTable as required by a specific TableAction.protected void
createModel()
Create the JTable DataModel, along with the changes for the specific case of Sensors.(package private) void
createPressed(java.awt.event.ActionEvent e)
Respond to Create new item button pressed on Add Sensor pane.java.lang.String
getClassDescription()
protected java.lang.String
getClassName()
(package private) void
handleCreateException(java.lang.Exception ex, java.lang.String hwAddress)
protected java.lang.String
helpTarget()
Specify the JavaHelp target for this specific panel.protected void
setDefaultDebounce(javax.swing.JFrame _who)
protected void
setDefaultState(javax.swing.JFrame _who)
void
setManager(Manager<Sensor> s)
If the subClass is being included in a greater tabbed frame, then this is used to specify which manager the subclass should be using.void
setMenuBar(BeanTableFrame<Sensor> f)
Insert a table specific Defaults menu.void
setMessagePreferencesDetails()
protected void
setTitle()
Include the correct title.-
Methods inherited from class jmri.jmrit.beantable.AbstractTableAction
actionPerformed, addBottomButtons, addToFrame, configureManagerComboBox, displayHwError, dispose, getDataModel, getFrame, getManager, getPanel, getTableDataModel, includeAddButton, nextName, print, removePrefixBoxListener, setFrame
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
sensorManager
protected SensorManager sensorManager
-
addFrame
JmriJFrame addFrame
-
hardwareAddressTextField
javax.swing.JTextField hardwareAddressTextField
-
userNameField
javax.swing.JTextField userNameField
-
prefixBox
ManagerComboBox<Sensor> prefixBox
-
rangeSpinner
javax.swing.SpinnerNumberModel rangeSpinner
-
numberToAddSpinner
javax.swing.JSpinner numberToAddSpinner
-
rangeBox
javax.swing.JCheckBox rangeBox
-
hwAddressLabel
javax.swing.JLabel hwAddressLabel
-
userNameLabel
javax.swing.JLabel userNameLabel
-
systemSelectionCombo
java.lang.String systemSelectionCombo
-
addButton
javax.swing.JButton addButton
-
statusBarLabel
javax.swing.JLabel statusBarLabel
-
connectionChoice
Manager<Sensor> connectionChoice
-
hardwareAddressValidator
SystemNameValidator hardwareAddressValidator
-
-
Constructor Detail
-
SensorTableAction
public SensorTableAction(java.lang.String actionName)
Create an action with a specific title.Note that the argument is the Action title, not the title of the resulting frame. Perhaps this should be changed?
- Parameters:
actionName
- title of the action
-
SensorTableAction
public SensorTableAction()
-
-
Method Detail
-
setManager
public void setManager(@Nonnull Manager<Sensor> s)
If the subClass is being included in a greater tabbed frame, then this is used to specify which manager the subclass should be using.- Overrides:
setManager
in classAbstractTableAction<Sensor>
- Parameters:
s
- Manager for this table tab
-
createModel
protected void createModel()
Create the JTable DataModel, along with the changes for the specific case of Sensors.- Specified by:
createModel
in classAbstractTableAction<Sensor>
-
setTitle
protected void setTitle()
Include the correct title.- Specified by:
setTitle
in classAbstractTableAction<Sensor>
-
helpTarget
protected java.lang.String helpTarget()
Specify the JavaHelp target for this specific panel.- Overrides:
helpTarget
in classAbstractTableAction<Sensor>
- Returns:
- a fixed default string "index" pointing to to highest level in JMRI Help
-
addPressed
protected void addPressed(java.awt.event.ActionEvent e)
- Specified by:
addPressed
in classAbstractTableAction<Sensor>
-
cancelPressed
void cancelPressed(java.awt.event.ActionEvent e)
-
createPressed
void createPressed(java.awt.event.ActionEvent e)
Respond to Create new item button pressed on Add Sensor pane.- Parameters:
e
- the click event
-
handleCreateException
void handleCreateException(java.lang.Exception ex, java.lang.String hwAddress)
-
setDefaultDebounce
protected void setDefaultDebounce(javax.swing.JFrame _who)
-
setDefaultState
protected void setDefaultState(javax.swing.JFrame _who)
-
setMenuBar
public void setMenuBar(BeanTableFrame<Sensor> f)
Insert a table specific Defaults menu. Account for the Window and Help menus, which are already added to the menu bar as part of the creation of the JFrame, by adding the Tools menu 2 places earlier unless the table is part of the ListedTableFrame, that adds the Help menu later on.- Overrides:
setMenuBar
in classAbstractTableAction<Sensor>
- Parameters:
f
- the JFrame of this table
-
configureTable
protected void configureTable(javax.swing.JTable table)
Description copied from class:AbstractTableAction
Perform configuration of the JTable as required by a specific TableAction.- Overrides:
configureTable
in classAbstractTableAction<Sensor>
- Parameters:
table
- The table to configure.
-
addToFrame
public void addToFrame(BeanTableFrame<Sensor> f)
Allow subclasses to add to the frame without having to actually subclass the BeanTableDataFrame.- Overrides:
addToFrame
in classAbstractTableAction<Sensor>
- Parameters:
f
- the Frame to add to
-
columnsVisibleUpdated
protected void columnsVisibleUpdated(boolean[] colsVisible)
Override to update showDebounceBox, showPullUpBox, showStateForgetAndQueryBox. Notification that column visibility for the JTable has updated.This is overridden by classes which have column visibility Checkboxes on bottom bar.
Called on table startup and whenever a column goes hidden / visible.
- Overrides:
columnsVisibleUpdated
in classAbstractTableAction<Sensor>
- Parameters:
colsVisible
- array of ALL table columns and their visibility status in order of main Table Model, NOT XTableColumnModel.
-
addToPanel
public void addToPanel(AbstractTableTabAction<Sensor> f)
If the subClass is being included in a greater tabbed frame, then this method is used to add the details to the tabbed frame.- Overrides:
addToPanel
in classAbstractTableAction<Sensor>
- Parameters:
f
- AbstractTableTabAction for the containing frame containing these and other tabs
-
setMessagePreferencesDetails
public void setMessagePreferencesDetails()
- Overrides:
setMessagePreferencesDetails
in classAbstractTableAction<Sensor>
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassName
in classAbstractTableAction<Sensor>
-
getClassDescription
public java.lang.String getClassDescription()
- Overrides:
getClassDescription
in classAbstractTableAction<Sensor>
-
-