com.oziexplorer
Class TrackFile

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<T>
              extended by com.oziexplorer.DataFile<TrackPoint>
                  extended by com.oziexplorer.TrackFile
All Implemented Interfaces:
Serializable, Cloneable, Iterable<TrackPoint>, Collection<TrackPoint>, List<TrackPoint>, RandomAccess

public class TrackFile
extends DataFile<TrackPoint>

Read and write OziExplorer track log files.

See Also:
Serialized Form

Field Summary
protected  int color
          The RGB track color.
protected  String datum
          The track datum.
protected  String description
          The track description.
protected  TrackFill fill
          The track fill type.
protected  int fillColor
          The track fill color.
protected  int reserved
          Reserved field - unknown use.
protected  int skip
          The track 'skip' value.
protected  int timezoneOffset
           
protected  TrackType type
          The track type.
protected  int width
          The track width, in pixels.
 
Fields inherited from class com.oziexplorer.DataFile
C, L, SepRE, T
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
TrackFile()
          Create a new track file reader/writer.
 
Method Summary
 void clear()
          Clear any current contents of the track.
 void display(int trackNum)
          Display the track log in the specified track number.
 String getDatum()
          Get the track datum.
 int getReserved()
          Get the value of the reserved field.
 int getTimezoneOffset()
          Get the timezone offset for the track, in minutes.
 int getTrackColor()
          Get the RGB track color.
 String getTrackDesc()
          Get the track description.
 TrackFill getTrackFill()
          Get the track fill pattern, see TrackFill.
 int getTrackFillColor()
          Get the RGB track fill color.
 int getTrackSkip()
          Get the track 'skip' value.
 TrackType getTrackType()
          Get the track type, see TrackType.
 int getTrackWidth()
          Get the track width, in pixels.
 void read(File file)
          Read a track log from the specified File.
 void read(InputStream input)
          Read a track log from the specified InputStream.
 void read(String file)
          Read a track log from the specified file.
 void setDatum(String datum)
          Set the track datum.
 void setReserved(int reserved)
          Set the value of the reserved field.
 void setTimezoneOffset(int timezoneOffset)
          Set the timezone offset for the track, in minutes.
 void setTrackColor(int trackColor)
          Set the RGB track color.
 void setTrackDesc(String trackDesc)
          Set the track description.
 void setTrackFill(TrackFill trackFill)
          Set the track fill pattern, see TrackFill.
 void setTrackFillColor(int trackFillColor)
          Set the RGB track fill color.
 void setTrackSkip(int trackSkip)
          set the track 'skip' value.
 void setTrackType(TrackType trackType)
          Set the track type, see TrackType.
 void setTrackWidth(int trackWidth)
          Set the track width, in pixels.
 void write(File file)
          Write a track log to the specified File.
 void write(OutputStream output)
          Write a track log to the specified OutputStream.
 void write(String file)
          Write a track log to the specified file.
 
Methods inherited from class com.oziexplorer.DataFile
calendarToOziDate, escapeCommas, getDate, getDouble, getInt, getString, newOziException, newOziException, newScanner, oziDateToCalendar, skipNext, unescapeCommas
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

datum

protected String datum
The track datum.


reserved

protected int reserved
Reserved field - unknown use.


width

protected int width
The track width, in pixels.


color

protected int color
The RGB track color.


description

protected String description
The track description.


skip

protected int skip
The track 'skip' value.


type

protected TrackType type
The track type.


fill

protected TrackFill fill
The track fill type.


fillColor

protected int fillColor
The track fill color.


timezoneOffset

protected int timezoneOffset
Constructor Detail

TrackFile

public TrackFile()
Create a new track file reader/writer.

Method Detail

clear

public void clear()
Clear any current contents of the track.

Specified by:
clear in interface Collection<TrackPoint>
Specified by:
clear in interface List<TrackPoint>
Overrides:
clear in class ArrayList<TrackPoint>

read

public void read(File file)
          throws OziException
Read a track log from the specified File.

Parameters:
file - the file to read from.
Throws:
OziException - if there is a problem reading the file.

read

public void read(String file)
          throws OziException
Read a track log from the specified file.

Parameters:
file - the file to read from.
Throws:
OziException - if there is a problem reading the file.

read

public void read(InputStream input)
          throws OziException
Read a track log from the specified InputStream.

Parameters:
input - the input stream to read from.
Throws:
OziException - if there is a problem reading the file.

write

public void write(File file)
           throws OziException
Write a track log to the specified File.

Parameters:
file - the file to write to.
Throws:
OziException - if there is a problem writing the file.

write

public void write(String file)
           throws OziException
Write a track log to the specified file.

Parameters:
file - the file to write to.
Throws:
OziException - if there is a problem writing the file.

write

public void write(OutputStream output)
           throws OziException
Write a track log to the specified OutputStream.

Parameters:
output - the input stream to write to.
Throws:
OziException - if there is a problem writing the file.

display

public void display(int trackNum)
             throws OziException
Display the track log in the specified track number. Note that the track skip and fill color/pattern cannot be set as OziAPI has no functions to allow that - if this is required, save the track log to a file and load it with OziAPI.loadTrackFile(int, java.lang.String).

Parameters:
trackNum - the track number to load into.
Throws:
OziException - if there is a problem displaying the track.

getDatum

public String getDatum()
Get the track datum.

Returns:
the track datum.

setDatum

public void setDatum(String datum)
Set the track datum.

Parameters:
datum - the track datum.

getReserved

public int getReserved()
Get the value of the reserved field.

Returns:
the value of the reserved field.

setReserved

public void setReserved(int reserved)
Set the value of the reserved field.

Parameters:
reserved - the value of the reserved field.

getTimezoneOffset

public int getTimezoneOffset()
Get the timezone offset for the track, in minutes.

Returns:
the timezone offset for the track.

setTimezoneOffset

public void setTimezoneOffset(int timezoneOffset)
Set the timezone offset for the track, in minutes.

Parameters:
timezoneOffset - the timezone offset for the track.

getTrackColor

public int getTrackColor()
Get the RGB track color.

Returns:
the RGB track color.

setTrackColor

public void setTrackColor(int trackColor)
Set the RGB track color.

Parameters:
trackColor - the RGB track color.

getTrackDesc

public String getTrackDesc()
Get the track description.

Returns:
the track description.

setTrackDesc

public void setTrackDesc(String trackDesc)
Set the track description.

Parameters:
trackDesc - the track description.

getTrackFill

public TrackFill getTrackFill()
Get the track fill pattern, see TrackFill.

Returns:
the track fill pattern

setTrackFill

public void setTrackFill(TrackFill trackFill)
Set the track fill pattern, see TrackFill.

Parameters:
trackFill - the track fill pattern.

getTrackFillColor

public int getTrackFillColor()
Get the RGB track fill color.

Returns:
the RGB track fill color.

setTrackFillColor

public void setTrackFillColor(int trackFillColor)
Set the RGB track fill color.

Parameters:
trackFillColor - the RGB track fill color.

getTrackSkip

public int getTrackSkip()
Get the track 'skip' value. This reduces the number of displayed points, but doesn't seem to correspond to any OziExplorer track management option. Normally set to 1.

Returns:
the track 'skip' value.

setTrackSkip

public void setTrackSkip(int trackSkip)
set the track 'skip' value. This reduces the number of displayed points, but doesn't seem to correspond to any OziExplorer track management option. Normally set to 1.

Parameters:
trackSkip - the track 'skip' value.

getTrackType

public TrackType getTrackType()
Get the track type, see TrackType.

Returns:
the track type

setTrackType

public void setTrackType(TrackType trackType)
Set the track type, see TrackType.

Parameters:
trackType -

getTrackWidth

public int getTrackWidth()
Get the track width, in pixels.

Returns:
the track width, in pixels.

setTrackWidth

public void setTrackWidth(int trackWidth)
Set the track width, in pixels.

Parameters:
trackWidth - the track width, in pixels.