Package jmri.jmrit.beantable
Class TurnoutTableAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrit.beantable.AbstractTableAction<Turnout>
-
- jmri.jmrit.beantable.TurnoutTableAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class TurnoutTableAction extends AbstractTableAction<Turnout>
Swing action to create and register a TurnoutTable 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) javax.swing.JTextField
hardwareAddressTextField
(package private) SystemNameValidator
hardwareAddressValidator
(package private) javax.swing.JSpinner
numberToAddSpinner
(package private) UserPreferencesManager
pref
(package private) ManagerComboBox<Turnout>
prefixBox
(package private) javax.swing.JCheckBox
rangeBox
(package private) javax.swing.SpinnerNumberModel
rangeSpinner
(package private) javax.swing.JLabel
statusBarLabel
(package private) java.lang.String
systemSelectionCombo
protected TurnoutManager
turnoutManager
(package private) javax.swing.JTextField
userNameTextField
-
Fields inherited from class jmri.jmrit.beantable.AbstractTableAction
f, includeAddButton, m
-
-
Constructor Summary
Constructors Constructor Description TurnoutTableAction()
TurnoutTableAction(java.lang.String actionName)
Create an action with a specific title.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPressed(java.awt.event.ActionEvent e)
void
addToFrame(BeanTableFrame<Turnout> f)
Add the check boxes to show/hide extra columns to the Turnout table frame.void
addToPanel(AbstractTableTabAction<Turnout> f)
Place the check boxes to show/hide extra columns to the tabbed Turnout table panel.(package private) void
cancelPressed(java.awt.event.ActionEvent e)
protected void
columnsVisibleUpdated(boolean[] colsVisible)
Override to update column select checkboxes.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 Turnouts.(package private) void
createPressed(java.awt.event.ActionEvent e)
Respond to Create new item button pressed on Add Turnout pane.java.lang.String
getClassDescription()
protected java.lang.String
getClassName()
(package private) void
handleCreateException(java.lang.Exception ex, java.lang.String sysName)
protected java.lang.String
helpTarget()
Specify the JavaHelp target for this specific panel.protected void
setDefaultSpeeds(javax.swing.JFrame _who)
Show a pane to configure closed and thrown turnout speed defaults.void
setManager(Manager<Turnout> man)
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<Turnout> f)
Insert table specific Automation and Speeds menus.void
setMessagePreferencesDetails()
protected void
setTitle()
Include the correct title.static void
updateAutomationBox(Turnout t, javax.swing.JComboBox<java.lang.String> cb)
Add the content and make the appropriate selection to a combo box for a turnout's automation choices.-
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
-
turnoutManager
protected TurnoutManager turnoutManager
-
addFrame
JmriJFrame addFrame
-
hardwareAddressTextField
javax.swing.JTextField hardwareAddressTextField
-
userNameTextField
javax.swing.JTextField userNameTextField
-
prefixBox
ManagerComboBox<Turnout> prefixBox
-
rangeSpinner
javax.swing.SpinnerNumberModel rangeSpinner
-
numberToAddSpinner
javax.swing.JSpinner numberToAddSpinner
-
rangeBox
javax.swing.JCheckBox rangeBox
-
systemSelectionCombo
java.lang.String systemSelectionCombo
-
addButton
javax.swing.JButton addButton
-
statusBarLabel
javax.swing.JLabel statusBarLabel
-
hardwareAddressValidator
SystemNameValidator hardwareAddressValidator
-
-
Constructor Detail
-
TurnoutTableAction
public TurnoutTableAction(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
-
TurnoutTableAction
public TurnoutTableAction()
-
-
Method Detail
-
setManager
public void setManager(@Nonnull Manager<Turnout> man)
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<Turnout>
- Parameters:
man
- Manager for this table tab
-
createModel
protected void createModel()
Create the JTable DataModel, along with the changes for the specific case of Turnouts.- Specified by:
createModel
in classAbstractTableAction<Turnout>
-
setTitle
protected void setTitle()
Include the correct title.- Specified by:
setTitle
in classAbstractTableAction<Turnout>
-
helpTarget
protected java.lang.String helpTarget()
Specify the JavaHelp target for this specific panel.- Overrides:
helpTarget
in classAbstractTableAction<Turnout>
- 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<Turnout>
-
updateAutomationBox
public static void updateAutomationBox(Turnout t, javax.swing.JComboBox<java.lang.String> cb)
Add the content and make the appropriate selection to a combo box for a turnout's automation choices.- Parameters:
t
- turnoutcb
- the JComboBox
-
setDefaultSpeeds
protected void setDefaultSpeeds(javax.swing.JFrame _who)
Show a pane to configure closed and thrown turnout speed defaults.- Parameters:
_who
- parent JFrame to center the pane on
-
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<Turnout>
- Parameters:
table
- The table to configure.
-
addToFrame
public void addToFrame(BeanTableFrame<Turnout> f)
Add the check boxes to show/hide extra columns to the Turnout table frame.Keep contents synchronized with
addToPanel(AbstractTableTabAction)
- Overrides:
addToFrame
in classAbstractTableAction<Turnout>
- Parameters:
f
- a Turnout table frame
-
addToPanel
public void addToPanel(AbstractTableTabAction<Turnout> f)
Place the check boxes to show/hide extra columns to the tabbed Turnout table panel.Keep contents synchronized with
addToFrame(BeanTableFrame)
- Overrides:
addToPanel
in classAbstractTableAction<Turnout>
- Parameters:
f
- a Turnout table action
-
columnsVisibleUpdated
protected void columnsVisibleUpdated(boolean[] colsVisible)
Override to update column select checkboxes. 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<Turnout>
- Parameters:
colsVisible
- array of ALL table columns and their visibility status in order of main Table Model, NOT XTableColumnModel.
-
setMenuBar
public void setMenuBar(BeanTableFrame<Turnout> f)
Insert table specific Automation and Speeds menus. 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 Automation menu 2 places earlier unless the table is part of the ListedTableFrame, that adds the Help menu later on.- Overrides:
setMenuBar
in classAbstractTableAction<Turnout>
- Parameters:
f
- the JFrame of this table
-
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 Turnout pane.- Parameters:
e
- the click event
-
handleCreateException
void handleCreateException(java.lang.Exception ex, java.lang.String sysName)
-
getClassName
protected java.lang.String getClassName()
- Specified by:
getClassName
in classAbstractTableAction<Turnout>
-
setMessagePreferencesDetails
public void setMessagePreferencesDetails()
- Overrides:
setMessagePreferencesDetails
in classAbstractTableAction<Turnout>
-
getClassDescription
public java.lang.String getClassDescription()
- Overrides:
getClassDescription
in classAbstractTableAction<Turnout>
-
-