Package jmri.util

Class JmriJFrame

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JmriJFrame.ScreenDimensions
      Represents the dimensions of an attached screen/display
      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean allowInFrameServlet  
      protected java.util.HashMap<java.lang.String,​java.lang.Object> properties  
      protected boolean reuseFrameSavedPosition  
      protected boolean reuseFrameSavedSized  
      (package private) static java.lang.String WINDOW_MODIFIED  
      (package private) java.lang.String windowFrameRef  
      protected WindowInterface windowInterface  
      • Fields inherited from class javax.swing.JFrame

        accessibleContext, rootPane, rootPaneCheckingEnabled
      • Fields inherited from class java.awt.Frame

        CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Constructor Summary

      Constructors 
      Constructor Description
      JmriJFrame()
      Creates a JFrame with standard settings, including saving/restoring of size and position.
      JmriJFrame​(boolean saveSize, boolean savePosition)
      Creates a JFrame with standard settings, optional save/restore of size and position.
      JmriJFrame​(java.lang.String name)
      Creates a JFrame with with given name plus standard settings, including saving/restoring of size and position.
      JmriJFrame​(java.lang.String name, boolean saveSize, boolean savePosition)
      Creates a JFrame with with given name plus standard settings, including optional save/restore of size and position.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHelpMenu​(java.lang.String ref, boolean direct)
      Add a standard help menu, including window specific help item.
      (package private) void addWindowCloseShortCut()
      Adds a "Close Window" key shortcut to close window on op-W.
      void componentHidden​(java.awt.event.ComponentEvent e)
      Does nothing in this class
      void componentMoved​(java.awt.event.ComponentEvent e)
      void componentResized​(java.awt.event.ComponentEvent e)
      void componentShown​(java.awt.event.ComponentEvent e)
      Does nothing in this class
      void dispose()
      When window is finally destroyed, remove it from the list of windows.
      void generateWindowRef()
      Regenerates the window frame ref that is used for saving and setting frame size and position against.
      boolean getAllowInFrameServlet()  
      javax.swing.AbstractAction getEscapeKeyAction()
      The action associated with the Escape key.
      boolean getEscapeKeyClosesWindow()
      Does the Escape key close the window?
      java.awt.Frame getFrame()
      Returns the WindowInterface as a Frame or null.
      static JmriJFrame getFrame​(java.lang.String name)
      Get a JmriJFrame of a particular name.
      static java.util.List<JmriJFrame> getFrameList()
      Get a List of the currently-existing JmriJFrame objects.
      static <T extends JmriJFrame>
      java.util.List<T>
      getFrameList​(java.lang.Class<T> type)
      Get a list of currently-existing JmriJFrame objects that are specific sub-classes of JmriJFrame.
      java.lang.Object getIndexedProperty​(java.lang.String key, int index)
      Get the value of an element in an indexed property.
      java.awt.Dimension getMaximumSize()
      Provide a maximum frame size that is limited to what can fit on the screen after toolbars, etc are deducted.
      boolean getModifiedFlag()
      Get the current value of the modified flag.
      java.awt.Dimension getPreferredSize()
      The preferred size must fit on the physical screen, so calculate the lesser of either the preferred size from the layout or the screen size.
      java.lang.Object getProperty​(java.lang.String key)
      Get the value of a property.
      java.util.Set<java.lang.String> getPropertyNames()
      List all property names or keys.
      boolean getSavePosition()
      Returns if the frame Position is saved or not.
      boolean getSaveSize()
      Returns if the frame Size is saved or not.
      static java.util.ArrayList<JmriJFrame.ScreenDimensions> getScreenDimensions()
      returns the previously initialized array of screens.
      java.lang.String getWindowFrameRef()  
      WindowInterface getWindowInterface()  
      protected void handleModified()
      Handle closing a window or quiting the program while the modified bit was set.
      boolean hasIndexedProperty​(java.lang.String key)
      Test that a property exists and is indexed.
      boolean hasProperty​(java.lang.String key)
      Test that a property exists.
      void initComponents()
      By default, Swing components should be created an installed in this method, rather than in the ctor itself.
      (package private) void initFrame()  
      void makePrivateWindow()
      Remove this window from the Windows Menu by removing it from the list of active JmriJFrames.
      void markWindowModified​(boolean yes)  
      boolean multipleInstances()
      Should 2nd and subsequent requests for a panel create a new instance, or provide the 1st one for reuse?
      (package private) void offSetFrameOnScreen​(JmriJFrame f)
      Move a frame down and to the left by it's top offset or a fixed amount, whichever is larger
      void pack()
      (package private) void reSizeToFitOnScreen()
      Tries to get window to fix entirely on screen.
      void setAllowInFrameServlet​(boolean allow)  
      void setEscapeKeyAction​(javax.swing.AbstractAction action)
      Bind an action to the Escape key.
      void setEscapeKeyClosesWindow​(boolean closesWindow)
      Bind the Escape key to an action that closes the window.
      void setFrameLocation()
      Reset frame location and size to stored preference value
      (package private) void setFrameTitle​(java.lang.String name)  
      void setIndexedProperty​(java.lang.String key, int index, java.lang.Object value)
      Set the value of an element in an indexed property.
      void setModifiedFlag​(boolean flag)
      Set the modified flag to a specific value
      void setProperty​(java.lang.String key, java.lang.Object value)
      Set the value of a property.
      void setSavePosition​(boolean save)
      Set whether the frame Position is saved or not after it has been created.
      void setSaveSize​(boolean save)
      Set whether the frame Size is saved or not after it has been created.
      protected void setShutDownTask()  
      void setWindowInterface​(WindowInterface wi)  
      void show​(JmriPanel child, JmriAbstractAction action)
      Show, in whatever way is appropriate, a specific JmriPanel
      void show​(JmriPanel child, JmriAbstractAction action, WindowInterface.Hint hint)
      Show, in whatever way is appropriate, a specific JmriPanel, in a hinted location
      protected void storeValues()  
      void undecorate()
      Remove any decoration, such as the title bar or close window control, from the JFrame.
      void windowActivated​(java.awt.event.WindowEvent e)
      Does nothing in this class
      void windowClosed​(java.awt.event.WindowEvent e)
      Does nothing in this class
      void windowClosing​(java.awt.event.WindowEvent e)
      The JmriJFrame implementation calls handleModified().
      void windowDeactivated​(java.awt.event.WindowEvent e)
      Does nothing in this class
      void windowDeiconified​(java.awt.event.WindowEvent e)
      Does nothing in this class
      void windowIconified​(java.awt.event.WindowEvent e)
      Does nothing in this class
      void windowOpened​(java.awt.event.WindowEvent e)
      Does nothing in this class
      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Constructor Detail

      • JmriJFrame

        public JmriJFrame​(boolean saveSize,
                          boolean savePosition)
        Creates a JFrame with standard settings, optional save/restore of size and position.
        Parameters:
        saveSize - Set true to save the last known size
        savePosition - Set true to save the last known location
      • JmriJFrame

        public JmriJFrame()
        Creates a JFrame with standard settings, including saving/restoring of size and position.
      • JmriJFrame

        public JmriJFrame​(java.lang.String name)
        Creates a JFrame with with given name plus standard settings, including saving/restoring of size and position.
        Parameters:
        name - Title of the JFrame
      • JmriJFrame

        public JmriJFrame​(java.lang.String name,
                          boolean saveSize,
                          boolean savePosition)
        Creates a JFrame with with given name plus standard settings, including optional save/restore of size and position.
        Parameters:
        name - Title of the JFrame
        saveSize - Set true to save the last knowm size
        savePosition - Set true to save the last known location
    • Method Detail

      • setFrameTitle

        final void setFrameTitle​(java.lang.String name)
      • makePrivateWindow

        public void makePrivateWindow()
        Remove this window from the Windows Menu by removing it from the list of active JmriJFrames.
      • setFrameLocation

        public void setFrameLocation()
        Reset frame location and size to stored preference value
      • getScreenDimensions

        public static java.util.ArrayList<JmriJFrame.ScreenDimensionsgetScreenDimensions()
        returns the previously initialized array of screens. See getScreenDimensionsOnce()
        Returns:
        ArrayList of screen bounds and insets
      • generateWindowRef

        public void generateWindowRef()
        Regenerates the window frame ref that is used for saving and setting frame size and position against.
      • pack

        public void pack()
        Overrides:
        pack in class java.awt.Window
      • undecorate

        public void undecorate()
        Remove any decoration, such as the title bar or close window control, from the JFrame.

        JmriJFrames are often built internally and presented to the user before any scripting action can interact with them. At that point it's too late to directly invoke setUndecorated(true) because the JFrame is already displayable. This method uses dispose() to drop the windowing resources, sets undecorated, and then redisplays the window.

      • reSizeToFitOnScreen

        void reSizeToFitOnScreen()
        Tries to get window to fix entirely on screen. First choice is to move the origin up and left as needed, then to make the window smaller
      • offSetFrameOnScreen

        void offSetFrameOnScreen​(JmriJFrame f)
        Move a frame down and to the left by it's top offset or a fixed amount, whichever is larger
        Parameters:
        f - JmirJFrame to move
      • initComponents

        public void initComponents()
        By default, Swing components should be created an installed in this method, rather than in the ctor itself.
      • addHelpMenu

        public final void addHelpMenu​(java.lang.String ref,
                                      boolean direct)
        Add a standard help menu, including window specific help item. Final because it defines the content of a standard help menu, not to be messed with individually
        Parameters:
        ref - JHelp reference for the desired window-specific help page
        direct - true if the help main-menu item goes directly to the help system, such as when there are no items in the help menu
      • addWindowCloseShortCut

        void addWindowCloseShortCut()
        Adds a "Close Window" key shortcut to close window on op-W.
      • setEscapeKeyAction

        public void setEscapeKeyAction​(javax.swing.AbstractAction action)
        Bind an action to the Escape key.

        Binds an AbstractAction to the Escape key. If an action is already bound to the Escape key, that action will be replaced. Passing null unbinds any existing actions from the Escape key.

        Note that binding the Escape key to any action may break expected or standardized behaviors. See Keyboard Shortcuts, Mnemonics, and Other Keyboard Operations in the Java Look and Feel Design Guidelines for standardized behaviors.

        Parameters:
        action - The AbstractAction to bind to.
        See Also:
        getEscapeKeyAction(), setEscapeKeyClosesWindow(boolean)
      • setEscapeKeyClosesWindow

        public void setEscapeKeyClosesWindow​(boolean closesWindow)
        Bind the Escape key to an action that closes the window.

        If closesWindow is true, this method creates an action that triggers the "window is closing" event; otherwise this method removes any actions from the Escape key.

        Parameters:
        closesWindow - Create or destroy an action to close the window.
        See Also:
        WindowEvent.WINDOW_CLOSING, setEscapeKeyAction(javax.swing.AbstractAction)
      • getMaximumSize

        public java.awt.Dimension getMaximumSize()
        Provide a maximum frame size that is limited to what can fit on the screen after toolbars, etc are deducted.

        Some of the methods used here return null pointers on some Java implementations, however, so this will return the superclasses's maximum size if the algorithm used here fails.

        Overrides:
        getMaximumSize in class java.awt.Container
        Returns:
        the maximum window size
      • getPreferredSize

        public java.awt.Dimension getPreferredSize()
        The preferred size must fit on the physical screen, so calculate the lesser of either the preferred size from the layout or the screen size.
        Overrides:
        getPreferredSize in class java.awt.Container
        Returns:
        the preferred size or the maximum size, whichever is smaller
      • getFrameList

        @Nonnull
        public static java.util.List<JmriJFramegetFrameList()
        Get a List of the currently-existing JmriJFrame objects. The returned list is a copy made at the time of the call, so it can be manipulated as needed by the caller.
        Returns:
        a list of JmriJFrame instances. If there are no instances, an empty list is returned.
      • getFrameList

        public static <T extends JmriJFrame> java.util.List<T> getFrameList​(@Nonnull
                                                                            java.lang.Class<T> type)
        Get a list of currently-existing JmriJFrame objects that are specific sub-classes of JmriJFrame.

        The returned list is a copy made at the time of the call, so it can be manipulated as needed by the caller.

        Type Parameters:
        T - generic JmriJframe.
        Parameters:
        type - The Class the list should be limited to.
        Returns:
        An ArrayList of Frames.
      • getFrame

        public static JmriJFrame getFrame​(java.lang.String name)
        Get a JmriJFrame of a particular name. If more than one exists, there's no guarantee as to which is returned.
        Parameters:
        name - the name of one or more JmriJFrame objects
        Returns:
        a JmriJFrame with the matching name or null if no matching frames exist
      • setSavePosition

        public void setSavePosition​(boolean save)
        Set whether the frame Position is saved or not after it has been created.
        Parameters:
        save - true if the frame position should be saved.
      • setSaveSize

        public void setSaveSize​(boolean save)
        Set whether the frame Size is saved or not after it has been created.
        Parameters:
        save - true if the frame size should be saved.
      • getSavePosition

        public boolean getSavePosition()
        Returns if the frame Position is saved or not.
        Returns:
        true if the frame position should be saved
      • getSaveSize

        public boolean getSaveSize()
        Returns if the frame Size is saved or not.
        Returns:
        true if the frame size should be saved
      • setModifiedFlag

        public void setModifiedFlag​(boolean flag)
        Set the modified flag to a specific value A frame is considered "modified" if it has changes that have not been stored.
        Specified by:
        setModifiedFlag in interface ModifiedFlag
        Parameters:
        flag - true if the object has been modified
      • getModifiedFlag

        public boolean getModifiedFlag()
        Get the current value of the modified flag.
        Specified by:
        getModifiedFlag in interface ModifiedFlag
        Returns:
        true if the object has been modified and needs to be stored
      • handleModified

        protected void handleModified()
        Handle closing a window or quiting the program while the modified bit was set.
      • windowOpened

        public void windowOpened​(java.awt.event.WindowEvent e)
        Does nothing in this class
        Specified by:
        windowOpened in interface java.awt.event.WindowListener
      • windowClosed

        public void windowClosed​(java.awt.event.WindowEvent e)
        Does nothing in this class
        Specified by:
        windowClosed in interface java.awt.event.WindowListener
      • windowActivated

        public void windowActivated​(java.awt.event.WindowEvent e)
        Does nothing in this class
        Specified by:
        windowActivated in interface java.awt.event.WindowListener
      • windowDeactivated

        public void windowDeactivated​(java.awt.event.WindowEvent e)
        Does nothing in this class
        Specified by:
        windowDeactivated in interface java.awt.event.WindowListener
      • windowIconified

        public void windowIconified​(java.awt.event.WindowEvent e)
        Does nothing in this class
        Specified by:
        windowIconified in interface java.awt.event.WindowListener
      • windowDeiconified

        public void windowDeiconified​(java.awt.event.WindowEvent e)
        Does nothing in this class
        Specified by:
        windowDeiconified in interface java.awt.event.WindowListener
      • windowClosing

        public void windowClosing​(java.awt.event.WindowEvent e)
        The JmriJFrame implementation calls handleModified().
        Specified by:
        windowClosing in interface java.awt.event.WindowListener
      • componentHidden

        public void componentHidden​(java.awt.event.ComponentEvent e)
        Does nothing in this class
        Specified by:
        componentHidden in interface java.awt.event.ComponentListener
      • componentMoved

        public void componentMoved​(java.awt.event.ComponentEvent e)
        Specified by:
        componentMoved in interface java.awt.event.ComponentListener
      • componentResized

        public void componentResized​(java.awt.event.ComponentEvent e)
        Specified by:
        componentResized in interface java.awt.event.ComponentListener
      • componentShown

        public void componentShown​(java.awt.event.ComponentEvent e)
        Does nothing in this class
        Specified by:
        componentShown in interface java.awt.event.ComponentListener
      • dispose

        @OverridingMethodsMustInvokeSuper
        public void dispose()
        When window is finally destroyed, remove it from the list of windows.

        Subclasses that over-ride this method must invoke this implementation with super.dispose() right before returning.

        Specified by:
        dispose in interface WindowInterface
        Overrides:
        dispose in class java.awt.Window
      • setIndexedProperty

        public void setIndexedProperty​(java.lang.String key,
                                       int index,
                                       java.lang.Object value)
        Set the value of an element in an indexed property.

        NOTE Implementing methods must not call Bean.setIndexedProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.setIntrospectedIndexedProperty() instead.

        Specified by:
        setIndexedProperty in interface BeanInterface
        Parameters:
        key - name of the property
        index - index of the property element to change
        value - the value to set the property to
      • getIndexedProperty

        public java.lang.Object getIndexedProperty​(java.lang.String key,
                                                   int index)
        Get the value of an element in an indexed property.

        NOTE Implementing methods must not call Bean.getIndexedProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.getIntrospectedIndexedProperty() instead.

        Specified by:
        getIndexedProperty in interface BeanInterface
        Parameters:
        key - name of the property
        index - index of the property element to change
        Returns:
        value of the property or null
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.Object value)
        Set the value of a property.

        NOTE Implementing methods must not call Bean.setProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.setIntrospectedProperty() instead. Subclasses should override this method with something more direct and faster

        Specified by:
        setProperty in interface BeanInterface
        Parameters:
        key - name of the property
        value - the value to set the property to
      • getProperty

        public java.lang.Object getProperty​(java.lang.String key)
        Get the value of a property.

        NOTE Implementing methods must not call Bean.getProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.getIntrospectedProperty() instead. Subclasses should override this method with something more direct and faster

        Specified by:
        getProperty in interface BeanInterface
        Parameters:
        key - name of the property
        Returns:
        The value of the property or null
      • hasProperty

        public boolean hasProperty​(java.lang.String key)
        Test that a property exists.

        NOTE Implementing method must not call Bean.hasProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.hasIntrospectedProperty() instead.

        Specified by:
        hasProperty in interface BeanInterface
        Parameters:
        key - name of the property
        Returns:
        true is property key exists
      • hasIndexedProperty

        public boolean hasIndexedProperty​(java.lang.String key)
        Test that a property exists and is indexed.

        NOTE Implementing method must not call Bean.hasIndexedProperty(), as doing so will cause a stack overflow. Implementing methods may call Beans.hasIntrospectedIndexedProperty() instead.

        Specified by:
        hasIndexedProperty in interface BeanInterface
        Parameters:
        key - name of the property
        Returns:
        true is property key exists and is indexed
      • show

        public void show​(JmriPanel child,
                         JmriAbstractAction action)
        Show, in whatever way is appropriate, a specific JmriPanel
        Specified by:
        show in interface WindowInterface
        Parameters:
        child - new JmriPanel to show
        action - JmriAbstractAction making the request
      • show

        public void show​(JmriPanel child,
                         JmriAbstractAction action,
                         WindowInterface.Hint hint)
        Show, in whatever way is appropriate, a specific JmriPanel, in a hinted location
        Specified by:
        show in interface WindowInterface
        Parameters:
        child - new JmriPanel to show
        action - JmriAbstractAction making the request
        hint - suggestion on where to put the content
      • multipleInstances

        public boolean multipleInstances()
        Should 2nd and subsequent requests for a panel create a new instance, or provide the 1st one for reuse?
        Specified by:
        multipleInstances in interface WindowInterface
        Returns:
        true if multiple instances should be provided, false if only one should be provided
      • getPropertyNames

        public java.util.Set<java.lang.String> getPropertyNames()
        List all property names or keys.

        NOTE Implementing method must not call Bean.getPropertyNames(), as doing so will cause a stack overflow. Implementing methods may call Beans.getIntrospectedPropertyNames() instead.

        NOTE Implementations of this method should not return null.

        Specified by:
        getPropertyNames in interface BeanInterface
        Returns:
        property names or an empty Set.
      • getFrame

        public java.awt.Frame getFrame()
        Returns the WindowInterface as a Frame or null.
        Specified by:
        getFrame in interface WindowInterface
        Returns:
        a Frame or null