Class ControlPanelEditor
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- jmri.util.JmriJFrame
-
- jmri.jmrit.display.JmriJFrameWithPermissions
-
- jmri.jmrit.display.Editor
-
- jmri.jmrit.display.controlPanelEditor.ControlPanelEditor
-
- All Implemented Interfaces:
java.awt.datatransfer.ClipboardOwner,java.awt.dnd.DropTargetListener,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
public class ControlPanelEditor extends Editor implements java.awt.dnd.DropTargetListener, java.awt.datatransfer.ClipboardOwner
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. Extends the behavior it shares with PanelPro DnD implemented at JDK 1.2 for backward compatibility
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classControlPanelEditor.PositionableListDnD-
Nested classes/interfaces inherited from class jmri.jmrit.display.Editor
Editor.JFrameItem, Editor.TargetPane, Editor.UrlErrorDialog
-
Nested classes/interfaces inherited from class jmri.util.JmriJFrame
JmriJFrame.ScreenDimensions
-
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from interface jmri.util.swing.WindowInterface
WindowInterface.Hint
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.ArrayList<Positionable>_clipGroupprotected javax.swing.JMenu_editMenuprotected javax.swing.JMenu_fileMenu(package private) int_fitX(package private) int_fitYprotected javax.swing.JMenu_iconMenuprotected javax.swing.JMenuBar_menuBar(package private) java.awt.datatransfer.DataFlavor_namedIconDataFlavorprotected javax.swing.JMenu_optionMenu(package private) java.awt.datatransfer.DataFlavor_positionableDataFlavor(package private) java.awt.datatransfer.DataFlavor_positionableListDataFlavorprotected javax.swing.JMenu_zoomMenu-
Fields inherited from class jmri.jmrit.display.Editor
_anchorX, _anchorY, _currentSelection, _dragging, _editable, _highlightcomponent, _iconEditorFrame, _lastX, _lastY, _paintScale, _pastePending, _scrollState, _selectionGroup, _selectRect, _targetPanel, BKG, BOTHPOPUPS, CLOCK, defaultBackgroundColor, EDITPOPUPONLY, frameLocationX, frameLocationY, HIGHLIGHT_COLOR, ICONS, LABELS, LIGHTS, MARKERS, MEMORIES, NUM_LEVELS, OPTION_CONTROLS, OPTION_HIDDEN, OPTION_POSITION, OPTION_TOOLTIP, POSITIONABLE_FLAVOR, REPORTERS, SCROLL_BOTH, SCROLL_HORIZONTAL, SCROLL_NONE, SCROLL_VERTICAL, SECURITY, SENSORS, SIGNALS, TEMP, TURNOUTS, VIEWPOPUPONLY, xLoc, yLoc
-
Fields inherited from class jmri.util.JmriJFrame
allowInFrameServlet, properties, reuseFrameSavedPosition, reuseFrameSavedSized, windowInterface
-
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
-
-
Constructor Summary
Constructors Constructor Description ControlPanelEditor()ControlPanelEditor(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidabortPasteItems()Showing the popup of a member of _selectionGroup causes an image to be placed in to the _targetPanel.protected voidcopyItem(Positionable p)Set up selections for a paste.voiddeselectSelectionGroup()protected voiddisableMenus()******************* Circuitbuilder ***********************************voiddragEnter(java.awt.dnd.DropTargetDragEvent evt)voiddragExit(java.awt.dnd.DropTargetEvent evt)************************* DropTargetListener ***********************voiddragOver(java.awt.dnd.DropTargetDragEvent evt)voiddrop(java.awt.dnd.DropTargetDropEvent evt)voiddropActionChanged(java.awt.dnd.DropTargetDragEvent evt)CircuitBuildergetCircuitBuilder()java.util.ArrayList<Positionable>getClipGroup()protected PositionablegetCurrentSelection(JmriMouseEvent event)java.lang.StringgetPortalIconFamily()java.util.HashMap<java.lang.String,NamedIcon>getPortalIconMap()protected java.util.ArrayList<Positionable>getSelectionGroup()ShapeDrawergetShapeDrawer()booleangetShapeSelect()protected voidhighlight(Positionable pos)Highlight an item.protected voidinit(java.lang.String name)voidinitView()After construction, initialize all the widgets to their saved config settings.voidkeyPressed(java.awt.event.KeyEvent e)Capture key events.voidloadComplete()voidlostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)protected voidmakeCircuitMenu(boolean edit)protected voidmakeDataFlavors()************************** DnD *************************************protected voidmakeDrawMenu()protected voidmakeEditMenu()Create an Edit menu to support cut/copy/paste.protected voidmakeIconMenu()protected voidmakeMarkerMenu()protected voidmakeOptionMenu()protected voidmakeWarrantMenu(boolean edit, boolean addMenu)protected voidmakeZoomMenu()voidmouseClicked(JmriMouseEvent event)Invoked when the mouse button has been clicked (pressed and released) on a component.voidmouseDragged(JmriMouseEvent event)Invoked when a mouse button is pressed on a component and then dragged.voidmouseEntered(JmriMouseEvent event)Invoked when the mouse enters a component.voidmouseExited(JmriMouseEvent event)Invoked when the mouse exits a component.voidmouseMoved(JmriMouseEvent event)Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.voidmousePressed(JmriMouseEvent event)Invoked when a mouse button has been pressed on a component.voidmouseReleased(JmriMouseEvent event)Invoked when a mouse button has been released on a component.protected voidpaintTargetPanel(java.awt.Graphics g)Called from TargetPanel's paint method for additional drawing by editor view.(package private) voidpasteItems()voidresetEditor()voidsetAllEditable(boolean edit)Control whether target panel items are editable.voidsetColorMenu(javax.swing.JPopupMenu popup, javax.swing.JComponent pos, int type)voidsetCopyMenu(Positionable p, javax.swing.JPopupMenu popup)Add an action to copy the Positionable item and the group to which is may belong.voidsetNextLocation(Positionable obj)Set an object's location when it is created.voidsetPortalIconFamily(java.lang.String family)protected voidsetSelectionGroup(java.util.ArrayList<Positionable> group)protected voidsetSelectionsRotation(int k, Positionable p)protected voidsetSelectionsScale(double s, Positionable p)voidsetShapeSelect(boolean set)voidsetTitle()voidsetUseGlobalFlag(boolean set)Set which flag should be used, global or local for Positioning and Control of individual items.protected voidshowPopUp(Positionable p, JmriMouseEvent event)Create popup for a Positionable object.protected voidtargetWindowClosingEvent(java.awt.event.WindowEvent e)The target window has been requested to close, don't delete it at this time.-
Methods inherited from class jmri.jmrit.display.Editor
actionPerformed, addAudioEditor, addBackgroundEditor, addBlockContentsEditor, addClock, addGlobalVariableEditor, addGlobalVariableInputBox, addGlobalVariableSpinner, addIconEditor, addLabel, addLeftTOEditor, addLight, addLightEditor, addLocoIcon, addLogixNGEditor, addMemoryEditor, addMemoryInputBox, addMemorySpinner, addMultiSensor, addMultiSensorEditor, addReporter, addReporterEditor, addRightTOEditor, addRpsReporter, addSensorEditor, addSignalHeadEditor, addSignalMastEditor, addSlipTOEditor, addTextEditor, addToPopUpMenu, addToTarget, addTrainIcon, addTurnout, allControlling, allPositionable, changeView, clearBackgroundColor, deletePanel, displayLevelChange, dispose, disposeLoadData, dockSelections, drawSelectRect, getAnchorX, getAnchorY, getBackgroundColor, getClassNames, getContents, getFlag, getIconEditor, getIconFrame, getIdContents, getItemX, getItemY, getLastX, getLastY, getPaintScale, getPanelScrollPane, getPositionablesByClassName, getScrollable, getSelectedItems, getSelectRect, getSignalHeadEditor, getTargetFrame, getTargetPanel, getTargetPanelSize, getUsageReport, isEditable, isPanelMenuVisible, keyReleased, keyTyped, loadFailed, loadFailed, loadOK, locoMarkerFromInput, locoMarkerFromRoster, makeAddIconFrame, makeSelectionGroup, modifySelectionGroup, moveItem, newPanelDefaults, positionalAddClass, positionalIdChange, positionalRemoveClass, putAudio, putBlockContents, putGlobalVariable, putIcon, putItem, putLocoIcon, putLogixNG, putMemory, putSensor, putSignalHead, putSignalMast, removeFromContents, removeFromTarget, removeMarkers, removeSelections, selectLoco, selectLoco, setAllControlling, setAllPositionable, setAllShowToolTip, setAttributes, setBackgroundColor, setDefaultToolTip, setDisplayLevelMenu, setEditClassesMenu, setEditIdMenu, setEmptyHiddenMenu, setGlobalSetsLocalFlag, setHiddenMenu, setLogixNGPositionableMenu, setPaintScale, setPanelMenuVisible, setPositionableMenu, setRemoveMenu, setScroll, setScroll, setSelectionsAttributes, setSelectionsDisplayLevel, setSelectionsDockingLocation, setSelectionsHidden, setSelectionsPositionable, setShowAlignmentMenu, setShowCoordinatesMenu, setShowHidden, setShowToolTipMenu, setTargetPanel, setTargetPanelSize, setToolTip, setUpBackground, setValueEditDisabledMenu, showAlignPopup, showHidden, showToolTip, showToolTip, targetWindowClosing, useGlobalFlag, vetoableChange
-
Methods inherited from class jmri.jmrit.display.JmriJFrameWithPermissions
getContentPane, getJMenuBar, revalidate, setContentPane, setJMenuBar, setKeepSize, setVisible
-
Methods inherited from class jmri.util.JmriJFrame
addHelpMenu, componentHidden, componentMoved, componentResized, componentShown, generateWindowRef, getAllowInFrameServlet, getEscapeKeyAction, getEscapeKeyClosesWindow, getFrame, getFrame, getFrameList, getFrameList, getIndexedProperty, getMaximumSize, getModifiedFlag, getPreferredSize, getProperty, getPropertyNames, getSavePosition, getSaveSize, getScreenDimensions, getWindowFrameRef, getWindowInterface, handleModified, hasIndexedProperty, hasProperty, initComponents, makePrivateWindow, makePublicWindow, markWindowModified, multipleInstances, pack, setAllowInFrameServlet, setEscapeKeyAction, setEscapeKeyClosesWindow, setFrameLocation, setIndexedProperty, setModifiedFlag, setProperty, setSavePosition, setSaveSize, setShutDownTask, setWindowInterface, show, show, storeValues, undecorate, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getDefaultCloseOperation, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, show, toBack, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
_menuBar
protected javax.swing.JMenuBar _menuBar
-
_editMenu
protected javax.swing.JMenu _editMenu
-
_fileMenu
protected javax.swing.JMenu _fileMenu
-
_optionMenu
protected javax.swing.JMenu _optionMenu
-
_iconMenu
protected javax.swing.JMenu _iconMenu
-
_zoomMenu
protected javax.swing.JMenu _zoomMenu
-
_clipGroup
java.util.ArrayList<Positionable> _clipGroup
-
_fitX
int _fitX
-
_fitY
int _fitY
-
_positionableDataFlavor
java.awt.datatransfer.DataFlavor _positionableDataFlavor
-
_positionableListDataFlavor
java.awt.datatransfer.DataFlavor _positionableListDataFlavor
-
_namedIconDataFlavor
java.awt.datatransfer.DataFlavor _namedIconDataFlavor
-
-
Constructor Detail
-
ControlPanelEditor
public ControlPanelEditor()
-
ControlPanelEditor
public ControlPanelEditor(java.lang.String name)
-
-
Method Detail
-
makeIconMenu
protected void makeIconMenu()
-
makeCircuitMenu
protected void makeCircuitMenu(boolean edit)
-
makeDrawMenu
protected void makeDrawMenu()
-
getShapeSelect
public boolean getShapeSelect()
-
setShapeSelect
public void setShapeSelect(boolean set)
-
getPortalIconFamily
public java.lang.String getPortalIconFamily()
-
setPortalIconFamily
public void setPortalIconFamily(java.lang.String family)
-
getPortalIconMap
@Nonnull public java.util.HashMap<java.lang.String,NamedIcon> getPortalIconMap()
-
getShapeDrawer
public ShapeDrawer getShapeDrawer()
-
makeZoomMenu
protected void makeZoomMenu()
-
makeWarrantMenu
protected void makeWarrantMenu(boolean edit, boolean addMenu)
-
makeMarkerMenu
protected void makeMarkerMenu()
-
makeOptionMenu
protected void makeOptionMenu()
-
makeEditMenu
protected void makeEditMenu()
Create an Edit menu to support cut/copy/paste. An incredible hack to get some semblance of CCP between panels. The hack works for one of two problems. 1. Invoking a copy to the system clipboard causes a delayed repaint placed on the EventQueue whenever ScrollBars are invoked. This repaint ends with a null pointer exception at javax.swing.plaf.basic.BasicScrollPaneUI.paint(BasicScrollPaneUI.java:90) This error occurs regardless of the method used to put the copy in the clipboard - JDK 1.2 style or 1.4 TransferHandler Fixed! Get the plaf glue (BasicScrollPaneUI) and call installUI(_panelScrollPane) See copyToClipboard() below, line 527 (something the Java code should have done) No scrollbars - no problem. Hack does not fix this problem. 2. The clipboard provides a shallow copy of what was placed there. For things that have an icon Map (ArrayLists) the Tranferable data is shallow. The Hack to work around this is: Place a reference to the panel copying to the clipboard in the clipboard and let the pasting panel callback to the copying panel to get the data. See public ArrayList<Positionable> getClipGroup() {} below.
-
getCircuitBuilder
public CircuitBuilder getCircuitBuilder()
-
getClipGroup
public java.util.ArrayList<Positionable> getClipGroup()
-
lostOwnership
public void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
- Specified by:
lostOwnershipin interfacejava.awt.datatransfer.ClipboardOwner
-
setAllEditable
public void setAllEditable(boolean edit)
Description copied from class:EditorControl whether target panel items are editable. Does this by invoke thePositionable.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).- Overrides:
setAllEditablein classEditor- Parameters:
edit- true for editable.
-
setUseGlobalFlag
public void setUseGlobalFlag(boolean set)
Description copied from class:EditorSet which flag should be used, global or local for Positioning and Control of individual items. Items call getFlag() to return the appropriate flag it should use.- Overrides:
setUseGlobalFlagin classEditor- Parameters:
set- True if global flags should be used for positioning.
-
loadComplete
public void loadComplete()
-
initView
public void initView()
After construction, initialize all the widgets to their saved config settings.
-
deselectSelectionGroup
public void deselectSelectionGroup()
- Overrides:
deselectSelectionGroupin classEditor
-
getCurrentSelection
protected Positionable getCurrentSelection(JmriMouseEvent event)
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
Capture key events.- Specified by:
keyPressedin interfacejava.awt.event.KeyListener- Overrides:
keyPressedin classEditor- Parameters:
e- the event
-
mousePressed
public void mousePressed(JmriMouseEvent event)
Description copied from interface:JmriMouseListenerInvoked when a mouse button has been pressed on a component.- Specified by:
mousePressedin interfaceJmriMouseListener- Specified by:
mousePressedin classEditor- Parameters:
event- the event to be processed
-
mouseReleased
public void mouseReleased(JmriMouseEvent event)
Description copied from interface:JmriMouseListenerInvoked when a mouse button has been released on a component.- Specified by:
mouseReleasedin interfaceJmriMouseListener- Specified by:
mouseReleasedin classEditor- Parameters:
event- the event to be processed
-
mouseClicked
public void mouseClicked(JmriMouseEvent event)
Description copied from interface:JmriMouseListenerInvoked when the mouse button has been clicked (pressed and released) on a component.- Specified by:
mouseClickedin interfaceJmriMouseListener- Specified by:
mouseClickedin classEditor- Parameters:
event- the event to be processed
-
mouseDragged
public void mouseDragged(JmriMouseEvent event)
Description copied from interface:JmriMouseMotionListenerInvoked when a mouse button is pressed on a component and then dragged.MOUSE_DRAGGEDevents will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).Due to platform-dependent Drag&Drop implementations,
MOUSE_DRAGGEDevents may not be delivered during a native Drag&Drop operation.- Specified by:
mouseDraggedin interfaceJmriMouseMotionListener- Specified by:
mouseDraggedin classEditor- Parameters:
event- the event to be processed
-
mouseMoved
public void mouseMoved(JmriMouseEvent event)
Description copied from interface:JmriMouseMotionListenerInvoked when the mouse cursor has been moved onto a component but no buttons have been pushed.- Specified by:
mouseMovedin interfaceJmriMouseMotionListener- Specified by:
mouseMovedin classEditor- Parameters:
event- the event to be processed
-
mouseEntered
public void mouseEntered(JmriMouseEvent event)
Description copied from interface:JmriMouseListenerInvoked when the mouse enters a component.- Specified by:
mouseEnteredin interfaceJmriMouseListener- Specified by:
mouseEnteredin classEditor- Parameters:
event- the event to be processed
-
mouseExited
public void mouseExited(JmriMouseEvent event)
Description copied from interface:JmriMouseListenerInvoked when the mouse exits a component.- Specified by:
mouseExitedin interfaceJmriMouseListener- Specified by:
mouseExitedin classEditor- Parameters:
event- the event to be processed
-
targetWindowClosingEvent
protected void targetWindowClosingEvent(java.awt.event.WindowEvent e)
The target window has been requested to close, don't delete it at this time. Deletion must be accomplished via the Delete this panel menu item.- Specified by:
targetWindowClosingEventin classEditor- Parameters:
e- the triggering event
-
paintTargetPanel
protected void paintTargetPanel(java.awt.Graphics g)
Description copied from class:EditorCalled from TargetPanel's paint method for additional drawing by editor view.- Specified by:
paintTargetPanelin classEditor- Parameters:
g- the context to paint within
-
setNextLocation
public void setNextLocation(Positionable obj)
Set an object's location when it is created.- Specified by:
setNextLocationin classEditor- Parameters:
obj- the object to locate
-
copyItem
protected void copyItem(Positionable p)
Set up selections for a paste. Note a copy of _selectionGroup is made that is NOT in the _contents. This disconnected ArrayList is added to the _contents when (if) a paste is made. The disconnected _selectionGroup can be dragged to a new location.
-
pasteItems
void pasteItems()
-
abortPasteItems
void abortPasteItems()
Showing the popup of a member of _selectionGroup causes an image to be placed in to the _targetPanel. If the objects are not put into _contents (putItem(p)) the image will persist. Thus set these transitory object invisible.
-
setCopyMenu
public void setCopyMenu(Positionable p, javax.swing.JPopupMenu popup)
Add an action to copy the Positionable item and the group to which is may belong.- Parameters:
p- the copyable itempopup- the menu to add it to
-
setSelectionsScale
protected void setSelectionsScale(double s, Positionable p)
- Overrides:
setSelectionsScalein classEditor
-
setSelectionsRotation
protected void setSelectionsRotation(int k, Positionable p)
- Overrides:
setSelectionsRotationin classEditor
-
showPopUp
protected void showPopUp(Positionable p, JmriMouseEvent 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.- Parameters:
p- the item containing or requiring the context menuevent- the event triggering the menu
-
setColorMenu
public void setColorMenu(javax.swing.JPopupMenu popup, javax.swing.JComponent pos, int type)
-
disableMenus
protected void disableMenus()
******************* Circuitbuilder ***********************************
-
resetEditor
public void resetEditor()
-
highlight
protected void highlight(Positionable pos)
Highlight an item.- Parameters:
pos- the item to hightlight
-
setSelectionGroup
protected void setSelectionGroup(java.util.ArrayList<Positionable> group)
-
getSelectionGroup
protected java.util.ArrayList<Positionable> getSelectionGroup()
-
makeDataFlavors
protected void makeDataFlavors()
************************** DnD *************************************
-
dragExit
public void dragExit(java.awt.dnd.DropTargetEvent evt)
************************* DropTargetListener ***********************- Specified by:
dragExitin interfacejava.awt.dnd.DropTargetListener
-
dragEnter
public void dragEnter(java.awt.dnd.DropTargetDragEvent evt)
- Specified by:
dragEnterin interfacejava.awt.dnd.DropTargetListener
-
dragOver
public void dragOver(java.awt.dnd.DropTargetDragEvent evt)
- Specified by:
dragOverin interfacejava.awt.dnd.DropTargetListener
-
dropActionChanged
public void dropActionChanged(java.awt.dnd.DropTargetDragEvent evt)
- Specified by:
dropActionChangedin interfacejava.awt.dnd.DropTargetListener
-
drop
public void drop(java.awt.dnd.DropTargetDropEvent evt)
- Specified by:
dropin interfacejava.awt.dnd.DropTargetListener
-
-