Package jmri.jmrit.beantable
Class TurnoutTableAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
public class TurnoutTableAction extends AbstractTableAction<Turnout>
Swing action to create and register a TurnoutTable GUI.
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description (package private) JButton
addButton
(package private) JmriJFrame
addFrame
(package private) JTextField
hardwareAddressTextField
(package private) SystemNameValidator
hardwareAddressValidator
(package private) JSpinner
numberToAddSpinner
(package private) UserPreferencesManager
pref
(package private) ManagerComboBox<Turnout>
prefixBox
(package private) JCheckBox
rangeBox
(package private) SpinnerNumberModel
rangeSpinner
(package private) JLabel
statusBarLabel
(package private) String
systemSelectionCombo
protected TurnoutManager
turnoutManager
(package private) JTextField
userNameTextField
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Constructor Summary
Constructors Constructor Description TurnoutTableAction()
TurnoutTableAction(String actionName)
Create an action with a specific title. -
Method Summary
Modifier and Type Method Description protected void
addPressed(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(ActionEvent e)
protected void
columnsVisibleUpdated(boolean[] colsVisible)
Override to update column select checkboxes.protected void
configureTable(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(ActionEvent e)
Respond to Create new item button pressed on Add Turnout pane.String
getClassDescription()
protected String
getClassName()
(package private) void
handleCreateException(Exception ex, String sysName)
protected String
helpTarget()
Specify the JavaHelp target for this specific panel.protected void
setDefaultSpeeds(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, JComboBox<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, configureManagerComboBox, displayHwError, dispose, 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 Details
-
Constructor Details
-
TurnoutTableAction
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 Details
-
setManager
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
Create the JTable DataModel, along with the changes for the specific case of Turnouts.- Specified by:
createModel
in classAbstractTableAction<Turnout>
-
setTitle
Include the correct title.- Specified by:
setTitle
in classAbstractTableAction<Turnout>
-
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
- Specified by:
addPressed
in classAbstractTableAction<Turnout>
-
updateAutomationBox
Add the content and make the appropriate selection to a combo box for a turnout's automation choices.- Parameters:
t
- turnoutcb
- the JComboBox
-
setDefaultSpeeds
Show a pane to configure closed and thrown turnout speed defaults.- Parameters:
_who
- parent JFrame to center the pane on
-
configureTable
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
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
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
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
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
-
createPressed
Respond to Create new item button pressed on Add Turnout pane.- Parameters:
e
- the click event
-
handleCreateException
-
getClassName
- Specified by:
getClassName
in classAbstractTableAction<Turnout>
-
setMessagePreferencesDetails
- Overrides:
setMessagePreferencesDetails
in classAbstractTableAction<Turnout>
-
getClassDescription
- Overrides:
getClassDescription
in classAbstractTableAction<Turnout>
-