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 Modifier and Type Class Description (package private) static class
SlipTurnoutIcon.SetSlipThread
-
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) java.util.HashMap<Turnout,java.lang.Integer>
_turnoutSetting
(package private) boolean
busy
static int
DOUBLESLIP
Constant used to refer to a Double Slip Configuration.static int
EAST
Constant used to refer to the Turnout address configured to operate the east (or second for a three way) of the Turnout.(package private) boolean
firstStraight
Throw the turnouts for a scissor crossing when the icon is clicked.(package private) NamedIcon
inconsistent
(package private) java.lang.String
inconsistentLName
static int
LOWEREAST
Constant used for a scissor crossing using 4 turnout address, and refers to the turnout located at the lower east.static int
LOWERWEST
Constant used for a scissor crossing using 4 turnout address, and refers to the turnout located at the lower west.(package private) NamedIcon
lowerWestToLowerEast
(package private) java.lang.String
lowerWestToLowerEastLName
(package private) java.lang.String
lowerWestToLowerEastText
(package private) NamedIcon
lowerWestToUpperEast
(package private) java.lang.String
lowerWestToUpperEastLName
(package private) java.lang.String
lowerWestToUpperEastText
static int
SCISSOR
Constant used to refer to a Scissor (Double Crossover) Configuration.static int
SINGLESLIP
Constant used to refer to a Single Slip Configuration.(package private) boolean
singleSlipRoute
static int
THREEWAY
Constant used to refer to a Three Way Turnout Configuration.(package private) javax.swing.JCheckBoxMenuItem
tristateItem
(package private) int
turnoutType
(package private) NamedIcon
unknown
(package private) java.lang.String
unknownLName
(package private) NamedIcon
upperWestToLowerEast
(package private) java.lang.String
upperWestToLowerEastLName
(package private) java.lang.String
upperWestToLowerEastText
(package private) NamedIcon
upperWestToUpperEast
(package private) java.lang.String
upperWestToUpperEastLName
(package private) java.lang.String
upperWestToUpperEastText
static int
WEST
Constant 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) void
addTristateEntry(javax.swing.JPopupMenu popup)
(package private) void
displayState(int state)
Drive the current state of the display from the state of the turnout.void
dispose()
Clean up when this object is no longer needed.void
doMouseClicked(JmriMouseEvent e)
Throw the turnout when the icon is clicked.protected void
edit()
NamedIcon
getInconsistentIcon()
NamedIcon
getLowerWestToLowerEastIcon()
NamedIcon
getLowerWestToUpperEastIcon()
java.lang.String
getLWLEText()
Get the text used in the pop-up for setting the route from Lower West to Lower East.java.lang.String
getLWUEText()
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.String
getNameString()
Get the name of the positional as a String.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.boolean
getTristate()
Turnout
getTurnout(int turn)
Returns the turnout located at the position specified.protected java.util.HashMap<Turnout,java.lang.Integer>
getTurnoutSettings()
int
getTurnoutType()
java.lang.String
getTypeString()
Get the type of the positional as a String.NamedIcon
getUnknownIcon()
NamedIcon
getUpperWestToLowerEastIcon()
NamedIcon
getUpperWestToUpperEastIcon()
java.lang.String
getUWLEText()
Get the text used in the pop-up for setting the route from Upper West to Lower East.java.lang.String
getUWUEText()
Get the text used in the pop-up for setting the route from Upper West to Upper East.protected boolean
isSlipBusy()
Check if Slip is busy.int
maxHeight()
int
maxWidth()
void
propertyChange(java.beans.PropertyChangeEvent e)
Update icon as state of turnout changes.protected void
reset()
void
rotate(int deg)
protected void
rotateOrthogonal()
****** popup AbstractAction.actionPerformed method overrides ********void
setInconsistentIcon(NamedIcon i)
void
setLowerWestToLowerEastIcon(NamedIcon i)
void
setLowerWestToUpperEastIcon(NamedIcon i)
void
setLWLEText(java.lang.String txt)
void
setLWUEText(java.lang.String txt)
void
setScale(double s)
void
setSingleSlipRoute(boolean route)
protected void
setSlipBusy()
Set Slip busy when commands are being issued to Slip turnouts.protected void
setSlipNotBusy()
Set Slip not busy when all commands have been issued to Slip turnouts.boolean
setTextEditMenu(javax.swing.JPopupMenu popup)
Add additional menu items to the menu.void
setTristate(boolean set)
void
setTurnout(java.lang.String pName, int turn)
Attach a named turnout to this display item.void
setTurnout(NamedBeanHandle<Turnout> to, int turn)
Attach a namedBean Handle turnout to this display item.void
setTurnoutType(int slip)
Sets the type of turnout configuration which is being usedvoid
setUnknownIcon(NamedIcon i)
void
setUpperWestToLowerEastIcon(NamedIcon i)
void
setUpperWestToUpperEastIcon(NamedIcon i)
void
setUWLEText(java.lang.String txt)
void
setUWUEText(java.lang.String txt)
boolean
showPopUp(javax.swing.JPopupMenu popup)
Display a popup menu to select a given state, rather than cycling through each state.void
slipTurnoutTextEdit(java.lang.String name)
(package private) int
turnoutState()
Get current state of attached turnouts.(package private) void
updateTurnout()
-
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, 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
-
turnoutType
int turnoutType
-
singleSlipRoute
boolean singleSlipRoute
-
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
-
firstStraight
boolean firstStraight
Throw the turnouts for a scissor crossing when the icon is clicked.
-
_turnoutSetting
java.util.HashMap<Turnout,java.lang.Integer> _turnoutSetting
-
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:
maxHeight
in interfacePositionable
- Overrides:
maxHeight
in classPositionableLabel
-
maxWidth
public int maxWidth()
- Specified by:
maxWidth
in interfacePositionable
- Overrides:
maxWidth
in classPositionableLabel
-
turnoutState
int turnoutState()
Get current state of attached turnouts. This adds the two turnout states together, however for the second turnout configured it will add 1 to the Closed state and 3 to the Thrown state. This helps to identify which turnout is thrown and/or closed.For a Scissor crossing that uses four turnouts, the code simply checks to ensure that diagonally opposite turnouts are set the same. If not, it will return Inconsistent state.
If any turnout that has either not been configured or is in an Unknown or Inconsistent state, the code will return the state UNKNOWN or INCONSISTENT.
- Returns:
- A state variable from a Turnout, e.g. Turnout.CLOSED
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Update icon as state of turnout changes.- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
getTypeString
@Nonnull public java.lang.String getTypeString()
Description copied from interface:Positionable
Get the type of the positional as a String.- Specified by:
getTypeString
in interfacePositionable
- Overrides:
getTypeString
in classPositionableLabel
- Returns:
- the type to display
-
getNameString
@Nonnull public java.lang.String getNameString()
Description copied from interface:Positionable
Get the name of the positional as a String. This is often the display name of the NamedBean being positioned.- Specified by:
getNameString
in interfaceInlineLogixNG
- Specified by:
getNameString
in interfacePositionable
- Overrides:
getNameString
in 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:
rotateOrthogonal
in classPositionableLabel
-
setScale
public void setScale(double s)
- Specified by:
setScale
in interfacePositionable
- Overrides:
setScale
in classPositionableLabel
-
rotate
public void rotate(int deg)
- Specified by:
rotate
in interfacePositionable
- Overrides:
rotate
in classPositionableLabel
-
displayState
void displayState(int state)
Drive the current state of the display from the state of the turnout. Here we have to alter the passed state to match the type of turnout we are dealing with.- Parameters:
state
- An integer value of the turnout states.
-
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:
edit
in classPositionableLabel
-
updateTurnout
void updateTurnout()
-
doMouseClicked
public void doMouseClicked(JmriMouseEvent e)
Throw the turnout when the icon is clicked.- Specified by:
doMouseClicked
in interfacePositionable
- Overrides:
doMouseClicked
in 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:
showPopUp
in interfacePositionable
- Overrides:
showPopUp
in 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:Positionable
Add additional menu items to the menu.- Specified by:
setTextEditMenu
in interfacePositionable
- Overrides:
setTextEditMenu
in 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:PositionableLabel
Clean up when this object is no longer needed. Should not be called while the object is still displayed; see remove()- Overrides:
dispose
in 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.
-
-