|
||||||||||
| 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.Editor
jmri.jmrit.display.panelEditor.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 jmri.jmrit.display.Editor |
|---|
Editor.JFrameItem, Editor.TargetPane |
| 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
boolean |
_debug
|
protected ArrayList<Positionable> |
_multiItemCopyGroup
|
protected boolean |
addItemViaMouseClick
|
protected boolean |
pasteItemFlag
|
| Fields inherited from class jmri.jmrit.display.Editor |
|---|
_anchorX, _anchorY, _contents, _currentSelection, _dragging, _editable, _highlightcomponent, _lastX, _lastY, _paintScale, _pastePending, _scrollState, _selectionGroup, _selectRect, _targetPanel, BKG, CLOCK, defaultBackgroundColor, frameLocationX, frameLocationY, ICON_EDITORS, ICONS, LABELS, LIGHTS, MARKERS, MEMORIES, NUM_LEVELS, OPTION_CONTROLS, OPTION_HIDDEN, OPTION_POSITION, OPTION_TOOLTIP, POSITIONABLE_FLAVOR, rb, rbean, REPORTERS, SCROLL_BOTH, SCROLL_HORIZONTAL, SCROLL_NONE, SCROLL_VERTICAL, SECURITY, SENSORS, SIGNALS, TEMP, TURNOUTS, xLoc, yLoc |
| Fields inherited from class jmri.util.JmriJFrame |
|---|
reuseFrameSavedPosition, reuseFrameSavedSized |
| 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 | |
|---|---|
protected void |
addColorMenuEntry(JMenu menu,
ButtonGroup colorButtonGroup,
String name,
Color color)
|
protected void |
addItemPopUp(jmri.jmrit.display.panelEditor.PanelEditor.ComboBoxItem item,
JMenu menu)
|
protected void |
backgroundPopUp(MouseEvent event)
|
protected void |
copyItem(Positionable p)
set up item(s) to be copied by paste |
protected void |
init(String name)
|
void |
initView()
After construction, initialize all the widgets to their saved config settings. |
void |
itemStateChanged(ItemEvent e)
|
protected void |
makeColorMenu(JMenu colorMenu)
|
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 |
mouseClicked(MouseEvent event)
|
void |
mouseDragged(MouseEvent event)
|
void |
mouseEntered(MouseEvent event)
|
void |
mouseExited(MouseEvent event)
|
void |
mouseMoved(MouseEvent event)
|
void |
mousePressed(MouseEvent event)
Abstract Methods |
void |
mouseReleased(MouseEvent event)
|
protected void |
paintTargetPanel(Graphics g)
Called from TargetPanel's paint method for additional drawing by editor view |
protected void |
pasteItem(MouseEvent e)
|
protected void |
pasteItemPopUp(MouseEvent event)
|
void |
putItem(Positionable l)
|
void |
setBackgroundMenu(JPopupMenu popup)
|
protected void |
setColorButton(Color color,
Color buttonColor,
JRadioButtonMenuItem r)
|
protected void |
setNextLocation(Positionable obj)
Set an object's location when it is created. |
void |
setRemoveMenu(Positionable p,
JPopupMenu popup)
Add an action to remove the Positionable item. |
protected void |
showAddItemPopUp(MouseEvent event,
JPopupMenu popup)
|
protected void |
showMultiSelectPopUp(MouseEvent event,
Positionable p)
|
protected void |
showPopUp(Positionable p,
MouseEvent event)
Create popup for a Positionable object Popup items common to all positionable objects are done before and after the items that pertain only to specific Positionable types. |
protected void |
targetWindowClosingEvent(WindowEvent e)
The target window has been requested to close, don't delete it at this time. |
void |
windowClosing(WindowEvent e)
Handle close of editor window. |
| Methods inherited from class java.awt.Frame |
|---|
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public boolean _debug
protected ArrayList<Positionable> _multiItemCopyGroup
protected boolean addItemViaMouseClick
protected boolean pasteItemFlag
| Constructor Detail |
|---|
public PanelEditor()
public PanelEditor(String name)
| Method Detail |
|---|
protected void init(String name)
init in class Editorpublic void initView()
initView in class Editorpublic void itemStateChanged(ItemEvent e)
itemStateChanged in interface ItemListenerpublic 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 JmriJFrame makeFrame(String name)
protected void targetWindowClosingEvent(WindowEvent e)
targetWindowClosingEvent in class Editorprotected void paintTargetPanel(Graphics g)
paintTargetPanel in class Editorprotected void setNextLocation(Positionable obj)
setNextLocation in class Editor
protected void showPopUp(Positionable p,
MouseEvent event)
showPopUp in class Editorpublic void mousePressed(MouseEvent event)
Editor
mousePressed in interface MouseListenermousePressed in class Editorpublic void mouseReleased(MouseEvent event)
mouseReleased in interface MouseListenermouseReleased in class Editorpublic void mouseDragged(MouseEvent event)
mouseDragged in interface MouseMotionListenermouseDragged in class Editorpublic void mouseMoved(MouseEvent event)
mouseMoved in interface MouseMotionListenermouseMoved in class Editorpublic void mouseClicked(MouseEvent event)
mouseClicked in interface MouseListenermouseClicked in class Editorpublic void mouseEntered(MouseEvent event)
mouseEntered in interface MouseListenermouseEntered in class Editorpublic void mouseExited(MouseEvent event)
mouseExited in interface MouseListenermouseExited in class Editorprotected void copyItem(Positionable p)
Editor
copyItem in class Editorprotected void pasteItemPopUp(MouseEvent event)
protected void backgroundPopUp(MouseEvent event)
protected void showMultiSelectPopUp(MouseEvent event,
Positionable p)
protected void showAddItemPopUp(MouseEvent event,
JPopupMenu popup)
protected void addItemPopUp(jmri.jmrit.display.panelEditor.PanelEditor.ComboBoxItem item,
JMenu menu)
public void putItem(Positionable l)
putItem in class Editorprotected void pasteItem(MouseEvent e)
public void setRemoveMenu(Positionable p,
JPopupMenu popup)
setRemoveMenu in class Editorpublic void setBackgroundMenu(JPopupMenu popup)
protected void makeColorMenu(JMenu colorMenu)
protected void addColorMenuEntry(JMenu menu,
ButtonGroup colorButtonGroup,
String name,
Color color)
protected void setColorButton(Color color,
Color buttonColor,
JRadioButtonMenuItem r)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||