public class ProfileGenerator extends java.lang.Object implements TerrainTool
The profile tool uses the ProfileStateMachine, and the Profile States, to keep track of the proper actions and reactions of user input.
Modifier and Type | Field and Description |
---|---|
java.util.Vector<LatLonPoint> |
coords
Array of LatLonPoints.
|
protected OMGraphicList |
graphics
The list of graphics to draw.
|
protected TerrainLayer |
layer
The layer that the tool is serving.
|
OMPoly |
profileLine
The line drawn on the screen representing the profile line
path.
|
protected com.bbn.openmap.layer.terrain.ProfileStateMachine |
stateMachine
The state machine for user gestures.
|
java.util.Vector<java.awt.Point> |
xypoints
These are the raw x-y points of the gestures, for the great
circle line points, too.
|
MAX_SPACE_BETWEEN_PIXELS
Constructor and Description |
---|
ProfileGenerator(TerrainLayer tLayer) |
Modifier and Type | Method and Description |
---|---|
protected void |
addGreatCirclePoints(java.awt.event.MouseEvent beginning,
java.awt.event.MouseEvent ending)
Figure out the internal points to create a great circle line
between two points on the screen.
|
protected void |
addProfileEvent(java.awt.event.MouseEvent event)
Used to keep track of another point for the line, as determined
by the state machine.
|
protected void |
createGIFFile(int distance,
int max,
int[] post_dist,
int[] post_height)
Create the image and write it the location.
|
void |
createProfileImage()
Creates the line points for the path drawn on the screen, and
collects the elevation values for those points.
|
OMGraphicList |
getGraphics()
Get the current list of graphics from the tool.
|
State |
getState()
Returns the current state of the state machine.
|
void |
init()
Create the line object, the state machine, and the vectors used
to keep track of the line being drawn.
|
void |
reset()
Clears the line from the screen, and resets the state machine.
|
double[] |
setLLPoints()
Returns a set of lat lon points that represent the line as it
was drawn.
|
void |
setScreenParameters(Projection p)
Let the tool know what the screen looks like.
|
protected com.bbn.openmap.layer.terrain.ProfileStateMachine stateMachine
protected TerrainLayer layer
protected OMGraphicList graphics
public java.util.Vector<LatLonPoint> coords
public java.util.Vector<java.awt.Point> xypoints
public OMPoly profileLine
public ProfileGenerator(TerrainLayer tLayer)
public OMGraphicList getGraphics()
TerrainTool
getGraphics
in interface TerrainTool
public void init()
init
in interface TerrainTool
public void reset()
reset
in interface TerrainTool
public void setScreenParameters(Projection p)
TerrainTool
setScreenParameters
in interface TerrainTool
public double[] setLLPoints()
public State getState()
getState
in interface TerrainTool
public void createProfileImage()
protected void createGIFFile(int distance, int max, int[] post_dist, int[] post_height)
distance
- total length of line, in pixelsmax
- highest point, in meters of all the heights in the
line.post_dist
- array of pixel distances between the pointspost_height
- the array of heightsprotected void addProfileEvent(java.awt.event.MouseEvent event)
event
- Mouse event that supplies the locationprotected void addGreatCirclePoints(java.awt.event.MouseEvent beginning, java.awt.event.MouseEvent ending)
beginning
- the starting mouse eventending
- the ending mouse eventCopyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details