|
||||||||||
| 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.controlPanelEditor.ControlPanelEditor
public class ControlPanelEditor
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. Extends the behavior it shares with PanelPro DnD implemented at JDK 1.2 for backward compatibility
| Nested Class Summary | |
|---|---|
protected static class |
ControlPanelEditor.PositionableListDnD
|
| 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 JMenu |
_editMenu
|
protected JMenu |
_fileMenu
|
protected JMenu |
_iconMenu
|
protected JMenuBar |
_menuBar
|
protected JMenu |
_optionMenu
|
protected JMenu |
_zoomMenu
|
static String |
POSITIONABLE_LIST_FLAVOR
|
static ResourceBundle |
rbcp
|
| 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 | |
|---|---|
ControlPanelEditor()
|
|
ControlPanelEditor(String name)
|
|
| Method Summary | |
|---|---|
protected void |
copyItem(Positionable p)
Set up selections for a paste. |
void |
dragEnter(DropTargetDragEvent evt)
|
void |
dragExit(DropTargetEvent evt)
DropTargetListener |
void |
dragOver(DropTargetDragEvent evt)
|
void |
drop(DropTargetDropEvent evt)
|
void |
dropActionChanged(DropTargetDragEvent evt)
|
ArrayList<Positionable> |
getClipGroup()
|
protected Positionable |
getCopySelection(MouseEvent event)
|
protected Positionable |
getCurrentSelection(MouseEvent event)
Overriden methods of Editor |
protected void |
init(String name)
|
void |
initView()
After construction, initialize all the widgets to their saved config settings. |
void |
loadComplete()
|
void |
lostOwnership(Clipboard clipboard,
Transferable contents)
|
protected void |
makeDataFlavors()
DnD |
protected void |
makeEditMenu()
Create an Edit menu to support cut/copy/paste. |
protected void |
makeIconMenu()
|
protected void |
makeOptionMenu()
|
void |
makePalette()
|
protected void |
makeZoomMenu()
|
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 |
void |
setAllEditable(boolean edit)
Control whether target panel items are editable. |
void |
setCopyMenu(Positionable p,
JPopupMenu popup)
Add an action to copy the Positionable item and the group to which is may belong. |
void |
setNextLocation(Positionable obj)
Set an object's location when it is created. |
void |
setTitle()
|
void |
setUseGlobalFlag(boolean set)
Set which flag should be used, global or local for Positioning and Control of individual items. |
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. |
| 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 JMenuBar _menuBar
protected JMenu _editMenu
protected JMenu _fileMenu
protected JMenu _optionMenu
protected JMenu _iconMenu
protected JMenu _zoomMenu
public static final ResourceBundle rbcp
public static final String POSITIONABLE_LIST_FLAVOR
| Constructor Detail |
|---|
public ControlPanelEditor()
public ControlPanelEditor(String name)
| Method Detail |
|---|
protected void init(String name)
init in class Editorprotected void makeIconMenu()
protected void makeZoomMenu()
protected void makeOptionMenu()
protected void makeEditMenu()
public ArrayList<Positionable> getClipGroup()
public void lostOwnership(Clipboard clipboard,
Transferable contents)
lostOwnership in interface ClipboardOwnerpublic void setAllEditable(boolean edit)
EditorPositionable.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).
setAllEditable in class Editoredit - true for editable.public void setUseGlobalFlag(boolean set)
Editor
setUseGlobalFlag in class Editorpublic void setTitle()
setTitle in class Editorpublic void makePalette()
makePalette in class Editorpublic void loadComplete()
public void initView()
initView in class Editorprotected Positionable getCurrentSelection(MouseEvent event)
protected Positionable getCopySelection(MouseEvent event)
public void mousePressed(MouseEvent event)
Editor
mousePressed in interface MouseListenermousePressed in class Editorpublic void mouseReleased(MouseEvent event)
mouseReleased in interface MouseListenermouseReleased in class Editorpublic void mouseClicked(MouseEvent event)
mouseClicked in interface MouseListenermouseClicked 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 mouseEntered(MouseEvent event)
mouseEntered in interface MouseListenermouseEntered in class Editorpublic void mouseExited(MouseEvent event)
mouseExited in interface MouseListenermouseExited in class Editorprotected void targetWindowClosingEvent(WindowEvent e)
targetWindowClosingEvent in class Editorprotected void paintTargetPanel(Graphics g)
Editor
paintTargetPanel in class Editorpublic void setNextLocation(Positionable obj)
setNextLocation in class Editorprotected void copyItem(Positionable p)
copyItem in class Editor
public void setCopyMenu(Positionable p,
JPopupMenu popup)
protected void showPopUp(Positionable p,
MouseEvent event)
showPopUp in class Editorprotected void makeDataFlavors()
public void dragExit(DropTargetEvent evt)
dragExit in interface DropTargetListenerpublic void dragEnter(DropTargetDragEvent evt)
dragEnter in interface DropTargetListenerpublic void dragOver(DropTargetDragEvent evt)
dragOver in interface DropTargetListenerpublic void dropActionChanged(DropTargetDragEvent evt)
dropActionChanged in interface DropTargetListenerpublic void drop(DropTargetDropEvent evt)
drop in interface DropTargetListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||