aim4.map.track
Class ArcTrack

java.lang.Object
  extended by aim4.map.track.ArcTrack
All Implemented Interfaces:
Track

public class ArcTrack
extends Object
implements Track

The arc-shape track.


Nested Class Summary
 class ArcTrack.Position
          A position of the arc-shape track.
 
Constructor Summary
ArcTrack(WayPoint p1, WayPoint p2, Point2D center, boolean isClockwiseDirection)
          Create an arc-shape track segment.
 
Method Summary
 WayPoint getEndWayPoint()
          Get the ending waypoint of the track segment.
 double getLength()
          Get the length of the track.
 TrackPosition getPosition(double dist)
          Get the position on the track that is a given distance from the starting waypoint.
 Shape getShape()
          Get the shape of the track segment
 WayPoint getStartWayPoint()
          Get the starting waypoint of the track segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArcTrack

public ArcTrack(WayPoint p1,
                WayPoint p2,
                Point2D center,
                boolean isClockwiseDirection)
Create an arc-shape track segment.

Parameters:
p1 - the starting point
p2 - the ending point
center - the center of the arc
isClockwiseDirection - whether the arc should draw in the clockwise direction
Method Detail

getStartWayPoint

public WayPoint getStartWayPoint()
Get the starting waypoint of the track segment.

Specified by:
getStartWayPoint in interface Track
Returns:
the starting waypoint

getEndWayPoint

public WayPoint getEndWayPoint()
Get the ending waypoint of the track segment.

Specified by:
getEndWayPoint in interface Track
Returns:
the ending waypoint

getLength

public double getLength()
Get the length of the track.

Specified by:
getLength in interface Track
Returns:
the length of the track.

getPosition

public TrackPosition getPosition(double dist)
Get the position on the track that is a given distance from the starting waypoint. It returns null if the position is off the track (i.e., beyond the ending waypoint.)

Specified by:
getPosition in interface Track
Parameters:
dist - the distance from the starting waypoint; null if the distance is longer than the length of the track.

getShape

public Shape getShape()
Get the shape of the track segment

Specified by:
getShape in interface Track
Returns:
the shape of the track segment


Copyright © 2011. All Rights Reserved.