Class Track

java.lang.Object
  |
  +--Track

public class Track
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static float SAMPLING_RATE
           
static int SLICE_DEPTH
           
static float SPEED_OF_SOUND
           
 
Constructor Summary
Track()
          Emptry constructor to be used for cloning.
Track(java.lang.String filename)
          Create a track object from the serialized object specified by the indicated filename.
Track(java.lang.String filename, int startLine, int n)
          Create a track object from a synch file segment.
 
Method Summary
 void boundMask(int start, int stop)
          Apply a dynamic range filter to the density mask
 void cloneTrack(Track t)
          Clone the given track into the current track object.
 float convertWaveDistance(int sliceIndex, int sampleIndex)
          Convert an indexed data point into a distance from the sonar source.
 void createNewImage()
          Create a new image from the density data and update the image.
static int densityToRGB(int d, int min, int max)
          Convert a density to a RGB color value.
 int getDensityArraySize()
          Returns the number of data points in the vertical slice.
 int getHeight()
           
 java.awt.image.BufferedImage getImage()
          Returns an object reference to the current track image.
 java.lang.String getName()
          Returns the object name.
 int getWidth()
          Returns the number of vertical slices.
 void modifyMask(int start, int stop)
          Modify the density mask to eliminate densities ranges from the display image.
 void printData()
          Print out all the time, position, and density bounds for each vertical slice.
 void printInfo()
          Print out track parameters.
 void readData(java.lang.String filename, int startLine, int n, int sliceDepth)
          Read in a track object from a synch file segment.
 void readObject()
          Reload the serialized object.
 void readObject(java.lang.String filename)
          Read in the serialized object using the specified filename.
 void resetMask(boolean b)
          Reset of the density mask to the specified value.
 void setObjectName(java.lang.String objectName)
          Sets the track's object name to objectName.
 java.lang.String toString()
          Return the object name.
 void updateImage()
          Render the track using the current density mask and dynamic-range extent.
 void writeObject()
          Store the track as a serialized object.
 void writeObject(java.lang.String objectName)
          Write the track as a serialized object using the specified filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SLICE_DEPTH

public static final int SLICE_DEPTH

SPEED_OF_SOUND

public static final float SPEED_OF_SOUND

SAMPLING_RATE

public static final float SAMPLING_RATE
Constructor Detail

Track

public Track()
Emptry constructor to be used for cloning.

Track

public Track(java.lang.String filename)
      throws java.io.IOException
Create a track object from the serialized object specified by the indicated filename.
Parameters:
filename - the name of the object file
Throws:
java.io.IOException - if the object cannot be read in

Track

public Track(java.lang.String filename,
             int startLine,
             int n)
      throws java.io.IOException
Create a track object from a synch file segment.
Parameters:
filename - the name of the object file
startLine - the line to starting reading from
n - the number of vertical slices to read
Throws:
java.io.IOException - if the object cannot be read in
Method Detail

toString

public java.lang.String toString()
Return the object name.
Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()
Returns the object name.

boundMask

public void boundMask(int start,
                      int stop)
Apply a dynamic range filter to the density mask
Parameters:
start - the lower density bound
stop - the higher density bound

modifyMask

public void modifyMask(int start,
                       int stop)
Modify the density mask to eliminate densities ranges from the display image.
Parameters:
start - the lower density bound
stop - the upper density bound

resetMask

public void resetMask(boolean b)
Reset of the density mask to the specified value.
Parameters:
b - value to set the mask values to

readObject

public void readObject()
                throws java.io.IOException
Reload the serialized object.
Throws:
java.io.IOException - if the object cannot be read or does not exist

readObject

public void readObject(java.lang.String filename)
                throws java.io.IOException
Read in the serialized object using the specified filename.
Parameters:
filename - the filename of the object
Throws:
java.io.IOException - if the object cannot be read or does not exist

writeObject

public void writeObject()
                 throws java.io.IOException
Store the track as a serialized object.
Throws:
java.io.IOException - if the object cannot be written

writeObject

public void writeObject(java.lang.String objectName)
                 throws java.io.IOException
Write the track as a serialized object using the specified filename.
Parameters:
filename - the name of the object file
Throws:
java.io.IOException - if the object cannot be written

cloneTrack

public void cloneTrack(Track t)
Clone the given track into the current track object.
Parameters:
t - the track to clone

getWidth

public int getWidth()
Returns the number of vertical slices.

getHeight

public int getHeight()

getDensityArraySize

public int getDensityArraySize()
Returns the number of data points in the vertical slice.

getImage

public java.awt.image.BufferedImage getImage()
Returns an object reference to the current track image.

setObjectName

public void setObjectName(java.lang.String objectName)
Sets the track's object name to objectName.
Parameters:
objectName - the name

printInfo

public void printInfo()
Print out track parameters.

printData

public void printData()
Print out all the time, position, and density bounds for each vertical slice.

readData

public void readData(java.lang.String filename,
                     int startLine,
                     int n,
                     int sliceDepth)
              throws java.io.IOException
Read in a track object from a synch file segment.
Parameters:
filename - the name of the synch file
startLine - the line to start reading from
n - the number of lines to read
sliceDepth - the number of datapoints in a vertical slice
Throws:
java.io.IOException - if the track cannot be read

createNewImage

public void createNewImage()
Create a new image from the density data and update the image.

updateImage

public void updateImage()
Render the track using the current density mask and dynamic-range extent.

convertWaveDistance

public float convertWaveDistance(int sliceIndex,
                                 int sampleIndex)
Convert an indexed data point into a distance from the sonar source.
Parameters:
sliceIndex - index of the vertical slice
sampleIndex - index of the sample within the vertical slice

densityToRGB

public static int densityToRGB(int d,
                               int min,
                               int max)
Convert a density to a RGB color value.
Parameters:
d - the density value
min - the minimum density bound
max - the maximum density bound