Class Editor

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.ComponentListener, 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:
    ControlPanelEditor, PanelEditor, SwitchboardEditor

    public abstract class Editor
    extends JmriJFrame
    implements JmriMouseListener, JmriMouseMotionListener, java.awt.event.ActionListener, java.awt.event.KeyListener, java.beans.VetoableChangeListener
    This is the Model and a Controller for panel editor Views. (Panel Editor, Layout Editor or any subsequent editors) The Model is simply a list of Positionable objects added to a "target panel". Control of the display attributes of the Positionable objects is done here. However, control of mouse events is passed to the editor views, so control is also done by the editor views.

    The "contents" List keeps track of all the objects added to the target frame for later manipulation. This class only locates and moves "target panel" items, and does not control their appearance - that is left for the editor views.

    The Editor has tri-state "flags" to control the display of Positionable object attributes globally - i.e. "on" or "off" for all - or as a third state, permits the display control "locally" by corresponding flags in each Positionable object

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

    Mouse events are initial handled here, rather than in the individual displayed objects, so that selection boxes for moving multiple objects can be provided.

    This class also implements an effective ToolTipManager replacement, because the standard Swing one can't deal with the coordinate changes used to zoom a panel. It works by controlling the contents of the _tooltip instance variable, and triggering repaint of the target window when the tooltip changes. The window painting then explicitly draws the tooltip for the underlying object.

    See Also:
    Serialized Form