Package jmri.jmrit.beantable
Class SignalGroupSubTableAction
- java.lang.Object
-
- jmri.jmrit.beantable.SignalGroupSubTableAction
-
public class SignalGroupSubTableAction extends java.lang.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
Fields Modifier and Type Field Description (package private) javax.swing.JComboBox<java.lang.String>
_OffAppearance
(package private) javax.swing.JComboBox<java.lang.String>
_OnAppearance
(package private) javax.swing.JComboBox<java.lang.String>
_SensorTurnoutOper
(package private) SignalGroupSubTableAction.SignalGroupSensorModel
_SignalGroupSensorModel
(package private) javax.swing.JScrollPane
_SignalGroupSensorScrollPane
(package private) SignalGroupSubTableAction.SignalGroupTurnoutModel
_SignalGroupTurnoutModel
(package private) javax.swing.JScrollPane
_SignalGroupTurnoutScrollPane
(package private) javax.swing.JLabel
_systemName
(package private) JmriJFrame
addSubFrame
(package private) javax.swing.JRadioButton
allButton
(package private) javax.swing.JButton
cancelButton
(package private) java.lang.String
curHeadName
(package private) SignalGroup
curSignalGroup
(package private) SignalHead
curSignalHead
(package private) javax.swing.JRadioButton
includedButton
(package private) javax.swing.JLabel
nameLabel
(package private) javax.swing.JPanel
p2xs
(package private) javax.swing.JPanel
p2xt
(package private) javax.swing.ButtonGroup
selGroup
(package private) javax.swing.JLabel
signalOffStateLabel
(package private) javax.swing.JLabel
signalOnStateLabel
(package private) javax.swing.JLabel
spacer
(package private) javax.swing.JLabel
status1
(package private) static java.lang.String
updateInst
(package private) javax.swing.JButton
updateSubButton
(package private) javax.swing.JLabel
userLabel
-
Constructor Summary
Constructors Constructor Description SignalGroupSubTableAction()
SignalGroupSubTableAction(java.lang.String s)
Create an action with a specific title.
-
Method Summary
All Methods Instance Methods Concrete Methods 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(java.awt.event.ActionEvent e)
Respond to the Cancel button - clean up.(package private) void
editHead(SignalGroup g, java.lang.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(javax.swing.JComboBox<java.lang.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) java.lang.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(javax.swing.JComboBox<java.lang.String> box)
Get the user choice for conditional evaluation.(package private) int
sensorModeFromBox(javax.swing.JComboBox<java.lang.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
setoperBox(boolean mode, javax.swing.JComboBox<java.lang.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, javax.swing.JComboBox<java.lang.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, javax.swing.JComboBox<java.lang.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, javax.swing.JComboBox<java.lang.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(javax.swing.JComboBox<java.lang.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(java.awt.event.ActionEvent e, boolean newSignalGroup)
Respond to the Update button on the Edit Head sub pane - update to SignalGroup.
-
-
-
Field Detail
-
_systemName
javax.swing.JLabel _systemName
-
_OnAppearance
javax.swing.JComboBox<java.lang.String> _OnAppearance
-
_OffAppearance
javax.swing.JComboBox<java.lang.String> _OffAppearance
-
spacer
javax.swing.JLabel spacer
-
_SensorTurnoutOper
javax.swing.JComboBox<java.lang.String> _SensorTurnoutOper
-
addSubFrame
JmriJFrame addSubFrame
-
_SignalGroupTurnoutModel
SignalGroupSubTableAction.SignalGroupTurnoutModel _SignalGroupTurnoutModel
-
_SignalGroupTurnoutScrollPane
javax.swing.JScrollPane _SignalGroupTurnoutScrollPane
-
_SignalGroupSensorModel
SignalGroupSubTableAction.SignalGroupSensorModel _SignalGroupSensorModel
-
_SignalGroupSensorScrollPane
javax.swing.JScrollPane _SignalGroupSensorScrollPane
-
selGroup
javax.swing.ButtonGroup selGroup
-
allButton
javax.swing.JRadioButton allButton
-
includedButton
javax.swing.JRadioButton includedButton
-
nameLabel
javax.swing.JLabel nameLabel
-
signalOnStateLabel
javax.swing.JLabel signalOnStateLabel
-
signalOffStateLabel
javax.swing.JLabel signalOffStateLabel
-
userLabel
javax.swing.JLabel userLabel
-
cancelButton
javax.swing.JButton cancelButton
-
updateSubButton
javax.swing.JButton updateSubButton
-
updateInst
static java.lang.String updateInst
-
status1
javax.swing.JLabel status1
-
p2xt
javax.swing.JPanel p2xt
-
p2xs
javax.swing.JPanel p2xs
-
curSignalGroup
SignalGroup curSignalGroup
-
curHeadName
java.lang.String curHeadName
-
curSignalHead
SignalHead curSignalHead
-
-
Constructor Detail
-
SignalGroupSubTableAction
public SignalGroupSubTableAction(java.lang.String s)
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 Detail
-
helpTarget
java.lang.String helpTarget()
-
setoperBox
void setoperBox(boolean mode, javax.swing.JComboBox<java.lang.String> box)
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
boolean operFromBox(javax.swing.JComboBox<java.lang.String> box)
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
int headStateFromBox(javax.swing.JComboBox<java.lang.String> box) throws java.lang.IllegalArgumentException
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
- Throws:
java.lang.IllegalArgumentException
-
setSignalHeadStateBox
void setSignalHeadStateBox(int mode, javax.swing.JComboBox<java.lang.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.- Parameters:
mode
- Value for an Appearance (color) i.e. 0 for DARKbox
- the comboBox object to set
-
sensorModeFromBox
int sensorModeFromBox(javax.swing.JComboBox<java.lang.String> box)
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
void setSensorModeBox(int mode, javax.swing.JComboBox<java.lang.String> box)
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
int turnoutModeFromBox(javax.swing.JComboBox<java.lang.String> box)
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
void setTurnoutModeBox(int mode, javax.swing.JComboBox<java.lang.String> box)
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
void editHead(SignalGroup g, java.lang.String headName)
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
-
initializeIncludedList
void initializeIncludedList()
Initialize the list of included turnouts and sensors for a Signal Head item on the sub pane.
-
setTurnoutInformation
int setTurnoutInformation(SignalGroup g)
Set the Turnout information for adding or editing.- Parameters:
g
- The Signal Group being configured- Returns:
- total number of turnouts included in group
-
setSensorInformation
int setSensorInformation(SignalGroup g)
Set the Sensor information for adding or editing.- Parameters:
g
- The Signal Group being configured- Returns:
- total number of sensors included in group
-
cancelSubPressed
void cancelSubPressed(java.awt.event.ActionEvent e)
Respond to the Cancel button - clean up.- Parameters:
e
- the event heard
-
updateSubPressed
void updateSubPressed(java.awt.event.ActionEvent e, boolean newSignalGroup)
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
-
-