Class JmriNamedPaneAction

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String paneClass  
      • Fields inherited from class javax.swing.AbstractAction

        changeSupport, enabled
      • 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​(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 icon
      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
    • 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 javax.swing.AbstractAction

        addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javax.swing.Action

        accept
    • 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 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​(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 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​(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 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 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 class JmriAbstractAction