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.JButtonaddButton(package private) JmriJFrameaddFrame(package private) Manager<Sensor>connectionChoice(package private) javax.swing.JTextFieldhardwareAddressTextField(package private) SystemNameValidatorhardwareAddressValidator(package private) javax.swing.JLabelhwAddressLabel(package private) javax.swing.JSpinnernumberToAddSpinner(package private) UserPreferencesManagerp(package private) ManagerComboBox<Sensor>prefixBox(package private) javax.swing.JCheckBoxrangeBox(package private) javax.swing.SpinnerNumberModelrangeSpinnerprotected SensorManagersensorManager(package private) javax.swing.JLabelstatusBarLabel(package private) java.lang.StringsystemSelectionCombo(package private) javax.swing.JTextFielduserNameField(package private) javax.swing.JLabeluserNameLabel-
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 voidaddPressed(java.awt.event.ActionEvent e)voidaddToFrame(BeanTableFrame<Sensor> f)Allow subclasses to add to the frame without having to actually subclass the BeanTableDataFrame.voidaddToPanel(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) voidcancelPressed(java.awt.event.ActionEvent e)protected voidcolumnsVisibleUpdated(boolean[] colsVisible)Override to update showDebounceBox, showPullUpBox, showStateForgetAndQueryBox.protected voidconfigureTable(javax.swing.JTable table)Perform configuration of the JTable as required by a specific TableAction.protected voidcreateModel()Create the JTable DataModel, along with the changes for the specific case of Sensors.(package private) voidcreatePressed(java.awt.event.ActionEvent e)Respond to Create new item button pressed on Add Sensor pane.java.lang.StringgetClassDescription()protected java.lang.StringgetClassName()(package private) voidhandleCreateException(java.lang.Exception ex, java.lang.String hwAddress)protected java.lang.StringhelpTarget()Specify the JavaHelp target for this specific panel.protected voidsetDefaultDebounce(javax.swing.JFrame _who)protected voidsetDefaultState(javax.swing.JFrame _who)voidsetManager(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.voidsetMenuBar(BeanTableFrame<Sensor> f)Insert a table specific Defaults menu.voidsetMessagePreferencesDetails()protected voidsetTitle()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:
setManagerin 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:
createModelin classAbstractTableAction<Sensor>
-
setTitle
protected void setTitle()
Include the correct title.- Specified by:
setTitlein classAbstractTableAction<Sensor>
-
helpTarget
protected java.lang.String helpTarget()
Specify the JavaHelp target for this specific panel.- Overrides:
helpTargetin 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:
addPressedin 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:
setMenuBarin classAbstractTableAction<Sensor>- Parameters:
f- the JFrame of this table
-
configureTable
protected void configureTable(javax.swing.JTable table)
Description copied from class:AbstractTableActionPerform configuration of the JTable as required by a specific TableAction.- Overrides:
configureTablein 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:
addToFramein 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:
columnsVisibleUpdatedin 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:
addToPanelin classAbstractTableAction<Sensor>- Parameters:
f- AbstractTableTabAction for the containing frame containing these and other tabs
-
setMessagePreferencesDetails
public void setMessagePreferencesDetails()
- Overrides:
setMessagePreferencesDetailsin classAbstractTableAction<Sensor>
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassNamein classAbstractTableAction<Sensor>
-
getClassDescription
public java.lang.String getClassDescription()
- Overrides:
getClassDescriptionin classAbstractTableAction<Sensor>
-
-