|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.visad.display.DisplayMaster
ucar.unidata.view.geoloc.NavigatedDisplay
ucar.unidata.view.geoloc.MapProjectionDisplay
public abstract class MapProjectionDisplay
Provides a navigated VisAD DisplayImpl for displaying data. The Projection or MapProjection provides the transformation from lat/lon space to xy space. There are three modes that can be used with this display - MODE_3D (Java 3D), MODE_2Din3D (2D in Java 3D), MODE_2D (Java 2D). Performance is better in Java 3D modes. In the 3D mode, RealType.Altitude is mapped to the display Z axis.
Any displayable data must be able to map to RealType.Latitude, RealType.Longitude and/or RealType.Altitude.
| Nested Class Summary | |
|---|---|
protected static class |
MapProjectionDisplay.MapProjection3DAdapter
An adapter for visad.georef.MapProjection coordinate systems (ie: ones with * a reference of Lat/Lon). |
| Nested classes/interfaces inherited from class ucar.unidata.view.geoloc.NavigatedDisplay |
|---|
NavigatedDisplay.VerticalMapSet |
| Field Summary | |
|---|---|
static String |
CURSOR_BEARING
The name of the bearing from center property. |
static RealType |
CURSOR_BEARING_TYPE
The bearing from center RealType. |
static String |
CURSOR_RANGE
The name of the range from center property. |
static RealType |
CURSOR_RANGE_TYPE
The range from center RealType. |
static boolean |
force2D
flag for forcing 2D |
| Fields inherited from class ucar.unidata.view.geoloc.NavigatedDisplay |
|---|
BOTTOM_VIEW, BOTTOM_VIEW_NAME, CURSOR_ALTITUDE, CURSOR_LATITUDE, CURSOR_LONGITUDE, EAST_VIEW, EAST_VIEW_NAME, MODE_2D, MODE_2Din3D, MODE_3D, NORTH_VIEW, NORTH_VIEW_NAME, SOUTH_VIEW, SOUTH_VIEW_NAME, TOP_VIEW, TOP_VIEW_NAME, WEST_VIEW, WEST_VIEW_NAME |
| Fields inherited from class ucar.visad.display.DisplayMaster |
|---|
behavior, defaultMouseFunctions, POINT_MODE |
| Constructor Summary | |
|---|---|
protected |
MapProjectionDisplay()
Constructs an instance with the specified MapProjection |
protected |
MapProjectionDisplay(MapProjection projection,
DisplayImpl display)
Constructs an instance with the specified MapProjection CoordinateSystem and display. |
| Method Summary | |
|---|---|
abstract void |
addKeyboardBehavior(KeyboardBehavior behavior)
Add a KeyboardBehavior to this class |
void |
addVerticalMap(RealType newVertType)
Add a new mapping of this type to the vertical coordinate |
protected void |
cursorMoved()
Handles a change to the cursor position. |
void |
destroy()
Destroy this class |
protected ScalarMap |
getAltitudeMap()
Accessor method for the vertical coordinate ScalarMap (i.e., what getDisplayAltitudeType is mapped from). |
Real |
getCursorBearing()
Gets the cursor bearing from center property. |
Real |
getCursorRange()
Gets the cursor range from center property. |
DisplayRealType |
getDisplayAltitudeType()
Accessor method for the DisplayAltitudeType (i.e., what RealType.Altitude is mapped to). |
CoordinateSystem |
getDisplayCoordinateSystem()
Get the display coordinate system that turns lat/lon/alt to x/y/z |
DisplayRealType |
getDisplayLatitudeType()
Accessor method for the DisplayLatitudeType (i.e., what RealType.Latitude is mapped to). |
DisplayRealType |
getDisplayLongitudeType()
Accessor method for the DisplayLongitudeType (i.e., what RealType.Longitude is mapped to). |
EarthLocation |
getEarthLocation(double x,
double y,
double z,
boolean setZToZeroIfOverhead)
Get the earth location from the VisAD xyz coodinates |
static MapProjectionDisplay |
getInstance(int mode)
Get an instance of a MapProjectionDisplay using the mode specified and the default projection. |
static MapProjectionDisplay |
getInstance(MapProjection p,
int mode)
Get an instance of a MapProjectionDisplay using the mode specified and the MapProjection. |
static MapProjectionDisplay |
getInstance(MapProjection p,
int mode,
boolean offscreen,
Dimension dimension)
Get an instance of a MapProjectionDisplay using the mode specified and the MapProjection. |
static MapProjectionDisplay |
getInstance(MapProjection p,
int mode,
boolean offscreen,
Dimension dimension,
GraphicsDevice screen)
Get an instance of a MapProjectionDisplay using the mode specified and the MapProjection. |
MapProjection |
getMapProjection()
Get the MapProjection that defines the xy mapping of this MapProjectionDisplay. |
RealTuple |
getSpatialCoordinates(EarthLocation el)
Returns the spatial (XYZ) coordinates of the particular EarthLocation |
double[] |
getSpatialCoordinates(EarthLocation el,
double[] xyz)
Returns the spatial (XYZ) coordinates of the particular EarthLocation |
double[] |
getVerticalRange()
Get the range of the vertical coordinate (Altitude) |
protected void |
init(MapProjection projection,
DisplayImpl display)
Initializes an instance with the specified MapProjection CoordinateSystem and display. |
protected void |
initializeClass()
Set up the display. |
static void |
main(String[] args)
test by running java ucar.unidata.view.geoloc.MapProjectionDisplay |
protected static MapProjection |
makeDefaultMapProjection()
Make the default projection. |
protected void |
pointerMoved(int x,
int y)
Handles a change in the position of the mouse-pointer. |
void |
removeVerticalMap(RealType vertType)
Remove a new mapping of this type to the vertical coordinate |
float[] |
scaleVerticalValues(float[] altValues)
Scale vertical values using the range of the vertical scalar map. |
protected void |
setCursorBearing(Real bearing)
Sets the cursor bearing (degrees) from center property. |
protected void |
setCursorRange(Real range)
Sets the cursor range from center property. |
void |
setMapArea(ucar.unidata.geoloc.ProjectionRect mapArea)
Set the map area from the projection rectangle |
void |
setMapProjection(MapProjection mapProjection)
Define the map projection using a MapProjection type CoordinateSystem |
void |
setMapProjection(ucar.unidata.geoloc.ProjectionImpl projection)
Define the map projection using a Projection interface |
void |
setMapRegion(Gridded2DSet region)
Set the map region to be displayed. |
void |
setVerticalRange(double min,
double max)
Set the range of the vertical coordinate |
void |
setVerticalRangeUnit(Unit newUnit)
Set the Unit of the vertical range |
void |
setView(int view)
Set the view for 3D. |
protected void |
updateLocation(EarthLocation el)
Update lat/lon/alt properties with the EarthLocation. |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static RealType CURSOR_RANGE_TYPE
public static RealType CURSOR_BEARING_TYPE
public static final String CURSOR_RANGE
public static final String CURSOR_BEARING
public static boolean force2D
| Constructor Detail |
|---|
protected MapProjectionDisplay()
protected MapProjectionDisplay(MapProjection projection,
DisplayImpl display)
throws VisADException,
RemoteException
projection - map projection CSdisplay - display to use
VisADException - Couldn't create necessary VisAD object
RemoteException - Couldn't create a remote object| Method Detail |
|---|
protected void init(MapProjection projection,
DisplayImpl display)
throws VisADException,
RemoteException
projection - map projection CSdisplay - display to use
VisADException - Couldn't create necessary VisAD object
RemoteException - Couldn't create a remote object
protected void initializeClass()
throws VisADException,
RemoteException
initializeClass in class NavigatedDisplayRemoteException - Java RMI problem
VisADException - VisAD problem
public static MapProjectionDisplay getInstance(int mode)
throws VisADException,
RemoteException
mode - mode to use
VisADException - problem creating some VisAD object
RemoteException - problem creating remote object
public static MapProjectionDisplay getInstance(MapProjection p,
int mode)
throws VisADException,
RemoteException
mode - mode to usep - initial MapProjection for display
VisADException - problem creating some VisAD object
RemoteException - problem creating remote object
public static MapProjectionDisplay getInstance(MapProjection p,
int mode,
boolean offscreen,
Dimension dimension)
throws VisADException,
RemoteException
p - map projectionmode - modeoffscreen - true if offscreendimension - dimension of display
RemoteException - Java RMI problem
VisADException - problem creating the display or some component
public static MapProjectionDisplay getInstance(MapProjection p,
int mode,
boolean offscreen,
Dimension dimension,
GraphicsDevice screen)
throws VisADException,
RemoteException
p - map projectionmode - modeoffscreen - true if offscreendimension - dimension of displayscreen - screen to display it on
RemoteException - Java RMI problem
VisADException - problem creating the display or some componentpublic void destroy()
destroy in class DisplayMasterpublic abstract void addKeyboardBehavior(KeyboardBehavior behavior)
addKeyboardBehavior in class DisplayMasterbehavior - behavior to add
public void addVerticalMap(RealType newVertType)
throws VisADException,
RemoteException
addVerticalMap in class NavigatedDisplaynewVertType - RealType of map
RemoteException - Java RMI problem
VisADException - VisAD problem
public void removeVerticalMap(RealType vertType)
throws VisADException,
RemoteException
removeVerticalMap in class NavigatedDisplayvertType - RealType of map
RemoteException - Java RMI problem
VisADException - VisAD problem
public void setVerticalRangeUnit(Unit newUnit)
throws VisADException,
RemoteException
setVerticalRangeUnit in class NavigatedDisplaynewUnit - unit of range
RemoteException - Java RMI problem
VisADException - VisAD problem
public void setVerticalRange(double min,
double max)
throws VisADException,
RemoteException
setVerticalRange in class NavigatedDisplaymin - minimum value for vertical axismax - maximum value for vertical axis
RemoteException - Java RMI problem
VisADException - VisAD problempublic double[] getVerticalRange()
getVerticalRange in class NavigatedDisplay
protected void setCursorRange(Real range)
throws VisADException,
RemoteException
range - The cursor range from center.
RemoteException - Java RMI problem
VisADException - VisAD problempublic Real getCursorRange()
null.
protected void setCursorBearing(Real bearing)
throws VisADException,
RemoteException
bearing - The cursor bearing from center.
RemoteException - Java RMI problem
VisADException - VisAD problempublic Real getCursorBearing()
null.public void setView(int view)
NORTH
_________
W | | E
E | TOP | A
S | | S
T |_______| T
SOUTH
setView in class NavigatedDisplayview - one of the static view fields (NORTH_VIEW, SOUTH_VIEW, ..
etc).public DisplayRealType getDisplayLatitudeType()
getDisplayLatitudeType in class NavigatedDisplaypublic DisplayRealType getDisplayLongitudeType()
getDisplayLongitudeType in class NavigatedDisplaypublic DisplayRealType getDisplayAltitudeType()
getDisplayAltitudeType in class NavigatedDisplayprotected ScalarMap getAltitudeMap()
getAltitudeMap in class NavigatedDisplay
public void setMapProjection(ucar.unidata.geoloc.ProjectionImpl projection)
throws VisADException,
RemoteException
setMapProjection in class NavigatedDisplayprojection - Projection to use
VisADException - Couldn't create necessary VisAD object
RemoteException - Couldn't create a remote object
public void setMapProjection(MapProjection mapProjection)
throws VisADException,
RemoteException
setMapProjection in class NavigatedDisplaymapProjection - map projection coordinate system
VisADException - Couldn't create necessary VisAD object
RemoteException - Couldn't create a remote objectpublic MapProjection getMapProjection()
public void setMapArea(ucar.unidata.geoloc.ProjectionRect mapArea)
throws VisADException,
RemoteException
setMapArea in class NavigatedDisplaymapArea - map area as lat/lon lines
RemoteException - problem setting remote data
VisADException - problem creating VisAD data object
public void setMapRegion(Gridded2DSet region)
throws VisADException,
RemoteException
region - Gridded2DSet containing the range of for the axis.
VisADException - invalid domain or null set
RemoteException - Couldn't create a remote objectpublic float[] scaleVerticalValues(float[] altValues)
altValues - altitude map values
protected void cursorMoved()
throws VisADException,
RemoteException
cursorMoved in class NavigatedDisplayVisADException - VisAD failure.
RemoteException - Java RMI failure.
protected void updateLocation(EarthLocation el)
throws VisADException,
RemoteException
updateLocation in class NavigatedDisplayel - EarthLocation to use.
RemoteException - Java RMI problem
VisADException - VisAD problem
protected void pointerMoved(int x,
int y)
throws UnitException,
VisADException,
RemoteException
pointerMoved in class NavigatedDisplayx - x mouse positiony - y mouse position
RemoteException - Java RMI problem
UnitException - Unit conversion problem
VisADException - VisAD problem
public EarthLocation getEarthLocation(double x,
double y,
double z,
boolean setZToZeroIfOverhead)
getEarthLocation in class NavigatedDisplayx - xy - yz - zsetZToZeroIfOverhead - If in the overhead view then set Z to 0
public RealTuple getSpatialCoordinates(EarthLocation el)
getSpatialCoordinates in class NavigatedDisplayel - earth location to transform
public double[] getSpatialCoordinates(EarthLocation el,
double[] xyz)
throws VisADException,
RemoteException
getSpatialCoordinates in class NavigatedDisplayel - earth location to transformxyz - The in value to set. May be null.
RemoteException - Java RMI problem
VisADException - VisAD problem
protected static MapProjection makeDefaultMapProjection()
throws VisADException
VisADException - couldn't create MapProjectionpublic CoordinateSystem getDisplayCoordinateSystem()
getDisplayCoordinateSystem in class NavigatedDisplay
public static void main(String[] args)
throws Exception
args - include an argument for a 3D display
Exception - problem creating the display
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||