Package jmri.jmrix
Class AbstractConnectionConfig
java.lang.Object
jmri.jmrix.AbstractConnectionConfig
- All Implemented Interfaces:
ConnectionConfig
- Direct Known Subclasses:
AbstractNetworkConnectionConfig,AbstractSerialConnectionConfig,AbstractSimulatorConnectionConfig,AbstractStreamConnectionConfig,AbstractUsbConnectionConfig,IpocsConnectionConfig,RaspberryPiConnectionConfig,RaspberryPiSimulatorConnectionConfig
Abstract base class for common implementation of the ConnectionConfig.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JPanelprotected ArrayList<JComponent>protected GridBagConstraintsprotected JTextFieldprotected JLabelprotected GridBagConstraintsprotected GridBagLayoutprotected intprotected final Map<String,AbstractConnectionConfig.Option> protected JCheckBoxprotected ValidatedTextFieldprotected JLabel -
Constructor Summary
ConstructorsConstructorDescriptionCtor for a functional object with no preexisting adapter. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddNameEntryCheckers(PortAdapter adapter) protected intaddStandardDetails(PortAdapter adapter, boolean incAdvanced, int i) protected abstract voidComplete connection adapter initialization, adding desired options to the Connection Configuration pane.voiddispose()Done with this ConnectionConfig object.abstract Stringabstract booleanabstract StringgetInfo()abstract StringbooleanisDirty()Determine if configuration needs to be written to disk.booleanDetermine if application needs to be restarted for configuration changes to be applied.abstract voidloadDetails(JPanel details) Load the Swing widgets needed to configure this connection into a specified JPanel.voidregister()Register the ConnectionConfig with the running JMRI process.abstract voidsetDisabled(boolean disable) protected abstract voidLoad the adapter with an appropriate object unless it's already been set.abstract voidsetManufacturer(String manufacturer) protected abstract voidabstract voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.jmrix.ConnectionConfig
getAdapter, name
-
Field Details
-
NUMOPTIONS
-
showAdvanced
-
systemPrefixLabel
-
connectionNameLabel
-
systemPrefixField
-
connectionNameField
-
_details
-
options
-
additionalItems
-
gbLayout
-
cL
-
cR
-
-
Constructor Details
-
AbstractConnectionConfig
public AbstractConnectionConfig()Ctor for a functional object with no preexisting adapter. Expect that the subclass setInstance() will fill the adapter member.AbstractConnectionConfigXmlloadCommon
-
-
Method Details
-
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
-
updateAdapter
-
isDirty
Determine if configuration needs to be written to disk.This default implementation always returns true to maintain the existing behavior.
- Specified by:
isDirtyin interfaceConnectionConfig- Returns:
- true if configuration need to be saved, false otherwise
-
isRestartRequired
Determine if application needs to be restarted for configuration changes to be applied.The default implementation always returns true to maintain the existing behavior.
- Specified by:
isRestartRequiredin interfaceConnectionConfig- Returns:
- true if application needs to restart, false otherwise
-
setInstance
Load the adapter with an appropriate object unless it's already been set. -
getInfo
- Specified by:
getInfoin interfaceConnectionConfig
-
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:
loadDetailsin interfaceConnectionConfig- Parameters:
details- the specific Swing object to be configured and filled
-
showAdvancedItems
-
addStandardDetails
-
getManufacturer
- Specified by:
getManufacturerin interfaceConnectionConfig
-
setManufacturer
- Specified by:
setManufacturerin interfaceConnectionConfig
-
getConnectionName
- Specified by:
getConnectionNamein interfaceConnectionConfig
-
getDisabled
- Specified by:
getDisabledin interfaceConnectionConfig
-
setDisabled
- Specified by:
setDisabledin interfaceConnectionConfig
-
register
Register the ConnectionConfig with the running JMRI process.At a minimum, is responsible for:
- Registering this object with the ConfigurationManager for persistance, typically at the "Preferences" level
- Adding this object to the default (@link ConnectionConfigManager}
- Specified by:
registerin interfaceConnectionConfig
-
dispose
Description copied from interface:ConnectionConfigDone with this ConnectionConfig object. Invoked inJmrixConfigPanewhen switching away from this particular mode.- Specified by:
disposein interfaceConnectionConfig
-
addNameEntryCheckers
-