jmri.jmrit.display.layoutEditor
Class TrackNode

java.lang.Object
  extended by jmri.jmrit.display.layoutEditor.TrackNode

public class TrackNode
extends Object

TrackNode is a temporary object specifying and returning track node information

Used 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.

Author:
Dave Duchamp Copyright (C) 2009

Constructor Summary
TrackNode(Object node, int nodeType, TrackSegment segment, boolean endBumper, int nodeState)
           
 
Method Summary
 Object getNode()
           
 Block getNodeBlock()
          Returns the Block of the node Object at the nodeType position
 int getNodeState()
           
 int getNodeType()
           
 TrackSegment getTrackSegment()
           
 boolean reachedEndOfTrack()
           
 void setNode(Object node)
          Access methods
 void setNodeType(int type)
           
 void setReachedEndBumper(boolean end)
           
 void setTrackSegment(TrackSegment s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrackNode

public TrackNode(Object node,
                 int nodeType,
                 TrackSegment segment,
                 boolean endBumper,
                 int nodeState)
Method Detail

setNode

public void setNode(Object node)
Access methods


getNode

public Object getNode()

setNodeType

public void setNodeType(int type)

getNodeType

public int 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()
Returns the Block of the node Object at the nodeType position



Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads