Package jmri.jmrix
Class AbstractNetworkConnectionConfig
- java.lang.Object
-
- jmri.jmrix.AbstractConnectionConfig
-
- jmri.jmrix.AbstractNetworkConnectionConfig
-
- All Implemented Interfaces:
ConnectionConfig
- Direct Known Subclasses:
ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,ConnectionConfig
,MarklinSimConnectionConfig
,MqttConnectionConfig
public abstract class AbstractNetworkConnectionConfig extends AbstractConnectionConfig
Abstract base class for common implementation of the NetworkConnectionConfig.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrix.AbstractConnectionConfig
AbstractConnectionConfig.Option
-
-
Field Summary
Fields Modifier and Type Field Description protected NetworkPortAdapter
adapter
protected javax.swing.JTextField
adNameField
protected javax.swing.JLabel
adNameFieldLabel
protected javax.swing.JTextField
hostNameField
protected javax.swing.JLabel
hostNameFieldLabel
protected boolean
init
protected javax.swing.SpinnerNumberModel
intervalSpinner
protected javax.swing.JLabel
outputIntervalLabel
protected javax.swing.JButton
outputIntervalReset
protected javax.swing.JSpinner
outputIntervalSpinner
(package private) UserPreferencesManager
p
protected javax.swing.JTextField
portField
protected javax.swing.JLabel
portFieldLabel
protected javax.swing.JTextField
serviceTypeField
protected javax.swing.JLabel
serviceTypeFieldLabel
protected javax.swing.JCheckBox
showAutoConfig
-
Fields inherited from class jmri.jmrix.AbstractConnectionConfig
_details, additionalItems, cL, connectionNameField, connectionNameLabel, cR, gbLayout, NUMOPTIONS, options, showAdvanced, systemPrefixField, systemPrefixLabel
-
-
Constructor Summary
Constructors Constructor Description AbstractNetworkConnectionConfig()
Ctor for a functional object with no preexisting adapter.AbstractNetworkConnectionConfig(NetworkPortAdapter p)
Create a connection configuration with a preexisting adapter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected int
addStandardDetails(boolean incAdvanced, int i)
protected void
checkInitDone()
Complete connection adapter initialization, adding desired options to the Connection Configuration pane.protected void
checkOptionValueValidity(java.lang.String i, javax.swing.JComboBox<java.lang.String> opt)
void
dispose()
Done with this ConnectionConfig object.NetworkPortAdapter
getAdapter()
java.lang.String
getConnectionName()
boolean
getDisabled()
java.lang.String
getInfo()
java.lang.String
getManufacturer()
boolean
isAutoConfigPossible()
boolean
isHostNameAdvanced()
boolean
isPortAdvanced()
Determine whether to display port in Advanced options.void
loadDetails(javax.swing.JPanel details)
Load the Swing widgets needed to configure this connection into a specified JPanel.void
setAutoNetworkConfig()
void
setDisabled(boolean disabled)
protected abstract void
setInstance()
Load the adapter with an appropriate object unless it's already been set.void
setManufacturer(java.lang.String manufacturer)
protected void
showAdvancedItems()
void
updateAdapter()
-
Methods inherited from class jmri.jmrix.AbstractConnectionConfig
addNameEntryCheckers, addStandardDetails, isDirty, isRestartRequired, register
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.ConnectionConfig
name
-
-
-
-
Field Detail
-
init
protected boolean init
-
hostNameField
protected javax.swing.JTextField hostNameField
-
hostNameFieldLabel
protected javax.swing.JLabel hostNameFieldLabel
-
portField
protected javax.swing.JTextField portField
-
portFieldLabel
protected javax.swing.JLabel portFieldLabel
-
showAutoConfig
protected javax.swing.JCheckBox showAutoConfig
-
adNameField
protected javax.swing.JTextField adNameField
-
adNameFieldLabel
protected javax.swing.JLabel adNameFieldLabel
-
serviceTypeField
protected javax.swing.JTextField serviceTypeField
-
serviceTypeFieldLabel
protected javax.swing.JLabel serviceTypeFieldLabel
-
intervalSpinner
protected javax.swing.SpinnerNumberModel intervalSpinner
-
outputIntervalSpinner
protected javax.swing.JSpinner outputIntervalSpinner
-
outputIntervalLabel
protected javax.swing.JLabel outputIntervalLabel
-
outputIntervalReset
protected javax.swing.JButton outputIntervalReset
-
adapter
protected NetworkPortAdapter adapter
-
-
Constructor Detail
-
AbstractNetworkConnectionConfig
public AbstractNetworkConnectionConfig(NetworkPortAdapter p)
Create a connection configuration with a preexisting adapter. This is used principally when loading a configuration that defines this connection.- Parameters:
p
- the adapter to create a connection configuration for
-
AbstractNetworkConnectionConfig
public AbstractNetworkConnectionConfig()
Ctor for a functional object with no preexisting adapter. Expect that the subclass setInstance() will fill the adapter member.
-
-
Method Detail
-
checkInitDone
protected 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
- Specified by:
checkInitDone
in classAbstractConnectionConfig
-
updateAdapter
public void updateAdapter()
- Specified by:
updateAdapter
in classAbstractConnectionConfig
-
getAdapter
public NetworkPortAdapter getAdapter()
-
setInstance
protected abstract void setInstance()
Load the adapter with an appropriate object unless it's already been set.- Specified by:
setInstance
in classAbstractConnectionConfig
-
getInfo
public java.lang.String getInfo()
- Specified by:
getInfo
in interfaceConnectionConfig
- Specified by:
getInfo
in classAbstractConnectionConfig
-
checkOptionValueValidity
protected void checkOptionValueValidity(java.lang.String i, javax.swing.JComboBox<java.lang.String> opt)
-
loadDetails
public 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:
loadDetails
in interfaceConnectionConfig
- Specified by:
loadDetails
in classAbstractConnectionConfig
- Parameters:
details
- the specific Swing object to be configured and filled
-
showAdvancedItems
protected void showAdvancedItems()
- Specified by:
showAdvancedItems
in classAbstractConnectionConfig
-
addStandardDetails
protected int addStandardDetails(boolean incAdvanced, int i)
-
isHostNameAdvanced
public boolean isHostNameAdvanced()
-
isPortAdvanced
public boolean isPortAdvanced()
Determine whether to display port in Advanced options.Default in Abstract Net Conn Config. Abstract True.
- Returns:
- true to display port in advanced options.
-
isAutoConfigPossible
public boolean isAutoConfigPossible()
-
setAutoNetworkConfig
public void setAutoNetworkConfig()
-
getManufacturer
public java.lang.String getManufacturer()
- Specified by:
getManufacturer
in interfaceConnectionConfig
- Specified by:
getManufacturer
in classAbstractConnectionConfig
-
setManufacturer
public void setManufacturer(java.lang.String manufacturer)
- Specified by:
setManufacturer
in interfaceConnectionConfig
- Specified by:
setManufacturer
in classAbstractConnectionConfig
-
getDisabled
public boolean getDisabled()
- Specified by:
getDisabled
in interfaceConnectionConfig
- Specified by:
getDisabled
in classAbstractConnectionConfig
-
setDisabled
public void setDisabled(boolean disabled)
- Specified by:
setDisabled
in interfaceConnectionConfig
- Specified by:
setDisabled
in classAbstractConnectionConfig
-
getConnectionName
public java.lang.String getConnectionName()
- Specified by:
getConnectionName
in interfaceConnectionConfig
- Specified by:
getConnectionName
in classAbstractConnectionConfig
-
dispose
public void 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
-
-