Package jmri.jmrit.display.layoutEditor
Class LayoutSlip
java.lang.Object
jmri.jmrit.display.layoutEditor.LayoutTrack
jmri.jmrit.display.layoutEditor.LayoutTurnout
jmri.jmrit.display.layoutEditor.LayoutSlip
- Direct Known Subclasses:
LayoutDoubleSlip,LayoutSingleSlip
A LayoutSlip is a crossing of two straight tracks designed in such a way as
to allow trains to change from one straight track to the other, as well as
going straight across.
For drawing purposes, each LayoutSlip carries a center point and displacements for A and B. The displacements for C = - the displacement for A, and the displacement for D = - the displacement for B. The center point and these displacements may be adjusted by the user when in edit mode.
A LayoutSlip has four connection points, designated A, B, C, and D. A train
may proceed between A and D, A and C, B and D and in the case of
double-slips, B and C.
\\ //
A==-==D
\\ //
X
// \\
B==-==C
// \\
For drawing purposes, each LayoutSlip carries a center point and displacements for A and B. The displacements for C = - the displacement for A, and the displacement for D = - the displacement for B. The center point and these displacements may be adjusted by the user when in edit mode.
When LayoutSlips are first created, there are no connections. Block information and connections are added when available.
SignalHead names are saved here to keep track of where signals are. LayoutSlip only serves as a storage place for SignalHead names. The names are placed here by Set Signals at Level Crossing in Tools menu.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class jmri.jmrit.display.layoutEditor.LayoutTurnout
LayoutTurnout.Geometry, LayoutTurnout.LinkType, LayoutTurnout.TurnoutType -
Field Summary
FieldsFields inherited from class jmri.jmrit.display.layoutEditor.LayoutTurnout
active, connectA, connectAName, connectB, connectBName, connectC, connectCName, connectD, connectDName, continuingSense, disabled, disableWhenOccupied, INCONSISTENT, linkedTurnoutName, linkType, namedLayoutBlockA, namedLayoutBlockB, namedLayoutBlockC, namedLayoutBlockD, namedTurnout, secondNamedTurnout, sensorANamed, sensorBNamed, sensorCNamed, sensorDNamed, signalA1HeadNamed, signalA2HeadNamed, signalA3HeadNamed, signalAMastNamed, signalB1HeadNamed, signalB2HeadNamed, signalBMastNamed, signalC1HeadNamed, signalC2HeadNamed, signalCMastNamed, signalD1HeadNamed, signalD2HeadNamed, signalDMastNamed, STATE_AC, STATE_AD, STATE_BC, STATE_BD, tBlockAName, tBlockBName, tBlockCName, tBlockDName, turnoutBXDefault, turnoutCXDefault, turnoutWidDefault, type, UNKNOWN, xOverHWidDefault, xOverLongDefault, xOverShortDefaultFields inherited from class jmri.jmrit.display.layoutEditor.LayoutTrack
models -
Constructor Summary
ConstructorsConstructorDescriptionLayoutSlip(String id, LayoutEditor models, LayoutTurnout.TurnoutType type) Constructor method. -
Method Summary
Modifier and TypeMethodDescription(package private) voidActivate/Deactivate turnout to redraw when turnout state changesreturn a list of the available connections for this layout track(package private) void(package private) voiddisableSML(SignalMast signalMast) String[]getConnection(HitPointType connectionType) get the LayoutTrack connected at the specified connection typeprotected intgetConnectivityStateForLayoutBlocks(LayoutBlock thisLayoutBlock, LayoutBlock prevLayoutBlock, LayoutBlock nextLayoutBlock, boolean suppress) protected List<LayoutConnectivity>get the layout connectivity for this trackCreate the tooltip name string for a slip.int(package private) StringgetSlipStateString(int slipState) intgetTurnoutBState(int state) intgetTurnoutState(int state) intgetTurnoutState(Turnout turn, int state) booleanMethods to test if mainline track or not Returns true if either connecting track segment is mainline Defaults to not mainline if connecting track segments are missing(package private) booleanis this turnout occupied?(package private) booleanCheck if either turnout is inconsistent.voidabstract method... subclasses should implement _IF_ they need to recheck their block boundariesvoidremove()Removes this object from display and persistancevoidsetConnection(HitPointType connectionType, LayoutTrack o, HitPointType type) set the LayoutTrack connected at the specified connection type(package private) voidsetSlipState(int newSlipState) voidsetTurnoutB(String tName) voidsetTurnoutStates(int state, String turnStateA, String turnStateB) voidtoggleState(HitPointType selectedPointType) Toggle slip states if clicked on, physical turnout exists, and not disabled.toString()void(package private) voidMethods inherited from class jmri.jmrit.display.layoutEditor.LayoutTurnout
canRemove, checkForNonContiguousBlocks, checkForUnAssignedBlocks, collectContiguousTracksNamesInBlockNamed, getBeanReferences, getBlockBName, getBlockCName, getBlockDName, getBlockName, getConnectA, getConnectB, getConnectC, getConnectD, getContinuingSense, getLayoutBlock, getLayoutBlockB, getLayoutBlockC, getLayoutBlockD, getLinkedTurnoutName, getLinkType, getProtectedBlocks, getSecondTurnout, getSecondTurnoutName, getSensorA, getSensorAName, getSensorB, getSensorBName, getSensorC, getSensorCName, getSensorD, getSensorDName, getSignalA1, getSignalA1Name, getSignalA2, getSignalA2Name, getSignalA3, getSignalA3Name, getSignalAMast, getSignalAMastName, getSignalB1, getSignalB1Name, getSignalB2, getSignalB2Name, getSignalBMast, getSignalBMastName, getSignalC1, getSignalC1Name, getSignalC2, getSignalC2Name, getSignalCMast, getSignalCMastName, getSignalD1, getSignalD1Name, getSignalD2, getSignalD2Name, getSignalDMast, getSignalDMastName, getSignalHead, getState, getToolTip, getTurnout, getTurnoutName, getTurnoutType, getTypeName, getVersion, hasEnteringDoubleTrack, hasEnteringDoubleTrack, hasEnteringSingleTrack, hasEnteringSingleTrack, isActive, isDisabled, isDisabledWhenOccupied, isInContinuingSenseState, isMainlineA, isMainlineB, isMainlineC, isMainlineD, isSecondTurnoutInverted, isTurnoutTypeSlip, isTurnoutTypeSlip, isTurnoutTypeTurnout, isTurnoutTypeTurnout, isTurnoutTypeXover, isTurnoutTypeXover, removeBeanReference, removeSML, setAllLayoutBlocks, setConnectA, setConnectB, setConnectC, setConnectD, setContinuingSense, setDisabled, setDisableWhenOccupied, setLayoutBlock, setLayoutBlockB, setLayoutBlockBByName, setLayoutBlockByName, setLayoutBlockC, setLayoutBlockCByName, setLayoutBlockD, setLayoutBlockDByName, setLinkedTurnoutName, setLinkType, setObjects, setSecondTurnout, setSecondTurnoutInverted, setSensorA, setSensorB, setSensorC, setSensorD, setShowToolTip, setSignalA1Name, setSignalA2Name, setSignalA3Name, setSignalAMast, setSignalB1Name, setSignalB2Name, setSignalBMast, setSignalC1Name, setSignalC2Name, setSignalCMast, setSignalD1Name, setSignalD2Name, setSignalDMast, setState, setToolTip, setTurnout, setVersion, showToolTip, toggleTurnout, useBlockSpeedMethods inherited from class jmri.jmrit.display.layoutEditor.LayoutTrack
getId, getName, getTurnoutStateString, isDisconnected, setIdent
-
Field Details
-
currentState
-
turnoutStates
-
-
Constructor Details
-
LayoutSlip
Constructor method.- Parameters:
id- slip ID.models- the layout editor.type- slip type, SINGLE_SLIP or DOUBLE_SLIP.
-
-
Method Details
-
toString
Description copied from class:LayoutTurnout- Overrides:
toStringin classLayoutTurnout
-
getSlipType
-
getSlipState
-
getTurnoutBName
-
getTurnoutB
-
setTurnoutB
-
getConnection
get the LayoutTrack connected at the specified connection type- Overrides:
getConnectionin classLayoutTurnout- Parameters:
connectionType- where on us to get the connection- Returns:
- the LayoutTrack connected at the specified connection type
-
setConnection
public void setConnection(HitPointType connectionType, @CheckForNull LayoutTrack o, HitPointType type) throws JmriException set the LayoutTrack connected at the specified connection type- Overrides:
setConnectionin classLayoutTurnout- Parameters:
connectionType- where on us to set the connectiono- the LayoutTrack that is to be connectedtype- where on the LayoutTrack we are connected- Throws:
JmriException- - if connectionType or type are invalid
-
getDisplayName
-
getSlipStateString
-
toggleState
Toggle slip states if clicked on, physical turnout exists, and not disabled.- Parameters:
selectedPointType- the selected hit point type.
-
setSlipState
-
isOccupied
boolean isOccupied()is this turnout occupied?- Overrides:
isOccupiedin classLayoutTurnout- Returns:
- true if occupied
-
activateTurnout
void activateTurnout()Activate/Deactivate turnout to redraw when turnout state changes -
deactivateTurnout
void deactivateTurnout() -
updateBlockInfo
- Overrides:
updateBlockInfoin classLayoutTurnout
-
isMainline
Methods to test if mainline track or not Returns true if either connecting track segment is mainline Defaults to not mainline if connecting track segments are missing- Overrides:
isMainlinein classLayoutTurnout
-
getBlockBoundaries
- Overrides:
getBlockBoundariesin classLayoutTurnout
-
remove
Removes this object from display and persistance- Overrides:
removein classLayoutTurnout
-
disableSML
-
getTurnoutStates
-
getTurnoutState
-
getTurnoutState
-
getTurnoutBState
-
setTurnoutStates
-
updateState
void updateState() -
isTurnoutInconsistent
boolean isTurnoutInconsistent()Check if either turnout is inconsistent. This is used to create an alternate slip image.- Returns:
- true if either turnout is inconsistent.
-
getConnectivityStateForLayoutBlocks
protected int getConnectivityStateForLayoutBlocks(@CheckForNull LayoutBlock thisLayoutBlock, @CheckForNull LayoutBlock prevLayoutBlock, @CheckForNull LayoutBlock nextLayoutBlock, boolean suppress) - Overrides:
getConnectivityStateForLayoutBlocksin classLayoutTurnout
-
reCheckBlockBoundary
Description copied from class:LayoutTurnoutabstract method... subclasses should implement _IF_ they need to recheck their block boundaries- Overrides:
reCheckBlockBoundaryin classLayoutTurnout
-
getLayoutConnectivity
Description copied from class:LayoutTurnoutget the layout connectivity for this track- Overrides:
getLayoutConnectivityin classLayoutTurnout- Returns:
- the list of Layout Connectivity objects
-
checkForFreeConnections
return a list of the available connections for this layout track- Overrides:
checkForFreeConnectionsin classLayoutTurnout- Returns:
- the list of available connections
-
getNameString
Create the tooltip name string for a slip.- Overrides:
getNameStringin classLayoutTurnout- Returns:
- the turnout display names or the Id.
-