Package jmri.jmrit.ctc.editor.code
Class CommonSubs
- java.lang.Object
- 
- jmri.jmrit.ctc.editor.code.CommonSubs
 
- 
 public class CommonSubs extends java.lang.Object 
- 
- 
Constructor SummaryConstructors Constructor Description CommonSubs()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddHelpMenu(javax.swing.JFrame frame, java.lang.String ref, boolean direct)Add a standard help menu, including the window specific help item.static voidaddSensorToSensorList(java.util.ArrayList<NBHSensor> list, java.lang.String sensorName)Add a valid NBHSensor entry to an ArrayList.static booleanallowClose(java.awt.Component parentComponent, boolean dataChanged)static voidcheckJComboBoxNotEmpty(javax.swing.JComboBox<java.lang.String> combo, javax.swing.JLabel promptName, java.util.ArrayList<java.lang.String> errors)static voidcheckJTextFieldNotEmpty(javax.swing.JTextField field, javax.swing.JLabel promptName, java.util.ArrayList<java.lang.String> errors)static intcompactDefaultTableModel(javax.swing.table.DefaultTableModel defaultTableModel)static java.util.ArrayList<java.lang.Integer>getArrayListOfSelectableOSSectionUniqueIDs(java.util.ArrayList<CodeButtonHandlerData> codeButtonHandlerDataList)static java.util.ArrayList<java.lang.String>getArrayListOfSelectableSwitchDirectionIndicators(java.util.ArrayList<CodeButtonHandlerData> codeButtonHandlerDataList)static java.lang.StringgetCSVStringFromDefaultTableModel(javax.swing.table.DefaultTableModel defaultTableModel)static intgetIntFromJTextFieldNoThrow(javax.swing.JTextField textField)static NBHSensorgetNBHSensor(java.lang.String newName, boolean isInternal)Get a NBHSensor from the CtcManager NBHSensor map or create a new one.static NBHSignalgetNBHSignal(java.lang.String newName)Get a NBHSignal from the CtcManager NBHSignal map or create a new one.static NBHTurnoutgetNBHTurnout(java.lang.String newName, boolean feedbackDifferent)Get a NBHTurnout from the CtcManager NBHTurnout map or create a new one.static java.util.ArrayList<java.lang.String>getStringArrayFromDefaultTableModel(javax.swing.table.DefaultTableModel defaultTableModel)static booleanisJComboBoxNotEmpty(javax.swing.JComboBox<java.lang.String> combo)static booleanisJTextFieldNotEmpty(javax.swing.JTextField field)static booleanmissingFieldsErrorDialogDisplayed(java.awt.Component parentComponent, java.util.ArrayList<java.lang.String> errors, boolean isCancel)static voidnumberButtonGroup(javax.swing.ButtonGroup buttonGroup)static voidpopulateJComboBoxWithBeans(javax.swing.JComboBox<java.lang.String> jComboBox, java.lang.String beanType, java.lang.String currentSelection, boolean firstRowBlank)Populate a combo box with bean names using getDisplayName().static voidpopulateJComboBoxWithColumnDescriptions(javax.swing.JComboBox<java.lang.String> jComboBox, CTCSerialData ctcSerialData)static voidpopulateJComboBoxWithColumnDescriptionsAndSelectViaUniqueID(javax.swing.JComboBox<java.lang.String> jComboBox, CTCSerialData ctcSerialData, int uniqueID)static booleanpopulateJComboBoxWithColumnDescriptionsExceptOurs(javax.swing.JComboBox<java.lang.String> jComboBox, CTCSerialData ctcSerialData, int ourUniqueID, java.util.ArrayList<java.lang.Integer> uniqueIDS)static voidsetButtonSelected(javax.swing.ButtonGroup buttonGroup, int selected)static voidsetMillisecondsEdit(javax.swing.JFormattedTextField formattedTextField)static voidsetSelectedIndexOfJComboBoxViaUniqueID(javax.swing.JComboBox<java.lang.String> jComboBox, CTCSerialData ctcSerialData, int uniqueID)
 
- 
- 
- 
Constructor Detail- 
CommonSubspublic CommonSubs() 
 
- 
 - 
Method Detail- 
setMillisecondsEditpublic static void setMillisecondsEdit(javax.swing.JFormattedTextField formattedTextField) 
 - 
getIntFromJTextFieldNoThrowpublic static int getIntFromJTextFieldNoThrow(javax.swing.JTextField textField) 
 - 
allowClosepublic static boolean allowClose(java.awt.Component parentComponent, boolean dataChanged) 
 - 
addHelpMenupublic static void addHelpMenu(javax.swing.JFrame frame, java.lang.String ref, boolean direct) Add a standard help menu, including the window specific help item.- Parameters:
- frame- The frame receiving the help menu.
- ref- JHelp reference for the desired window-specific help page
- direct- true if the help main-menu item goes directly to the help system, such as when there are no items in the help menu
 
 - 
getCSVStringFromDefaultTableModelpublic static java.lang.String getCSVStringFromDefaultTableModel(javax.swing.table.DefaultTableModel defaultTableModel) 
 - 
getStringArrayFromDefaultTableModelpublic static java.util.ArrayList<java.lang.String> getStringArrayFromDefaultTableModel(javax.swing.table.DefaultTableModel defaultTableModel) 
 - 
compactDefaultTableModelpublic static int compactDefaultTableModel(javax.swing.table.DefaultTableModel defaultTableModel) 
 - 
getArrayListOfSelectableSwitchDirectionIndicatorspublic static java.util.ArrayList<java.lang.String> getArrayListOfSelectableSwitchDirectionIndicators(java.util.ArrayList<CodeButtonHandlerData> codeButtonHandlerDataList) 
 - 
getArrayListOfSelectableOSSectionUniqueIDspublic static java.util.ArrayList<java.lang.Integer> getArrayListOfSelectableOSSectionUniqueIDs(java.util.ArrayList<CodeButtonHandlerData> codeButtonHandlerDataList) 
 - 
populateJComboBoxWithColumnDescriptionsAndSelectViaUniqueIDpublic static void populateJComboBoxWithColumnDescriptionsAndSelectViaUniqueID(javax.swing.JComboBox<java.lang.String> jComboBox, CTCSerialData ctcSerialData, int uniqueID) 
 - 
populateJComboBoxWithColumnDescriptionspublic static void populateJComboBoxWithColumnDescriptions(javax.swing.JComboBox<java.lang.String> jComboBox, CTCSerialData ctcSerialData) 
 - 
populateJComboBoxWithColumnDescriptionsExceptOurspublic static boolean populateJComboBoxWithColumnDescriptionsExceptOurs(javax.swing.JComboBox<java.lang.String> jComboBox, CTCSerialData ctcSerialData, int ourUniqueID, java.util.ArrayList<java.lang.Integer> uniqueIDS) 
 - 
populateJComboBoxWithBeanspublic static void populateJComboBoxWithBeans(javax.swing.JComboBox<java.lang.String> jComboBox, java.lang.String beanType, java.lang.String currentSelection, boolean firstRowBlank) Populate a combo box with bean names using getDisplayName().If a panel xml file has not been loaded, the combo box will behave as a text field (editable), otherwise it will behave as standard combo box (not editable). - Parameters:
- jComboBox- The string based combo box to be populated.
- beanType- The bean type to be loaded. It has to be in the switch list.
- currentSelection- The current item to be selected, none if null.
- firstRowBlank- True to create a blank row. If the selection is null or empty, the blank row will be selected.
 
 - 
setSelectedIndexOfJComboBoxViaUniqueIDpublic static void setSelectedIndexOfJComboBoxViaUniqueID(javax.swing.JComboBox<java.lang.String> jComboBox, CTCSerialData ctcSerialData, int uniqueID) 
 - 
numberButtonGrouppublic static void numberButtonGroup(javax.swing.ButtonGroup buttonGroup) 
 - 
setButtonSelectedpublic static void setButtonSelected(javax.swing.ButtonGroup buttonGroup, int selected) 
 - 
missingFieldsErrorDialogDisplayedpublic static boolean missingFieldsErrorDialogDisplayed(java.awt.Component parentComponent, java.util.ArrayList<java.lang.String> errors, boolean isCancel) 
 - 
checkJTextFieldNotEmptypublic static void checkJTextFieldNotEmpty(javax.swing.JTextField field, javax.swing.JLabel promptName, java.util.ArrayList<java.lang.String> errors) 
 - 
isJTextFieldNotEmptypublic static boolean isJTextFieldNotEmpty(javax.swing.JTextField field) 
 - 
checkJComboBoxNotEmptypublic static void checkJComboBoxNotEmpty(javax.swing.JComboBox<java.lang.String> combo, javax.swing.JLabel promptName, java.util.ArrayList<java.lang.String> errors) 
 - 
isJComboBoxNotEmptypublic static boolean isJComboBoxNotEmpty(javax.swing.JComboBox<java.lang.String> combo) 
 - 
getNBHSensorpublic static NBHSensor getNBHSensor(java.lang.String newName, boolean isInternal) Get a NBHSensor from the CtcManager NBHSensor map or create a new one.- Parameters:
- newName- The new name to be retrieved from the map or created.
- isInternal- True if an internal sensor is being requested. Internal will create the sensor if necessary using provide(String).
- Returns:
- a NBHSensor or null.
 
 - 
getNBHTurnoutpublic static NBHTurnout getNBHTurnout(java.lang.String newName, boolean feedbackDifferent) Get a NBHTurnout from the CtcManager NBHTurnout map or create a new one.- Parameters:
- newName- The new name to be retrieved from the map or created.
- feedbackDifferent- The feedback different state.
- Returns:
- a valid NBHTurnout or an empty NBHTurnout.
 
 - 
getNBHSignalpublic static NBHSignal getNBHSignal(java.lang.String newName) Get a NBHSignal from the CtcManager NBHSignal map or create a new one.- Parameters:
- newName- The new name to be retrieved from the map or created.
- Returns:
- a valid NBHSignal or null.
 
 - 
addSensorToSensorListpublic static void addSensorToSensorList(java.util.ArrayList<NBHSensor> list, java.lang.String sensorName) Add a valid NBHSensor entry to an ArrayList. The sensor name has to match an existing sensor in the JMRI sensor table.- Parameters:
- list- The NBHSensor array list.
- sensorName- The proposed sensor name.
 
 
- 
 
-