jmri.jmrit.display
Class PositionablePoint

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

public class PositionablePoint
extends Object

PositionablePoint is a Point defining a node in the Track that can be dragged around the inside of the enclosing LayoutEditor panel using a right-drag (drag with meta key).

Two types of Positionable Point are supported: Anchor - point on track - two track connections End Bumper - end of track point - one track connection

Note that a PositionablePoint exists for specifying connectivity and drawing position only. The Track Segments connected to a PositionablePoint may belong to the same block or to different blocks. Since each Track Segment may only belong to one block, a PositionablePoint may function as a Block Boundary.

Signal names are saved here at a Block Boundary anchor point by the tool Set Signals at Block Boundary. PositionablePoint does nothing with these signal head names; it only serves as a place to store them.

Author:
Dave Duchamp Copyright (c) 2004-2007

Field Summary
static int ANCHOR
           
static int END_BUMPER
           
 String trackSegment1Name
           
 String trackSegment2Name
           
 
Constructor Summary
PositionablePoint(String id, int t, Point2D p, LayoutEditor myPanel)
           
 
Method Summary
 TrackSegment getConnect1()
           
 TrackSegment getConnect2()
           
 Point2D getCoords()
           
 String getEastBoundSignal()
           
 String getID()
          Accessor methods
 int getType()
           
 String getWestBoundSignal()
           
 boolean isActive()
          "active" means that the object is still displayed, and should be stored.
protected  int maxHeight()
           
protected  int maxWidth()
           
 void mouseClicked(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void removeTrackConnection(TrackSegment track)
           
 void setCoords(Point2D p)
           
 void setEastBoundSignal(String signalName)
           
 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 setTrackConnection(TrackSegment track)
          Setup and remove connections to track
 void setWestBoundSignal(String signalName)
           
protected  void showPopUp(MouseEvent e)
          For editing: only provides remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANCHOR

public static final int ANCHOR
See Also:
Constant Field Values

END_BUMPER

public static final int END_BUMPER
See Also:
Constant Field Values

trackSegment1Name

public String trackSegment1Name

trackSegment2Name

public String trackSegment2Name
Constructor Detail

PositionablePoint

public PositionablePoint(String id,
                         int t,
                         Point2D p,
                         LayoutEditor myPanel)
Method Detail

getID

public String getID()
Accessor methods


getType

public int getType()

getConnect1

public TrackSegment getConnect1()

getConnect2

public TrackSegment getConnect2()

getCoords

public Point2D getCoords()

setCoords

public void setCoords(Point2D p)

getEastBoundSignal

public String getEastBoundSignal()

setEastBoundSignal

public void setEastBoundSignal(String signalName)

getWestBoundSignal

public String getWestBoundSignal()

setWestBoundSignal

public void setWestBoundSignal(String signalName)

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.


setTrackConnection

public void setTrackConnection(TrackSegment track)
Setup and remove connections to track


removeTrackConnection

public void removeTrackConnection(TrackSegment track)

maxWidth

protected int maxWidth()

maxHeight

protected int maxHeight()

mousePressed

public void mousePressed(MouseEvent e)

mouseReleased

public void mouseReleased(MouseEvent e)

mouseClicked

public void mouseClicked(MouseEvent e)

showPopUp

protected void showPopUp(MouseEvent e)
For editing: only provides remove


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