Class LayoutEditor
- 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.panelEditor.PanelEditor
-
- jmri.jmrit.display.layoutEditor.LayoutEditor
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.ComponentListener,java.awt.event.ItemListener,java.awt.event.KeyListener,java.awt.event.MouseWheelListener,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,LayoutModels,ModifiedFlag,JmriMouseListener,JmriMouseMotionListener,WindowInterface
public final class LayoutEditor extends PanelEditor implements java.awt.event.MouseWheelListener, LayoutModels
Provides a scrollable Layout Panel and editor toolbars (that can be hidden)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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classLayoutEditor.TurnoutComboBoxPopupMenuListener-
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 java.util.List<LayoutShape>_layoutShapeSelectionjava.util.List<LayoutTrack>_layoutTrackSelectionjava.util.List<Positionable>_positionableSelection(package private) int_prevNumSeljava.awt.geom.Point2DbeginLocationLayoutTrackbeginTrackdoublecircleDiameterdoublecircleRadiusjava.awt.geom.Point2DcurrentLocationjava.awt.ColordefaultTrackColorHitPointTypefoundHitPointTypeLayoutTrackfoundTrackLayoutTrackViewfoundTrackViewLayoutEditorViewContextgContext(package private) booleanopenDispatcherOnLoadjava.lang.ObjectprevSelectedObjectjava.lang.ObjectselectedObjectbooleanselectionActivedoubleselectionHeightdoubleselectionWidthstatic doubleSIZEstatic doubleSIZE2java.awt.ColorturnoutCircleColorjava.awt.ColorturnoutCircleThrownColor(package private) java.util.List<NamedBeanUsageReport>usageReport-
Fields inherited from class jmri.jmrit.display.panelEditor.PanelEditor
_multiItemCopyGroup, addItemViaMouseClick, pasteItemFlag
-
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 LayoutEditor()LayoutEditor(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnchor()Add an Anchor point.PositionablePointaddAnchor(java.awt.geom.Point2D point)(package private) voidaddAudioIcon()Add a LogixNG icon to the targetvoidaddBackground()Add a background image(package private) voidaddBlockContents()voidaddEdgeConnector()Add an Edge Connector point.voidaddEndBumper()Add an End Bumper point.(package private) voidaddGlobalVariable()(package private) voidaddIcon()Add an icon to the target(package private) voidaddLabel()Add a label to the Draw PanelvoidaddLayoutSlip(LayoutTurnout.TurnoutType type)Add a LayoutSlipvoidaddLayoutTrack(LayoutTrack trk, LayoutTrackView v)Add a LayoutTrack and LayoutTrackView to the list of LayoutTrack family objects.voidaddLayoutTurnout(LayoutTurnout.TurnoutType type)Add a Layout TurnoutvoidaddLevelXing()Add a Level CrossingLocoIconaddLocoIcon(java.lang.String name)Add a loco marker to the target(package private) voidaddLogixNGIcon()Add a LogixNG icon to the target(package private) voidaddMemory()Add a memory label to the Draw PanelvoidaddMultiSensor(MultiSensorIcon l)voidaddPopupItems(javax.swing.JPopupMenu popup, JmriMouseEvent event)voidaddReporter(Reporter reporter, int xx, int yy)Add a Reporter Icon to the panel.(package private) voidaddSensor()Add a sensor indicator to the Draw Panel(package private) voidaddSignalHead()Add a signal head to the Panel(package private) voidaddSignalMast()voidaddToPopUpMenu(NamedBean nb, javax.swing.JMenuItem item, int menu)Provide a method for external code to add items to context menus.voidaddTrackSegment()Add a Track SegmentvoidaddTurntable(java.awt.geom.Point2D pt)Add a layout turntable at location specifiedvoidalignLayoutToGrid()align the layout to gridvoidalignSelection(boolean alignX)voidalignSelectionToGrid()align selection to gridvoidamendSelectionGroup(LayoutShape shape)voidamendSelectionGroup(LayoutTrack track)booleancanDeletePanel()Check for conditions that prevent a delete.voidclearSelectionGroups()intcomputeDirection(LayoutTrack trk1, HitPointType h1, LayoutTrack trk2, HitPointType h2)Compute octagonal direction of vector from p1 to p2.intcomputeDirectionFromCenter(PositionablePoint p, LayoutTrack trk1, HitPointType h1)intcomputeDirectionToCenter(LayoutTrack trk1, HitPointType h1, PositionablePoint p)booleancontainsSignalHead(SignalHead head)booleancontainsSignalMast(SignalMast mast)booleandeletePanel()Invoked by DeletePanel menu item Validate user intent before deletingvoiddispose()Dispose of the editor.(package private) voidfindPositionalUsage(NamedBean bean)(package private) voidfindSegmentWhereUsed(NamedBean bean)(package private) voidfindTurnoutUsage(NamedBean bean)(package private) voidfindXingWhereUsed(NamedBean bean)LayoutBlockgetAffectedBlock(LayoutTrack track, HitPointType type)Depending on the given type, and the real class of the given LayoutTrack, determine the connected LayoutTrack.booleangetAntialiasingOn()booleangetAutoBlockAssignment()java.util.List<BlockContentsIcon>getBlockContentsLabelList()ConnectivityUtilgetConnectivityUtil()java.awt.geom.Point2DgetCoords(LayoutTrack track, HitPointType connectionType)Get the coordinates for the connection type of the specified LayoutTrack or subtype.java.awt.geom.Point2DgetCoords(LayoutTrackView trkView, HitPointType connectionType)Get the coordinates for the connection type of the specified LayoutTrackView or subtype.java.lang.StringgetDefaultAlternativeTrackColor()java.awt.ColorgetDefaultAlternativeTrackColorColor()Getter defaultAlternativeTrackColor.java.lang.StringgetDefaultOccupiedTrackColor()java.awt.ColorgetDefaultOccupiedTrackColorColor()Getter defaultOccupiedTrackColor.java.lang.StringgetDefaultTextColor()java.lang.StringgetDefaultTrackColor()java.awt.ColorgetDefaultTrackColorColor()Getter defaultTrackColor.booleangetDirectTurnoutControl()booleangetDrawGrid()LayoutEditorFindItemsgetFinder()java.util.List<GlobalVariableIcon>getGlobalVariableLabelList()booleangetHighlightSelectedBlock()java.util.List<PositionableLabel>getLabelImageList()LayoutBlockgetLayoutBlock(java.lang.String blockID)Return a layout block with the given name if one exists.LayoutEditorToolBarPanelgetLayoutEditorToolBarPanel()java.lang.StringgetLayoutName()java.util.List<LayoutShape>getLayoutShapes()java.util.List<LayoutShape>getLayoutShapeSelection()java.util.List<LayoutSlip>getLayoutSlips()LayoutSlipViewgetLayoutSlipView(LayoutSlip to)java.util.List<LayoutSlipView>getLayoutSlipViews()LayoutTrackDrawingOptionsgetLayoutTrackDrawingOptions()Getter Layout Track Drawing Options. since 4.15.6 split variable defaultTrackColor and mainlineTrackColor/sidelineTrackColor
blockDefaultColor, blockOccupiedColor and blockAlternativeColor added to LayoutTrackDrawingOptionsjava.util.List<LayoutTrack>getLayoutTracks()Read-only access to the list of LayoutTrack family objects.java.util.List<LayoutTrack>getLayoutTrackSelection()java.util.stream.Stream<LayoutTrack>getLayoutTracksOfClass(java.lang.Class<? extends LayoutTrack> layoutTrackClass)LayoutTrackViewgetLayoutTrackView(LayoutTrack trk)java.util.List<LayoutTrackView>getLayoutTrackViews()Read-only access to the list of LayoutTrackView family objects.java.util.stream.Stream<LayoutTrackView>getLayoutTrackViewsOfClass(java.lang.Class<? extends LayoutTrackView> layoutTrackViewClass)java.util.List<LayoutTurnoutView>getLayoutTurnoutAndSlipViews()java.util.List<LayoutTurnout>getLayoutTurnouts()java.util.List<LayoutTurnout>getLayoutTurnoutsAndSlips()LayoutTurnoutViewgetLayoutTurnoutView(LayoutTurnout to)java.util.List<LayoutTurnoutView>getLayoutTurnoutViews()java.util.List<LayoutTurntable>getLayoutTurntables()LayoutTurntableViewgetLayoutTurntableView(LayoutTurntable to)java.util.List<LayoutTurntableView>getLayoutTurntableViews()LayoutEditorAuxToolsgetLEAuxTools()LayoutEditorChecksgetLEChecks()LayoutEditorToolsgetLETools()java.util.List<LevelXing>getLevelXings()LevelXingViewgetLevelXingView(LevelXing xing)java.util.List<LevelXingView>getLevelXingViews()doublegetMaxZoom()getMaxZoomjava.util.List<MemoryIcon>getMemoryLabelList()doublegetMinZoom()getMinZoombooleangetOpenDispatcherOnLoad()java.awt.geom.Rectangle2DgetPanelBounds()java.util.List<PositionablePoint>getPositionablePoints()PositionablePointViewgetPositionablePointView(PositionablePoint to)java.util.List<PositionablePointView>getPositionablePointViews()java.util.List<Positionable>getPositionalSelection()booleangetScroll()java.awt.geom.Rectangle2DgetSelectionRect()java.util.List<SensorIcon>getSensorList()booleangetShowHelpBar()(package private) SignalHeadgetSignalHead(java.lang.String name)java.util.List<SignalHeadIcon>getSignalList()(package private) SignalMastgetSignalMast(java.lang.String name)java.util.List<SignalMastIcon>getSignalMastList()booleangetSnapOnAdd()booleangetSnapOnMove()jmri.jmrit.display.layoutEditor.LayoutEditor.ToolBarSidegetToolBarSide()get the toolbar sidebooleangetTooltipsInEdit()booleangetTooltipsNotEdit()java.util.List<TrackSegment>getTrackSegments()TrackSegmentViewgetTrackSegmentView(TrackSegment to)java.util.List<TrackSegmentView>getTrackSegmentViews()doublegetTurnoutBX()java.lang.StringgetTurnoutCircleColor()booleangetTurnoutCircles()intgetTurnoutCircleSize()java.lang.StringgetTurnoutCircleThrownColor()doublegetTurnoutCX()doublegetTurnoutWid()(package private) java.lang.StringgetUsageData(LayoutTrack track)java.util.List<NamedBeanUsageReport>getUsageReport(NamedBean bean)doublegetXOverHWid()doublegetXOverLong()doublegetXOverShort()doublegetZoom()getZoombooleanhighlightBlock(Block inBlock)highlight the specified blockbooleanhighlightBlockInComboBox(NamedBeanComboBox<Block> inComboBox)booleanhighlightLayoutBlock(LayoutBlock inLayoutBlock)highlight the specified layout blockvoidinit(java.lang.String name)voidinitView()After construction, initialize all the widgets to their saved config settings.booleanisAnimating()booleanisDirty()Check the dirty state.booleanisDrawLayoutTracksLabel()booleanisHighlightCursor()booleanisIncludedTurnoutSkipped()(package private) booleanisLBLockUsed(NamedBean bean, LayoutBlock lblock)booleanisTurnoutDrawUnselectedLeg()booleanisTurnoutFillControlCircles()(package private) booleanisUsedInXing(NamedBean bean, LevelXing xing, LevelXing.Geometry point)voidkeyPressed(java.awt.event.KeyEvent event)java.awt.geom.Rectangle2DlayoutEditorControlCircleRectAt(java.awt.geom.Point2D inPoint)java.awt.geom.Rectangle2DlayoutEditorControlRectAt(java.awt.geom.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(java.awt.event.MouseWheelEvent event)voidnewPanelDefaults()Set white as the default background color for panels created using the New Panel menu item.LayoutEditor.TurnoutComboBoxPopupMenuListenernewTurnoutComboBoxPopupMenuListener(NamedBeanComboBox<Turnout> comboBox)Create a listener that will exclude turnouts that are present in the current panel.LayoutEditor.TurnoutComboBoxPopupMenuListenernewTurnoutComboBoxPopupMenuListener(NamedBeanComboBox<Turnout> comboBox, java.util.List<Turnout> currentTurnouts)Create a listener that will exclude turnouts that are present in the current panel.voidpaintTargetPanel(java.awt.Graphics g)Special internal class to allow drawing of layout to a JLayeredPane This is the 'target' pane where the layout is displayedLayoutBlockprovideLayoutBlock(java.lang.String inBlockName)Return a layout block with the entered name, creating a new one if needed.voidputItem(Positionable l)voidputLocoIcon(LocoIcon l, java.lang.String name)voidputSensor(SensorIcon l)voidputSignal(SignalHeadIcon l)voidputSignalMast(SignalMastIcon l)voidredrawPanel()Allow external trigger of re-drawHiddenbooleanremoveFromContents(Positionable l)booleanremoveLayoutShape(LayoutShape s)Remove a layout shape from the list of layout shapesbooleanremoveLayoutSlip(LayoutTurnout o)Remove a slipvoidremoveLayoutTrack(LayoutTrack trk)If item present, delete from the list of LayoutTracks and force a dirty redraw.booleanremoveLayoutTrackAndRedraw(LayoutTrack trk)If item present, delete from the list of LayoutTracks and force a dirty redraw.booleanremoveLayoutTurnout(LayoutTurnout o)Remove a LayoutTurnoutbooleanremoveLevelXing(LevelXing o)Remove a Level CrossingvoidremoveMarkers()Remove marker icons from panelbooleanremovePositionablePoint(PositionablePoint o)Remove a PositionablePoint -- an Anchor or an End Bumper.voidremoveSignalHead(SignalHead head)voidremoveTrackSegment(TrackSegment o)Remove a Track SegmentbooleanremoveTurntable(LayoutTurntable o)Remove a Layout TurntablevoidresetAwaitingIconChange()voidresetDirty()Allow external reset of dirty bitvoidrotateLayout90()Rotate the entire layout by 90 degrees clockwise.voidrotateSelection90()Rotate selection by 90 degrees clockwise.booleanscaleTrack(float xFactor, float yFactor)scale all LayoutTracks coordinates by the x and y factors.voidscrollBarAdjusted(java.awt.event.AdjustmentEvent event)voidsetAllEditable(boolean editable)Control whether target panel items are editable.voidsetAllPositionable(boolean state)Control whether panel items are positionable.voidsetAllShowLayoutTurnoutToolTip(boolean state)intsetAllTracksToDefaultColors()loop 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)voidsetAwaitingIconChange()Allow external set/reset of awaitingIconChangevoidsetConnections()voidsetCurrentPositionAndSize()voidsetDefaultAlternativeTrackColor(java.awt.Color color)voidsetDefaultBackgroundColor(java.awt.Color color)voidsetDefaultOccupiedTrackColor(java.awt.Color color)voidsetDefaultTextColor(java.awt.Color color)voidsetDefaultTrackColor(java.awt.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)voidsetIncludedTurnoutSkipped(java.lang.Boolean boo)voidsetLayoutDimensions(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(java.lang.String name)voidsetLayoutTrackDrawingOptions(LayoutTrackDrawingOptions ltdo)since 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 typevoidsetNextLocation(Positionable obj)Set object location and size for icon and label object as it is created.voidsetOpenDispatcherOnLoad(java.lang.Boolean boo)voidsetPanelBounds(java.awt.geom.Rectangle2D newBounds)voidsetScroll(int state)voidsetScroll(java.lang.String value)The LE xml load uses the string version of setScroll which went directly to Editor.voidsetSelectionRect(java.awt.geom.Rectangle2D selectionRect)voidsetSelectRect(java.awt.Rectangle rectangle)booleansetShowAlignmentMenu(javax.swing.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(java.awt.Color color)voidsetTurnoutCircles(boolean state)voidsetTurnoutCircleSize(int size)voidsetTurnoutCircleThrownColor(java.awt.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.booleanshowAlignPopup(Positionable l)voidshowPopUp(Positionable pos, JmriMouseEvent event)Select the menu items to display for the Positionable's popup.voidshowToolTip(Positionable selection, JmriMouseEvent event)voidsortLayoutShapesByLevel()(package private) voidstartMultiSensor()voidtargetWindowClosingEvent(java.awt.event.WindowEvent e)The target window has been requested to close, don't delete it at this time.java.lang.StringtoString()voidtranslate(float xTranslation, float yTranslation)Translate entire layout by x and y amounts.booleantranslateTrack(float xDel, float yDel)(package private) voidundoMoveSelection()undo the move selectionjava.awt.geom.Rectangle2DunionToPanelBounds(java.awt.geom.Rectangle2D bounds)booleanvalidatePhysicalTurnout(java.lang.String inTurnoutName, java.awt.Component inOpenPane)Validates that a physical turnout exists and is unique among Layout Turnouts Returns true if valid turnout was entered, false otherwisebooleanvalidateSensor(java.lang.String sensorName, LayoutBlock blk, java.awt.Component openFrame)Validates that the supplied occupancy sensor name corresponds to an existing sensor and is unique among all blocks.voidvetoableChange(java.beans.PropertyChangeEvent evt)-
Methods inherited from class jmri.jmrit.display.panelEditor.PanelEditor
addItemPopUp, backgroundPopUp, copyItem, itemStateChanged, makeFrame, mouseExited, pasteItem, pasteItemPopUp, setBackgroundMenu, setRemoveMenu, showAddItemPopUp, showMultiSelectPopUp, showPopUp, windowClosing
-
Methods 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, useGlobalFlag
-
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, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.jmrit.display.layoutEditor.LayoutModels
computeDirectionAB, computeDirectionAC, computeDirectionAD, computeDirectionBC, computeDirectionBD, computeDirectionCD, displayRemoveWarning
-
-
-
-
Field Detail
-
SIZE
public static final double SIZE
- See Also:
- Constant Field Values
-
SIZE2
public static final double SIZE2
- See Also:
- Constant Field Values
-
turnoutCircleColor
public java.awt.Color turnoutCircleColor
-
turnoutCircleThrownColor
public java.awt.Color turnoutCircleThrownColor
-
circleRadius
public double circleRadius
-
circleDiameter
public double circleDiameter
-
selectionActive
public boolean selectionActive
-
selectionWidth
public double selectionWidth
-
selectionHeight
public double selectionHeight
-
selectedObject
public java.lang.Object selectedObject
-
prevSelectedObject
public java.lang.Object prevSelectedObject
-
foundTrack
public LayoutTrack foundTrack
-
foundTrackView
public LayoutTrackView foundTrackView
-
foundHitPointType
public HitPointType foundHitPointType
-
beginTrack
public LayoutTrack beginTrack
-
beginLocation
public java.awt.geom.Point2D beginLocation
-
currentLocation
public java.awt.geom.Point2D currentLocation
-
gContext
public final LayoutEditorViewContext gContext
-
defaultTrackColor
public java.awt.Color defaultTrackColor
-
openDispatcherOnLoad
boolean openDispatcherOnLoad
-
_positionableSelection
public java.util.List<Positionable> _positionableSelection
-
_layoutTrackSelection
public java.util.List<LayoutTrack> _layoutTrackSelection
-
_layoutShapeSelection
public java.util.List<LayoutShape> _layoutShapeSelection
-
_prevNumSel
int _prevNumSel
-
usageReport
java.util.List<NamedBeanUsageReport> usageReport
-
-
Constructor Detail
-
LayoutEditor
public LayoutEditor()
-
LayoutEditor
public LayoutEditor(@Nonnull java.lang.String name)
-
-
Method Detail
-
getLayoutEditorToolBarPanel
@Nonnull public LayoutEditorToolBarPanel getLayoutEditorToolBarPanel()
-
getSensorList
@Nonnull public java.util.List<SensorIcon> getSensorList()
-
getLabelImageList
@Nonnull public java.util.List<PositionableLabel> getLabelImageList()
-
getBlockContentsLabelList
@Nonnull public java.util.List<BlockContentsIcon> getBlockContentsLabelList()
-
getMemoryLabelList
@Nonnull public java.util.List<MemoryIcon> getMemoryLabelList()
-
getGlobalVariableLabelList
@Nonnull public java.util.List<GlobalVariableIcon> getGlobalVariableLabelList()
-
getSignalList
@Nonnull public java.util.List<SignalHeadIcon> getSignalList()
-
getSignalMastList
@Nonnull public java.util.List<SignalMastIcon> getSignalMastList()
-
getFinder
@Nonnull public LayoutEditorFindItems getFinder()
-
newPanelDefaults
public void 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
public void init(java.lang.String name)
- Overrides:
initin classPanelEditor
-
initView
public void initView()
Description copied from class:PanelEditorAfter construction, initialize all the widgets to their saved config settings.- Overrides:
initViewin classPanelEditor
-
setSize
public void setSize(int w, int h)
- Overrides:
setSizein classjava.awt.Window
-
targetWindowClosingEvent
public void targetWindowClosingEvent(java.awt.event.WindowEvent e)
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
@Nonnull public LayoutTrackDrawingOptions 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
public void setLayoutTrackDrawingOptions(LayoutTrackDrawingOptions ltdo)
since 4.15.6 split variable defaultTrackColor and mainlineTrackColor/sidelineTrackColor- Parameters:
ltdo- LayoutTrackDrawingOptions object
-
getToolBarSide
public jmri.jmrit.display.layoutEditor.LayoutEditor.ToolBarSide getToolBarSide()
get the toolbar side- Returns:
- the side where to put the tool bar
-
setToolBarSide
public void setToolBarSide(jmri.jmrit.display.layoutEditor.LayoutEditor.ToolBarSide newToolBarSide)
set the tool bar side- Parameters:
newToolBarSide- on which side to put the toolbar
-
scrollBarAdjusted
public void scrollBarAdjusted(java.awt.event.AdjustmentEvent event)
-
mouseWheelMoved
public void mouseWheelMoved(@Nonnull java.awt.event.MouseWheelEvent event)
- Specified by:
mouseWheelMovedin interfacejava.awt.event.MouseWheelListener
-
setZoom
public double setZoom(double zoomFactor)
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
public double getZoom()
getZoom- Returns:
- the zooming scale
-
getMinZoom
public double getMinZoom()
getMinZoom- Returns:
- the minimum zoom scale
-
getMaxZoom
public double getMaxZoom()
getMaxZoom- Returns:
- the maximum zoom scale
-
isIncludedTurnoutSkipped
public boolean isIncludedTurnoutSkipped()
-
setIncludedTurnoutSkipped
public void setIncludedTurnoutSkipped(java.lang.Boolean boo)
-
getOpenDispatcherOnLoad
public boolean getOpenDispatcherOnLoad()
-
setOpenDispatcherOnLoad
public void setOpenDispatcherOnLoad(java.lang.Boolean boo)
-
removeMarkers
public void removeMarkers()
Remove marker icons from panel- Overrides:
removeMarkersin classEditor
-
translateTrack
public boolean translateTrack(float xDel, float yDel)
-
scaleTrack
public boolean scaleTrack(float xFactor, float yFactor)
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
public int setAllTracksToDefaultColors()
loop through all LayoutBlocks and set colors to the default colors from this LayoutEditor- Returns:
- count of changed blocks
-
translate
public void translate(float xTranslation, float yTranslation)
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
public void rotateSelection90()
Rotate selection by 90 degrees clockwise.
-
rotateLayout90
public void rotateLayout90()
Rotate the entire layout by 90 degrees clockwise.
-
alignLayoutToGrid
public void alignLayoutToGrid()
align the layout to grid
-
alignSelectionToGrid
public void alignSelectionToGrid()
align selection to grid
-
setCurrentPositionAndSize
public void setCurrentPositionAndSize()
-
setScroll
public void setScroll(java.lang.String value)
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
public void addTurntable(@Nonnull java.awt.geom.Point2D pt)
Add a layout turntable at location specified- Parameters:
pt- x,y placement for turntable
-
redrawPanel
public void redrawPanel()
Allow external trigger of re-drawHidden- Specified by:
redrawPanelin interfaceLayoutModels
-
setAwaitingIconChange
public void setAwaitingIconChange()
Allow external set/reset of awaitingIconChange
-
resetAwaitingIconChange
public void resetAwaitingIconChange()
-
resetDirty
public void resetDirty()
Allow external reset of dirty bit
-
setDirty
public void setDirty(boolean val)
Allow external set of dirty bit- Parameters:
val- true/false for panelChanged
-
setDirty
public void setDirty()
- Specified by:
setDirtyin interfaceLayoutModels
-
isDirty
public boolean isDirty()
Check the dirty state.- Specified by:
isDirtyin interfaceLayoutModels- Returns:
- true if panel has changed
-
mousePressed
public void mousePressed(JmriMouseEvent event)
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
@Nonnull public java.awt.geom.Point2D getCoords(@Nonnull LayoutTrack track, HitPointType connectionType)
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
@Nonnull public java.awt.geom.Point2D getCoords(@Nonnull LayoutTrackView trkView, HitPointType connectionType)
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
public void mouseReleased(JmriMouseEvent event)
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
public void addPopupItems(@Nonnull javax.swing.JPopupMenu popup, @Nonnull JmriMouseEvent event)
-
showPopUp
public void showPopUp(@Nonnull Positionable pos, @Nonnull JmriMouseEvent event)
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
public void mouseClicked(@Nonnull JmriMouseEvent event)
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
@Nonnull public java.util.List<Positionable> getPositionalSelection()
-
getLayoutTrackSelection
@Nonnull public java.util.List<LayoutTrack> getLayoutTrackSelection()
-
getLayoutShapeSelection
@Nonnull public java.util.List<LayoutShape> getLayoutShapeSelection()
-
clearSelectionGroups
public void clearSelectionGroups()
-
amendSelectionGroup
public void amendSelectionGroup(@Nonnull LayoutTrack track)
-
amendSelectionGroup
public void amendSelectionGroup(@Nonnull LayoutShape shape)
-
alignSelection
public void alignSelection(boolean alignX)
-
setShowAlignmentMenu
public boolean setShowAlignmentMenu(@Nonnull javax.swing.JPopupMenu popup)
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
public void keyPressed(@Nonnull java.awt.event.KeyEvent event)
- Specified by:
keyPressedin interfacejava.awt.event.KeyListener- Overrides:
keyPressedin classEditor
-
mouseMoved
public void mouseMoved(@Nonnull 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- Overrides:
mouseMovedin classPanelEditor- Parameters:
event- the event to be processed
-
setAllShowLayoutTurnoutToolTip
public void setAllShowLayoutTurnoutToolTip(boolean state)
-
mouseDragged
public void mouseDragged(@Nonnull 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- Overrides:
mouseDraggedin classPanelEditor- Parameters:
event- the event to be processed
-
mouseEntered
public void mouseEntered(@Nonnull JmriMouseEvent event)
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
public void addAnchor()
Add an Anchor point.
-
addAnchor
@Nonnull public PositionablePoint addAnchor(@Nonnull java.awt.geom.Point2D point)
-
addEndBumper
public void addEndBumper()
Add an End Bumper point.
-
addEdgeConnector
public void addEdgeConnector()
Add an Edge Connector point.
-
addTrackSegment
public void addTrackSegment()
Add a Track Segment
-
addLevelXing
public void addLevelXing()
Add a Level Crossing
-
addLayoutSlip
public void addLayoutSlip(LayoutTurnout.TurnoutType type)
Add a LayoutSlip- Parameters:
type- the slip type
-
addLayoutTurnout
public void addLayoutTurnout(LayoutTurnout.TurnoutType type)
Add a Layout Turnout- Parameters:
type- the turnout type
-
validatePhysicalTurnout
public boolean validatePhysicalTurnout(@Nonnull java.lang.String inTurnoutName, @CheckForNull java.awt.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
public LayoutBlock provideLayoutBlock(@Nonnull java.lang.String inBlockName)
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 java.lang.String sensorName, @Nonnull LayoutBlock blk, @Nonnull java.awt.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
public LayoutBlock getLayoutBlock(@Nonnull java.lang.String blockID)
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
public boolean removeFromContents(@Nonnull Positionable l)
- Overrides:
removeFromContentsin classEditor
-
removePositionablePoint
public boolean removePositionablePoint(@Nonnull PositionablePoint o)
Remove a PositionablePoint -- an Anchor or an End Bumper.- Parameters:
o- the PositionablePoint to remove- Returns:
- true if removed
-
removeLayoutTurnout
public boolean removeLayoutTurnout(@Nonnull LayoutTurnout o)
Remove a LayoutTurnout- Parameters:
o- the LayoutTurnout to remove- Returns:
- true if removed
-
removeLevelXing
public boolean removeLevelXing(@Nonnull LevelXing o)
Remove a Level Crossing- Parameters:
o- the LevelXing to remove- Returns:
- true if removed
-
removeLayoutSlip
public boolean removeLayoutSlip(@Nonnull LayoutTurnout o)
Remove a slip- Parameters:
o- the LayoutSlip to remove- Returns:
- true if removed
-
removeTurntable
public boolean removeTurntable(@Nonnull LayoutTurntable o)
Remove a Layout Turntable- Parameters:
o- the LayoutTurntable to remove- Returns:
- true if removed
-
removeTrackSegment
public void removeTrackSegment(@Nonnull TrackSegment o)
Remove a Track Segment- Parameters:
o- the TrackSegment to remove
-
getAffectedBlock
public LayoutBlock getAffectedBlock(@Nonnull LayoutTrack track, HitPointType type)
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
public void putSensor(@Nonnull SensorIcon l)
-
addSignalHead
void addSignalHead()
Add a signal head to the Panel
-
putSignal
public void putSignal(@Nonnull SignalHeadIcon l)
-
getSignalHead
@CheckForNull SignalHead getSignalHead(@Nonnull java.lang.String name)
-
containsSignalHead
public boolean containsSignalHead(@CheckForNull SignalHead head)
-
removeSignalHead
public void removeSignalHead(@CheckForNull SignalHead head)
-
addSignalMast
void addSignalMast()
-
putSignalMast
public void putSignalMast(@Nonnull SignalMastIcon l)
-
getSignalMast
SignalMast getSignalMast(@Nonnull java.lang.String name)
-
containsSignalMast
public boolean containsSignalMast(@Nonnull SignalMast mast)
-
addLabel
void addLabel()
Add a label to the Draw Panel
-
putItem
public void putItem(@Nonnull Positionable l) throws Positionable.DuplicateIdException
- Overrides:
putItemin classPanelEditor- Throws:
Positionable.DuplicateIdException
-
addMemory
void addMemory()
Add a memory label to the Draw Panel
-
addGlobalVariable
void addGlobalVariable()
-
addBlockContents
void addBlockContents()
-
addReporter
public void addReporter(@Nonnull Reporter reporter, int xx, int yy)
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
public LocoIcon addLocoIcon(@Nonnull java.lang.String name)
Add a loco marker to the target- Overrides:
addLocoIconin classEditor
-
putLocoIcon
public void putLocoIcon(@Nonnull LocoIcon l, @Nonnull java.lang.String name)
- Overrides:
putLocoIconin classEditor
-
addBackground
public void addBackground()
Add a background image
-
removeLayoutShape
public boolean removeLayoutShape(@Nonnull LayoutShape s)
Remove a layout shape from the list of layout shapes- Parameters:
s- the LayoutShape to add- Returns:
- true if added
-
startMultiSensor
void startMultiSensor()
-
addMultiSensor
public void addMultiSensor(@Nonnull MultiSensorIcon l)
-
setNextLocation
public void setNextLocation(@Nonnull Positionable obj)
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
@Nonnull public ConnectivityUtil getConnectivityUtil()
-
getLETools
@Nonnull public LayoutEditorTools getLETools()
-
getLEAuxTools
@Nonnull public LayoutEditorAuxTools getLEAuxTools()
- Specified by:
getLEAuxToolsin interfaceLayoutModels
-
getLEChecks
@Nonnull public LayoutEditorChecks getLEChecks()
-
deletePanel
public boolean deletePanel()
Invoked by DeletePanel menu item Validate user intent before deleting- Overrides:
deletePanelin classEditor- Returns:
- true if panel should be deleted.
-
canDeletePanel
public boolean 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
public void setAllEditable(boolean editable)
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
public void setAllPositionable(boolean state)
Control whether panel items are positionable. Markers are always positionable.- Overrides:
setAllPositionablein classEditor- Parameters:
state- true for positionable.
-
setTurnoutAnimation
public void setTurnoutAnimation(boolean state)
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
public boolean isAnimating()
-
getScroll
public boolean getScroll()
-
getDefaultTrackColor
public java.lang.String getDefaultTrackColor()
-
getDefaultTrackColorColor
@Nonnull public java.awt.Color getDefaultTrackColorColor()
Getter defaultTrackColor.- Returns:
- block default color as Color
-
getDefaultOccupiedTrackColor
@Nonnull public java.lang.String getDefaultOccupiedTrackColor()
-
getDefaultOccupiedTrackColorColor
@Nonnull public java.awt.Color getDefaultOccupiedTrackColorColor()
Getter defaultOccupiedTrackColor.- Returns:
- block default occupied color as Color
-
getDefaultAlternativeTrackColor
@Nonnull public java.lang.String getDefaultAlternativeTrackColor()
-
getDefaultAlternativeTrackColorColor
@Nonnull public java.awt.Color getDefaultAlternativeTrackColorColor()
Getter defaultAlternativeTrackColor.- Returns:
- block default alternative color as Color
-
getDefaultTextColor
@Nonnull public java.lang.String getDefaultTextColor()
-
getTurnoutCircleColor
@Nonnull public java.lang.String getTurnoutCircleColor()
-
getTurnoutCircleThrownColor
@Nonnull public java.lang.String getTurnoutCircleThrownColor()
-
isTurnoutFillControlCircles
public boolean isTurnoutFillControlCircles()
-
getTurnoutCircleSize
public int getTurnoutCircleSize()
-
isTurnoutDrawUnselectedLeg
public boolean isTurnoutDrawUnselectedLeg()
-
isHighlightCursor
public boolean isHighlightCursor()
-
getLayoutName
public java.lang.String getLayoutName()
-
getShowHelpBar
public boolean getShowHelpBar()
-
getDrawGrid
public boolean getDrawGrid()
-
getSnapOnAdd
public boolean getSnapOnAdd()
-
getSnapOnMove
public boolean getSnapOnMove()
-
getAntialiasingOn
public boolean getAntialiasingOn()
-
isDrawLayoutTracksLabel
public boolean isDrawLayoutTracksLabel()
-
getHighlightSelectedBlock
public boolean getHighlightSelectedBlock()
-
getTurnoutCircles
public boolean getTurnoutCircles()
-
getTooltipsNotEdit
public boolean getTooltipsNotEdit()
-
getTooltipsInEdit
public boolean getTooltipsInEdit()
-
getAutoBlockAssignment
public boolean 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
@Nonnull public java.awt.geom.Rectangle2D getPanelBounds()
-
setPanelBounds
public void setPanelBounds(@Nonnull java.awt.geom.Rectangle2D newBounds)
-
unionToPanelBounds
@Nonnull public java.awt.geom.Rectangle2D unionToPanelBounds(@Nonnull java.awt.geom.Rectangle2D bounds)
-
setDefaultTrackColor
public void setDefaultTrackColor(@Nonnull java.awt.Color color)
- Parameters:
color- value to set the default track color to.
-
setDefaultOccupiedTrackColor
public void setDefaultOccupiedTrackColor(@Nonnull java.awt.Color color)
- Parameters:
color- value to set the default occupied track color to.
-
setDefaultAlternativeTrackColor
public void setDefaultAlternativeTrackColor(@Nonnull java.awt.Color color)
- Parameters:
color- value to set the default alternate track color to.
-
setTurnoutCircleColor
public void setTurnoutCircleColor(@CheckForNull java.awt.Color color)
- Parameters:
color- new color for turnout circle.
-
setTurnoutCircleThrownColor
public void setTurnoutCircleThrownColor(@CheckForNull java.awt.Color color)
- Parameters:
color- new color for turnout circle.
-
setTurnoutFillControlCircles
@InvokeOnGuiThread public void setTurnoutFillControlCircles(boolean state)
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to fill in turnout control circles, else false.
-
setTurnoutCircleSize
public void setTurnoutCircleSize(int size)
-
setTurnoutDrawUnselectedLeg
@InvokeOnGuiThread public void setTurnoutDrawUnselectedLeg(boolean state)
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to draw unselected legs, else false.
-
setHighlightCursor
@InvokeOnGuiThread public void setHighlightCursor(boolean state)
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to enable highlighting the cursor (mouse/finger press/drag)
-
setDefaultTextColor
public void setDefaultTextColor(@Nonnull java.awt.Color color)
- Parameters:
color- value to set the default text color to.
-
setDefaultBackgroundColor
public void setDefaultBackgroundColor(@Nonnull java.awt.Color color)
- Parameters:
color- value to set the panel background to.
-
setLayoutName
public void setLayoutName(@Nonnull java.lang.String name)
-
setShowHelpBar
@InvokeOnGuiThread public void setShowHelpBar(boolean state)
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to show the help bar, else false.
-
setDrawGrid
@InvokeOnGuiThread public void setDrawGrid(boolean state)
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to show the draw grid, else false.
-
setSnapOnAdd
@InvokeOnGuiThread public void setSnapOnAdd(boolean state)
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to set snap to grid on add, else false.
-
setSnapOnMove
@InvokeOnGuiThread public void setSnapOnMove(boolean state)
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to set snap on move, else false.
-
setAntialiasingOn
@InvokeOnGuiThread public void setAntialiasingOn(boolean state)
Should only be invoked on the GUI (Swing) thread.- Parameters:
state- true to set anti-aliasing flag on, else false.
-
setDrawLayoutTracksLabel
public void setDrawLayoutTracksLabel(boolean state)
- Parameters:
state- true to set anti-aliasing flag on, else false.
-
setHighlightSelectedBlock
public void setHighlightSelectedBlock(boolean state)
-
highlightBlockInComboBox
public boolean highlightBlockInComboBox(@Nonnull NamedBeanComboBox<Block> inComboBox)
-
highlightBlock
public boolean highlightBlock(@CheckForNull Block inBlock)
highlight the specified block- Parameters:
inBlock- the block- Returns:
- true if block was highlighted
-
highlightLayoutBlock
public boolean highlightLayoutBlock(@Nonnull LayoutBlock inLayoutBlock)
highlight the specified layout block- Parameters:
inLayoutBlock- the layout block- Returns:
- true if layout block was highlighted
-
setTurnoutCircles
public void setTurnoutCircles(boolean state)
-
setAutoBlockAssignment
public void setAutoBlockAssignment(boolean boo)
-
setTooltipsNotEdit
public void setTooltipsNotEdit(boolean state)
-
setTooltipsInEdit
public void setTooltipsInEdit(boolean state)
-
setTurnoutBX
public void setTurnoutBX(double bx)
-
getTurnoutBX
public double getTurnoutBX()
-
setTurnoutCX
public void setTurnoutCX(double cx)
-
getTurnoutCX
public double getTurnoutCX()
-
setTurnoutWid
public void setTurnoutWid(double wid)
-
getTurnoutWid
public double getTurnoutWid()
-
setXOverLong
public void setXOverLong(double lg)
-
getXOverLong
public double getXOverLong()
-
setXOverHWid
public void setXOverHWid(double hwid)
-
getXOverHWid
public double getXOverHWid()
-
setXOverShort
public void setXOverShort(double sh)
-
getXOverShort
public double getXOverShort()
-
setDirectTurnoutControl
public void setDirectTurnoutControl(boolean boo)
-
getDirectTurnoutControl
public boolean getDirectTurnoutControl()
-
setConnections
public void setConnections()
-
layoutEditorControlRectAt
@Nonnull public java.awt.geom.Rectangle2D layoutEditorControlRectAt(@Nonnull java.awt.geom.Point2D inPoint)
-
layoutEditorControlCircleRectAt
@Nonnull public java.awt.geom.Rectangle2D layoutEditorControlCircleRectAt(@Nonnull java.awt.geom.Point2D inPoint)
-
paintTargetPanel
public void paintTargetPanel(@Nonnull java.awt.Graphics g)
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
@Nonnull public java.awt.geom.Rectangle2D getSelectionRect()
-
setSelectionRect
public void setSelectionRect(@Nonnull java.awt.geom.Rectangle2D selectionRect)
-
setSelectRect
public void setSelectRect(java.awt.Rectangle rectangle)
-
getLayoutTracksOfClass
@Nonnull public java.util.stream.Stream<LayoutTrack> getLayoutTracksOfClass(java.lang.Class<? extends LayoutTrack> layoutTrackClass)
- Specified by:
getLayoutTracksOfClassin interfaceLayoutModels
-
getLayoutTrackViewsOfClass
@Nonnull public java.util.stream.Stream<LayoutTrackView> getLayoutTrackViewsOfClass(java.lang.Class<? extends LayoutTrackView> layoutTrackViewClass)
- Specified by:
getLayoutTrackViewsOfClassin interfaceLayoutModels
-
getPositionablePointViews
@Nonnull public java.util.List<PositionablePointView> getPositionablePointViews()
- Specified by:
getPositionablePointViewsin interfaceLayoutModels
-
getPositionablePoints
@Nonnull public java.util.List<PositionablePoint> getPositionablePoints()
- Specified by:
getPositionablePointsin interfaceLayoutModels
-
getLayoutSlipViews
@Nonnull public java.util.List<LayoutSlipView> getLayoutSlipViews()
-
getLayoutSlips
@Nonnull public java.util.List<LayoutSlip> getLayoutSlips()
- Specified by:
getLayoutSlipsin interfaceLayoutModels
-
getTrackSegmentViews
@Nonnull public java.util.List<TrackSegmentView> getTrackSegmentViews()
- Specified by:
getTrackSegmentViewsin interfaceLayoutModels
-
getTrackSegments
@Nonnull public java.util.List<TrackSegment> getTrackSegments()
- Specified by:
getTrackSegmentsin interfaceLayoutModels
-
getLayoutTurnoutViews
@Nonnull public java.util.List<LayoutTurnoutView> getLayoutTurnoutViews()
-
getLayoutTurnouts
@Nonnull public java.util.List<LayoutTurnout> getLayoutTurnouts()
- Specified by:
getLayoutTurnoutsin interfaceLayoutModels
-
getLayoutTurntables
@Nonnull public java.util.List<LayoutTurntable> getLayoutTurntables()
- Specified by:
getLayoutTurntablesin interfaceLayoutModels
-
getLayoutTurntableViews
@Nonnull public java.util.List<LayoutTurntableView> getLayoutTurntableViews()
-
getLevelXings
@Nonnull public java.util.List<LevelXing> getLevelXings()
- Specified by:
getLevelXingsin interfaceLayoutModels
-
getLevelXingViews
@Nonnull public java.util.List<LevelXingView> getLevelXingViews()
- Specified by:
getLevelXingViewsin interfaceLayoutModels
-
getLayoutTracks
@Nonnull public final java.util.List<LayoutTrack> 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
@Nonnull public java.util.List<LayoutTurnoutView> getLayoutTurnoutAndSlipViews()
-
getLayoutTurnoutsAndSlips
@Nonnull public java.util.List<LayoutTurnout> getLayoutTurnoutsAndSlips()
- Specified by:
getLayoutTurnoutsAndSlipsin interfaceLayoutModels
-
getLayoutTrackViews
@Nonnull public final java.util.List<LayoutTrackView> 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
public final LayoutTrackView getLayoutTrackView(LayoutTrack trk)
- Specified by:
getLayoutTrackViewin interfaceLayoutModels
-
getLevelXingView
public final LevelXingView getLevelXingView(LevelXing xing)
- Specified by:
getLevelXingViewin interfaceLayoutModels
-
getLayoutTurnoutView
public final LayoutTurnoutView getLayoutTurnoutView(LayoutTurnout to)
- Specified by:
getLayoutTurnoutViewin interfaceLayoutModels
-
getLayoutTurntableView
public final LayoutTurntableView getLayoutTurntableView(LayoutTurntable to)
- Specified by:
getLayoutTurntableViewin interfaceLayoutModels
-
getLayoutSlipView
public final LayoutSlipView getLayoutSlipView(LayoutSlip to)
-
getTrackSegmentView
public final TrackSegmentView getTrackSegmentView(TrackSegment to)
- Specified by:
getTrackSegmentViewin interfaceLayoutModels
-
getPositionablePointView
public final PositionablePointView getPositionablePointView(PositionablePoint to)
- Specified by:
getPositionablePointViewin interfaceLayoutModels
-
addLayoutTrack
public final void addLayoutTrack(@Nonnull LayoutTrack trk, @Nonnull LayoutTrackView v)
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
public final boolean removeLayoutTrackAndRedraw(@Nonnull LayoutTrack trk)
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
public final void removeLayoutTrack(@Nonnull LayoutTrack trk)
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
@Nonnull public java.util.List<LayoutShape> getLayoutShapes()
- Specified by:
getLayoutShapesin interfaceLayoutModels
-
sortLayoutShapesByLevel
public void sortLayoutShapesByLevel()
-
computeDirection
public int computeDirection(LayoutTrack trk1, HitPointType h1, LayoutTrack trk2, HitPointType h2)
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
public boolean showAlignPopup(@Nonnull Positionable l)
- Overrides:
showAlignPopupin classEditor
-
showToolTip
public void showToolTip(@Nonnull Positionable selection, @Nonnull JmriMouseEvent event)
- Overrides:
showToolTipin classEditor
-
addToPopUpMenu
public void addToPopUpMenu(@Nonnull NamedBean nb, @Nonnull javax.swing.JMenuItem item, int menu)
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
@Nonnull public java.lang.String toString()
- Overrides:
toStringin classjava.awt.Component
-
vetoableChange
public void vetoableChange(@Nonnull java.beans.PropertyChangeEvent evt) throws java.beans.PropertyVetoException
- Specified by:
vetoableChangein interfacejava.beans.VetoableChangeListener- Overrides:
vetoableChangein classEditor- Throws:
java.beans.PropertyVetoException
-
dispose
public void 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, java.util.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
public java.util.List<NamedBeanUsageReport> getUsageReport(NamedBean bean)
- Overrides:
getUsageReportin classEditor
-
findTurnoutUsage
void findTurnoutUsage(NamedBean bean)
-
findPositionalUsage
void findPositionalUsage(NamedBean bean)
-
findSegmentWhereUsed
void findSegmentWhereUsed(NamedBean bean)
-
findXingWhereUsed
void findXingWhereUsed(NamedBean bean)
-
getUsageData
java.lang.String getUsageData(LayoutTrack track)
-
isLBLockUsed
boolean isLBLockUsed(NamedBean bean, LayoutBlock lblock)
-
isUsedInXing
boolean isUsedInXing(NamedBean bean, LevelXing xing, LevelXing.Geometry point)
-
-