|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
jmri.util.JmriJFrame
jmri.jmrit.display.PanelEditor
public class PanelEditor
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):
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static Integer |
BKG
|
static Integer |
CLOCK
|
ArrayList |
contents
|
static Integer |
ICONS
|
static Integer |
LABELS
|
static Integer |
MARKERS
|
static Integer |
MEMORIES
|
static Integer |
REPORTERS
|
static Integer |
SECURITY
|
static Integer |
SENSORS
|
static Integer |
SIGNALS
|
JLayeredPane |
target
|
static Integer |
TURNOUTS
|
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, 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 javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PanelEditor()
|
|
PanelEditor(String name)
|
|
| Method Summary | |
|---|---|
LocoIcon |
addLocoIcon(String name)
|
void |
addMultiSensor(MultiSensorIcon l)
|
void |
deletePanel()
Invoked by DeletePanel menu item Validate user intent before deleting |
void |
dispose()
Clean up when its time to make it all go away |
JFrame |
getFrame()
Get the frame containing the resulting panel (not the editor) |
JLayeredPane |
getTarget()
|
boolean |
hasPanelMenu()
|
boolean |
isControlling()
|
boolean |
isEditable()
|
boolean |
isPositionable()
|
boolean |
isShowCoordinates()
|
JmriJFrame |
makeFrame(String name)
Create sequence of panels, etc, for layout: JFrame contains its ContentPane which contains a JPanel with BoxLayout (p1) which contains a JScollPane (js) which contains the targetPane |
void |
putClock(AnalogClock2Display c)
|
void |
putLabel(PositionableLabel l)
|
void |
putLocoIcon(LocoIcon l)
|
void |
putMultiSensor(MultiSensorIcon l)
|
void |
putSensor(SensorIcon l)
|
void |
putSignal(SignalHeadIcon l)
|
void |
putTurnout(TurnoutIcon l)
|
void |
setAllControlling(boolean state)
Control whether target panel items are controlling layout items. |
void |
setAllEditable(boolean state)
Control whether target panel items are editable. |
void |
setAllPositionable(boolean state)
Control whether target panel items are positionable. |
void |
setFrame(JFrame f)
Set the frame containing the resulting panel (not the editor). |
void |
setPanelMenu(boolean state)
Control whether target panel shows a menu |
void |
setShowCoordinates(boolean state)
Control whether target panel items will show their coordinates in their popup memu. |
void |
setTarget(JLayeredPane f)
Set the JLayeredPane containing the objects to be edited. |
void |
setTitle()
|
void |
windowClosing(WindowEvent e)
Handle close of editor window. |
| Methods inherited from class jmri.util.JmriJFrame |
|---|
addHelpMenu, addNotify, getFrame, getFrameList, getMaximumSize, getModifiedFlag, getPreferredSize, handleModified, initComponents, markWindowModified, setModifiedFlag, setShutDownTask, storeValues, windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpened |
| Methods inherited from class java.awt.Frame |
|---|
finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public static final Integer BKG
public static final Integer ICONS
public static final Integer LABELS
public static final Integer MEMORIES
public static final Integer REPORTERS
public static final Integer SECURITY
public static final Integer TURNOUTS
public static final Integer SIGNALS
public static final Integer SENSORS
public static final Integer CLOCK
public static final Integer MARKERS
public JLayeredPane target
public ArrayList contents
| Constructor Detail |
|---|
public PanelEditor()
public PanelEditor(String name)
| Method Detail |
|---|
public void putTurnout(TurnoutIcon l)
public LocoIcon addLocoIcon(String name)
public void putLocoIcon(LocoIcon l)
public void putSensor(SensorIcon l)
public void addMultiSensor(MultiSensorIcon l)
public void putMultiSensor(MultiSensorIcon l)
public void putSignal(SignalHeadIcon l)
public void putClock(AnalogClock2Display c)
public void putLabel(PositionableLabel l)
public void setTarget(JLayeredPane f)
public JLayeredPane getTarget()
public JFrame getFrame()
public void setFrame(JFrame f)
public void deletePanel()
public void dispose()
dispose in class JmriJFramepublic void windowClosing(WindowEvent e)
Overload/override method in JmriJFrame parent, which by default is permanently closing the window. Here, we just want to make it invisible, so we don't dispose it (yet).
windowClosing in interface WindowListenerwindowClosing in class JmriJFramepublic void setTitle()
public void setAllPositionable(boolean state)
Positionable.setPositionable(boolean) function of
each item on the target panel.
state - true for positionable.public void setAllEditable(boolean state)
Positionable.setEditable(boolean) function of
each item on the target panel. This also controls the relevant pop-up menu items
(which are the primary way that items are edited).
state - true for editable.public void setShowCoordinates(boolean state)
state - true for show coodinates.public void setAllControlling(boolean state)
Positionable.setControlling(boolean) function of
each item on the target panel. This also controls the relevant pop-up menu items.
state - true for controlling.public void setPanelMenu(boolean state)
state - true for controlling.public boolean isEditable()
public boolean isPositionable()
public boolean isShowCoordinates()
public boolean isControlling()
public boolean hasPanelMenu()
public JmriJFrame makeFrame(String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||