Package jmri.jmrix.lenz.swing
Class AbstractXPressNetAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.jmrix.lenz.swing.AbstractXPressNetAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,SystemConnectionAction<XNetSystemConnectionMemo>
- Direct Known Subclasses:
LI101Action
,LIUSBConfigAction
,LZ100Action
,LZV100Action
,PacketGenAction
,StackMonAction
,SystemInfoAction
public abstract class AbstractXPressNetAction extends javax.swing.AbstractAction implements SystemConnectionAction<XNetSystemConnectionMemo>
Abstract action to create and register a swing object for XpressNet systems.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected XNetSystemConnectionMemo
_memo
-
Constructor Summary
Constructors Constructor Description AbstractXPressNetAction(java.lang.String s, XNetSystemConnectionMemo memo)
AbstractXPressNetAction(XNetSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XNetSystemConnectionMemo
getSystemConnectionMemo()
Get theSystemConnectionMemo
this action is bound to.java.util.Set<java.lang.Class<? extends SystemConnectionMemo>>
getSystemConnectionMemoClasses()
Get a list ofSystemConnectionMemo
subclasses that the implementing class accepts.void
setSystemConnectionMemo(XNetSystemConnectionMemo memo)
Set theSystemConnectionMemo
this action is bound to.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
_memo
protected XNetSystemConnectionMemo _memo
-
-
Constructor Detail
-
AbstractXPressNetAction
public AbstractXPressNetAction(java.lang.String s, XNetSystemConnectionMemo memo)
-
AbstractXPressNetAction
public AbstractXPressNetAction(XNetSystemConnectionMemo memo)
-
-
Method Detail
-
getSystemConnectionMemo
@CheckForNull public XNetSystemConnectionMemo getSystemConnectionMemo()
Get theSystemConnectionMemo
this action is bound to.- Specified by:
getSystemConnectionMemo
in interfaceSystemConnectionAction<XNetSystemConnectionMemo>
- Returns:
- the SystemConnectionMemo or null if not bound
-
setSystemConnectionMemo
public void setSystemConnectionMemo(@Nonnull XNetSystemConnectionMemo memo)
Set theSystemConnectionMemo
this action is bound to.Implementing classes may throw an IllegalArgumentException if the implementing class requires a specific subclass of SystemConnectionMemo.
- Specified by:
setSystemConnectionMemo
in interfaceSystemConnectionAction<XNetSystemConnectionMemo>
- Parameters:
memo
- the SystemConnectionMemo- Throws:
java.lang.IllegalArgumentException
- if the SystemConnectionMemo is invalid
-
getSystemConnectionMemoClasses
@Nonnull public java.util.Set<java.lang.Class<? extends SystemConnectionMemo>> getSystemConnectionMemoClasses()
Get a list ofSystemConnectionMemo
subclasses that the implementing class accepts.If the implementing class is a subclass of a class that does accept SystemConnectionMemos, but the implementing class does not accept any, return an empty array instead of null.
- Specified by:
getSystemConnectionMemoClasses
in interfaceSystemConnectionAction<XNetSystemConnectionMemo>
- Returns:
- Set of SystemConnectionMemo subclasses or empty array.
-
-