Package jmri.jmrit.display
Class SlipTurnoutIcon
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JLabel
-
- jmri.jmrit.display.PositionableLabel
-
- jmri.jmrit.display.SlipTurnoutIcon
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.beans.PropertyChangeListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.accessibility.Accessible,javax.swing.SwingConstants,Positionable,InlineLogixNG
public class SlipTurnoutIcon extends PositionableLabel implements java.beans.PropertyChangeListener
An icon to display a status of a Slip, either Single or Double.This responds to only KnownState, leaving CommandedState to some other graphic representation later.
A click on the icon will command a state change. Specifically, it will set the CommandedState to the opposite (THROWN vs CLOSED) of the current KnownState.
Note: lower west to lower east icon is used for storing the slip icon, in a single slip, even if the slip is set for upper west to upper east.
With a 3-Way point we use the following translations
- lower west to upper east - to upper exit
- upper west to lower east - to middle exit
- lower west to lower east - to lower exit
- west Turnout - First Turnout
- east Turnout - Second Turnout
- singleSlipRoute - translates to which exit the first turnout goes to
- true if upper, or false if lower
Based upon the TurnoutIcon by Bob Jacobsen
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.display.PositionableLabel
PositionableLabel.PaletteFrameCloser
-
Nested classes/interfaces inherited from class javax.swing.JLabel
javax.swing.JLabel.AccessibleJLabel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
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.jmrit.display.Positionable
Positionable.DuplicateIdException
-
-
Field Summary
Fields Modifier and Type Field Description (package private) SlipIconAdder_iconEditor(package private) booleanbusystatic intDOUBLESLIPConstant used to refer to a Double Slip Configuration.static intEASTConstant used to refer to the Turnout address configured to operate the east (or second for a three way) of the Turnout.(package private) NamedIconinconsistent(package private) java.lang.StringinconsistentLNamestatic intLOWEREASTConstant used for a scissor crossing using 4 turnout address, and refers to the turnout located at the lower east.static intLOWERWESTConstant used for a scissor crossing using 4 turnout address, and refers to the turnout located at the lower west.(package private) NamedIconlowerWestToLowerEast(package private) java.lang.StringlowerWestToLowerEastLName(package private) java.lang.StringlowerWestToLowerEastText(package private) NamedIconlowerWestToUpperEast(package private) java.lang.StringlowerWestToUpperEastLName(package private) java.lang.StringlowerWestToUpperEastTextstatic intSCISSORConstant used to refer to a Scissor (Double Crossover) Configuration.static intSINGLESLIPConstant used to refer to a Single Slip Configuration.static intTHREEWAYConstant used to refer to a Three Way Turnout Configuration.(package private) javax.swing.JCheckBoxMenuItemtristateItem(package private) NamedIconunknown(package private) java.lang.StringunknownLName(package private) NamedIconupperWestToLowerEast(package private) java.lang.StringupperWestToLowerEastLName(package private) java.lang.StringupperWestToLowerEastText(package private) NamedIconupperWestToUpperEast(package private) java.lang.StringupperWestToUpperEastLName(package private) java.lang.StringupperWestToUpperEastTextstatic intWESTConstant used to refer to the Turnout address configured to operate the west (or first for a three way) of the Turnout.-
Fields inherited from class jmri.jmrit.display.PositionableLabel
_control, _controlling, _displayLevel, _editable, _editor, _emptyHidden, _hidden, _icon, _iconEditorFrame, _iconItemPanel, _itemPanel, _namedIcon, _paletteFrame, _popupUtil, _positionable, _rotateText, _showTooltip, _text, _tooltip, _unRotatedText, _valueEditDisabled, _viewCoordinates, active, disableItem
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description SlipTurnoutIcon(Editor editor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddTristateEntry(javax.swing.JPopupMenu popup)voiddispose()Clean up when this object is no longer needed.voiddoMouseClicked(JmriMouseEvent e)Throw the turnout when the icon is clicked.protected voidedit()NamedIcongetInconsistentIcon()NamedIcongetLowerWestToLowerEastIcon()NamedIcongetLowerWestToUpperEastIcon()java.lang.StringgetLWLEText()Get the text used in the pop-up for setting the route from Lower West to Lower East.java.lang.StringgetLWUEText()Get the text used in the pop-up for setting the route from Lower West to Upper East.NamedBeanHandle<Turnout>getNamedTurnout(int turn)Returns the turnout located at the position specified.java.lang.StringgetNameString()Get the name of the positional as a String.booleangetSingleSlipRoute()Single Slip Route, determines if the slip route is from upper west to upper east (true) or lower west to lower east (false) This also doubles up for the three way and determines if the first turnout routes to the upper (true) or lower (false) exit point.booleangetTristate()TurnoutgetTurnout(int turn)Returns the turnout located at the position specified.protected java.util.HashMap<Turnout,java.lang.Integer>getTurnoutSettings()intgetTurnoutType()java.lang.StringgetTypeString()Get the type of the positional as a String.NamedIcongetUnknownIcon()NamedIcongetUpperWestToLowerEastIcon()NamedIcongetUpperWestToUpperEastIcon()java.lang.StringgetUWLEText()Get the text used in the pop-up for setting the route from Upper West to Lower East.java.lang.StringgetUWUEText()Get the text used in the pop-up for setting the route from Upper West to Upper East.protected booleanisSlipBusy()Check if Slip is busy.intmaxHeight()intmaxWidth()voidpropertyChange(java.beans.PropertyChangeEvent e)Update icon as state of turnout changes.protected voidreset()voidrotate(int deg)protected voidrotateOrthogonal()****** popup AbstractAction.actionPerformed method overrides ********voidsetInconsistentIcon(NamedIcon i)voidsetLowerWestToLowerEastIcon(NamedIcon i)voidsetLowerWestToUpperEastIcon(NamedIcon i)voidsetLWLEText(java.lang.String txt)voidsetLWUEText(java.lang.String txt)voidsetScale(double s)voidsetSingleSlipRoute(boolean route)protected voidsetSlipBusy()Set Slip busy when commands are being issued to Slip turnouts.protected voidsetSlipNotBusy()Set Slip not busy when all commands have been issued to Slip turnouts.booleansetTextEditMenu(javax.swing.JPopupMenu popup)Add additional menu items to the menu.voidsetTristate(boolean set)voidsetTurnout(java.lang.String pName, int turn)Attach a named turnout to this display item.voidsetTurnout(NamedBeanHandle<Turnout> to, int turn)Attach a namedBean Handle turnout to this display item.voidsetTurnoutType(int slip)Sets the type of turnout configuration which is being usedvoidsetUnknownIcon(NamedIcon i)voidsetUpperWestToLowerEastIcon(NamedIcon i)voidsetUpperWestToUpperEastIcon(NamedIcon i)voidsetUWLEText(java.lang.String txt)voidsetUWUEText(java.lang.String txt)booleanshowPopUp(javax.swing.JPopupMenu popup)Display a popup menu to select a given state, rather than cycling through each state.voidslipTurnoutTextEdit(java.lang.String name)(package private) voidupdateTurnout()-
Methods inherited from class jmri.jmrit.display.PositionableLabel
addClass, cloneIcon, deepClone, doMouseDragged, doMouseEntered, doMouseExited, doMouseMoved, doMousePressed, doMouseReleased, doViemMenu, editIcon, editIconItem, editTextItem, finishClone, finishItemUpdate, getClasses, getDegrees, getDisplayLevel, getEditor, getHeight, getId, getLogixNG, getNamedBean, getPopupUtility, getScale, getSize, getTextComponent, getToolTip, getUnRotatedText, getViewCoordinates, getWidth, initPaletteFrame, isActive, isBackground, isControl, isControlling, isEditable, isEmptyHidden, isHidden, isIcon, isPositionable, isRotated, isText, isValueEditDisabled, makeIconEditorFrame, makePaletteFrame, makeTextOverlaidIcon, maxHeightTrue, maxWidthTrue, paintComponent, remove, removeAllClasses, removeClass, setControlling, setDegrees, setDisableControlMenu, setDisplayLevel, setEditable, setEditIconMenu, setEditItemMenu, setEditor, setEditTextItemMenu, setEmptyHidden, setHidden, setIcon, setId, setLevel, setLogixNG, setLogixNG_SystemName, setPopupUtility, setPositionable, setRotateMenu, setRotateOrthogonalMenu, setScaleMenu, setShowToolTip, setSuperText, setText, setToolTip, setUnRotatedText, setupLogixNG, setValueEditDisabled, setViewCoordinates, showEmptyHidden, showHidden, showToolTip, storeItem, updateIcon, updateSize, updateTextItem
-
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, 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.Positionable
contains, getBackground, getBounds, getEditorName, getFont, getForeground, getLocation, getParent, getPreferredSize, getTypeName, getX, getY, invalidate, isOpaque, repaint, requestFocusInWindow, setBackground, setBorder, setForeground, setLocation, setLocation, setOpaque, setSize, setVisible
-
-
-
-
Field Detail
-
WEST
public static final int WEST
Constant used to refer to the Turnout address configured to operate the west (or first for a three way) of the Turnout.- See Also:
- Constant Field Values
-
EAST
public static final int EAST
Constant used to refer to the Turnout address configured to operate the east (or second for a three way) of the Turnout.- See Also:
- Constant Field Values
-
LOWERWEST
public static final int LOWERWEST
Constant used for a scissor crossing using 4 turnout address, and refers to the turnout located at the lower west.- See Also:
- Constant Field Values
-
LOWEREAST
public static final int LOWEREAST
Constant used for a scissor crossing using 4 turnout address, and refers to the turnout located at the lower east.- See Also:
- Constant Field Values
-
DOUBLESLIP
public static final int DOUBLESLIP
Constant used to refer to a Double Slip Configuration.- See Also:
- Constant Field Values
-
SINGLESLIP
public static final int SINGLESLIP
Constant used to refer to a Single Slip Configuration.- See Also:
- Constant Field Values
-
THREEWAY
public static final int THREEWAY
Constant used to refer to a Three Way Turnout Configuration.- See Also:
- Constant Field Values
-
SCISSOR
public static final int SCISSOR
Constant used to refer to a Scissor (Double Crossover) Configuration.- See Also:
- Constant Field Values
-
lowerWestToUpperEastLName
java.lang.String lowerWestToUpperEastLName
-
lowerWestToUpperEast
NamedIcon lowerWestToUpperEast
-
upperWestToLowerEastLName
java.lang.String upperWestToLowerEastLName
-
upperWestToLowerEast
NamedIcon upperWestToLowerEast
-
lowerWestToLowerEastLName
java.lang.String lowerWestToLowerEastLName
-
lowerWestToLowerEast
NamedIcon lowerWestToLowerEast
-
upperWestToUpperEastLName
java.lang.String upperWestToUpperEastLName
-
upperWestToUpperEast
NamedIcon upperWestToUpperEast
-
inconsistentLName
java.lang.String inconsistentLName
-
inconsistent
NamedIcon inconsistent
-
unknownLName
java.lang.String unknownLName
-
tristateItem
javax.swing.JCheckBoxMenuItem tristateItem
-
lowerWestToUpperEastText
java.lang.String lowerWestToUpperEastText
-
upperWestToLowerEastText
java.lang.String upperWestToLowerEastText
-
lowerWestToLowerEastText
java.lang.String lowerWestToLowerEastText
-
upperWestToUpperEastText
java.lang.String upperWestToUpperEastText
-
_iconEditor
SlipIconAdder _iconEditor
-
busy
boolean busy
-
-
Constructor Detail
-
SlipTurnoutIcon
public SlipTurnoutIcon(Editor editor)
-
-
Method Detail
-
setTurnout
public void setTurnout(java.lang.String pName, int turn)
Attach a named turnout to this display item.- Parameters:
pName- Used as a system/user name to lookup the turnout objectturn- is used to determine which turnout position this is for. 0x01 - West 0x02 - East 0x04 - Lower West 0x06 - Upper East
-
setTurnout
public void setTurnout(NamedBeanHandle<Turnout> to, int turn)
Attach a namedBean Handle turnout to this display item.- Parameters:
to- Used as the NamedBeanHandle to lookup the turnout objectturn- is used to determine which turnout position this is for.- 0x01 - West
- 0x02 - East
- 0x04 - Lower West
- 0x06 - Upper East
-
setTurnoutType
public void setTurnoutType(int slip)
Sets the type of turnout configuration which is being used- Parameters:
slip- valid values are- 0x00 - Double Slip
- 0x02 - Single Slip
- 0x04 - Three Way Turnout
- 0x08 - Scissor Crossing
-
getTurnoutType
public int getTurnoutType()
-
getSingleSlipRoute
public boolean getSingleSlipRoute()
Single Slip Route, determines if the slip route is from upper west to upper east (true) or lower west to lower east (false) This also doubles up for the three way and determines if the first turnout routes to the upper (true) or lower (false) exit point.In a Scissor crossing this returns true if only two turnout address are required to set the crossing or false if four turnout address are required.
- Returns:
- true if route is through the turnout on a slip; false otherwise
-
setSingleSlipRoute
public void setSingleSlipRoute(boolean route)
-
getTurnout
public Turnout getTurnout(int turn)
Returns the turnout located at the position specified.
-
getNamedTurnout
public NamedBeanHandle<Turnout> getNamedTurnout(int turn)
Returns the turnout located at the position specified.
-
getLowerWestToUpperEastIcon
public NamedIcon getLowerWestToUpperEastIcon()
-
setLowerWestToUpperEastIcon
public void setLowerWestToUpperEastIcon(NamedIcon i)
-
getUpperWestToLowerEastIcon
public NamedIcon getUpperWestToLowerEastIcon()
-
setUpperWestToLowerEastIcon
public void setUpperWestToLowerEastIcon(NamedIcon i)
-
getLowerWestToLowerEastIcon
public NamedIcon getLowerWestToLowerEastIcon()
-
setLowerWestToLowerEastIcon
public void setLowerWestToLowerEastIcon(NamedIcon i)
-
getUpperWestToUpperEastIcon
public NamedIcon getUpperWestToUpperEastIcon()
-
setUpperWestToUpperEastIcon
public void setUpperWestToUpperEastIcon(NamedIcon i)
-
getInconsistentIcon
public NamedIcon getInconsistentIcon()
-
setInconsistentIcon
public void setInconsistentIcon(NamedIcon i)
-
getUnknownIcon
public NamedIcon getUnknownIcon()
-
setUnknownIcon
public void setUnknownIcon(NamedIcon i)
-
maxHeight
public int maxHeight()
- Specified by:
maxHeightin interfacePositionable- Overrides:
maxHeightin classPositionableLabel
-
maxWidth
public int maxWidth()
- Specified by:
maxWidthin interfacePositionable- Overrides:
maxWidthin classPositionableLabel
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Update icon as state of turnout changes.- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
getTypeString
@Nonnull public java.lang.String getTypeString()
Description copied from interface:PositionableGet the type of the positional as a String.- Specified by:
getTypeStringin interfacePositionable- Overrides:
getTypeStringin classPositionableLabel- Returns:
- the type to display
-
getNameString
@Nonnull public java.lang.String getNameString()
Description copied from interface:PositionableGet the name of the positional as a String. This is often the display name of the NamedBean being positioned.- Specified by:
getNameStringin interfaceInlineLogixNG- Specified by:
getNameStringin interfacePositionable- Overrides:
getNameStringin classPositionableLabel- Returns:
- the name to display
-
setTristate
public void setTristate(boolean set)
-
getTristate
public boolean getTristate()
-
addTristateEntry
void addTristateEntry(javax.swing.JPopupMenu popup)
-
rotateOrthogonal
protected void rotateOrthogonal()
****** popup AbstractAction.actionPerformed method overrides ********- Overrides:
rotateOrthogonalin classPositionableLabel
-
setScale
public void setScale(double s)
- Specified by:
setScalein interfacePositionable- Overrides:
setScalein classPositionableLabel
-
rotate
public void rotate(int deg)
- Specified by:
rotatein interfacePositionable- Overrides:
rotatein classPositionableLabel
-
getLWUEText
public java.lang.String getLWUEText()
Get the text used in the pop-up for setting the route from Lower West to Upper East. For a scissor crossing this is the Left-hand crossing. For a 3 Way turnout this is the Upper Exit.- Returns:
- localized description of route
-
getUWLEText
public java.lang.String getUWLEText()
Get the text used in the pop-up for setting the route from Upper West to Lower East. For a scissor crossing this is the Right-hand crossing. For a 3 Way turnout this is the Middle Exit.- Returns:
- localized description of route
-
getLWLEText
public java.lang.String getLWLEText()
Get the text used in the pop-up for setting the route from Lower West to Lower East. For a scissor crossing this is the Straight (Normal) Route. For a 3 Way turnout this is the Lower Exit.- Returns:
- localized description of route
-
getUWUEText
public java.lang.String getUWUEText()
Get the text used in the pop-up for setting the route from Upper West to Upper East. For a scissor crossing this is not used. For a 3 Way turnout this is not used.- Returns:
- localized description of route
-
setLWUEText
public void setLWUEText(java.lang.String txt)
-
setUWLEText
public void setUWLEText(java.lang.String txt)
-
setLWLEText
public void setLWLEText(java.lang.String txt)
-
setUWUEText
public void setUWUEText(java.lang.String txt)
-
edit
protected void edit()
- Overrides:
editin classPositionableLabel
-
updateTurnout
void updateTurnout()
-
doMouseClicked
public void doMouseClicked(JmriMouseEvent e)
Throw the turnout when the icon is clicked.- Specified by:
doMouseClickedin interfacePositionable- Overrides:
doMouseClickedin classPositionableLabel- Parameters:
e- the click event
-
getTurnoutSettings
protected java.util.HashMap<Turnout,java.lang.Integer> getTurnoutSettings()
-
reset
protected void reset()
-
showPopUp
public boolean showPopUp(javax.swing.JPopupMenu popup)
Display a popup menu to select a given state, rather than cycling through each state.- Specified by:
showPopUpin interfacePositionable- Overrides:
showPopUpin classPositionableLabel- Parameters:
popup- the menu to add the state menu to- Returns:
- true if anything added to menu
-
setTextEditMenu
public boolean setTextEditMenu(@Nonnull javax.swing.JPopupMenu popup)
Description copied from interface:PositionableAdd additional menu items to the menu.- Specified by:
setTextEditMenuin interfacePositionable- Overrides:
setTextEditMenuin classPositionableLabel- Parameters:
popup- the menu to add the menu items to- Returns:
- true if adding items; false otherwise
-
slipTurnoutTextEdit
public void slipTurnoutTextEdit(java.lang.String name)
-
dispose
public void dispose()
Description copied from class:PositionableLabelClean up when this object is no longer needed. Should not be called while the object is still displayed; see remove()- Overrides:
disposein classPositionableLabel
-
setSlipBusy
protected void setSlipBusy()
Set Slip busy when commands are being issued to Slip turnouts.
-
setSlipNotBusy
protected void setSlipNotBusy()
Set Slip not busy when all commands have been issued to Slip turnouts.
-
isSlipBusy
protected boolean isSlipBusy()
Check if Slip is busy.- Returns:
- true if commands are being issued to Slip turnouts.
-
-