ucar.visad.display
Class XYDisplay

java.lang.Object
  extended by ucar.visad.display.DisplayMaster
      extended by ucar.visad.display.XYDisplay
Direct Known Subclasses:
HovmollerDisplay, TimeHeightDisplay, XSDisplay

public class XYDisplay
extends DisplayMaster

A wrapper for a 2D display for XY plots of data

Version:
$Revision: 1.25 $
Author:
Don Murray

Field Summary
 
Fields inherited from class ucar.visad.display.DisplayMaster
behavior, defaultMouseFunctions, log_, POINT_MODE
 
Constructor Summary
XYDisplay()
          Constuctor for display with RealType.XAxis mapped to Display.XAxis and RealType.YAxis mapped to Display.YAxis and a default name.
XYDisplay(boolean offscreen, Dimension dimension)
          Constuctor for display with RealType.XAxis mapped to Display.XAxis and RealType.YAxis mapped to Display.YAxis and the specified offscreen.
XYDisplay(String name)
          Constuctor for display with RealType.XAxis mapped to Display.XAxis and RealType.YAxis mapped to Display.YAxis and the specified name.
XYDisplay(String name, RealType xAxisType, RealType yAxisType)
          Constructor with RealTypes for the X and Y axes and the given name.
XYDisplay(String name, RealType xAxisType, RealType yAxisType, boolean offScreen, Dimension dimension)
          Constructor with RealTypes for the X and Y axes and the given name.
 
Method Summary
 void autoScaleXAxis()
          Let the XAxis autoscale.
 void autoScaleYAxis()
          Let the YAxis autoscale.
 void enableClipping(boolean clip)
          Enable clipping of data at the box edges.
 boolean getGridLinesVisible()
          Get whether the grid lines are visible
 String getName()
          Get the name given to this display.
 AxisScale getXAxisScale()
          Get the AxisScale associated with the X axis.
 RealType getXAxisType()
          Get the mapping for the XAxis.
 Unit getXDisplayUnit()
          Get the units of displayed values on the X axis
 AxisScale getYAxisScale()
          Get the AxisScale associated with the Y axis.
 RealType getYAxisType()
          Get the mapping for the YAxis.
 Unit getYDisplayUnit()
          Get the units of displayed values on the Y axis
 void setAspect(double x, double y)
          Set the aspect ratio of the axes
 void setAxisTypes(RealType xType, RealType yType)
          Change the mapping for both axes
 void setGridLinesVisible(boolean yesorno)
          Set the grid lines visible
 void setName(String newName)
          Set the name of this display.
 void setXAxisType(RealType xType)
          Change the mapping for the XAxis.
 void setXDisplayUnit(Unit newUnit)
          Set the units of displayed values on the X axis
 void setXRange(double min, double max)
          Set the range of displayed values on the X axis
 void setYAxisType(RealType yType)
          Change the mapping for the YAxis.
 void setYDisplayUnit(Unit newUnit)
          Set the units of displayed values on the Y axis
 void setYRange(double min, double max)
          Set the range of displayed values on the Y axis
 void showAxisScales(boolean show)
          Show the scale on both axes.
 
Methods inherited from class ucar.visad.display.DisplayMaster
addDisplayable, addDisplayListener, addKeyboardBehavior, addPropertyChangeListener, addPropertyChangeListener, addScalarMap, addScalarMaps, addVetoableChangeListener, addVetoableChangeListener, buildAnimationSet, dataChange, destroy, draw, ensureInactive, equals, finalize, firePropertyChange, firePropertyChange, getAnimationSetFromDisplayables, getAnimationStringVisible, getBackground, getComponent, getDestroyed, getDisplay, getDisplayableCount, getDisplayables, getDisplayables, getDisplayAspect, getDisplayComponent, getDisplayScale, getForeground, getImage, getMouseBehavior, getMouseFunctionMap, getOffscreenDimension, getProjectionMatrix, getRotation, getSavedProjectionMatrix, getScale, getScreenBounds, getStereoAvailable, getWaitMessageVisible, handleMouseWheelMoved, hashCode, indexOf, init, is3D, isActive, isPointMode, printMatrix, printMe, rebuild, rebuildDisplay, reDisplayAll, removeDisplayable, removeDisplayables, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, removeScalarMaps, removeVetoableChangeListener, removeVetoableChangeListener, replaceScalarMap, reScale, resetMouseFunctions, resetProjection, rotate, rotateX, rotateY, rotateZ, saveCurrentDisplay, saveCurrentDisplay, saveCurrentDisplay, saveProjection, setActive, setAnimation, setAnimationStringVisible, setBackground, setDefaultMouseFunctions, setDisplayables, setDisplayables, setDisplayActive, setDisplayAspect, setDisplayInactive, setEyePosition, setForeground, setKeyboardBehavior, setKeyboardEventMap, setKeyboardEventMap, setMouseFunctions, setOffscreenDimension, setPointMode, setProjectionMatrix, setRebuildNecessary, setWaitMessageVisible, setWheelEventMap, translate, zoom, zoom
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XYDisplay

public XYDisplay()
          throws VisADException,
                 RemoteException
Constuctor for display with RealType.XAxis mapped to Display.XAxis and RealType.YAxis mapped to Display.YAxis and a default name.

Throws:
VisADException - some VisAD error
RemoteException - a remote error

XYDisplay

public XYDisplay(String name)
          throws VisADException,
                 RemoteException
Constuctor for display with RealType.XAxis mapped to Display.XAxis and RealType.YAxis mapped to Display.YAxis and the specified name.

Parameters:
name - name for the display
Throws:
VisADException - some VisAD error
RemoteException - a remote error

XYDisplay

public XYDisplay(boolean offscreen,
                 Dimension dimension)
          throws VisADException,
                 RemoteException
Constuctor for display with RealType.XAxis mapped to Display.XAxis and RealType.YAxis mapped to Display.YAxis and the specified offscreen.

Parameters:
offscreen - is this display offscreen
dimension - size of display for off screen rendering. May be null.
Throws:
VisADException - some VisAD error
RemoteException - a remote error

XYDisplay

public XYDisplay(String name,
                 RealType xAxisType,
                 RealType yAxisType)
          throws VisADException,
                 RemoteException
Constructor with RealTypes for the X and Y axes and the given name.

Parameters:
name - name for the display
xAxisType - a RealType for ScalarMap(yAxisType, Display.XAxis)
yAxisType - a RealType for ScalarMap(xAxisType, Display.YAxis)
Throws:
VisADException - some VisAD error
RemoteException - a remote error

XYDisplay

public XYDisplay(String name,
                 RealType xAxisType,
                 RealType yAxisType,
                 boolean offScreen,
                 Dimension dimension)
          throws VisADException,
                 RemoteException
Constructor with RealTypes for the X and Y axes and the given name.

Parameters:
name - name for the display
xAxisType - a RealType for ScalarMap(yAxisType, Display.XAxis)
yAxisType - a RealType for ScalarMap(xAxisType, Display.YAxis)
offScreen - is this display offscreen
dimension - size of display for off screen rendering. May be null.
Throws:
VisADException - some VisAD error
RemoteException - a remote error
Method Detail

setXAxisType

public void setXAxisType(RealType xType)
                  throws VisADException,
                         RemoteException
Change the mapping for the XAxis.

Parameters:
xType - new RealType for ScalarMap
Throws:
VisADException - some VisAD error
RemoteException - a remote error

setYAxisType

public void setYAxisType(RealType yType)
                  throws VisADException,
                         RemoteException
Change the mapping for the YAxis.

Parameters:
yType - new RealType for ScalarMap
Throws:
VisADException - some VisAD error
RemoteException - a remote error

getXAxisType

public RealType getXAxisType()
Get the mapping for the XAxis.

Returns:
RealType for X axis ScalarMap

getYAxisType

public RealType getYAxisType()
Get the mapping for the YAxis.

Returns:
RealType for Y axis ScalarMap

setAxisTypes

public void setAxisTypes(RealType xType,
                         RealType yType)
                  throws VisADException,
                         RemoteException
Change the mapping for both axes

Parameters:
xType - new RealType for X axis ScalarMap
yType - new RealType for Y axis ScalarMap
Throws:
VisADException - some VisAD error
RemoteException - a remote error

getXAxisScale

public AxisScale getXAxisScale()
Get the AxisScale associated with the X axis.

Returns:
X AxisScale

getYAxisScale

public AxisScale getYAxisScale()
Get the AxisScale associated with the Y axis.

Returns:
X AxisScale

showAxisScales

public void showAxisScales(boolean show)
Show the scale on both axes.

Parameters:
show - true to show

setXRange

public void setXRange(double min,
                      double max)
Set the range of displayed values on the X axis

Parameters:
min - minimum value for axis
max - maximum value for axis

setYRange

public void setYRange(double min,
                      double max)
Set the range of displayed values on the Y axis

Parameters:
min - minimum value for axis
max - maximum value for axis

autoScaleXAxis

public void autoScaleXAxis()
Let the XAxis autoscale.


autoScaleYAxis

public void autoScaleYAxis()
Let the YAxis autoscale.


setXDisplayUnit

public void setXDisplayUnit(Unit newUnit)
Set the units of displayed values on the X axis

Parameters:
newUnit - units to use

setYDisplayUnit

public void setYDisplayUnit(Unit newUnit)
Set the units of displayed values on the Y axis

Parameters:
newUnit - units to use

getXDisplayUnit

public Unit getXDisplayUnit()
Get the units of displayed values on the X axis

Returns:
axis units

getYDisplayUnit

public Unit getYDisplayUnit()
Get the units of displayed values on the Y axis

Returns:
axis units

setAspect

public void setAspect(double x,
                      double y)
Set the aspect ratio of the axes

Parameters:
x - X axis ratio
y - Y axis ratio

getName

public String getName()
Get the name given to this display.

Returns:
name of display.

setName

public void setName(String newName)
Set the name of this display.

Parameters:
newName - new name of display.

enableClipping

public void enableClipping(boolean clip)
Enable clipping of data at the box edges.

Parameters:
clip - true to turn clipping on, otherwise off

setGridLinesVisible

public void setGridLinesVisible(boolean yesorno)
Set the grid lines visible

Parameters:
yesorno - true to be visible

getGridLinesVisible

public boolean getGridLinesVisible()
Get whether the grid lines are visible

Returns:
true if visible