hydroScalingAPI.examples.visad
Class MapProjectionDisplay

java.lang.Object
  extended by visad.ActionImpl
      extended by visad.DisplayImpl
          extended by visad.java3d.DisplayImplJ3D
              extended by hydroScalingAPI.examples.visad.MapProjectionDisplay
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, visad.Action, visad.Display, visad.LocalDisplay, visad.ThingChangedListener

public class MapProjectionDisplay
extends visad.java3d.DisplayImplJ3D

Example class to show how to create a Display side CoordinateSystem for supporting various map projections. Also shows how to create a component for displaying the EarthLocation of the cursor.


Nested Class Summary
protected  class MapProjectionDisplay.MapProjectionAdapter
          An adapter for MapProjection coordinate systems (ie: ones with a reference of Lat/Lon).
 
Nested classes/interfaces inherited from class visad.DisplayImpl
visad.DisplayImpl.Syncher
 
Field Summary
 
Fields inherited from class visad.java3d.DisplayImplJ3D
APPLETFRAME, BACK2D, FASTEST, JPANEL, NICEST, OFFSCREEN, PARALLEL_PROJECTION, PERSPECTIVE_PROJECTION, POLYGON_FILL, POLYGON_LINE, POLYGON_POINT, TRANSFORM_ONLY, UNKNOWN
 
Fields inherited from interface visad.Display
AdjustProjectionSeam, Alpha, Animation, Blue, CMY, ColorMode, components3c, components3s, componentscmy, componentscyl, componentsflow1, componentsflow1s, componentsflow2, componentsflow2s, componentshsv, componentsrgb, componentsso, CurvedSize, Cyan, CylAzimuth, CylRadius, CylZAxis, DisplayCMYCoordSys, DisplayCMYTuple, DisplayCylindricalCoordSys, DisplayFlow1SphericalCoordSys, DisplayFlow1SphericalTuple, DisplayFlow1Tuple, DisplayFlow2SphericalCoordSys, DisplayFlow2SphericalTuple, DisplayFlow2Tuple, DisplayHSVCoordSys, DisplayHSVTuple, DisplayRealArray, DisplayRGBTuple, DisplaySpatialCartesianTuple, DisplaySpatialCylindricalTuple, DisplaySpatialOffsetTuple, DisplaySpatialSphericalTuple, DisplaySphericalCoordSys, Flow1Azimuth, Flow1Elevation, Flow1Radial, Flow1X, Flow1Y, Flow1Z, Flow2Azimuth, Flow2Elevation, Flow2Radial, Flow2X, Flow2Y, Flow2Z, Green, HSV, Hue, IsoContour, Latitude, LineStyle, LineWidth, List, Longitude, Magenta, MissingTransparent, PointSize, PolygonMode, PolygonOffset, PolygonOffsetFactor, Radius, Red, RGB, RGBA, Saturation, SelectRange, SelectValue, Shape, ShapeScale, Text, TextureEnable, Value, XAxis, XAxisOffset, YAxis, YAxisOffset, Yellow, ZAxis, ZAxisOffset
 
Constructor Summary
MapProjectionDisplay(java.lang.String imageSource)
          Construct a new MapProjectionDisplay using an image for the projection.
MapProjectionDisplay(java.lang.String imageSource, boolean do3D)
          Construct a new MapProjectionDisplay using an image for the projection.
 
Method Summary
 visad.georef.EarthLocation getCenterPoint()
          Get the center lat/lon/alt of the projection.
 visad.georef.EarthLocation getEarthLocation(double[] xyz)
          Get the EarthLocation of a point in XYZ space
 visad.georef.EarthLocation getEarthLocation(visad.RealTuple xyz)
          Get the EarthLocation of a point in XYZ space
 java.awt.Component getLocationIndicator()
          Get the component that will show the location.
 visad.RealTuple getSpatialCoordinates(visad.georef.EarthLocation el)
          Returns the spatial (XYZ) coordinates of the particular EarthLocation
 boolean isDisplay3D()
          See if this is a 2D or 3D display.
static void main(java.lang.String[] args)
          Test with 'java -Xmx64m MapProjectionDisplay '.
 
Methods inherited from class visad.java3d.DisplayImplJ3D
destroy, destroyUniverse, getAPI, getApplet, getDefaultDisplayRenderer, getGraphicsModeControl, getProjectionControl, makeGeometry, setScreenAspect
 
Methods inherited from class visad.DisplayImpl
addActivityHandler, addControl, addDataSourceListener, addDisplayListener, addMap, addMap, addMessageListener, addReference, addReference, addReferences, addReferences, addReferences, addReferences, addRemoteSourceListener, addRendererSourceListener, addSlave, checkTicks, clearMaps, connectionFailed, controlChanged, delay, disableEvent, doAction, enableEvent, equals, finalize, getComponent, getConnectionID, getConstantMapVector, getControl, getControl, getControls, getControlVector, getDisplayMonitor, getDisplayRenderer, getDisplayScalar, getDisplayScalarCount, getDisplayScalarIndex, getDisplaySync, getImage, getImage, getMapVector, getMouseBehavior, getNumberOfControls, getPrintable, getRenderers, getRendererVector, getScalar, getScalarCount, getScalarIndex, getValueArrayLength, getValueToMap, getValueToScalar, getWidgetPanel, hasSlaves, isEventEnabled, lostCollabConnection, make_matrix, multiply_matrix, notifyListeners, notifyListeners, printStack, reAutoScale, reDisplayAll, removeActivityHandler, removeAllReferences, removeAllSlaves, removeDataSourceListener, removeDisplayListener, removeMap, removeMap, removeMessageListener, removeReference, removeRemoteSourceListener, removeRendererSourceListener, removeSlave, replaceReference, replaceReference, replaceReferences, replaceReferences, replaceReferences, replaceReferences, sendMessage, setAlwaysAutoScale, setComponent, setMouseBehavior, syncRemoteData, toString, toString, updateBusyStatus, updateSlaves, updateSlaves
 
Methods inherited from class visad.ActionImpl
disableAction, enableAction, findReference, getCurrentActionThread, getLinks, getName, run, setEnabled, setName, setThreadPoolMaximum, stop, stopThreadPool, thingChanged, waitForTasks
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface visad.Action
getName
 
Methods inherited from interface visad.ThingChangedListener
thingChanged
 

Constructor Detail

MapProjectionDisplay

public MapProjectionDisplay(java.lang.String imageSource)
                     throws java.lang.Exception
Construct a new MapProjectionDisplay using an image for the projection. Will be displayed on a 2D surface

Parameters:
imageSource - image to use
Throws:
java.lang.Exception

MapProjectionDisplay

public MapProjectionDisplay(java.lang.String imageSource,
                            boolean do3D)
                     throws java.lang.Exception
Construct a new MapProjectionDisplay using an image for the projection.

Parameters:
imageSource - image to use for MapProjection
do3D - construct as a 3D display if true
Throws:
java.lang.Exception
See Also:
MapProjection
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test with 'java -Xmx64m MapProjectionDisplay '.

Parameters:
args - A string array with two entries args[0] is do3D "true" if you want a 3D display, X for 2D args[1] image for MapProjection (file or ADDE URL)
Throws:
java.lang.Exception

getCenterPoint

public visad.georef.EarthLocation getCenterPoint()
Get the center lat/lon/alt of the projection.

Returns:
center location

getEarthLocation

public visad.georef.EarthLocation getEarthLocation(visad.RealTuple xyz)
Get the EarthLocation of a point in XYZ space

Parameters:
xyz - RealTuple with MathType RealTupleType.SpatialCartesian3DTuple)
Returns:
point in lat/lon/alt space.

getEarthLocation

public visad.georef.EarthLocation getEarthLocation(double[] xyz)
Get the EarthLocation of a point in XYZ space

Parameters:
xyz - double[3] of x,y,z coords.
Returns:
point in lat/lon/alt space.

getSpatialCoordinates

public visad.RealTuple getSpatialCoordinates(visad.georef.EarthLocation el)
Returns the spatial (XYZ) coordinates of the particular EarthLocation

Returns:
RealTuple of display coordinates.

isDisplay3D

public boolean isDisplay3D()
See if this is a 2D or 3D display.

Returns:
true if 3D

getLocationIndicator

public java.awt.Component getLocationIndicator()
Get the component that will show the location.

Returns:
a component to show the cursor location.


CUENCAS was initially developed by Ricardo Mantilla at the University of Colorado under the supervision of Dr. Vijay K. Gupta. We wish to recognize the support from the National Science Fundation.