Package jmri.jmrix
Class AbstractSerialConnectionConfig
java.lang.Object
jmri.jmrix.AbstractConnectionConfig
jmri.jmrix.AbstractSerialConnectionConfig
- All Implemented Interfaces:
ConnectionConfig
- Direct Known Subclasses:
AbstractDCCppSerialConnectionConfig
,AbstractXNetSerialConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
public abstract class AbstractSerialConnectionConfig extends AbstractConnectionConfig
Abstract base class for common implementation of the SerialConnectionConfig.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
AbstractSerialConnectionConfig.ComboBoxRenderer
Nested classes/interfaces inherited from class jmri.jmrix.AbstractConnectionConfig
AbstractConnectionConfig.Option
-
Field Summary
Fields Modifier and Type Field Description protected SerialPortAdapter
adapter
protected JComboBox<String>
baudBox
protected JLabel
baudBoxLabel
protected String[]
baudList
protected boolean
init
(package private) String
invalidPort
(package private) Vector<String>
originalList
protected JLabel
outputIntervalLabel
protected JButton
outputIntervalReset
protected JSpinner
outputIntervalSpinner
(package private) UserPreferencesManager
p
protected JComboBox<String>
portBox
protected JLabel
portBoxLabel
(package private) Vector<String>
v
Fields inherited from class jmri.jmrix.AbstractConnectionConfig
_details, additionalItems, cL, connectionNameField, connectionNameLabel, cR, gbLayout, NUMOPTIONS, options, showAdvanced, systemPrefixField, systemPrefixLabel
-
Constructor Summary
Constructors Constructor Description AbstractSerialConnectionConfig()
Ctor for a functional object with no preexisting adapter.AbstractSerialConnectionConfig(PortAdapter p)
Ctor for an object being created during load process.AbstractSerialConnectionConfig(SerialPortAdapter p)
-
Method Summary
Modifier and Type Method Description protected int
addStandardDetails(boolean incAdvanced, int i)
protected void
addToActionList()
Deprecated.since 4.19.7 without direct replacementprotected void
checkInitDone()
Complete connection adapter initialization, adding desired options to the Connection Configuration pane.void
dispose()
Done with this ConnectionConfig object.protected ResourceBundle
getActionModelResourceBundle()
This is purely here for systems that do not implement the SystemConnectionMemo and can be removed once they have been migrated.SerialPortAdapter
getAdapter()
String
getConnectionName()
boolean
getDisabled()
String
getInfo()
String
getManufacturer()
protected String[]
getPortFriendlyNames()
This provides a method to return potentially meaningful names that are used in OS to help identify ports against Hardware.protected Vector<String>
getPortNames()
boolean
isBaudAdvanced()
boolean
isPortAdvanced()
void
loadDetails(JPanel details)
Load the Swing widgets needed to configure this connection into a specified JPanel.void
refreshPortBox()
protected void
removeFromActionList()
Deprecated.since 4.19.7 without direct replacementvoid
setDisabled(boolean disabled)
protected abstract void
setInstance()
Load the adapter with an appropriate object unless it's already been set.void
setManufacturer(String manufacturer)
protected void
showAdvancedItems()
void
updateAdapter()
protected static void
updateSerialPortNames(String portName, JComboBox<String> portCombo, Vector<String> portList)
Handle friendly port names.Methods inherited from class jmri.jmrix.AbstractConnectionConfig
addNameEntryCheckers, addStandardDetails, isDirty, isRestartRequired, register
-
Field Details
-
Constructor Details
-
AbstractSerialConnectionConfig
Ctor for an object being created during load process.- Parameters:
p
- port being configured
-
AbstractSerialConnectionConfig
-
AbstractSerialConnectionConfig
public AbstractSerialConnectionConfig()Ctor for a functional object with no preexisting adapter. Expect that the subclass setInstance() will fill the adapter member.
-
-
Method Details
-
getAdapter
-
checkInitDone
Complete connection adapter initialization, adding desired options to the Connection Configuration pane. Required action: set init to true. Optional actions:- fill in connectionNameField
- add ActionListeners to config fields eg. systemPrefixField to update adapter after change by the user
- Specified by:
checkInitDone
in classAbstractConnectionConfig
-
updateAdapter
- Specified by:
updateAdapter
in classAbstractConnectionConfig
-
setInstance
Load the adapter with an appropriate object unless it's already been set.- Specified by:
setInstance
in classAbstractConnectionConfig
-
getInfo
- Specified by:
getInfo
in interfaceConnectionConfig
- Specified by:
getInfo
in classAbstractConnectionConfig
-
refreshPortBox
-
loadDetails
Load the Swing widgets needed to configure this connection into a specified JPanel. Used during the configuration process to fill out the preferences window with content specific to this Connection type. The JPanel contents need to handle their own gets/sets to the underlying Connection content.- Specified by:
loadDetails
in interfaceConnectionConfig
- Specified by:
loadDetails
in classAbstractConnectionConfig
- Parameters:
details
- the specific Swing object to be configured and filled
-
showAdvancedItems
- Specified by:
showAdvancedItems
in classAbstractConnectionConfig
-
addStandardDetails
-
isPortAdvanced
-
isBaudAdvanced
-
getManufacturer
- Specified by:
getManufacturer
in interfaceConnectionConfig
- Specified by:
getManufacturer
in classAbstractConnectionConfig
-
setManufacturer
- Specified by:
setManufacturer
in interfaceConnectionConfig
- Specified by:
setManufacturer
in classAbstractConnectionConfig
-
getDisabled
- Specified by:
getDisabled
in interfaceConnectionConfig
- Specified by:
getDisabled
in classAbstractConnectionConfig
-
setDisabled
- Specified by:
setDisabled
in interfaceConnectionConfig
- Specified by:
setDisabled
in classAbstractConnectionConfig
-
getConnectionName
- Specified by:
getConnectionName
in interfaceConnectionConfig
- Specified by:
getConnectionName
in classAbstractConnectionConfig
-
dispose
Description copied from interface:ConnectionConfig
Done with this ConnectionConfig object. Invoked inJmrixConfigPane
when switching away from this particular mode.- Specified by:
dispose
in interfaceConnectionConfig
- Overrides:
dispose
in classAbstractConnectionConfig
-
updateSerialPortNames
protected static void updateSerialPortNames(String portName, JComboBox<String> portCombo, Vector<String> portList)Handle friendly port names. Note that this changes the selection in portCombo, so that should be tracked after this returns.- Parameters:
portName
- The currently-selected port nameportCombo
- The combo box that's displaying the available portsportList
- The list of valid (unfriendly) port names
-
getPortNames
-
getPortFriendlyNames
This provides a method to return potentially meaningful names that are used in OS to help identify ports against Hardware.- Returns:
- array of friendly port names
-
getActionModelResourceBundle
This is purely here for systems that do not implement the SystemConnectionMemo and can be removed once they have been migrated.- Returns:
- Resource bundle for action model
-
addToActionList
Deprecated.since 4.19.7 without direct replacement -
removeFromActionList
Deprecated.since 4.19.7 without direct replacement
-