Package jmri.util.swing
Class JmriNamedPaneAction
java.lang.Object
javax.swing.AbstractAction
jmri.util.swing.JmriAbstractAction
jmri.util.swing.JmriNamedPaneAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
CanNamedPaneAction
,Dcc4PcNamedPaneAction
,DCCppMonPane.Default
,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
-
Field Summary
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Constructor Summary
Constructors Constructor Description JmriNamedPaneAction(String s, String paneClass)
Original constructor for compatibility with older menus.JmriNamedPaneAction(String s, Icon i, WindowInterface wi, String paneClass)
Constructor that associates a newly created panel with the given window, showing a name and iconJmriNamedPaneAction(String s, WindowInterface wi, String paneClass)
Constructor that associates a newly created panel with the given window, showing a name -
Method Summary
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 Details
-
Constructor Details
-
JmriNamedPaneAction
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
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
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 Details
-
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
-