Class DefaultModuleSwing
- java.lang.Object
-
- jmri.jmrit.logixng.swing.AbstractSwingConfigurator
-
- jmri.jmrit.logixng.implementation.swing.DefaultModuleSwing
-
- All Implemented Interfaces:
java.lang.Comparable<SwingConfiguratorInterface>,SwingConfiguratorInterface
public class DefaultModuleSwing extends AbstractSwingConfigurator
Configures an DefaultModule object with a Swing JPanel.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ModuleParametersTableModel_moduleParametersTableModelprotected javax.swing.JPanelpanel(package private) static java.util.ResourceBundlerbx
-
Constructor Summary
Constructors Constructor Description DefaultModuleSwing()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MaleSocketcreateNewObject(java.lang.String systemName, java.lang.String userName)Create a new object with the data entered.This method must also register the object in its manager.protected voidcreatePanel(Base object, javax.swing.JPanel buttonPanel)voiddispose()Dispose the panel and remove all the listeners that this class may have registered.voidexecuteEvaluate(Base object)Execute or evaluate an item that this object configures.java.lang.StringgetAutoSystemName()Create a new system name.javax.swing.JPanelgetConfigPanel(javax.swing.JPanel buttonPanel)Get a configuration panel when a new object is to be created and we don't have it yet.javax.swing.JPanelgetConfigPanel(Base object, javax.swing.JPanel buttonPanel)Get a configuration panel for an object.java.lang.StringgetExampleSystemName()Get an example of a system namejava.lang.StringgetExecuteEvaluateMenuText()Get the menu text for execute/evaluate.BaseManager<? extends NamedBean>getManager()Get the manager that handles the beans for the new object.java.lang.StringtoString()Returns the name of the class that this class configures.voidupdateObject(Base object)Updates the object with the data in the form.booleanvalidate(java.util.List<java.lang.String> errorMessages)Validate the form.-
Methods inherited from class jmri.jmrit.logixng.swing.AbstractSwingConfigurator
getAllSymbols, getJDialog, setJDialog
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.jmrit.logixng.swing.SwingConfiguratorInterface
canClose, compareTo, setDefaultValues
-
-
-
-
Field Detail
-
rbx
static final java.util.ResourceBundle rbx
-
panel
protected javax.swing.JPanel panel
-
_moduleParametersTableModel
ModuleParametersTableModel _moduleParametersTableModel
-
-
Constructor Detail
-
DefaultModuleSwing
public DefaultModuleSwing()
-
-
Method Detail
-
getExecuteEvaluateMenuText
public java.lang.String getExecuteEvaluateMenuText()
Get the menu text for execute/evaluate.- Specified by:
getExecuteEvaluateMenuTextin interfaceSwingConfiguratorInterface- Overrides:
getExecuteEvaluateMenuTextin classAbstractSwingConfigurator- Returns:
- the menu text
-
executeEvaluate
public void executeEvaluate(@Nonnull Base object)
Execute or evaluate an item that this object configures.- Specified by:
executeEvaluatein interfaceSwingConfiguratorInterface- Overrides:
executeEvaluatein classAbstractSwingConfigurator- Parameters:
object- the object to execute or evaluate
-
getManager
public BaseManager<? extends NamedBean> getManager()
Get the manager that handles the beans for the new object. This is used for validation of the system name for the bean that this class creates.- Returns:
- the manager
-
getConfigPanel
public javax.swing.JPanel getConfigPanel(@Nonnull javax.swing.JPanel buttonPanel) throws java.lang.IllegalArgumentException
Get a configuration panel when a new object is to be created and we don't have it yet. This method initializes the panel with an empty configuration.- Parameters:
buttonPanel- panel with the buttons- Returns:
- a panel that configures this object
- Throws:
java.lang.IllegalArgumentException- if this class does not support the class with the name given in parameter 'className'
-
getConfigPanel
public javax.swing.JPanel getConfigPanel(@Nonnull Base object, @Nonnull javax.swing.JPanel buttonPanel) throws java.lang.IllegalArgumentException
Get a configuration panel for an object. This method initializes the panel with the configuration of the object.- Parameters:
object- the object for which to return a configuration panelbuttonPanel- panel with the buttons- Returns:
- a panel that configures this object
- Throws:
java.lang.IllegalArgumentException- when needed
-
getExampleSystemName
public java.lang.String getExampleSystemName()
Get an example of a system name- Returns:
- the system name
-
getAutoSystemName
public java.lang.String getAutoSystemName()
Create a new system name.- Returns:
- a new system name
-
createPanel
protected void createPanel(@CheckForNull Base object, @Nonnull javax.swing.JPanel buttonPanel)
-
validate
public boolean validate(@Nonnull java.util.List<java.lang.String> errorMessages)
Validate the form.The parameter errorMessage is used to give the error message in case of an error. If there are errors, the error messages is added to the list errorMessage.
- Parameters:
errorMessages- the error messages in case of an error- Returns:
- true if data in the form is valid, false otherwise
-
createNewObject
public MaleSocket createNewObject(@Nonnull java.lang.String systemName, @CheckForNull java.lang.String userName)
Create a new object with the data entered.This method must also register the object in its manager.- Parameters:
systemName- system nameuserName- user name- Returns:
- a male socket for the new object
-
updateObject
public void updateObject(@Nonnull Base object)
Updates the object with the data in the form.- Parameters:
object- the object to update
-
toString
public java.lang.String toString()
Returns the name of the class that this class configures.- Specified by:
toStringin interfaceSwingConfiguratorInterface- Overrides:
toStringin classjava.lang.Object- Returns:
- the name of the class this class configures.
-
dispose
public void dispose()
Description copied from interface:SwingConfiguratorInterfaceDispose the panel and remove all the listeners that this class may have registered.
-
-