Package jmri.jmrit.beantable
Class SignalGroupSubTableAction
java.lang.Object
jmri.jmrit.beantable.SignalGroupSubTableAction
public class SignalGroupSubTableAction extends Object
Swing action to create and register a SignalGroup - Signal Head Edit Table.
Based in part on RouteTableAction.java and SignalGroupTableAction.java by Bob Jacobsen
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SignalGroupSubTableAction.SignalGroupOutputModel
Base table model for selecting Signal Group Head control Conditionals(package private) class
SignalGroupSubTableAction.SignalGroupSensorModel
Set up a table for selecting Sensors and Sensor On State as Conditionals for a Signal Group Signal Head member.(package private) class
SignalGroupSubTableAction.SignalGroupTurnoutModel
Table model for selecting Turnouts and their On State as Conditionals for a Signal Group Signal Head member. -
Field Summary
-
Constructor Summary
Constructors Constructor Description SignalGroupSubTableAction()
SignalGroupSubTableAction(String s)
Create an action with a specific title. -
Method Summary
Modifier and Type Method Description (package private) void
cancelIncludedOnly()
Cancel included Turnouts and Sensors only option(package private) void
cancelSubEdit()
Cancel edit mode(package private) void
cancelSubPressed(ActionEvent e)
Respond to the Cancel button - clean up.(package private) void
editHead(SignalGroup g, String headName)
Open an editor to set the details of a Signal Head as part of a Signal Group.(package private) void
finishUpdate()
Clean up the interface and reset Included radio button to All for next use(package private) int
headStateFromBox(JComboBox<String> box)
Get the user choice for a Signal Group Signal Head's On and Off Appearance from a comboBox at the top of the Edit Head sub pane.(package private) String
helpTarget()
(package private) void
initializeIncludedList()
Initialize the list of included turnouts and sensors for a Signal Head item on the sub pane.(package private) boolean
operFromBox(JComboBox<String> box)
Get the user choice for conditional evaluation.(package private) int
sensorModeFromBox(JComboBox<String> box)
Get the user choice for a Sensor conditional's On state from the comboBox on the Edit Head sub pane.(package private) void
setColumnToHoldButton(JTable table, int column, JButton sample)
Configure column widths for the Turnout and Sensor Conditional tables.(package private) void
setoperBox(boolean mode, JComboBox<String> box)
Set choice for conditional evaluation.(package private) int
setSensorInformation(SignalGroup g)
Set the Sensor information for adding or editing.(package private) void
setSensorModeBox(int mode, JComboBox<String> box)
Set selected item for a Sensor conditional's On state in the comboBox on the Edit Head sub pane.(package private) void
setSignalHeadStateBox(int mode, JComboBox<String> box)
Set selected item in a Signal Group Signal Head's On and Off Appearance in a comboBox at the top of the Edit Head sub pane.(package private) int
setTurnoutInformation(SignalGroup g)
Set the Turnout information for adding or editing.(package private) void
setTurnoutModeBox(int mode, JComboBox<String> box)
Set selected item for a Control Turnout conditional's On state in the comboBox on the Edit Head sub pane.(package private) int
turnoutModeFromBox(JComboBox<String> box)
Get the user choice for a Control Turnout conditional's On state from the comboBox on the Edit Head sub pane.(package private) void
updateSubPressed(ActionEvent e, boolean newSignalGroup)
Respond to the Update button on the Edit Head sub pane - update to SignalGroup.
-
Field Details
-
_systemName
-
_OnAppearance
-
_OffAppearance
-
spacer
-
_SensorTurnoutOper
-
addSubFrame
-
_SignalGroupTurnoutModel
-
_SignalGroupTurnoutScrollPane
-
_SignalGroupSensorModel
-
_SignalGroupSensorScrollPane
-
selGroup
-
allButton
-
includedButton
-
nameLabel
-
signalOnStateLabel
-
signalOffStateLabel
-
userLabel
-
cancelButton
-
updateSubButton
-
updateInst
-
status1
-
p2xt
-
p2xs
-
curSignalGroup
-
curHeadName
-
curSignalHead
-
-
Constructor Details
-
SignalGroupSubTableAction
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:
s
- title of the action
-
SignalGroupSubTableAction
public SignalGroupSubTableAction()
-
-
Method Details
-
helpTarget
-
setoperBox
Set choice for conditional evaluation.Set to AND when you want all conditionals to be met for the Signal Head to turn On when an included Aspect is shown on the main Mast. Set to OR when you at least one of the conditionals to be met for the Signal Head to turn On when an included Aspect is shown. See
operFromBox(javax.swing.JComboBox<java.lang.String>)
- Parameters:
mode
- True for ANDbox
- the comboBox object to set
-
operFromBox
Get the user choice for conditional evaluation. SeesetoperBox(boolean, javax.swing.JComboBox<java.lang.String>)
- Parameters:
box
- the comboBox object containing the user choice- Returns:
- True for AND, False for OR
-
headStateFromBox
Get the user choice for a Signal Group Signal Head's On and Off Appearance from a comboBox at the top of the Edit Head sub pane.- Parameters:
box
- the comboBox object containing the user choice- Returns:
- Value for the Appearance (color) set i.e. 0 for DARK
-
setSignalHeadStateBox
Set selected item in a Signal Group Signal Head's On and Off Appearance in a comboBox at the top of the Edit Head sub pane.- Parameters:
mode
- Value for an Appearance (color) i.e. 0 for DARKbox
- the comboBox object to set
-
sensorModeFromBox
Get the user choice for a Sensor conditional's On state from the comboBox on the Edit Head sub pane. SeeturnoutModeFromBox(javax.swing.JComboBox<java.lang.String>)
- Parameters:
box
- the comboBox object containing the user choice- Returns:
- Value for ACTIVE/INACTIVE
-
setSensorModeBox
Set selected item for a Sensor conditional's On state in the comboBox on the Edit Head sub pane. SeeturnoutModeFromBox(javax.swing.JComboBox<java.lang.String>)
- Parameters:
mode
- Value for ACTIVE/INACTIVEbox
- the comboBox object to set
-
turnoutModeFromBox
Get the user choice for a Control Turnout conditional's On state from the comboBox on the Edit Head sub pane. SeesensorModeFromBox(javax.swing.JComboBox<java.lang.String>)
- Parameters:
box
- the comboBox object containing the user choice- Returns:
- Value for CLOSED/THROWN
-
setTurnoutModeBox
Set selected item for a Control Turnout conditional's On state in the comboBox on the Edit Head sub pane. SeeturnoutModeFromBox(javax.swing.JComboBox<java.lang.String>)
- Parameters:
mode
- Value for CLOSED/THROWNbox
- the comboBox object to set
-
editHead
Open an editor to set the details of a Signal Head as part of a Signal Group. Called when user clicks the Edit button for a Head in the Add/Edit Signal Group pane.- Parameters:
g
- Parent Signal HeadheadName
- System or User Name of this Signal Head- See Also:
SignalGroupTableAction.signalHeadEditPressed
-
setColumnToHoldButton
Configure column widths for the Turnout and Sensor Conditional tables.- Parameters:
table
- JTable to put button incolumn
- index of column in tablesample
- sample button to use as spacer
-
initializeIncludedList
void initializeIncludedList()Initialize the list of included turnouts and sensors for a Signal Head item on the sub pane. -
setTurnoutInformation
Set the Turnout information for adding or editing.- Parameters:
g
- The Signal Group being configured- Returns:
- total number of turnouts included in group
-
setSensorInformation
Set the Sensor information for adding or editing.- Parameters:
g
- The Signal Group being configured- Returns:
- total number of sensors included in group
-
cancelSubPressed
Respond to the Cancel button - clean up.- Parameters:
e
- the event heard
-
updateSubPressed
Respond to the Update button on the Edit Head sub pane - update to SignalGroup.- Parameters:
e
- the event heardnewSignalGroup
- True if this is a newly created Signal Group for which additional actions are required
-
finishUpdate
void finishUpdate()Clean up the interface and reset Included radio button to All for next use -
cancelSubEdit
void cancelSubEdit()Cancel edit mode -
cancelIncludedOnly
void cancelIncludedOnly()Cancel included Turnouts and Sensors only option
-