Class JmriPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
AbstractLoaderPane, AbstractMonPane, AddEntryExitPairPanel, AddNewBeanPanel, AddNewDevicePanel, AddNewHardwareDevicePanel, AppConfigBase, AssociateTag, BeanTablePane, CabSignalPane, CanPanel, Dcc4PcPanel, DemoPanel, EcosPanel, EventTablePane, HubPane, IdToolPane, LayoutBlockRouteTable, LccProTable, LnPanel, LocoSelPane, Log4JTreePane, ManagerDefaultsConfigPane, MarklinPanel, MemoryToolPane, MrcPanel, Mx1Panel, NcePanel, NetworkTreePane, NewLocoSelPane, PowerlinePanel, PowerPane, RfidPanel, RosterTable, SampleConfigPane, SampleToolsMenuItem.SampleToolsMenuPanel, SignallingPanel, SignallingSourcePanel, SignalMastRepeaterPanel, SpeedProfilePanel, StlEditorPane, TagMonitorPane, TamsPanel, UserMessagePreferencesPane

public class JmriPanel extends JPanel
JPanel extension to handle automatic creation of window title and help reference.

For use with JmriAbstractAction or preferably JmriNamedPaneAction.

The expected initialization sequence is:

  1. The constructor, which can initialize internal variables, but shouldn't expose the object by installing any listeners, etc.
  2. initComponents() is called, which initializes Swing components and can make other external references.
  3. initContext(Object context) is called, which can make outside connections.
  4. Optionally, other usage-specific initialization methods can be called as needed.

A WindowInterface property is provided for use when the JmriPanel's controller logic wants to open a window or dialog in a position relative to this panel.

Since:
2.9.4
See Also:
  • Constructor Details

  • Method Details

    • getHelpTarget

      Provide a help target string which an enclosing frame can provide as a help reference.

      This automatically provides a reference to the usual place for JMRI window-specific help pages that are named for the implementing class, but note this is a Pane class, not a Frame class.

      Returns:
      the target String
    • getTitle

      public String getTitle()
      Provide a recommended title for an enclosing frame.
      Returns:
      the title; a null value will be treated as "" by the enclosing frame
    • isMultipleInstances

      public boolean isMultipleInstances()
      Can multiple instances of a specific pane subclass exist?
      Returns:
      true if multiple panels of this class can be open at once; false if only one instance of this panel can exist.
    • getMenus

      Provide menu items to add to a menu bar.
      Returns:
      a list of menu items to add or an empty list
    • getMinimumDimension

    • getWindowInterface

    • setWindowInterface

    • initComponents

      public void initComponents()
      2nd stage of initialization, invoked after the constructor is complete.
    • initContext

      public void initContext(Object context)
      3rd stage of initialization, invoked after Swing components exist.
      Parameters:
      context - the context that this panel may be initialized with
    • dispose

      public void dispose()