Class LayoutEditor
- All Implemented Interfaces:
ActionListener,ComponentListener,ItemListener,KeyListener,MouseWheelListener,WindowListener,ImageObserver,MenuContainer,VetoableChangeListener,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants,BeanInterface,LayoutModels,ModifiedFlag,JmriMouseListener,JmriMouseMotionListener,WindowInterface
This module serves as a manager for the LayoutTurnout, Layout Block, PositionablePoint, Track Segment, LayoutSlip and LevelXing objects which are integral subparts of the LayoutEditor class.
All created objects are put on specific levels depending on their type (higher levels are in front): Note that higher numbers appear behind lower numbers.
The "contents" List keeps track of all text and icon label objects added to the target frame for later manipulation. Other Lists keep track of drawn items.
Based in part on PanelEditor.java (Bob Jacobsen (c) 2002, 2003). In particular, text and icon label items are copied from Panel editor, as well as some of the control design.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classNested classes/interfaces inherited from class jmri.jmrit.display.Editor
Editor.JFrameItem, Editor.TargetPane, Editor.UrlErrorDialogNested 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 TypeFieldDescription(package private) intdoubledoublefinal LayoutEditorViewContext(package private) booleanbooleandoubledoublestatic final doublestatic final double(package private) List<NamedBeanUsageReport>Fields inherited from class jmri.jmrit.display.panelEditor.PanelEditor
_multiItemCopyGroup, addItemViaMouseClick, pasteItemFlagFields 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, yLocFields 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 TypeMethodDescriptionvoidAdd an Anchor point.(package private) voidAdd a LogixNG icon to the targetvoidAdd a background image(package private) voidvoidAdd an Edge Connector point.voidAdd an End Bumper point.(package private) void(package private) voidaddIcon()Add an icon to the target(package private) voidaddLabel()Add a label to the Draw PanelvoidAdd a LayoutSlipfinal voidaddLayoutTrack(LayoutTrack trk, LayoutTrackView v) Add a LayoutTrack and LayoutTrackView to the list of LayoutTrack family objects.voidAdd a Layout TurnoutvoidAdd a Level CrossingaddLocoIcon(String name) Add a loco marker to the target(package private) voidAdd a LogixNG icon to the target(package private) voidAdd a memory label to the Draw PanelvoidvoidaddPopupItems(JPopupMenu popup, JmriMouseEvent event) voidaddReporter(Reporter reporter, int xx, int yy) Add a Reporter Icon to the panel.(package private) voidAdd a sensor indicator to the Draw Panel(package private) voidAdd a signal head to the Panel(package private) voidvoidaddToPopUpMenu(NamedBean nb, JMenuItem item, int menu) Provide a method for external code to add items to context menus.voidAdd a Track SegmentvoidaddTurntable(Point2D pt) Add a layout turntable at location specifiedvoidalign the layout to gridvoidalignSelection(boolean alignX) voidalign selection to gridvoidamendSelectionGroup(LayoutShape shape) voidamendSelectionGroup(LayoutTrack track) booleanCheck for conditions that prevent a delete.voidintcomputeDirection(LayoutTrack trk1, HitPointType h1, LayoutTrack trk2, HitPointType h2) Compute octagonal direction of vector from p1 to p2.intintcomputeDirectionToCenter(LayoutTrack trk1, HitPointType h1, PositionablePoint p) booleancontainsSignalHead(SignalHead head) booleancontainsSignalMast(SignalMast mast) booleanInvoked by DeletePanel menu item Validate user intent before deletingvoiddispose()Dispose of the editor.(package private) voidfindPositionalUsage(NamedBean bean) (package private) void(package private) voidfindTurnoutUsage(NamedBean bean) (package private) voidfindXingWhereUsed(NamedBean bean) getAffectedBlock(LayoutTrack track, HitPointType type) Depending on the given type, and the real class of the given LayoutTrack, determine the connected LayoutTrack.booleanbooleangetCoords(LayoutTrack track, HitPointType connectionType) Get the coordinates for the connection type of the specified LayoutTrack or subtype.getCoords(LayoutTrackView trkView, HitPointType connectionType) Get the coordinates for the connection type of the specified LayoutTrackView or subtype.Getter defaultAlternativeTrackColor.Getter defaultOccupiedTrackColor.Getter defaultTrackColor.booleanbooleanbooleangetLayoutBlock(String blockID) Return a layout block with the given name if one exists.final LayoutSlipViewGetter Layout Track Drawing Options. since 4.15.6 split variable defaultTrackColor and mainlineTrackColor/sidelineTrackColor
blockDefaultColor, blockOccupiedColor and blockAlternativeColor added to LayoutTrackDrawingOptionsfinal List<LayoutTrack>Read-only access to the list of LayoutTrack family objects.getLayoutTracksOfClass(Class<? extends LayoutTrack> layoutTrackClass) final LayoutTrackViewfinal List<LayoutTrackView>Read-only access to the list of LayoutTrackView family objects.getLayoutTrackViewsOfClass(Class<? extends LayoutTrackView> layoutTrackViewClass) final LayoutTurnoutViewfinal LayoutTurntableViewfinal LevelXingViewgetLevelXingView(LevelXing xing) doublegetMaxZoomdoublegetMinZoombooleanfinal PositionablePointViewbooleanboolean(package private) SignalHeadgetSignalHead(String name) (package private) SignalMastgetSignalMast(String name) booleanbooleanjmri.jmrit.display.layoutEditor.LayoutEditor.ToolBarSideget the toolbar sidebooleanbooleanfinal TrackSegmentViewdoublebooleanintdoubledouble(package private) StringgetUsageData(LayoutTrack track) getUsageReport(NamedBean bean) doubledoubledoubledoublegetZoom()getZoombooleanhighlightBlock(Block inBlock) highlight the specified blockbooleanhighlightBlockInComboBox(NamedBeanComboBox<Block> inComboBox) booleanhighlightLayoutBlock(LayoutBlock inLayoutBlock) highlight the specified layout blockvoidvoidinitView()After construction, initialize all the widgets to their saved config settings.booleanbooleanisDirty()Check the dirty state.booleanbooleanboolean(package private) booleanisLBLockUsed(NamedBean bean, LayoutBlock lblock) booleanboolean(package private) booleanisUsedInXing(NamedBean bean, LevelXing xing, LevelXing.Geometry point) voidkeyPressed(KeyEvent event) layoutEditorControlCircleRectAt(Point2D inPoint) layoutEditorControlRectAt(Point2D inPoint) 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.voidmouseMoved(JmriMouseEvent event) Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.voidmousePressed(JmriMouseEvent event) Handle a mouse pressed eventvoidmouseReleased(JmriMouseEvent event) Invoked when a mouse button has been released on a component.voidmouseWheelMoved(MouseWheelEvent event) voidSet white as the default background color for panels created using the New Panel menu item.Create a listener that will exclude turnouts that are present in the current panel.newTurnoutComboBoxPopupMenuListener(NamedBeanComboBox<Turnout> comboBox, List<Turnout> currentTurnouts) Create a listener that will exclude turnouts that are present in the current panel.voidSpecial internal class to allow drawing of layout to a JLayeredPane This is the 'target' pane where the layout is displayedprovideLayoutBlock(String inBlockName) Return a layout block with the entered name, creating a new one if needed.voidvoidputLocoIcon(LocoIcon l, String name) voidvoidvoidvoidAllow external trigger of re-drawHiddenbooleanbooleanRemove a layout shape from the list of layout shapesbooleanRemove a slipfinal voidIf item present, delete from the list of LayoutTracks and force a dirty redraw.final booleanIf item present, delete from the list of LayoutTracks and force a dirty redraw.booleanRemove a LayoutTurnoutbooleanRemove a Level CrossingvoidRemove marker icons from panelbooleanRemove a PositionablePoint -- an Anchor or an End Bumper.voidremoveSignalHead(SignalHead head) voidRemove a Track SegmentbooleanRemove a Layout TurntablevoidvoidAllow external reset of dirty bitvoidRotate the entire layout by 90 degrees clockwise.voidRotate selection by 90 degrees clockwise.booleanscaleTrack(float xFactor, float yFactor) scale all LayoutTracks coordinates by the x and y factors.voidscrollBarAdjusted(AdjustmentEvent event) voidsetAllEditable(boolean editable) Control whether target panel items are editable.voidsetAllPositionable(boolean state) Control whether panel items are positionable.voidsetAllShowLayoutTurnoutToolTip(boolean state) intloop through all LayoutBlocks and set colors to the default colors from this LayoutEditorvoidsetAntialiasingOn(boolean state) Should only be invoked on the GUI (Swing) thread.voidsetAutoBlockAssignment(boolean boo) voidAllow external set/reset of awaitingIconChangevoidvoidvoidvoidsetDefaultBackgroundColor(Color color) voidvoidsetDefaultTextColor(Color color) voidsetDefaultTrackColor(Color color) voidsetDirectTurnoutControl(boolean boo) voidsetDirty()voidsetDirty(boolean val) Allow external set of dirty bitvoidsetDrawGrid(boolean state) Should only be invoked on the GUI (Swing) thread.voidsetDrawLayoutTracksLabel(boolean state) voidsetHighlightCursor(boolean state) Should only be invoked on the GUI (Swing) thread.voidsetHighlightSelectedBlock(boolean state) voidvoidsetLayoutDimensions(int windowWidth, int windowHeight, int windowX, int windowY, int panelWidth, int panelHeight) voidsetLayoutDimensions(int windowWidth, int windowHeight, int windowX, int windowY, int panelWidth, int panelHeight, boolean merge) voidsetLayoutName(String name) voidsince 4.15.6 split variable defaultTrackColor and mainlineTrackColor/sidelineTrackColorvoidsetLink(LayoutTrack fromObject, HitPointType fromPointType, LayoutTrack toObject, HitPointType toPointType) link the 'from' object and type to the 'to' object and typevoidSet object location and size for icon and label object as it is created.voidvoidsetPanelBounds(Rectangle2D newBounds) voidsetScroll(int state) voidThe LE xml load uses the string version of setScroll which went directly to Editor.voidsetSelectionRect(Rectangle2D selectionRect) voidsetSelectRect(Rectangle rectangle) booleansetShowAlignmentMenu(JPopupMenu popup) Offer actions to align the selected Positionable items either Horizontally (at average y coord) or Vertically (at average x coord).voidsetShowHelpBar(boolean state) Should only be invoked on the GUI (Swing) thread.voidsetSize(int w, int h) voidsetSnapOnAdd(boolean state) Should only be invoked on the GUI (Swing) thread.voidsetSnapOnMove(boolean state) Should only be invoked on the GUI (Swing) thread.voidsetToolBarSide(jmri.jmrit.display.layoutEditor.LayoutEditor.ToolBarSide newToolBarSide) set the tool bar sidevoidsetTooltipsInEdit(boolean state) voidsetTooltipsNotEdit(boolean state) voidsetTurnoutAnimation(boolean state) Control whether target panel items are controlling layout items.voidsetTurnoutBX(double bx) voidsetTurnoutCircleColor(Color color) voidsetTurnoutCircles(boolean state) voidsetTurnoutCircleSize(int size) voidsetTurnoutCircleThrownColor(Color color) voidsetTurnoutCX(double cx) voidsetTurnoutDrawUnselectedLeg(boolean state) Should only be invoked on the GUI (Swing) thread.voidsetTurnoutFillControlCircles(boolean state) Should only be invoked on the GUI (Swing) thread.voidsetTurnoutWid(double wid) static voidsetupComboBox(NamedBeanComboBox<?> nbComboBox, boolean inValidateMode, boolean inEnable, boolean inEditable) Set up NamedBeanComboBoxvoidsetXOverHWid(double hwid) voidsetXOverLong(double lg) voidsetXOverShort(double sh) doublesetZoom(double zoomFactor) Set panel Zoom factor.booleanvoidshowPopUp(Positionable pos, JmriMouseEvent event) Select the menu items to display for the Positionable's popup.voidshowToolTip(Positionable selection, JmriMouseEvent event) void(package private) voidvoidThe target window has been requested to close, don't delete it at this time.toString()voidtranslate(float xTranslation, float yTranslation) Translate entire layout by x and y amounts.booleantranslateTrack(float xDel, float yDel) (package private) voidundo the move selectionunionToPanelBounds(Rectangle2D bounds) booleanvalidatePhysicalTurnout(String inTurnoutName, Component inOpenPane) Validates that a physical turnout exists and is unique among Layout Turnouts Returns true if valid turnout was entered, false otherwisebooleanvalidateSensor(String sensorName, LayoutBlock blk, Component openFrame) Validates that the supplied occupancy sensor name corresponds to an existing sensor and is unique among all blocks.voidMethods inherited from class jmri.jmrit.display.panelEditor.PanelEditor
addItemPopUp, backgroundPopUp, copyItem, itemStateChanged, makeFrame, mouseExited, pasteItem, pasteItemPopUp, setBackgroundMenu, setRemoveMenu, showAddItemPopUp, showMultiSelectPopUp, showPopUp, windowClosingMethods inherited from class jmri.jmrit.display.Editor
actionPerformed, addAudioEditor, addBackgroundEditor, addBlockContentsEditor, addClock, addGlobalVariableEditor, addGlobalVariableInputBox, addGlobalVariableSpinner, addIconEditor, addLabel, addLeftTOEditor, addLight, addLightEditor, addLogixNGEditor, addMemoryEditor, addMemoryInputBox, addMemorySpinner, addMultiSensor, addMultiSensorEditor, addReporter, addReporterEditor, addRightTOEditor, addRpsReporter, addSensorEditor, addSignalHeadEditor, addSignalMastEditor, addSlipTOEditor, addTextEditor, addToTarget, addTrainIcon, addTurnout, allControlling, allPositionable, changeView, clearBackgroundColor, deselectSelectionGroup, displayLevelChange, 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, isEditable, isPanelMenuVisible, keyReleased, keyTyped, loadFailed, loadFailed, loadOK, locoMarkerFromInput, locoMarkerFromRoster, makeAddIconFrame, makeSelectionGroup, modifySelectionGroup, moveItem, positionalAddClass, positionalIdChange, positionalRemoveClass, putAudio, putBlockContents, putGlobalVariable, putIcon, putLogixNG, putMemory, putSensor, putSignalHead, putSignalMast, removeFromTarget, removeSelections, selectLoco, selectLoco, setAllControlling, setAllShowToolTip, setAttributes, setBackgroundColor, setDefaultToolTip, setDisplayLevelMenu, setEditClassesMenu, setEditIdMenu, setEmptyHiddenMenu, setGlobalSetsLocalFlag, setHiddenMenu, setLogixNGPositionableMenu, setPaintScale, setPanelMenuVisible, setPositionableMenu, setSelectionsAttributes, setSelectionsDisplayLevel, setSelectionsDockingLocation, setSelectionsHidden, setSelectionsPositionable, setSelectionsRotation, setSelectionsScale, setShowAlignmentMenu, setShowCoordinatesMenu, setShowHidden, setShowToolTipMenu, setTargetPanel, setTargetPanelSize, setTitle, setToolTip, setUpBackground, setUseGlobalFlag, setValueEditDisabledMenu, showHidden, showToolTip, targetWindowClosing, useGlobalFlagMethods 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, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.jmrit.display.layoutEditor.LayoutModels
computeDirectionAB, computeDirectionAC, computeDirectionAD, computeDirectionBC, computeDirectionBD, computeDirectionCD, displayRemoveWarningMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
SIZE
- See Also:
-
SIZE2
- See Also:
-
turnoutCircleColor
-
turnoutCircleThrownColor
-
circleRadius
-
circleDiameter
-
selectionActive
-
selectionWidth
-
selectionHeight
-
selectedObject
-
prevSelectedObject
-
foundTrack
-
foundTrackView
-
foundHitPointType
-
beginTrack
-
beginLocation
-
currentLocation
-
gContext
-
defaultTrackColor
-
openDispatcherOnLoad
boolean openDispatcherOnLoad -
_positionableSelection
-
_layoutTrackSelection
-
_layoutShapeSelection
-
_prevNumSel
int _prevNumSel -
usageReport
-
-
Constructor Details
-
LayoutEditor
public LayoutEditor() -
LayoutEditor
-
-
Method Details
-
getLayoutEditorToolBarPanel
-
getSensorList
-
getLabelImageList
-
getBlockContentsLabelList
-
getMemoryLabelList
-
getGlobalVariableLabelList
-
getSignalList
-
getSignalMastList
-
getFinder
-
newPanelDefaults
Description copied from class:EditorSet 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.- Overrides:
newPanelDefaultsin classEditor
-
init
- Overrides:
initin classPanelEditor
-
initView
Description copied from class:PanelEditorAfter construction, initialize all the widgets to their saved config settings.- Overrides:
initViewin classPanelEditor
-
setSize
-
targetWindowClosingEvent
Description copied from class:PanelEditorThe 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.- Overrides:
targetWindowClosingEventin classPanelEditor
-
setupComboBox
public static void setupComboBox(@Nonnull NamedBeanComboBox<?> nbComboBox, boolean inValidateMode, boolean inEnable, boolean inEditable) Set up NamedBeanComboBox- Parameters:
nbComboBox- the NamedBeanComboBox to set upinValidateMode- true to validate typed inputs; false otherwiseinEnable- boolean to enable / disable the NamedBeanComboBoxinEditable- boolean to make the NamedBeanComboBox editable
-
getLayoutTrackDrawingOptions
Getter Layout Track Drawing Options. since 4.15.6 split variable defaultTrackColor and mainlineTrackColor/sidelineTrackColor
blockDefaultColor, blockOccupiedColor and blockAlternativeColor added to LayoutTrackDrawingOptions- Returns:
- LayoutTrackDrawingOptions object
-
setLayoutTrackDrawingOptions
since 4.15.6 split variable defaultTrackColor and mainlineTrackColor/sidelineTrackColor- Parameters:
ltdo- LayoutTrackDrawingOptions object
-
getToolBarSide
get the toolbar side- Returns:
- the side where to put the tool bar
-
setToolBarSide
set the tool bar side- Parameters:
newToolBarSide- on which side to put the toolbar
-
scrollBarAdjusted
-
mouseWheelMoved
- Specified by:
mouseWheelMovedin interfaceMouseWheelListener
-
setZoom
Set panel Zoom factor.- Parameters:
zoomFactor- the amount to scale, eg. 2.0 for 2x zoom.- Returns:
- the new scale amount (not necessarily the same as zoomFactor)
-
getZoom
getZoom- Returns:
- the zooming scale
-
getMinZoom
getMinZoom- Returns:
- the minimum zoom scale
-
getMaxZoom
getMaxZoom- Returns:
- the maximum zoom scale
-
isIncludedTurnoutSkipped
-
setIncludedTurnoutSkipped
-
getOpenDispatcherOnLoad
-
setOpenDispatcherOnLoad
-
removeMarkers
Remove marker icons from panel- Overrides:
removeMarkersin classEditor
-
translateTrack
-
scaleTrack
scale all LayoutTracks coordinates by the x and y factors.- Parameters:
xFactor- the amount to scale X coordinates.yFactor- the amount to scale Y coordinates.- Returns:
- true when complete.
-
setAllTracksToDefaultColors
loop through all LayoutBlocks and set colors to the default colors from this LayoutEditor- Returns:
- count of changed blocks
-
translate
Translate entire layout by x and y amounts.- Parameters:
xTranslation- horizontal (X) translation valueyTranslation- vertical (Y) translation value
-
undoMoveSelection
void undoMoveSelection()undo the move selection -
rotateSelection90
Rotate selection by 90 degrees clockwise. -
rotateLayout90
Rotate the entire layout by 90 degrees clockwise. -
alignLayoutToGrid
align the layout to grid -
alignSelectionToGrid
align selection to grid -
setCurrentPositionAndSize
-
setScroll
-
setScroll
The LE xml load uses the string version of setScroll which went directly to Editor. The string version has been added here so that LE can set the scroll selection. -
addTurntable
Add a layout turntable at location specified- Parameters:
pt- x,y placement for turntable
-
redrawPanel
Allow external trigger of re-drawHidden- Specified by:
redrawPanelin interfaceLayoutModels
-
setAwaitingIconChange
Allow external set/reset of awaitingIconChange -
resetAwaitingIconChange
-
resetDirty
Allow external reset of dirty bit -
setDirty
Allow external set of dirty bit- Parameters:
val- true/false for panelChanged
-
setDirty
- Specified by:
setDirtyin interfaceLayoutModels
-
isDirty
Check the dirty state.- Specified by:
isDirtyin interfaceLayoutModels- Returns:
- true if panel has changed
-
mousePressed
Handle a mouse pressed eventSide-effects on _anchorX, _anchorY,_lastX, _lastY, xLoc, yLoc, dLoc, selectionActive, xLabel, yLabel
- Specified by:
mousePressedin interfaceJmriMouseListener- Overrides:
mousePressedin classPanelEditor- Parameters:
event- the JmriMouseEvent
-
getCoords
Get the coordinates for the connection type of the specified LayoutTrack or subtype.This uses the current LayoutEditor object to map a LayoutTrack (no coordinates) object to _a_ specific LayoutTrackView object in the current LayoutEditor i.e. window. This allows the same model object in two windows, but not twice in a single window.
This is temporary, and needs to go away as the LayoutTrack doesn't logically have position; just the LayoutTrackView does, and multiple LayoutTrackViews can refer to one specific LayoutTrack.
- Parameters:
track- the object (LayoutTrack subclass)connectionType- the type of connection- Returns:
- the coordinates for the connection type of the specified object
-
getCoords
Get the coordinates for the connection type of the specified LayoutTrackView or subtype.- Parameters:
trkView- the object (LayoutTrackView subclass)connectionType- the type of connection- Returns:
- the coordinates for the connection type of the specified object
-
mouseReleased
Description copied from interface:JmriMouseListenerInvoked when a mouse button has been released on a component.- Specified by:
mouseReleasedin interfaceJmriMouseListener- Overrides:
mouseReleasedin classPanelEditor- Parameters:
event- the event to be processed
-
addPopupItems
-
showPopUp
Select the menu items to display for the Positionable's popup.- Parameters:
pos- the item containing or requiring the context menuevent- the event triggering the menu
-
mouseClicked
Description copied from interface:JmriMouseListenerInvoked when the mouse button has been clicked (pressed and released) on a component.- Specified by:
mouseClickedin interfaceJmriMouseListener- Overrides:
mouseClickedin classPanelEditor- Parameters:
event- the event to be processed
-
getPositionalSelection
-
getLayoutTrackSelection
-
getLayoutShapeSelection
-
clearSelectionGroups
-
amendSelectionGroup
-
amendSelectionGroup
-
alignSelection
-
setShowAlignmentMenu
Offer actions to align the selected Positionable items either Horizontally (at average y coord) or Vertically (at average x coord).- Parameters:
popup- the JPopupMenu to add alignment menu to- Returns:
- true if alignment menu added
-
keyPressed
- Specified by:
keyPressedin interfaceKeyListener- Overrides:
keyPressedin classEditor
-
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- Overrides:
mouseMovedin classPanelEditor- Parameters:
event- the event to be processed
-
setAllShowLayoutTurnoutToolTip
-
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- Overrides:
mouseDraggedin classPanelEditor- Parameters:
event- the event to be processed
-
mouseEntered
Description copied from interface:JmriMouseListenerInvoked when the mouse enters a component.- Specified by:
mouseEnteredin interfaceJmriMouseListener- Overrides:
mouseEnteredin classPanelEditor- Parameters:
event- the event to be processed
-
addAnchor
Add an Anchor point. -
addAnchor
-
addEndBumper
Add an End Bumper point. -
addEdgeConnector
Add an Edge Connector point. -
addTrackSegment
Add a Track Segment -
addLevelXing
Add a Level Crossing -
addLayoutSlip
Add a LayoutSlip- Parameters:
type- the slip type
-
addLayoutTurnout
Add a Layout Turnout- Parameters:
type- the turnout type
-
validatePhysicalTurnout
public boolean validatePhysicalTurnout(@Nonnull String inTurnoutName, @CheckForNull Component inOpenPane) Validates that a physical turnout exists and is unique among Layout Turnouts Returns true if valid turnout was entered, false otherwise- Parameters:
inTurnoutName- the (system or user) name of the turnoutinOpenPane- the pane over which to show dialogs (null to suppress dialogs)- Returns:
- true if valid
-
setLink
public void setLink(@Nonnull LayoutTrack fromObject, HitPointType fromPointType, @Nonnull LayoutTrack toObject, HitPointType toPointType) link the 'from' object and type to the 'to' object and type- Parameters:
fromObject- the object to link fromfromPointType- the object type to link fromtoObject- the object to link totoPointType- the object type to link to
-
provideLayoutBlock
Return a layout block with the entered name, creating a new one if needed. Note that the entered name becomes the user name of the LayoutBlock, and a system name is automatically created by LayoutBlockManager if needed.If the block name is a system name, then the user will have to supply a user name for the block.
Some, but not all, errors pop a Swing error dialog in addition to logging.
- Parameters:
inBlockName- the entered name- Returns:
- the provided LayoutBlock
-
validateSensor
public boolean validateSensor(@Nonnull String sensorName, @Nonnull LayoutBlock blk, @Nonnull Component openFrame) Validates that the supplied occupancy sensor name corresponds to an existing sensor and is unique among all blocks. If valid, returns true and sets the block sensor name in the block. Else returns false, and does nothing to the block.- Parameters:
sensorName- the sensor name to validateblk- the LayoutBlock in which to set itopenFrame- the frame (Component) it is in- Returns:
- true if sensor is valid
-
getLayoutBlock
Return a layout block with the given name if one exists. Registers this LayoutEditor with the layout block. This method is designed to be used when a panel is loaded. The calling method must handle whether the use count should be incremented.- Parameters:
blockID- the given name- Returns:
- null if blockID does not already exist
-
removeFromContents
- Overrides:
removeFromContentsin classEditor
-
removePositionablePoint
Remove a PositionablePoint -- an Anchor or an End Bumper.- Parameters:
o- the PositionablePoint to remove- Returns:
- true if removed
-
removeLayoutTurnout
Remove a LayoutTurnout- Parameters:
o- the LayoutTurnout to remove- Returns:
- true if removed
-
removeLevelXing
Remove a Level Crossing- Parameters:
o- the LevelXing to remove- Returns:
- true if removed
-
removeLayoutSlip
Remove a slip- Parameters:
o- the LayoutSlip to remove- Returns:
- true if removed
-
removeTurntable
Remove a Layout Turntable- Parameters:
o- the LayoutTurntable to remove- Returns:
- true if removed
-
removeTrackSegment
Remove a Track Segment- Parameters:
o- the TrackSegment to remove
-
getAffectedBlock
Depending on the given type, and the real class of the given LayoutTrack, determine the connected LayoutTrack. This provides a variable-indirect form of e.g. trk.getLayoutBlockC() for example. Perhaps "Connected Block" captures the idea better, but that method name is being used for something else.- Parameters:
track- The track who's connected blocks are being examinedtype- This point to check for connected blocks, i.e. TURNOUT_B- Returns:
- The block at a particular point on the track object, or null if none.
-
addSensor
void addSensor()Add a sensor indicator to the Draw Panel -
putSensor
-
addSignalHead
void addSignalHead()Add a signal head to the Panel -
putSignal
-
getSignalHead
-
containsSignalHead
-
removeSignalHead
-
addSignalMast
void addSignalMast() -
putSignalMast
-
getSignalMast
-
containsSignalMast
-
addLabel
void addLabel()Add a label to the Draw Panel -
putItem
- Overrides:
putItemin classPanelEditor- Throws:
Positionable.DuplicateIdException
-
addMemory
void addMemory()Add a memory label to the Draw Panel -
addGlobalVariable
void addGlobalVariable() -
addBlockContents
void addBlockContents() -
addReporter
Add a Reporter Icon to the panel.- Parameters:
reporter- the reporter icon to add.xx- the horizontal location.yy- the vertical location.
-
addIcon
void addIcon()Add an icon to the target -
addLogixNGIcon
void addLogixNGIcon()Add a LogixNG icon to the target -
addAudioIcon
void addAudioIcon()Add a LogixNG icon to the target -
addLocoIcon
Add a loco marker to the target- Overrides:
addLocoIconin classEditor
-
putLocoIcon
- Overrides:
putLocoIconin classEditor
-
addBackground
Add a background image -
removeLayoutShape
Remove a layout shape from the list of layout shapes- Parameters:
s- the LayoutShape to add- Returns:
- true if added
-
startMultiSensor
void startMultiSensor() -
addMultiSensor
-
setNextLocation
Set object location and size for icon and label object as it is created. Size comes from the preferredSize; location comes from the fields where the user can spec it.- Overrides:
setNextLocationin classPanelEditor- Parameters:
obj- the positionable object.
-
getConnectivityUtil
-
getLETools
-
getLEAuxTools
- Specified by:
getLEAuxToolsin interfaceLayoutModels
-
getLEChecks
-
deletePanel
Invoked by DeletePanel menu item Validate user intent before deleting- Overrides:
deletePanelin classEditor- Returns:
- true if panel should be deleted.
-
canDeletePanel
Check for conditions that prevent a delete.- The panel has active edge connector links
- The panel is used by EntryExit
- Returns:
- true if ok to delete
-
setAllEditable
Control whether target panel items are editable. Does this by invoking theEditor.setAllEditable(boolean)function of the parent class. This also controls the relevant pop-up menu items (which are the primary way that items are edited).- Overrides:
setAllEditablein classEditor- Parameters:
editable- true for editable.
-
setAllPositionable
Control whether panel items are positionable. Markers are always positionable.- Overrides:
setAllPositionablein classEditor- Parameters:
state- true for positionable.
-
setTurnoutAnimation
Control whether target panel items are controlling layout items. Does this by invoke thePositionable.setControlling(boolean)function of each item on the target panel. This also controls the relevant pop-up menu items.- Parameters:
state- true for controlling.
-
isAnimating
-
getScroll
-
getDefaultTrackColor
-
getDefaultTrackColorColor
Getter defaultTrackColor.- Returns:
- block default color as Color
-
getDefaultOccupiedTrackColor
-
getDefaultOccupiedTrackColorColor
Getter defaultOccupiedTrackColor.- Returns:
- block default occupied color as Color
-
getDefaultAlternativeTrackColor
-
getDefaultAlternativeTrackColorColor
Getter defaultAlternativeTrackColor.- Returns:
- block default alternative color as Color
-
getDefaultTextColor
-
getTurnoutCircleColor
-
getTurnoutCircleThrownColor
-
isTurnoutFillControlCircles
-
getTurnoutCircleSize
-
isTurnoutDrawUnselectedLeg
-
isHighlightCursor
-
getLayoutName
-
getShowHelpBar
-
getDrawGrid
-
getSnapOnAdd
-
getSnapOnMove
-
getAntialiasingOn
-
isDrawLayoutTracksLabel
-
getHighlightSelectedBlock
-
getTurnoutCircles
-
getTooltipsNotEdit
-
getTooltipsInEdit
-
getAutoBlockAssignment
-
setLayoutDimensions
public void setLayoutDimensions(int windowWidth, int windowHeight, int windowX, int windowY, int panelWidth, int panelHeight) -
setLayoutDimensions
public void setLayoutDimensions(int windowWidth, int windowHeight, int windowX, int windowY, int panelWidth, int panelHeight, boolean merge) -
getPanelBounds
-
setPanelBounds
-
unionToPanelBounds
-
setDefaultTrackColor
- Parameters:
color- value to set the default track color to.
-
setDefaultOccupiedTrackColor
- Parameters:
color- value to set the default occupied track color to.
-
setDefaultAlternativeTrackColor
- Parameters:
color- value to set the default alternate track color to.
-
setTurnoutCircleColor
- Parameters:
color- new color for turnout circle.
-
setTurnoutCircleThrownColor
- Parameters:
color- new color for turnout circle.
-
setTurnoutFillControlCircles
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to fill in turnout control circles, else false.
-
setTurnoutCircleSize
-
setTurnoutDrawUnselectedLeg
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to draw unselected legs, else false.
-
setHighlightCursor
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to enable highlighting the cursor (mouse/finger press/drag)
-
setDefaultTextColor
- Parameters:
color- value to set the default text color to.
-
setDefaultBackgroundColor
- Parameters:
color- value to set the panel background to.
-
setLayoutName
-
setShowHelpBar
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to show the help bar, else false.
-
setDrawGrid
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to show the draw grid, else false.
-
setSnapOnAdd
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to set snap to grid on add, else false.
-
setSnapOnMove
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to set snap on move, else false.
-
setAntialiasingOn
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to set anti-aliasing flag on, else false.
-
setDrawLayoutTracksLabel
- Parameters:
state- true to set anti-aliasing flag on, else false.
-
setHighlightSelectedBlock
-
highlightBlockInComboBox
-
highlightBlock
highlight the specified block- Parameters:
inBlock- the block- Returns:
- true if block was highlighted
-
highlightLayoutBlock
highlight the specified layout block- Parameters:
inLayoutBlock- the layout block- Returns:
- true if layout block was highlighted
-
setTurnoutCircles
-
setAutoBlockAssignment
-
setTooltipsNotEdit
-
setTooltipsInEdit
-
setTurnoutBX
-
getTurnoutBX
-
setTurnoutCX
-
getTurnoutCX
-
setTurnoutWid
-
getTurnoutWid
-
setXOverLong
-
getXOverLong
-
setXOverHWid
-
getXOverHWid
-
setXOverShort
-
getXOverShort
-
setDirectTurnoutControl
-
getDirectTurnoutControl
-
setConnections
-
layoutEditorControlRectAt
-
layoutEditorControlCircleRectAt
-
paintTargetPanel
Special internal class to allow drawing of layout to a JLayeredPane This is the 'target' pane where the layout is displayed- Overrides:
paintTargetPanelin classPanelEditor- Parameters:
g- the context to paint within
-
getSelectionRect
-
setSelectionRect
-
setSelectRect
-
getLayoutTracksOfClass
@Nonnull public Stream<LayoutTrack> getLayoutTracksOfClass(Class<? extends LayoutTrack> layoutTrackClass) - Specified by:
getLayoutTracksOfClassin interfaceLayoutModels
-
getLayoutTrackViewsOfClass
@Nonnull public Stream<LayoutTrackView> getLayoutTrackViewsOfClass(Class<? extends LayoutTrackView> layoutTrackViewClass) - Specified by:
getLayoutTrackViewsOfClassin interfaceLayoutModels
-
getPositionablePointViews
- Specified by:
getPositionablePointViewsin interfaceLayoutModels
-
getPositionablePoints
- Specified by:
getPositionablePointsin interfaceLayoutModels
-
getLayoutSlipViews
-
getLayoutSlips
- Specified by:
getLayoutSlipsin interfaceLayoutModels
-
getTrackSegmentViews
- Specified by:
getTrackSegmentViewsin interfaceLayoutModels
-
getTrackSegments
- Specified by:
getTrackSegmentsin interfaceLayoutModels
-
getLayoutTurnoutViews
-
getLayoutTurnouts
- Specified by:
getLayoutTurnoutsin interfaceLayoutModels
-
getLayoutTurntables
- Specified by:
getLayoutTurntablesin interfaceLayoutModels
-
getLayoutTurntableViews
-
getLevelXings
- Specified by:
getLevelXingsin interfaceLayoutModels
-
getLevelXingViews
- Specified by:
getLevelXingViewsin interfaceLayoutModels
-
getLayoutTracks
Read-only access to the list of LayoutTrack family objects. The returned list will throw UnsupportedOperationException if you attempt to modify it.- Specified by:
getLayoutTracksin interfaceLayoutModels- Returns:
- unmodifiable copy of layout track list.
-
getLayoutTurnoutAndSlipViews
-
getLayoutTurnoutsAndSlips
- Specified by:
getLayoutTurnoutsAndSlipsin interfaceLayoutModels
-
getLayoutTrackViews
Read-only access to the list of LayoutTrackView family objects. The returned list will throw UnsupportedOperationException if you attempt to modify it.- Specified by:
getLayoutTrackViewsin interfaceLayoutModels- Returns:
- unmodifiable copy of track views.
-
getLayoutTrackView
- Specified by:
getLayoutTrackViewin interfaceLayoutModels
-
getLevelXingView
- Specified by:
getLevelXingViewin interfaceLayoutModels
-
getLayoutTurnoutView
- Specified by:
getLayoutTurnoutViewin interfaceLayoutModels
-
getLayoutTurntableView
- Specified by:
getLayoutTurntableViewin interfaceLayoutModels
-
getLayoutSlipView
-
getTrackSegmentView
- Specified by:
getTrackSegmentViewin interfaceLayoutModels
-
getPositionablePointView
- Specified by:
getPositionablePointViewin interfaceLayoutModels
-
addLayoutTrack
Add a LayoutTrack and LayoutTrackView to the list of LayoutTrack family objects.- Specified by:
addLayoutTrackin interfaceLayoutModels- Parameters:
trk- the layout track to add.v- corresponding view
-
removeLayoutTrackAndRedraw
If item present, delete from the list of LayoutTracks and force a dirty redraw.- Parameters:
trk- the layout track to remove and redraw.- Returns:
- true is item was deleted and a redraw done.
-
removeLayoutTrack
If item present, delete from the list of LayoutTracks and force a dirty redraw.- Specified by:
removeLayoutTrackin interfaceLayoutModels- Parameters:
trk- the layout track to remove.
-
getLayoutShapes
- Specified by:
getLayoutShapesin interfaceLayoutModels
-
sortLayoutShapesByLevel
-
computeDirection
Compute octagonal direction of vector from p1 to p2.The octagonal (8) directions are: North, North-East, East, South-East, South, South-West, West and North-West; see
Pathfor more on this.This method must eventually be in terms _other_ than the screen geometry of the associated LayoutTrackView objects, as it's meant to be the track connectivity direction not the on the screen implementation.
This implementation is temporary, using the on-screen points from the LayoutTrackViews via @{link LayoutEditor#getCoords}.
- Specified by:
computeDirectionin interfaceLayoutModels- Parameters:
trk1- track at "from" endh1- the hit point for "from" endtrk2- the track at the "to" endh2- the hit at the "to" end- Returns:
- the octagonal direction from p1 to p2
-
computeDirectionToCenter
public int computeDirectionToCenter(@Nonnull LayoutTrack trk1, @Nonnull HitPointType h1, @Nonnull PositionablePoint p) - Specified by:
computeDirectionToCenterin interfaceLayoutModels
-
computeDirectionFromCenter
public int computeDirectionFromCenter(@Nonnull PositionablePoint p, @Nonnull LayoutTrack trk1, @Nonnull HitPointType h1) - Specified by:
computeDirectionFromCenterin interfaceLayoutModels
-
showAlignPopup
- Overrides:
showAlignPopupin classEditor
-
showToolTip
- Overrides:
showToolTipin classEditor
-
addToPopUpMenu
Description copied from class:EditorProvide a method for external code to add items to context menus.- Overrides:
addToPopUpMenuin classEditor- 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.
-
toString
-
vetoableChange
- Specified by:
vetoableChangein interfaceVetoableChangeListener- Overrides:
vetoableChangein classEditor- Throws:
PropertyVetoException
-
dispose
Description copied from class:EditorDispose of the editor.- Specified by:
disposein interfaceWindowInterface- Overrides:
disposein classEditor
-
newTurnoutComboBoxPopupMenuListener
public LayoutEditor.TurnoutComboBoxPopupMenuListener newTurnoutComboBoxPopupMenuListener(NamedBeanComboBox<Turnout> comboBox) Create a listener that will exclude turnouts that are present in the current panel.- Parameters:
comboBox- The NamedBeanComboBox that contains the turnout list.- Returns:
- A PopupMenuListener
-
newTurnoutComboBoxPopupMenuListener
public LayoutEditor.TurnoutComboBoxPopupMenuListener newTurnoutComboBoxPopupMenuListener(NamedBeanComboBox<Turnout> comboBox, List<Turnout> currentTurnouts) Create a listener that will exclude turnouts that are present in the current panel. The list of current turnouts are not excluded.- Parameters:
comboBox- The NamedBeanComboBox that contains the turnout list.currentTurnouts- The turnouts to be left in the turnout list.- Returns:
- A PopupMenuListener
-
getUsageReport
- Overrides:
getUsageReportin classEditor
-
findTurnoutUsage
-
findPositionalUsage
-
findSegmentWhereUsed
-
findXingWhereUsed
-
getUsageData
-
isLBLockUsed
-
isUsedInXing
-