jmri.jmrit.display
Class TrackSegment

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

public class TrackSegment
extends Object

TrackSegment is a segment of track on a layout linking two nodes of the layout. A node may be a PositionableTurnout, a LevelXing or a PositionablePoint.

PositionablePoints have only one possible connection point. Positionable Turnouts have 3 or 4 (double crossover) connection points, designated A, B, C, and D. LevelXing's have 4 connection points, designated A, B, C, and D.

TrackSegments carry Block information, as do Positionable Turnouts.

TrackSegments may be drawn as dashed lines or solid lines. In addition TrackSegments may be hidden when the panel is not in EditMode.

Author:
Dave Duchamp Copyright (c) 2004-2007

Field Summary
 String tBlockName
           
 String tConnect1Name
           
 String tConnect2Name
           
 
Constructor Summary
TrackSegment(String id, Object c1, int t1, Object c2, int t2, boolean dash, boolean main, LayoutEditor myPanel)
           
TrackSegment(String id, String c1Name, int t1, String c2Name, int t2, boolean dash, boolean main, boolean hide, LayoutEditor myPanel)
           
 
Method Summary
protected  void editTrackSegment()
          Edit a Track Segment
 String getBlockName()
           
 Object getConnect1()
           
 String getConnect1Name()
           
 Object getConnect2()
           
 String getConnect2Name()
           
 boolean getDashed()
           
 boolean getHidden()
           
 String getID()
          Accessor methods
 LayoutBlock getLayoutBlock()
           
 boolean getMainline()
           
 int getType1()
           
 int getType2()
           
 boolean isActive()
          "active" means that the object is still displayed, and should be stored.
 void setDashed(boolean dash)
           
 void setHidden(boolean hide)
           
 void setLayoutBlock(LayoutBlock b)
          Set Up a Layout Block for a Track Segment
 void setLayoutBlockByName(String name)
           
 void setMainline(boolean main)
           
 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.
protected  void showPopUp(MouseEvent e)
          Display popup menu for information and editing
protected  void updateBlockInfo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tBlockName

public String tBlockName

tConnect1Name

public String tConnect1Name

tConnect2Name

public String tConnect2Name
Constructor Detail

TrackSegment

public TrackSegment(String id,
                    Object c1,
                    int t1,
                    Object c2,
                    int t2,
                    boolean dash,
                    boolean main,
                    LayoutEditor myPanel)

TrackSegment

public TrackSegment(String id,
                    String c1Name,
                    int t1,
                    String c2Name,
                    int t2,
                    boolean dash,
                    boolean main,
                    boolean hide,
                    LayoutEditor myPanel)
Method Detail

getID

public String getID()
Accessor methods


getBlockName

public String getBlockName()

getType1

public int getType1()

getType2

public int getType2()

getConnect1

public Object getConnect1()

getConnect2

public Object getConnect2()

getDashed

public boolean getDashed()

setDashed

public void setDashed(boolean dash)

getHidden

public boolean getHidden()

setHidden

public void setHidden(boolean hide)

getMainline

public boolean getMainline()

setMainline

public void setMainline(boolean main)

getLayoutBlock

public LayoutBlock getLayoutBlock()

getConnect1Name

public String getConnect1Name()

getConnect2Name

public String getConnect2Name()

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.


setLayoutBlock

public void setLayoutBlock(LayoutBlock b)
Set Up a Layout Block for a Track Segment


setLayoutBlockByName

public void setLayoutBlockByName(String name)

updateBlockInfo

protected void updateBlockInfo()

showPopUp

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


editTrackSegment

protected void editTrackSegment()
Edit a Track Segment


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