Class 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 Details

  • Constructor Details

    • JmriNamedPaneAction

      public JmriNamedPaneAction​(String s, WindowInterface wi, 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 action
      wi - 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​(String s, Icon i, WindowInterface wi, 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 action
      i - Icon for display by the action
      wi - 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​(String s, String paneClass)
      Original constructor for compatibility with older menus. Assumes SDI GUI.
      Parameters:
      s - Human-readable panel name for display by the action
      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.
  • Method Details

    • 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 class JmriAbstractAction