Class Editor
- All Implemented Interfaces:
ActionListener,ComponentListener,KeyListener,WindowListener,ImageObserver,MenuContainer,VetoableChangeListener,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants,BeanInterface,ModifiedFlag,JmriMouseListener,JmriMouseMotionListener,WindowInterface
- Direct Known Subclasses:
ControlPanelEditor,PanelEditor,SwitchboardEditor
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classclassSpecial internal class to allow drawing of layout to a JLayeredPane.(package private) static classclassNested classes/interfaces inherited from class jmri.util.JmriJFrame
JmriJFrame.ScreenDimensionsNested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyNested classes/interfaces inherited from interface jmri.util.swing.WindowInterface
WindowInterface.Hint -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected Positionable(package private) booleanprotected booleanprotected booleanprotected Rectangleprotected HashMap<String,Editor.JFrameItem> (package private) booleanprotected intprotected int(package private) NamedIconprotected doubleprotected booleanprotected intprotected ArrayList<Positionable>protected Rectangleprotected JLayeredPanestatic final intstatic final intstatic final int(package private) BasicStrokeprotected Color(package private) static final intstatic final intintintstatic final Color(package private) static final String[]static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int(package private) static int(package private) static intstatic final intstatic final intprotected intprotected intFields inherited from class jmri.util.JmriJFrame
allowInFrameServlet, properties, reuseFrameSavedPosition, reuseFrameSavedSized, windowInterfaceFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields 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_CURSORFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) protected voidprotected voidprotected voidprotected AnalogClock2DisplayaddClock()protected voidprotected GlobalVariableInputIconprotected GlobalVariableSpinnerIconprotected voidprotected PositionableLabelprotected voidprotected LightIconaddLight()Add a Light indicator to the targetprotected voidaddLocoIcon(String name) protected voidprotected voidprotected MemoryInputIconprotected MemorySpinnerIconprotected Editor.JFrameItemprotected ReporterIconprotected voidprotected voidprotected RpsPositionIconprotected voidprotected voidprotected void(package private) SlipTurnoutIconaddSlip()protected voidprotected voidAdd a label to the target.voidaddToPopUpMenu(NamedBean nb, JMenuItem item, int menu) Provide a method for external code to add items to context menus.protected voidaddTrainIcon(String name) protected TurnoutIconaddTurnout(IconAdder editor) (package private) void(package private) voidAdd a turnout indicator to the targetbooleanbooleanprotected EditorchangeView(String className) voidprotected abstract voidSet up item(s) to be copied by paste.booleanAsk user if panel should be deleted.voidvoidPositionable has set a new level.voiddispose()Dispose of the editor.voidprotected voidvoiddrawSelectRect(int x, int y) final intfinal intbooleangetFlag(int whichOption, boolean localFlag) Get the setting for the specified option.getIconEditor(String name) getIconFrame(String name) Create editor for a given item type.protected intgetItemX(Positionable p, int deltaX) protected intgetItemY(Positionable p, int deltaY) final intgetLastX()final intgetLastY()final doubleGet scale for TargetPane drawing.final JScrollPaneAllow public access to the scroll pane for external control of position, particularly from scripts.getPositionablesByClassName(String className) protected List<Positionable>getSelectedItems(JmriMouseEvent event) Return a List of all items whose bounding rectangle contain the mouse position. ordered from top level to bottomprotected IconAdderfinal JFramefinal JComponentAllow public access to the target (content) panel for external modification, particularly from scripts.protected Dimension(package private) StringgetUsageData(Positionable pos) getUsageReport(NamedBean bean) protected abstract voidprotected abstract voidinitView()After construction, initialize all the widgets to their saved config settings.booleanbooleanIs the menu on the target panel shown?voidvoidvoidvoidloadFailed(String msg, String url) booleanloadOK()protected voidprotected voidprotected Editor.JFrameItemmakeAddIconFrame(String name, boolean add, boolean table, IconAdder editor) Create a frame showing all images in the set used for an icon.protected voidmakeSelectionGroup(JmriMouseEvent event) protected voidmodifySelectionGroup(Positionable selection, JmriMouseEvent event) abstract voidmouseClicked(JmriMouseEvent event) Invoked when the mouse button has been clicked (pressed and released) on a component.abstract voidmouseDragged(JmriMouseEvent event) Invoked when a mouse button is pressed on a component and then dragged.abstract voidmouseEntered(JmriMouseEvent event) Invoked when the mouse enters a component.abstract voidmouseExited(JmriMouseEvent event) Invoked when the mouse exits a component.abstract voidmouseMoved(JmriMouseEvent event) Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.abstract voidmousePressed(JmriMouseEvent event) Invoked when a mouse button has been pressed on a component.abstract voidmouseReleased(JmriMouseEvent event) Invoked when a mouse button has been released on a component.voidmoveItem(Positionable p, int deltaX, int deltaY) Relocate item.voidSet white as the default background color for panels created using the New Panel menu item.protected abstract voidCalled from TargetPanel's paint method for additional drawing by editor view.voidpositionalAddClass(Positionable p, String className) Add a class name to the PositionablevoidpositionalIdChange(Positionable p, String newId) Check if it's possible to change the id of the Positionable to the desired string.voidpositionalRemoveClass(Positionable p, String className) Removes a class name from the Positionableprotected PositionableputAudio()Add a LogixNG icon to the target.(package private) voidButton pushed, add a background image.protected BlockContentsIconprotected GlobalVariableIconprotected PositionableputIcon()Add an icon to the target.voidvoidputLocoIcon(LocoIcon l, String name) protected PositionableAdd a LogixNG icon to the target.protected MemoryIconprotected SensorIconAdd a sensor indicator to the target.protected SignalHeadIconAdd a signal head to the target.protected SignalMastIconAdd a signal mast to the target.booleanprotected voidprotected voidRemove marker icons from panelprotected voidprotected LocoIconselectLoco(String rosterEntryTitle) protected LocoIconselectLoco(RosterEntry entry) voidsetAllControlling(boolean state) Control whether target panel items are controlling layout items.voidsetAllEditable(boolean state) Control whether target panel items are editable.voidsetAllPositionable(boolean state) Control whether panel items can be positioned.voidsetAllShowToolTip(boolean state) voidsetAttributes(PositionablePopupUtil newUtil, Positionable p) Set attributes of a Positionable.voidsetBackgroundColor(Color col) voidsetDefaultToolTip(ToolTip dtt) voidsetDisplayLevelMenu(Positionable p, JPopupMenu popup) Display 'z' level of the Positionable item and provide a dialog menu item to edit it.voidsetEditClassesMenu(Positionable p, JPopupMenu popup) Add a menu entry to edit Classes of the Positionable itemvoidsetEditIdMenu(Positionable p, JPopupMenu popup) Add a menu entry to edit Id of the Positionable itemvoidsetEmptyHiddenMenu(Positionable p, JPopupMenu popup) Add a menu entry to set visibility of the Positionable item based on the presence of contents.voidsetGlobalSetsLocalFlag(boolean set) Set ifsetAllControlling(boolean)andsetAllPositionable(boolean)are set for existing as well as new items.voidsetHiddenMenu(Positionable p, JPopupMenu popup) Add a menu entry to set visibility of the Positionable itemvoidsetLogixNGPositionableMenu(Positionable p, JPopupMenu popup) Add a menu entry to edit Id of the Positionable itemprotected abstract voidSet an object's location when it is created.protected final voidsetPaintScale(double newScale) voidsetPanelMenuVisible(boolean state) Hide or show menus on the target panel.voidsetPositionableMenu(Positionable p, JPopupMenu popup) Add a checkbox to lock the position of the Positionable item.voidsetRemoveMenu(Positionable p, JPopupMenu popup) Add an action to remove the Positionable item.protected voidsetScroll(int state) voidprotected voidprotected voidsetSelectionsDisplayLevel(int k, Positionable p) protected voidprotected voidsetSelectionsHidden(boolean enabled, Positionable p) protected booleansetSelectionsPositionable(boolean enabled, Positionable p) protected voidsetSelectionsRotation(int k, Positionable p) protected voidsetSelectionsScale(double s, Positionable p) booleansetShowAlignmentMenu(Positionable p, JPopupMenu popup) Offer actions to align the selected Positionable items either Horizontally (at average y coordinates) or Vertically (at average x coordinates).booleansetShowCoordinatesMenu(Positionable p, JPopupMenu popup) Display the X & Y coordinates of the Positionable item and provide a dialog menu item to edit them.voidsetShowHidden(boolean state) Control whether target panel hidden items are visible or not.voidsetShowToolTipMenu(Positionable p, JPopupMenu popup) Add a checkbox to display a tooltip for the Positionable item and if showable, provide a dialog menu to edit it.protected voidsetTargetPanel(JLayeredPane targetPanel, JmriJFrame frame) Set the target panel.protected voidsetTargetPanelSize(int w, int h) voidsetTitle()protected voidsetToolTip(ToolTip tt) setUpBackground(String name) voidsetUseGlobalFlag(boolean set) Set which flag should be used, global or local for Positioning and Control of individual items.voidsetValueEditDisabledMenu(Positionable p, JPopupMenu popup) Add a menu entry to disable double click value edits.protected booleanbooleanbooleanvoidshowToolTip(Positionable selection, JmriMouseEvent event) protected voidprotected abstract voidbooleanvoidMethods inherited from class jmri.jmrit.display.JmriJFrameWithPermissions
getContentPane, getJMenuBar, revalidate, setContentPane, setJMenuBar, setKeepSize, setVisibleMethods 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, windowOpenedMethods 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, updateMethods 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, setUndecoratedMethods 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, toFrontMethods 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, validateTreeMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
BKG
- See Also:
-
TEMP
- See Also:
-
ICONS
- See Also:
-
LABELS
- See Also:
-
MEMORIES
- See Also:
-
REPORTERS
- See Also:
-
SECURITY
- See Also:
-
TURNOUTS
- See Also:
-
LIGHTS
- See Also:
-
SIGNALS
- See Also:
-
SENSORS
- See Also:
-
CLOCK
- See Also:
-
MARKERS
- See Also:
-
NUM_LEVELS
- See Also:
-
SCROLL_NONE
- See Also:
-
SCROLL_BOTH
- See Also:
-
SCROLL_HORIZONTAL
- See Also:
-
SCROLL_VERTICAL
- See Also:
-
HIGHLIGHT_COLOR
-
POSITIONABLE_FLAVOR
- See Also:
-
_targetPanel
-
_scrollState
-
_editable
-
OPTION_POSITION
- See Also:
-
OPTION_CONTROLS
- See Also:
-
OPTION_HIDDEN
- See Also:
-
OPTION_TOOLTIP
- See Also:
-
_lastX
-
_lastY
-
DASHED_LINE
-
_selectRect
-
_highlightcomponent
-
_dragging
-
_selectionGroup
-
_currentSelection
-
xLoc
-
yLoc
-
_anchorX
-
_anchorY
-
_paintScale
-
defaultBackgroundColor
-
_pastePending
-
_iconEditorFrame
-
_newIcon
-
_ignore
boolean _ignore -
_delete
boolean _delete -
_urlMap
-
TOOLTIPSHOWDELAY
-
TOOLTIPDISMISSDELAY
-
ICON_EDITORS
-
frameLocationX
-
frameLocationY
-
DELTA
- See Also:
-
VIEWPOPUPONLY
- See Also:
-
EDITPOPUPONLY
- See Also:
-
BOTHPOPUPS
- See Also:
-
-
Constructor Details
-
Editor
public Editor() -
Editor
-
Editor
-
-
Method Details
-
newPanelDefaults
Set white as the default background color for panels created using the New Panel menu item. Overriden by LE to use a different default background color and set other initial defaults. -
loadFailed
-
loadFailed
-
disposeLoadData
-
loadOK
-
getContents
-
getIdContents
-
getClassNames
-
getPositionablesByClassName
-
setDefaultToolTip
-
setTargetPanel
Set the target panel.An Editor may or may not choose to use 'this' as its frame or the interior class 'TargetPane' for its targetPanel.
- Parameters:
targetPanel- the panel to be editedframe- the frame to embed the panel in
-
setTargetPanelSize
-
getTargetPanelSize
-
getTargetPanel
Allow public access to the target (content) panel for external modification, particularly from scripts.- Returns:
- the target panel
-
getPanelScrollPane
Allow public access to the scroll pane for external control of position, particularly from scripts.- Returns:
- the scroll pane containing the target panel
-
getTargetFrame
-
getBackgroundColor
-
setBackgroundColor
-
clearBackgroundColor
-
getPaintScale
Get scale for TargetPane drawing.- Returns:
- the scale
-
setPaintScale
-
setToolTip
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
setAllEditable
Control 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).- Parameters:
state- true for editable.
-
deselectSelectionGroup
-
isEditable
-
setUseGlobalFlag
Set 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.- Parameters:
set- True if global flags should be used for positioning.
-
useGlobalFlag
-
getFlag
Get the setting for the specified option.- Parameters:
whichOption- The option to getlocalFlag- is the current setting of the item- Returns:
- The setting for the option
-
setGlobalSetsLocalFlag
Set ifsetAllControlling(boolean)andsetAllPositionable(boolean)are set for existing as well as new items.- Parameters:
set- true if setAllControlling() and setAllPositionable() are set for existing items
-
setAllPositionable
Control whether panel items can be positioned. Markers can always be positioned.- Parameters:
state- true to set all items positionable; false otherwise
-
allPositionable
-
setAllControlling
Control whether target panel items are controlling layout items.Does this by invoking the
Positionable.setControlling(boolean)function of each item on the target panel. This also controls the relevant pop-up menu items.- Parameters:
state- true for controlling.
-
allControlling
-
setShowHidden
Control whether target panel hidden items are visible or not. Does this by invoke thePositionable.setHidden(boolean)function of each item on the target panel.- Parameters:
state- true for Visible.
-
showHidden
-
setAllShowToolTip
-
showToolTip
-
setPanelMenuVisible
Hide or show menus on the target panel.- Parameters:
state- true to show menus; false to hide menus- Since:
- 3.9.5
-
isPanelMenuVisible
Is the menu on the target panel shown?- Returns:
- true if menu is visible
- Since:
- 3.9.5
-
setScroll
-
setScroll
-
getScrollable
-
targetWindowClosing
-
changeView
-
setPositionableMenu
Add a checkbox to lock the position of the Positionable item.- Parameters:
p- the itempopup- the menu to add the lock menu item to
-
setShowCoordinatesMenu
Display the X & Y coordinates of the Positionable item and provide a dialog menu item to edit them.- Parameters:
p- The item to add the menu item topopup- The menu item to add the action to- Returns:
- always returns true
-
setShowAlignmentMenu
Offer actions to align the selected Positionable items either Horizontally (at average y coordinates) or Vertically (at average x coordinates).- Parameters:
p- The positionable itempopup- The menu to add entries to- Returns:
- true if entries added to menu
-
setDisplayLevelMenu
Display 'z' level of the Positionable item and provide a dialog menu item to edit it.- Parameters:
p- The itempopup- the menu to add entries to
-
setHiddenMenu
Add a menu entry to set visibility of the Positionable item- Parameters:
p- the itempopup- the menu to add the entry to
-
setEmptyHiddenMenu
Add a menu entry to set visibility of the Positionable item based on the presence of contents. If the value is null or empty, the icon is not visible. This is applicable to memory, block content and LogixNG global variable labels.- Parameters:
p- the itempopup- the menu to add the entry to
-
setValueEditDisabledMenu
Add a menu entry to disable double click value edits. This applies when not in panel edit mode. This is applicable to memory, block content and LogixNG global variable labels.- Parameters:
p- the itempopup- the menu to add the entry to
-
setEditIdMenu
Add a menu entry to edit Id of the Positionable item- Parameters:
p- the itempopup- the menu to add the entry to
-
setEditClassesMenu
Add a menu entry to edit Classes of the Positionable item- Parameters:
p- the itempopup- the menu to add the entry to
-
setLogixNGPositionableMenu
Add a menu entry to edit Id of the Positionable item- Parameters:
p- the itempopup- the menu to add the entry to
-
positionalIdChange
public void positionalIdChange(Positionable p, String newId) throws Positionable.DuplicateIdException Check if it's possible to change the id of the Positionable to the desired string.- Parameters:
p- the PositionablenewId- the desired new id- Throws:
Positionable.DuplicateIdException- if another Positionable in the editor already has this id
-
positionalAddClass
Add a class name to the Positionable- Parameters:
p- the PositionableclassName- the class name- Throws:
IllegalArgumentException- if the name contains a comma
-
positionalRemoveClass
Removes a class name from the Positionable- Parameters:
p- the PositionableclassName- the class name
-
setShowToolTipMenu
Add a checkbox to display a tooltip for the Positionable item and if showable, provide a dialog menu to edit it.- Parameters:
p- the item to set the menu forpopup- the menu to add for p
-
setRemoveMenu
Add an action to remove the Positionable item.- Parameters:
p- the item to set the menu forpopup- the menu to add for p
-
locoMarkerFromRoster
-
selectLoco
-
selectLoco
-
locoMarkerFromInput
-
removeMarkers
Remove marker icons from panel -
setUpBackground
-
addLabel
-
displayLevelChange
Positionable has set a new level. Editor must change it in the target panel.- Parameters:
l- the positionable to display.
-
addTrainIcon
-
addLocoIcon
-
putLocoIcon
-
putItem
-
addToTarget
-
getIconFrame
Create editor for a given item type. Paths to default icons are fixed in code. Compare to respective icon package, eg.addSensorEditor()andSensorIcon- Parameters:
name- Icon editor's name- Returns:
- a window
-
getIconEditor
-
addTextEditor
Add a label to the target. -
addRightTOEditor
-
addLeftTOEditor
-
addSlipTOEditor
-
addSensorEditor
-
addSignalHeadEditor
-
getSignalHeadEditor
-
addSignalMastEditor
-
addMemoryEditor
-
addGlobalVariableEditor
-
addBlockContentsEditor
-
addReporterEditor
-
addLightEditor
-
addBackgroundEditor
-
addMultiSensorEditor
-
addIconEditor
-
addAudioEditor
-
addLogixNGEditor
-
putSensor
Add a sensor indicator to the target.- Returns:
- The sensor that was added to the panel.
-
addTurnoutR
void addTurnoutR()Add a turnout indicator to the target -
addTurnoutL
void addTurnoutL() -
addTurnout
-
addSlip
-
putSignalHead
Add a signal head to the target.- Returns:
- The signal head that was added to the target.
-
putSignalMast
Add a signal mast to the target.- Returns:
- The signal mast that was added to the target.
-
putMemory
-
addMemorySpinner
-
addMemoryInputBox
-
putGlobalVariable
-
addGlobalVariableSpinner
-
addGlobalVariableInputBox
-
putBlockContents
-
addLight
Add a Light indicator to the target- Returns:
- The light indicator that was added to the target.
-
addReporter
-
putBackground
void putBackground()Button pushed, add a background image. Note that a background image differs from a regular icon only in the level at which it's presented. -
putIcon
Add an icon to the target.- Returns:
- The icon that was added to the target.
-
putAudio
Add a LogixNG icon to the target.- Returns:
- The LogixNG icon that was added to the target.
-
putLogixNG
Add a LogixNG icon to the target.- Returns:
- The LogixNG icon that was added to the target.
-
addMultiSensor
-
addClock
-
addRpsReporter
-
setTitle
-
makeAddIconFrame
protected Editor.JFrameItem makeAddIconFrame(String name, boolean add, boolean table, IconAdder editor) Create a frame showing all images in the set used for an icon. Opened when editItemInPanel button is clicked in the Edit Icon Panel, shown after icon's context menu Edit Icon... item is selected.- Parameters:
name- bean type nameadd- true when used to add a new item on panel, false when used to edit an item already on the paneltable- true for bean types presented as table instead of iconseditor- parent frame of the image frame- Returns:
- JFrame connected to the editor, to be filled with icons
-
removeFromTarget
-
removeFromContents
-
deletePanel
Ask user if panel should be deleted. The caller should dispose the panel to delete it.- Returns:
- true if panel should be deleted.
-
dispose
Dispose of the editor.- Specified by:
disposein interfaceWindowInterface- Overrides:
disposein classJmriJFrame
-
showToolTip
-
getItemX
-
getItemY
-
addToPopUpMenu
Provide a method for external code to add items to context menus.- Parameters:
nb- The namedBean associated with the postionable item.item- The entry to add to the menu.menu- The menu to add the entry to.
-
moveItem
Relocate item.Note that items can not be moved past the left or top edges of the panel.
- Parameters:
p- The item to move.deltaX- The horizontal displacement.deltaY- The vertical displacement.
-
getSelectedItems
Return a List of all items whose bounding rectangle contain the mouse position. ordered from top level to bottom- Parameters:
event- contains the mouse position.- Returns:
- a list of positionable items or an empty list.
-
makeSelectionGroup
-
modifySelectionGroup
-
setAttributes
Set attributes of a Positionable.- Parameters:
newUtil- helper from which to get attributesp- the item to set attributes of
-
setSelectionsAttributes
-
setSelectionsHidden
-
setSelectionsPositionable
-
removeSelections
-
setSelectionsScale
-
setSelectionsRotation
-
setSelectionsDisplayLevel
-
setSelectionsDockingLocation
-
dockSelections
-
showAlignPopup
-
getSelectRect
-
drawSelectRect
-
getAnchorX
-
getAnchorY
-
getLastX
-
getLastY
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-
keyPressed
- Specified by:
keyPressedin interfaceKeyListener
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
vetoableChange
- Specified by:
vetoableChangein interfaceVetoableChangeListener- Throws:
PropertyVetoException
-
mousePressed
Description copied from interface:JmriMouseListenerInvoked when a mouse button has been pressed on a component.- Specified by:
mousePressedin interfaceJmriMouseListener- Parameters:
event- the event to be processed
-
mouseReleased
Description copied from interface:JmriMouseListenerInvoked when a mouse button has been released on a component.- Specified by:
mouseReleasedin interfaceJmriMouseListener- Parameters:
event- the event to be processed
-
mouseClicked
Description copied from interface:JmriMouseListenerInvoked when the mouse button has been clicked (pressed and released) on a component.- Specified by:
mouseClickedin interfaceJmriMouseListener- Parameters:
event- the event to be processed
-
mouseDragged
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- Parameters:
event- the event to be processed
-
mouseMoved
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- Parameters:
event- the event to be processed
-
mouseEntered
Description copied from interface:JmriMouseListenerInvoked when the mouse enters a component.- Specified by:
mouseEnteredin interfaceJmriMouseListener- Parameters:
event- the event to be processed
-
mouseExited
Description copied from interface:JmriMouseListenerInvoked when the mouse exits a component.- Specified by:
mouseExitedin interfaceJmriMouseListener- Parameters:
event- the event to be processed
-
init
-
targetWindowClosingEvent
-
paintTargetPanel
Called from TargetPanel's paint method for additional drawing by editor view.- Parameters:
g- the context to paint within
-
setNextLocation
Set an object's location when it is created.- Parameters:
obj- the object to locate
-
initView
After construction, initialize all the widgets to their saved config settings. -
copyItem
Set up item(s) to be copied by paste.- Parameters:
p- the item to copy
-
getUsageReport
-
getUsageData
-