|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrit.display.layoutEditor.LayoutConnectivity
public class LayoutConnectivity
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 |
|---|
public static final int NONE
public static final int XOVER_BOUNDARY_AB
public static final int XOVER_BOUNDARY_CD
public static final int XOVER_BOUNDARY_AC
public static final int XOVER_BOUNDARY_BD
LayoutBlock block1
LayoutBlock block2
int direction
TrackSegment track1
Object connect2
int typeConnect2
LayoutTurnout xover
int xoverBoundaryType
PositionablePoint anchor
static org.slf4j.Logger log
| Constructor Detail |
|---|
public LayoutConnectivity(LayoutBlock b1,
LayoutBlock b2)
| Method Detail |
|---|
public LayoutBlock getBlock1()
public LayoutBlock getBlock2()
public int getDirection()
public int getReverseDirection()
public boolean setDirection(int dir)
public void setConnections(TrackSegment t,
Object o,
int type,
PositionablePoint p)
public void setXoverBoundary(LayoutTurnout t,
int type)
public TrackSegment getTrackSegment()
public Object getConnectedObject()
public int getConnectedType()
public LayoutTurnout getXover()
public int getXoverBoundaryType()
public PositionablePoint getAnchor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||