jmri.jmrit.display
Class LevelXing

java.lang.Object
  extended by jmri.jmrit.display.LevelXing

public class LevelXing
extends Object

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.

Author:
Dave Duchamp Copyright (c) 2004-2007

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

connectAName

public String connectAName

connectBName

public String connectBName

connectCName

public String connectCName

connectDName

public String connectDName

tBlockNameAC

public String tBlockNameAC

tBlockNameBD

public String tBlockNameBD
Constructor Detail

LevelXing

public LevelXing(String id,
                 Point2D c,
                 LayoutEditor myPanel)
constructor method

Method Detail

getID

public String getID()
Accessor methods


getBlockNameAC

public String getBlockNameAC()

getBlockNameBD

public String getBlockNameBD()

getSignalAName

public String getSignalAName()

setSignalAName

public void setSignalAName(String signalName)

getSignalBName

public String getSignalBName()

setSignalBName

public void setSignalBName(String signalName)

getSignalCName

public String getSignalCName()

setSignalCName

public void setSignalCName(String signalName)

getSignalDName

public String getSignalDName()

setSignalDName

public void setSignalDName(String signalName)

getConnectA

public Object getConnectA()

getConnectB

public Object getConnectB()

getConnectC

public Object getConnectC()

getConnectD

public Object getConnectD()

setConnectA

public void setConnectA(Object o,
                        int type)

setConnectB

public void setConnectB(Object o,
                        int type)

setConnectC

public void setConnectC(Object o,
                        int type)

setConnectD

public void setConnectD(Object o,
                        int type)

getLayoutBlockAC

public LayoutBlock getLayoutBlockAC()

getLayoutBlockBD

public LayoutBlock getLayoutBlockBD()

getCoordsCenter

public Point2D getCoordsCenter()

getCoordsA

public Point2D getCoordsA()

getCoordsB

public Point2D getCoordsB()

getCoordsC

public Point2D getCoordsC()

getCoordsD

public Point2D getCoordsD()

setLayoutBlockAC

public void setLayoutBlockAC(LayoutBlock b)
Add Layout Blocks


setLayoutBlockBD

public void setLayoutBlockBD(LayoutBlock b)

isMainlineAC

public 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


isMainlineBD

public boolean isMainlineBD()

setCoordsCenter

public void setCoordsCenter(Point2D p)
Modify coordinates methods


setCoordsA

public void setCoordsA(Point2D p)

setCoordsB

public void setCoordsB(Point2D p)

setCoordsC

public void setCoordsC(Point2D p)

setCoordsD

public void setCoordsD(Point2D p)

scaleCoords

public void scaleCoords(float xFactor,
                        float yFactor)

setObjects

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


showPopUp

protected void showPopUp(MouseEvent e)
Display popup menu for information and editing


editLevelXing

protected void editLevelXing(LevelXing o)
Edit a Level Crossing


isActive

public boolean isActive()
"active" means that the object is still displayed, and should be stored.



Copyright © 1997 - 2008 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: SourceForge_Logo