|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrit.display.layoutEditor.LayoutTurntable
public class LayoutTurntable
A LayoutTurntable is a representation used by LayoutEditor to display a turntable.
A LayoutTurntable has a variable number of connection points, called RayTracks, each radiating from the center of the turntable. Each of these points should be connected to a TrackSegment.
Each radiating segment (RayTrack) gets its Block information from its connected track segment.
Each radiating segment (RayTrack) has a unique connection index. The connection index is set when the RayTrack is created, and cannot be changed. This connection index is used to maintain the identity of the radiating segment to its connected Track Segment as ray tracks are added and deleted by the user.
The radius of the turntable circle is variable by the user.
Each radiating segment (RayTrack) connecting point is a fixed distance from the center of the turntable. The user may vary the angle of the radiating segment. Angles are measured from the vertical (12 o'clock) position in a clockwise manner. For example, 30 degrees is 1 o'clock, 60 degrees is 2 o'clock, 90 degrees is 3 o'clock, etc.
Each radiating segment is drawn from its connection point to the turntable circle in the direction of the turntable center.
| Constructor Summary | |
|---|---|
LayoutTurntable(String id,
Point2D c,
LayoutEditor myPanel)
constructor method |
|
| Method Summary | |
|---|---|
protected jmri.jmrit.display.layoutEditor.LayoutTurntable.RayTrack |
addRay(double angle)
|
void |
addRayTrack(double angle,
int index,
String name)
|
double |
diffAngle(double a,
double b)
|
protected void |
editTurntable(LayoutTurntable x)
Edit a Turntable |
Point2D |
getCoordsCenter()
|
String |
getID()
Accessor methods |
int |
getNumberRays()
|
double |
getRadius()
|
double |
getRayAngle(int i)
|
TrackSegment |
getRayConnectIndexed(int index)
|
TrackSegment |
getRayConnectOrdered(int i)
|
Point2D |
getRayCoordsIndexed(int index)
|
Point2D |
getRayCoordsOrdered(int i)
|
int |
getRayIndex(int i)
|
boolean |
isActive()
"active" means that the object is still displayed, and should be stored. |
boolean |
isMainlineIndexed(int index)
Methods to test if ray is a mainline track or not Returns true if connecting track segment is mainline Defaults to not mainline if connecting track segment is missing |
boolean |
isMainlineOrdered(int i)
|
double |
normalizeAngle(double a)
|
void |
scaleCoords(float xFactor,
float yFactor)
|
void |
setCoordsCenter(Point2D p)
Modify coordinates methods |
void |
setObjects(LayoutEditor p)
Initialization method The name of each track segment connected to a ray track is initialized by by LayoutTurntableXml, then the following method is called after the entire LayoutEditor is loaded to set the specific TrackSegment objects. |
void |
setRadius(double r)
|
void |
setRayConnect(TrackSegment tr,
int index)
|
void |
setRayCoordsIndexed(double x,
double y,
int index)
|
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 |
| Constructor Detail |
|---|
public LayoutTurntable(String id,
Point2D c,
LayoutEditor myPanel)
| Method Detail |
|---|
public String getID()
public Point2D getCoordsCenter()
public double getRadius()
public void setRadius(double r)
protected jmri.jmrit.display.layoutEditor.LayoutTurntable.RayTrack addRay(double angle)
public void addRayTrack(double angle,
int index,
String name)
public TrackSegment getRayConnectIndexed(int index)
public TrackSegment getRayConnectOrdered(int i)
public void setRayConnect(TrackSegment tr,
int index)
public int getNumberRays()
public int getRayIndex(int i)
public double getRayAngle(int i)
public Point2D getRayCoordsIndexed(int index)
public Point2D getRayCoordsOrdered(int i)
public void setRayCoordsIndexed(double x,
double y,
int index)
public boolean isMainlineIndexed(int index)
public boolean isMainlineOrdered(int i)
public void setCoordsCenter(Point2D p)
public void scaleCoords(float xFactor,
float yFactor)
public void setObjects(LayoutEditor p)
protected void showPopUp(MouseEvent e)
protected void editTurntable(LayoutTurntable x)
public boolean isActive()
public double normalizeAngle(double a)
public double diffAngle(double a,
double b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||