jmri.jmrit.display.layoutEditor
Class LayoutConnectivity

Show UML class diagram
java.lang.Object
  extended by jmri.jmrit.display.layoutEditor.LayoutConnectivity

public class LayoutConnectivity
extends Object

A LayoutConnectivity object represents a junction between two LayoutBlocks on a LayoutEditor panel.

LayoutConnectivity objects do not persist (are not saved when panels are saved). Instead they are initialized when a panel is loaded and changed dynamically as a panel is edited.

The direction stored here is the direction for proceeding across the block boundary from block1 to block2. The directions represent directions on the LayoutEditor panel. Allowed values (using Path object definitions) are: Path.NORTH (up on panel) Path.SOUTH (down on panel) Path.EAST (right on panel) Path.WEST (left on panel) and points in between: Path.NORTH + Path.EAST Path.NORTH + Path.WEST Path.SOUTH + Path.EAST Path.SOUTH + Path.WEST

The connected object in the first block is usually a track segment. This track segment is connected to an object in the second block. The connection point in the second block can be either one end of a track segment, or one of the connection points on a turnout, or one of the connection points on a level crossing. The allowed values for the connection points at the second block are defined in LayoutEditor.

The exception to the above is when a crossover turnout has multiple blocks. If so, at least one block boundary is internal to the crossover turnout. Such cases are handled differently, as "crossover block boundary types", see definition of the type codes below. The first letter in the boundary type corresponds to the first block, and the second letter corresponds to the second block. All four block boundaries are possible for the double crossover. One of the crossed over boundaries is not possible with each single crossover.

Note that each LayoutEditor panel has its own list of LayoutConnectivity objects, nominally called its "block connectivity". In contrast, there is only one set of LayoutBlocks, Blocks, and Paths, which are used by all LayoutEditor panels.


Field Summary
(package private)  PositionablePoint anchor
           
(package private)  LayoutBlock block1
           
(package private)  LayoutBlock block2
           
(package private)  Object connect2
           
(package private)  int direction
           
(package private) static org.slf4j.Logger log
           
static int NONE
           
(package private)  TrackSegment track1
           
(package private)  int typeConnect2
           
(package private)  LayoutTurnout xover
           
static int XOVER_BOUNDARY_AB
           
static int XOVER_BOUNDARY_AC
           
static int XOVER_BOUNDARY_BD
           
static int XOVER_BOUNDARY_CD
           
(package private)  int xoverBoundaryType
           
 
Constructor Summary
LayoutConnectivity(LayoutBlock b1, LayoutBlock b2)
          Constructor
 
Method Summary
 PositionablePoint getAnchor()
           
 LayoutBlock getBlock1()
          Accessor routines
 LayoutBlock getBlock2()
           
 Object getConnectedObject()
           
 int getConnectedType()
           
 int getDirection()
           
 int getReverseDirection()
           
 TrackSegment getTrackSegment()
           
 LayoutTurnout getXover()
           
 int getXoverBoundaryType()
           
 void setConnections(TrackSegment t, Object o, int type, PositionablePoint p)
           
 boolean setDirection(int dir)
           
 void setXoverBoundary(LayoutTurnout t, int type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
See Also:
Constant Field Values

XOVER_BOUNDARY_AB

public static final int XOVER_BOUNDARY_AB
See Also:
Constant Field Values

XOVER_BOUNDARY_CD

public static final int XOVER_BOUNDARY_CD
See Also:
Constant Field Values

XOVER_BOUNDARY_AC

public static final int XOVER_BOUNDARY_AC
See Also:
Constant Field Values

XOVER_BOUNDARY_BD

public static final int XOVER_BOUNDARY_BD
See Also:
Constant Field Values

block1

LayoutBlock block1

block2

LayoutBlock block2

direction

int direction

track1

TrackSegment track1

connect2

Object connect2

typeConnect2

int typeConnect2

xover

LayoutTurnout xover

xoverBoundaryType

int xoverBoundaryType

anchor

PositionablePoint anchor

log

static org.slf4j.Logger log
Constructor Detail

LayoutConnectivity

public LayoutConnectivity(LayoutBlock b1,
                          LayoutBlock b2)
Constructor

Method Detail

getBlock1

public LayoutBlock getBlock1()
Accessor routines


getBlock2

public LayoutBlock getBlock2()

getDirection

public int getDirection()

getReverseDirection

public int getReverseDirection()

setDirection

public boolean setDirection(int dir)

setConnections

public void setConnections(TrackSegment t,
                           Object o,
                           int type,
                           PositionablePoint p)

setXoverBoundary

public void setXoverBoundary(LayoutTurnout t,
                             int type)

getTrackSegment

public TrackSegment getTrackSegment()

getConnectedObject

public Object getConnectedObject()

getConnectedType

public int getConnectedType()

getXover

public LayoutTurnout getXover()

getXoverBoundaryType

public int getXoverBoundaryType()

getAnchor

public PositionablePoint getAnchor()


Copyright © 1997-2013 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