com.oziexplorer
Class Waypoint

java.lang.Object
  extended by com.oziexplorer.Waypoint

public class Waypoint
extends Object

This class represents OziExplorer waypoints. One important OziExplorer 'gotcha' is that waypoint numbers are not a reliable way of identifying waypoints - if a waypoint is deleted the remaining waypoints are renumbered. This means that most of the OziAPI functions that manipulate waypoints by using the waypoint number are unreliable.

Copyright 2011 Alan Burlison, . All rights reserved. Use is subject to license terms, see LICENSE.txt.
SourceForge.net


Field Summary
protected  double altitude
          Waypoint altitude - OziAPI.UNKALT for unknown.
protected  int backColor
          RGB background color.
protected  Calendar date
          Creation date of the waypoint.
protected  String description
          Waypoint description.
protected  String fileAttachmentName
          Attachment filename.
protected  int fontSize
          Font size in points.
protected  int fontStyle
          Font style.
protected  int foreColor
          RGB foreground color.
protected  int garminDisplayFormat
          Garmin display format.
protected  int mapDisplayFormat
          may display format.
protected  String name
          Waypoint name.
protected  int number
          Waypoint number, set by JNI code.
protected  int pointerDirection
          Pointer direction.
protected  Position position
          Waypoint position.
protected  int proximityDistance
          Proximity distance.
protected  String proximityFileAttachmentName
          Proximity attachment filename.
protected  int proximityRoute
          Proximity route.
protected  String proximitySymbolName
          Proximity symbol filename.
protected  int proximitySymbolPos
          Proximity symbol position.
protected  double proximityTime
          Proximity time.
protected  int symbol
          Waypoint symbol - GPS specific.
protected  int symbolSize
          Symbol size.
 
Constructor Summary
Waypoint(String name, int symbol, Position position)
          Creates a new Waypoint with default parameters.
Waypoint(String name, int symbol, Position position, double altitude, Calendar date, int mapDisplayFormat, int pointerDirection, int garminDisplayFormat, int foreColor, int backColor, int proximityDistance, String description, int fontSize, int fontStyle, int symbolSize)
          Create a new Waypoint with default proximity and attachment information.
Waypoint(String name, int symbol, Position position, double altitude, Calendar date, int mapDisplayFormat, int pointerDirection, int garminDisplayFormat, int foreColor, int backColor, int proximityDistance, String description, int fontSize, int fontStyle, int symbolSize, int proximitySymbolPos, double proximityTime, int proximityRoute, String fileAttachmentName, String proximityFileAttachmentName, String proximitySymbolName)
          Create a new fully-specified Waypoint.
 
Method Summary
 boolean equals(Object that)
          Test if two waypoints are equal.
 double getAltitude()
          Retrieve the altitude for the waypoint.
 int getBackColor()
          Retrieve the background RGB color.
 Calendar getDate()
          Retrieve the date the waypoint was created.
 String getDescription()
          Retrieve the waypoint description.
 String getFileAttachmentName()
          Retrieve the attachment filename.
 int getFontSize()
          Retrieve the label font size, in points.
 int getFontStyle()
          Retrieve the font style - 0 for normal, 1 for bold.
 int getForeColor()
          Retrieve the foreground RGB color.
 int getGarminDisplayFormat()
          Retrieve the Garmin display format.
 int getMapDisplayFormat()
          Retrieve the map display format for the waypoint.
 String getName()
          Retrieve the name of the waypoint.
 int getNumber()
          Retrieve the waypoint number.
 int getPointerDirection()
          Retrieve the pointer direction for the waypoint.
 Position getPosition()
          Retrieve the Position for the waypoint.
 int getProximityDistance()
          Retrieve the proximity distance, in metres.
 String getProximityFileAttachmentName()
          Retrieve the proximity attachment filename.
 int getProximityRoute()
          Retrieve the proximity route.
 String getProximitySymbolName()
          Retrieve the proximity symbol filename.
 int getProximitySymbolPos()
          Retrieve the proximity symbol position.
 double getProximityTime()
          Retrieve the proximity time, in seconds.
 int getSymbol()
          Retrieve the symbol number for the waypoint.
 int getSymbolSize()
          Retrieve the symbol size.
 int hashCode()
          Return the hash code for this object.
 String toString()
          Return a string representation of the waypoint - name, position and description.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected final String name
Waypoint name.


symbol

protected final int symbol
Waypoint symbol - GPS specific.


position

protected final Position position
Waypoint position.


altitude

protected final double altitude
Waypoint altitude - OziAPI.UNKALT for unknown.


date

protected final Calendar date
Creation date of the waypoint.


mapDisplayFormat

protected final int mapDisplayFormat
may display format.


pointerDirection

protected final int pointerDirection
Pointer direction.


garminDisplayFormat

protected final int garminDisplayFormat
Garmin display format.


foreColor

protected final int foreColor
RGB foreground color.


backColor

protected final int backColor
RGB background color.


proximityDistance

protected final int proximityDistance
Proximity distance.


description

protected final String description
Waypoint description.


fontSize

protected final int fontSize
Font size in points.


fontStyle

protected final int fontStyle
Font style.


symbolSize

protected final int symbolSize
Symbol size.


proximitySymbolPos

protected final int proximitySymbolPos
Proximity symbol position.


proximityTime

protected final double proximityTime
Proximity time.


proximityRoute

protected final int proximityRoute
Proximity route.


fileAttachmentName

protected final String fileAttachmentName
Attachment filename.


proximityFileAttachmentName

protected final String proximityFileAttachmentName
Proximity attachment filename.


proximitySymbolName

protected final String proximitySymbolName
Proximity symbol filename.


number

protected final int number
Waypoint number, set by JNI code.

Constructor Detail

Waypoint

public Waypoint(String name,
                int symbol,
                Position position)
Creates a new Waypoint with default parameters.

Parameters:
name - name for the symbol.
symbol - symbol number, or OziAPI.DEFVAL.
position - Position of the waypoint.

Waypoint

public Waypoint(String name,
                int symbol,
                Position position,
                double altitude,
                Calendar date,
                int mapDisplayFormat,
                int pointerDirection,
                int garminDisplayFormat,
                int foreColor,
                int backColor,
                int proximityDistance,
                String description,
                int fontSize,
                int fontStyle,
                int symbolSize)
Create a new Waypoint with default proximity and attachment information.

Parameters:
name - name for the symbol
symbol - symbol number, or OziAPI.DEFVAL.
position - Position of the waypoint.
altitude - atlitude of the waypoint, or OziAPI.UNKALT.
date - ceation date of the waypoint.
mapDisplayFormat - display format - 0 to 8, or OziAPI.DEFVAL.
pointerDirection - pointer direction - 0 to 3, or OziAPI.DEFVAL.
garminDisplayFormat - garmin display format - 0 to 2, or OziAPI.DEFVAL.
foreColor - foreground RGB color, or OziAPI.DEFVAL.
backColor - background RGB color, or OziAPI.DEFVAL.
proximityDistance - procimity distance in metres, or 0.
description - waypoint description
fontSize - font size in points, or OziAPI.DEFVAL.
fontStyle - font style. 0 = normal, 1 = bold, or OziAPI.DEFVAL.
symbolSize - in pixels, 17 is the norm, or OziAPI.DEFVAL.

Waypoint

public Waypoint(String name,
                int symbol,
                Position position,
                double altitude,
                Calendar date,
                int mapDisplayFormat,
                int pointerDirection,
                int garminDisplayFormat,
                int foreColor,
                int backColor,
                int proximityDistance,
                String description,
                int fontSize,
                int fontStyle,
                int symbolSize,
                int proximitySymbolPos,
                double proximityTime,
                int proximityRoute,
                String fileAttachmentName,
                String proximityFileAttachmentName,
                String proximitySymbolName)
Create a new fully-specified Waypoint.

Parameters:
name - name for the symbol
symbol - symbol number, or OziAPI.DEFVAL.
position - Position of the waypoint.
altitude - atlitude of the waypoint, or OziAPI.UNKALT.
date - ceation date of the waypoint.
mapDisplayFormat - display format - 0 to 8, or OziAPI.DEFVAL.
pointerDirection - pointer direction - 0 to 3, or OziAPI.DEFVAL.
garminDisplayFormat - garmin display format - 0 to 2, or OziAPI.DEFVAL.
foreColor - foreground RGB color, or OziAPI.DEFVAL.
backColor - background RGB color, or OziAPI.DEFVAL.
proximityDistance - procimity distance in metres, or 0.
description - waypoint description
fontSize - font size in points, or OziAPI.DEFVAL.
fontStyle - fornt style. 0 = normal, 1 = bold, or OziAPI.DEFVAL.
symbolSize - in pixels, 17 is the norm, or OziAPI.DEFVAL.
proximitySymbolPos - proximity symbol position, 0 to 7, or OziAPI.DEFVAL.
proximityTime - proximity time in seconds
proximityRoute - proximity route, 0 = proximity, 1 = route, 2 = proximity and route.
fileAttachmentName - Waypoint attachment file path
proximityFileAttachmentName - proximity attachment file path.
proximitySymbolName - proximity symbol file path.
Method Detail

equals

public boolean equals(Object that)
Test if two waypoints are equal. All the fields with the exception of the number OziExplorer assigns to the waypoint are used in the comparison.

Overrides:
equals in class Object
Parameters:
that - the object to compare against.
Returns:
true if the objects are equal.

hashCode

public int hashCode()
Return the hash code for this object.

Overrides:
hashCode in class Object
Returns:
the hash code for this object.

getName

public String getName()
Retrieve the name of the waypoint.

Returns:
the name of ther waypoint.

getSymbol

public int getSymbol()
Retrieve the symbol number for the waypoint.

Returns:
the symbol number for the waypoint.

getPosition

public Position getPosition()
Retrieve the Position for the waypoint.

Returns:
the Position for the waypoint.

getAltitude

public double getAltitude()
Retrieve the altitude for the waypoint.

Returns:
the altitude for the waypoint.

getDate

public Calendar getDate()
Retrieve the date the waypoint was created.

Returns:
the date the waypoint was created.

getMapDisplayFormat

public int getMapDisplayFormat()
Retrieve the map display format for the waypoint.

Returns:
the map display format for the waypoint

getPointerDirection

public int getPointerDirection()
Retrieve the pointer direction for the waypoint.

Returns:
the pointer direction for the waypoint.

getGarminDisplayFormat

public int getGarminDisplayFormat()
Retrieve the Garmin display format.

Returns:
the Garmin display format.

getForeColor

public int getForeColor()
Retrieve the foreground RGB color.

Returns:
the foreground color.

getBackColor

public int getBackColor()
Retrieve the background RGB color.

Returns:
the background RGB color.

getProximityDistance

public int getProximityDistance()
Retrieve the proximity distance, in metres. 0 means none.

Returns:
the proximity distance.

getDescription

public String getDescription()
Retrieve the waypoint description.

Returns:
the waypoint description.

getFontSize

public int getFontSize()
Retrieve the label font size, in points.

Returns:
the label font size.

getFontStyle

public int getFontStyle()
Retrieve the font style - 0 for normal, 1 for bold.

Returns:
the font style.

getSymbolSize

public int getSymbolSize()
Retrieve the symbol size.

Returns:
the symbol size.

getProximitySymbolPos

public int getProximitySymbolPos()
Retrieve the proximity symbol position.

Returns:
the proximity symbol position.

getProximityTime

public double getProximityTime()
Retrieve the proximity time, in seconds.

Returns:
the proximity time.

getProximityRoute

public int getProximityRoute()
Retrieve the proximity route.

Returns:
the proximity route.

getFileAttachmentName

public String getFileAttachmentName()
Retrieve the attachment filename.

Returns:
the attachment filename.

getProximityFileAttachmentName

public String getProximityFileAttachmentName()
Retrieve the proximity attachment filename.

Returns:
the proximity attachment filename.

getProximitySymbolName

public String getProximitySymbolName()
Retrieve the proximity symbol filename.

Returns:
the proximity symbol filename.

getNumber

public int getNumber()
Retrieve the waypoint number.

Returns:
the waypoint number.

toString

public String toString()
Return a string representation of the waypoint - name, position and description.

Overrides:
toString in class Object
Returns:
a string representation of the waypoint.