|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.layer.terrain.ProfileGenerator
public class ProfileGenerator
This tool lets the user draw a line on the map, and then presents the profile of the path in a GIF picture. The line can be drawn in a series if clicks, or the mouse button can be held down as the mouse is dragged around. The lines are drawn as great circle lines, which represent the straight geographical line between clicks.
The profile tool uses the ProfileStateMachine, and the Profile States, to keep track of the proper actions and reactions of user input.
Field Summary | |
---|---|
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. |
Fields inherited from interface com.bbn.openmap.layer.terrain.TerrainTool |
---|
MAX_SPACE_BETWEEN_PIXELS |
Constructor Summary | |
---|---|
ProfileGenerator(TerrainLayer tLayer)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public ProfileGenerator(TerrainLayer tLayer)
Method Detail |
---|
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 event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |