Class PanelEditor

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.VetoableChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, BeanInterface, ModifiedFlag, JmriMouseListener, JmriMouseMotionListener, WindowInterface
    Direct Known Subclasses:
    LayoutEditor

    public class PanelEditor
    extends Editor
    implements java.awt.event.ItemListener
    Provides a simple editor for adding jmri.jmrit.display items to a captive JFrame.

    GUI is structured as a band of common parameters across the top, then a series of things you can add.

    All created objects are put specific levels depending on their type (higher levels are in front):

    • BKG background
    • ICONS icons and other drawing symbols
    • LABELS text labels
    • TURNOUTS turnouts and other variable track items
    • SENSORS sensors and other independently modified objects

    The "contents" List keeps track of all the objects added to the target frame for later manipulation.

    If you close the Editor window, the target is left alone and the editor window is just hidden, not disposed. If you close the target, the editor and target are removed, and dispose is run. To make this logic work, the PanelEditor is descended from a JFrame, not a JPanel. That way it can control its own visibility.

    The title of the target and the editor panel are kept consistent via the {#setTitle} method.

    See Also:
    Serialized Form