|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcourselog.maputils.MapTrack
public class MapTrack
A track which is able to display on a map.
Field Summary | |
---|---|
protected int |
DISTANCESYMBOLSSQUARE
|
protected GeoDirection |
gdTmp
|
protected int |
myIndexNext
|
protected int |
myIndexSelected
|
protected double |
myTotalLength
|
protected TrackRecord |
myTrack
|
protected ewe.fx.Pen |
PENHANDLE
|
protected ewe.fx.Point |
ptTmp
|
protected ewe.fx.Pen |
thePenNonVisited
|
protected ewe.fx.Pen |
thePenVisited
|
protected int[] |
tPX
|
protected int[] |
tPY
|
Constructor Summary | |
---|---|
MapTrack(ewe.fx.Pen pVisited,
ewe.fx.Pen pNotVisited)
Creates a new instance of MapTrack |
|
MapTrack(ewe.fx.Pen pVisited,
ewe.fx.Pen pNotVisited,
TrackRecord tr)
Creates a new instance of MapTrack with a track |
Method Summary | |
---|---|
void |
addLast(ewe.fx.Point p,
GeoGraphable gG)
Add a point to the track |
void |
drawHandle(ewe.fx.Graphics g,
int x,
int y)
Draw the handle for a waypoint. |
void |
drawIn(ewe.fx.Graphics g,
ewe.fx.Rect r,
GeoGraphable gG)
Display track on a GeoGraphable. |
ewe.fx.Point |
getMapPointFromPosition(int idxP,
GeoDirection tmp,
ewe.fx.Point pt,
GeoGraphable gG)
Compute X and Y on map from point index in track. |
TrackPoint |
getNext()
Getter for next point to visit. |
TrackPoint |
getPointAt(int idx)
Element from the track. |
TrackPoint |
getSelected()
Getter for selected point. |
int |
getSize()
Number of elements in the track. |
double |
getTotalLength()
Total length of the track. |
int |
indexOfClosestPoint(ewe.fx.Point p,
int dMinInt,
GeoGraphable gG)
Find index of closest point from track. |
void |
loadFromFile(ewe.io.File f)
Load the track from a file. |
void |
movePointAt(int idx,
ewe.fx.Point p,
GeoGraphable gG)
Move a point to a new position. |
void |
removeAll()
Empty the track. |
void |
removeAt(int idx)
Remove a point at an index from the track. |
void |
reverse()
Invert the direction of the track. |
void |
selectNext(int direction)
Circular selection of points. |
void |
setNextTo(int idx)
Set the next track point to visit. |
void |
setSelectedIndex(int sel)
Setter for selected point. |
void |
updateDistancesFromIndex(int idxStart)
Update track points distances starting at a given point. |
void |
visitNext()
Visit next point on the track. |
boolean |
writeToFile(ewe.io.File f)
Write the track to a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final ewe.fx.Pen PENHANDLE
protected final int DISTANCESYMBOLSSQUARE
protected ewe.fx.Pen thePenVisited
protected ewe.fx.Pen thePenNonVisited
protected int[] tPX
protected int[] tPY
protected TrackRecord myTrack
protected int myIndexSelected
protected int myIndexNext
protected double myTotalLength
protected ewe.fx.Point ptTmp
protected GeoDirection gdTmp
Constructor Detail |
---|
public MapTrack(ewe.fx.Pen pVisited, ewe.fx.Pen pNotVisited)
public MapTrack(ewe.fx.Pen pVisited, ewe.fx.Pen pNotVisited, TrackRecord tr)
Method Detail |
---|
public int getSize()
public TrackPoint getPointAt(int idx)
idx
- index of the point from the track.
public double getTotalLength()
public TrackPoint getNext()
public TrackPoint getSelected()
public void setSelectedIndex(int sel)
public void selectNext(int direction)
direction
- if positive, go to next, if negative previous.public void addLast(ewe.fx.Point p, GeoGraphable gG)
public void updateDistancesFromIndex(int idxStart)
idxStart
- Index of first point to update. If 0, all track is updated.public void removeAt(int idx)
public void removeAll()
public int indexOfClosestPoint(ewe.fx.Point p, int dMinInt, GeoGraphable gG)
public void movePointAt(int idx, ewe.fx.Point p, GeoGraphable gG)
public void reverse()
public void visitNext()
public void setNextTo(int idx)
public void loadFromFile(ewe.io.File f)
public boolean writeToFile(ewe.io.File f)
public void drawIn(ewe.fx.Graphics g, ewe.fx.Rect r, GeoGraphable gG)
public void drawHandle(ewe.fx.Graphics g, int x, int y)
public ewe.fx.Point getMapPointFromPosition(int idxP, GeoDirection tmp, ewe.fx.Point pt, GeoGraphable gG)
idxP
- Point index to localise.tmp
- GeoDirection reference to compute intermediate direction.
If null a new object is allocated.pt
- point on bitmap image to compute.
If null a new Point object is allocated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |