Package jmri.util.swing
Class JmriNamedPaneAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.util.swing.JmriAbstractAction
-
- jmri.util.swing.JmriNamedPaneAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
BiDiBNamedPaneAction
,CanNamedPaneAction
,Dcc4PcNamedPaneAction
,IEEE802154MonPane.Default
,JMRIClientMonPane.Default
,LnNamedPaneAction
,MarklinNamedPaneAction
,MrcNamedPaneAction
,Mx1NamedPaneAction
,PowerlineNamedPaneAction
,PowerPanelAction
,RfidNamedPaneAction
,SampleConfigPane.Default
,SRCPMonPane.Default
,SystemConnectionNamedPaneAction
,TamsNamedPaneAction
,XNetMonPane.Default
,XpaMonPane.Default
,Z21MonPane.Default
public class JmriNamedPaneAction extends JmriAbstractAction
Action that, when invoked, creates a JmriPanel from its class name and installs it in a given window.Windows are referenced through the
WindowInterface
, which can provide access to a new or existing single-pane window, or a more complex multi-pane window as seen in the DecoderPro interface.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JmriNamedPaneAction(java.lang.String s, java.lang.String paneClass)
Original constructor for compatibility with older menus.JmriNamedPaneAction(java.lang.String s, javax.swing.Icon i, WindowInterface wi, java.lang.String paneClass)
Constructor that associates a newly created panel with the given window, showing a name and iconJmriNamedPaneAction(java.lang.String s, WindowInterface wi, java.lang.String paneClass)
Constructor that associates a newly created panel with the given window, showing a name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JmriPanel
makePanel()
Invoked as part of the action being invoked, e.g. when button pressed or menu item selected, this runs the panel through the initial part of its life cycle and installs in the given window interface.-
Methods inherited from class jmri.util.swing.JmriAbstractAction
actionPerformed, dispose, setContext, setHint, setName, setParameter, setParameter, setWindowInterface, toString
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
paneClass
protected java.lang.String paneClass
-
-
Constructor Detail
-
JmriNamedPaneAction
public JmriNamedPaneAction(java.lang.String s, WindowInterface wi, java.lang.String paneClass)
Constructor that associates a newly created panel with the given window, showing a name- Parameters:
s
- Human-readable panel name for display by the actionwi
- Window into which to install the new panel. If you want it to be put into a existing one, provide a reference. To create a new window containing just this pane, use "new jmri.util.swing.sdi.JmriJFrameInterface()"paneClass
- Name of the panel's class, which must be a subclass of JmriPanel. That's not checked at compile time or when the constructor runs, but must be true for the action to be invoked successfully.
-
JmriNamedPaneAction
public JmriNamedPaneAction(java.lang.String s, javax.swing.Icon i, WindowInterface wi, java.lang.String paneClass)
Constructor that associates a newly created panel with the given window, showing a name and icon- Parameters:
s
- Human-readable panel name for display by the actioni
- Icon for display by the actionwi
- Window into which to install the new panel. If you want it to be put into a existing one, provide a reference. To create a new window containing just this pane, use "new jmri.util.swing.sdi.JmriJFrameInterface()"paneClass
- Name of the panel's class, which must be a subclass of JmriPanel. That's not checked at compile time or when the constructor runs, but must be true for the action to be invoked successfully.
-
JmriNamedPaneAction
public JmriNamedPaneAction(java.lang.String s, java.lang.String paneClass)
Original constructor for compatibility with older menus. Assumes SDI GUI.- Parameters:
s
- Human-readable panel name for display by the actionpaneClass
- Name of the panel's class, which must be a subclass of JmriPanel. That's not checked at compile time or when the constructor runs, but must be true for the action to be invoked successfully.
-
-
Method Detail
-
makePanel
public JmriPanel makePanel()
Invoked as part of the action being invoked, e.g. when button pressed or menu item selected, this runs the panel through the initial part of its life cycle and installs in the given window interface.If different or additional initialization is needed, inherit from this class and override this method to do it.
- Specified by:
makePanel
in classJmriAbstractAction
-
-