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
 
 public abstract class AbstractConnectionConfig extends java.lang.Object implements ConnectionConfig Abstract base class for common implementation of the ConnectionConfig.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classAbstractConnectionConfig.Option
 - 
Field SummaryFields Modifier and Type Field Description protected javax.swing.JPanel_detailsprotected java.util.ArrayList<javax.swing.JComponent>additionalItemsprotected java.awt.GridBagConstraintscLprotected javax.swing.JTextFieldconnectionNameFieldprotected javax.swing.JLabelconnectionNameLabelprotected java.awt.GridBagConstraintscRprotected java.awt.GridBagLayoutgbLayoutprotected intNUMOPTIONSprotected java.util.Map<java.lang.String,AbstractConnectionConfig.Option>optionsprotected javax.swing.JCheckBoxshowAdvancedprotected ValidatedTextFieldsystemPrefixFieldprotected javax.swing.JLabelsystemPrefixLabel
 - 
Constructor SummaryConstructors Constructor Description AbstractConnectionConfig()Ctor for a functional object with no preexisting adapter.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddNameEntryCheckers(PortAdapter adapter)protected intaddStandardDetails(PortAdapter adapter, boolean incAdvanced, int i)protected abstract voidcheckInitDone()Complete connection adapter initialization, adding desired options to the Connection Configuration pane.voiddispose()Done with this ConnectionConfig object.abstract java.lang.StringgetConnectionName()abstract booleangetDisabled()abstract java.lang.StringgetInfo()abstract java.lang.StringgetManufacturer()booleanisDirty()Determine if configuration needs to be written to disk.booleanisRestartRequired()Determine if application needs to be restarted for configuration changes to be applied.abstract voidloadDetails(javax.swing.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 voidsetInstance()Load the adapter with an appropriate object unless it's already been set.abstract voidsetManufacturer(java.lang.String manufacturer)protected abstract voidshowAdvancedItems()abstract voidupdateAdapter()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface jmri.jmrix.ConnectionConfiggetAdapter, name
 
- 
 
- 
- 
- 
Field Detail- 
NUMOPTIONSprotected int NUMOPTIONS 
 - 
showAdvancedprotected javax.swing.JCheckBox showAdvanced 
 - 
systemPrefixLabelprotected javax.swing.JLabel systemPrefixLabel 
 - 
connectionNameLabelprotected javax.swing.JLabel connectionNameLabel 
 - 
systemPrefixFieldprotected ValidatedTextField systemPrefixField 
 - 
connectionNameFieldprotected javax.swing.JTextField connectionNameField 
 - 
_detailsprotected javax.swing.JPanel _details 
 - 
optionsprotected final java.util.Map<java.lang.String,AbstractConnectionConfig.Option> options 
 - 
additionalItemsprotected java.util.ArrayList<javax.swing.JComponent> additionalItems 
 - 
gbLayoutprotected java.awt.GridBagLayout gbLayout 
 - 
cLprotected java.awt.GridBagConstraints cL 
 - 
cRprotected java.awt.GridBagConstraints cR 
 
- 
 - 
Constructor Detail- 
AbstractConnectionConfigpublic AbstractConnectionConfig() Ctor for a functional object with no preexisting adapter. Expect that the subclass setInstance() will fill the adapter member.AbstractConnectionConfigXmlloadCommon
 
- 
 - 
Method Detail- 
checkInitDoneprotected abstract void 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
 
 - 
updateAdapterpublic abstract void updateAdapter() 
 - 
isDirtypublic boolean isDirty() Determine if configuration needs to be written to disk.This default implementation always returns true to maintain the existing behavior. - Specified by:
- isDirtyin interface- ConnectionConfig
- Returns:
- true if configuration need to be saved, false otherwise
 
 - 
isRestartRequiredpublic boolean 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 interface- ConnectionConfig
- Returns:
- true if application needs to restart, false otherwise
 
 - 
setInstanceprotected abstract void setInstance() Load the adapter with an appropriate object unless it's already been set.
 - 
getInfopublic abstract java.lang.String getInfo() - Specified by:
- getInfoin interface- ConnectionConfig
 
 - 
loadDetailspublic abstract void loadDetails(javax.swing.JPanel details) 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 interface- ConnectionConfig
- Parameters:
- details- the specific Swing object to be configured and filled
 
 - 
showAdvancedItemsprotected abstract void showAdvancedItems() 
 - 
addStandardDetailsprotected int addStandardDetails(PortAdapter adapter, boolean incAdvanced, int i) 
 - 
getManufacturerpublic abstract java.lang.String getManufacturer() - Specified by:
- getManufacturerin interface- ConnectionConfig
 
 - 
setManufacturerpublic abstract void setManufacturer(java.lang.String manufacturer) - Specified by:
- setManufacturerin interface- ConnectionConfig
 
 - 
getConnectionNamepublic abstract java.lang.String getConnectionName() - Specified by:
- getConnectionNamein interface- ConnectionConfig
 
 - 
getDisabledpublic abstract boolean getDisabled() - Specified by:
- getDisabledin interface- ConnectionConfig
 
 - 
setDisabledpublic abstract void setDisabled(boolean disable) - Specified by:
- setDisabledin interface- ConnectionConfig
 
 - 
registerpublic void 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 interface- ConnectionConfig
 
 - 
disposepublic void dispose() Description copied from interface:ConnectionConfigDone with this ConnectionConfig object. Invoked inJmrixConfigPanewhen switching away from this particular mode.- Specified by:
- disposein interface- ConnectionConfig
 
 - 
addNameEntryCheckersprotected void addNameEntryCheckers(@Nonnull PortAdapter adapter) 
 
- 
 
-