|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrit.display.LevelXing
public class LevelXing
A LevelXing is two track segment on a layout that cross at an angle.
A LevelXing has four connection points, designated A, B, C, and D. At the crossing, A-C and B-D are straight segments. A train proceeds through the crossing on either of these segments.
Each straight segment carries Block information. A-C and B-D may be in the same or different Layout Blocks.
For drawing purposes, each LevelXing 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 LevelXings are first created, there are no connections. Block information and connections are added when available.
Signal Head names are saved here to keep track of where signals are. LevelXing only serves as a storage place for signal head names. The names are placed here by Set Signals at Level Crossing in Tools menu.
| Field Summary | |
|---|---|
String |
connectAName
|
String |
connectBName
|
String |
connectCName
|
String |
connectDName
|
String |
tBlockNameAC
|
String |
tBlockNameBD
|
| Constructor Summary | |
|---|---|
LevelXing(String id,
Point2D c,
LayoutEditor myPanel)
constructor method |
|
| Method Summary | |
|---|---|
protected void |
editLevelXing(LevelXing o)
Edit a Level Crossing |
String |
getBlockNameAC()
|
String |
getBlockNameBD()
|
Object |
getConnectA()
|
Object |
getConnectB()
|
Object |
getConnectC()
|
Object |
getConnectD()
|
Point2D |
getCoordsA()
|
Point2D |
getCoordsB()
|
Point2D |
getCoordsC()
|
Point2D |
getCoordsCenter()
|
Point2D |
getCoordsD()
|
String |
getID()
Accessor methods |
LayoutBlock |
getLayoutBlockAC()
|
LayoutBlock |
getLayoutBlockBD()
|
String |
getSignalAName()
|
String |
getSignalBName()
|
String |
getSignalCName()
|
String |
getSignalDName()
|
boolean |
isActive()
"active" means that the object is still displayed, and should be stored. |
boolean |
isMainlineAC()
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 |
boolean |
isMainlineBD()
|
void |
scaleCoords(float xFactor,
float yFactor)
|
void |
setConnectA(Object o,
int type)
|
void |
setConnectB(Object o,
int type)
|
void |
setConnectC(Object o,
int type)
|
void |
setConnectD(Object o,
int type)
|
void |
setCoordsA(Point2D p)
|
void |
setCoordsB(Point2D p)
|
void |
setCoordsC(Point2D p)
|
void |
setCoordsCenter(Point2D p)
Modify coordinates methods |
void |
setCoordsD(Point2D p)
|
void |
setLayoutBlockAC(LayoutBlock b)
Add Layout Blocks |
void |
setLayoutBlockBD(LayoutBlock b)
|
void |
setObjects(LayoutEditor p)
Initialization method The above variables are initialized by PositionablePointXml, then the following method is called after the entire LayoutEditor is loaded to set the specific TrackSegment objects. |
void |
setSignalAName(String signalName)
|
void |
setSignalBName(String signalName)
|
void |
setSignalCName(String signalName)
|
void |
setSignalDName(String signalName)
|
protected void |
showPopUp(MouseEvent e)
Display popup menu for information and editing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public String connectAName
public String connectBName
public String connectCName
public String connectDName
public String tBlockNameAC
public String tBlockNameBD
| Constructor Detail |
|---|
public LevelXing(String id,
Point2D c,
LayoutEditor myPanel)
| Method Detail |
|---|
public String getID()
public String getBlockNameAC()
public String getBlockNameBD()
public String getSignalAName()
public void setSignalAName(String signalName)
public String getSignalBName()
public void setSignalBName(String signalName)
public String getSignalCName()
public void setSignalCName(String signalName)
public String getSignalDName()
public void setSignalDName(String signalName)
public Object getConnectA()
public Object getConnectB()
public Object getConnectC()
public Object getConnectD()
public void setConnectA(Object o,
int type)
public void setConnectB(Object o,
int type)
public void setConnectC(Object o,
int type)
public void setConnectD(Object o,
int type)
public LayoutBlock getLayoutBlockAC()
public LayoutBlock getLayoutBlockBD()
public Point2D getCoordsCenter()
public Point2D getCoordsA()
public Point2D getCoordsB()
public Point2D getCoordsC()
public Point2D getCoordsD()
public void setLayoutBlockAC(LayoutBlock b)
public void setLayoutBlockBD(LayoutBlock b)
public boolean isMainlineAC()
public boolean isMainlineBD()
public void setCoordsCenter(Point2D p)
public void setCoordsA(Point2D p)
public void setCoordsB(Point2D p)
public void setCoordsC(Point2D p)
public void setCoordsD(Point2D p)
public void scaleCoords(float xFactor,
float yFactor)
public void setObjects(LayoutEditor p)
protected void showPopUp(MouseEvent e)
protected void editLevelXing(LevelXing o)
public boolean isActive()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||