Class PanelEditor

All Implemented Interfaces:
ActionListener, ComponentListener, ItemListener, KeyListener, MouseListener, MouseMotionListener, WindowListener, ImageObserver, MenuContainer, VetoableChangeListener, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, BeanInterface, ModifiedFlag, WindowInterface
Direct Known Subclasses:
LayoutEditor

public class PanelEditor
extends Editor
implements 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