Class TrackNode
- java.lang.Object
-
- jmri.jmrit.display.layoutEditor.TrackNode
-
public class TrackNode extends java.lang.Object
TrackNode is a memo object specifying and returning track node informationUsed in conjunction with ConnectivityUtil.java to return information about track nodes following a search of layout connectivity.
Track nodes are nodes in the layout connectivity diagram. They may be: positionable points - either anchor points that define a block boundary or end bumpers (end of a track), turnouts, -OR_ level crossings
The components of a TrackNode are: Node Object - the object reached by searching connectivity Node Type - connection types defined in Layout Editor, for example, TURNOUT_A, indicates a turnout connected at A (the throat of a RH, LH, or WYE turnout) Track Segment - the track segment connected at the connection point specified in Node Type Reached End Bumper - 'true' if the connectivity search has reached an end bumper (the end of the search track) before reaching a Node Object. 'false' otherwise. Node State - if the Node Object can have multiple states, for example, a turnout, this gives the state it was when finding this track node.
Actually you could think of an End Bumper as a 'Node', but End Bumpers are treated differently here. When an End Bumper is reached during a connectivity search, Track Segment is returned, Reached End Bumper is set true, and Node Object and Node Type, are not returned.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) LayoutTrack
_Node
(package private) int
_NodeState
(package private) HitPointType
_NodeType
(package private) boolean
_ReachedEndBumper
(package private) TrackSegment
_TrackSegment
-
Constructor Summary
Constructors Constructor Description TrackNode(LayoutTrack node, HitPointType nodeType, TrackSegment segment, boolean endBumper, int nodeState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LayoutTrack
getNode()
Block
getNodeBlock()
Get the node block.int
getNodeState()
HitPointType
getNodeType()
TrackSegment
getTrackSegment()
boolean
reachedEndOfTrack()
void
setNode(LayoutTrack node)
Set the node.void
setNodeType(HitPointType type)
void
setReachedEndBumper(boolean end)
void
setTrackSegment(TrackSegment s)
-
-
-
Field Detail
-
_Node
LayoutTrack _Node
-
_NodeType
HitPointType _NodeType
-
_TrackSegment
TrackSegment _TrackSegment
-
_ReachedEndBumper
boolean _ReachedEndBumper
-
_NodeState
int _NodeState
-
-
Constructor Detail
-
TrackNode
public TrackNode(LayoutTrack node, HitPointType nodeType, TrackSegment segment, boolean endBumper, int nodeState)
-
-
Method Detail
-
setNode
public void setNode(LayoutTrack node)
Set the node.- Parameters:
node
- the layout track node.
-
getNode
public LayoutTrack getNode()
-
setNodeType
public void setNodeType(HitPointType type)
-
getNodeType
public HitPointType getNodeType()
-
setTrackSegment
public void setTrackSegment(TrackSegment s)
-
getTrackSegment
public TrackSegment getTrackSegment()
-
setReachedEndBumper
public void setReachedEndBumper(boolean end)
-
reachedEndOfTrack
public boolean reachedEndOfTrack()
-
getNodeState
public int getNodeState()
-
getNodeBlock
public Block getNodeBlock()
Get the node block.- Returns:
- the Block of the node Object at the nodeType position, may be null.
-
-