ucar.visad.display
Class LineDrawing

java.lang.Object
  extended by ucar.visad.display.Displayable
      extended by ucar.visad.display.DisplayableData
          extended by ucar.visad.display.LineDrawing
Direct Known Subclasses:
Box, CenterPole, CompassLabels, ContourLines, CurveDrawer, DisplayableMeanWind, IndicatorPoint, LatLonLines, MapLines, MeanWindTrace, PickableLineDrawing, PolarLineDrawing, Profile, ProfileLine, RubberBandBox, ScaleLabels, ScaleLabels, SelectorPoint, ShapeDisplayable, SoundingProfile, TextDisplayable, Trajectory, WindArrow, WindProfileDisplayable, WindTrace.DisplayableWindTrace

public class LineDrawing
extends DisplayableData

Provides support for line drawings. The color and width of the lines can be controlled using the methods of this class.

Instances of this class have the following bound properties:

Name Type Access Default Description
color java.awt.Color set/get Color.white The color of rendered lines or points.
lineWidth float set/get 1.0f The width of rendered lines.
lineStyle int set/get 0 The style of rendered lines.
pointSize float set/get 1.0f The size of rendered points.

Version:
$Revision: 1.21 $
Author:
Steven R. Emmerson, Don Murray

Field Summary
static String COLOR
          The name of the color property.
static String LINE_STYLE
          The name of the line-style property.
static String LINE_WIDTH
          The name of the line-width property.
static String POINT_SIZE
          The name of the point-size property.
 
Fields inherited from class ucar.visad.display.DisplayableData
MANIPULABLE, VISIBLE
 
Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
 
Constructor Summary
LineDrawing(LineDrawing that)
          Constructs from another instance.
LineDrawing(String name)
          Constructs an instance with the specified name
 
Method Summary
 Color getColor()
          Gets the current java.awt.Color associated with this LineDrawing
 int getLineStyle()
          Gets the current line style associated with this LineDrawing
 float getLineWidth()
          Gets the current line width associated with this LineDrawing
 float getPointSize()
          Gets the point size associated with this LineDrawing
 void setColor(Color color)
          Sets the color of the lines for this Displayable.
 void setHSV(double hue, double saturation, double value)
          Sets the HSV values to control the color of this Displayable.
 void setHSV(float[] hsv)
          Sets the HSV values to control the color of this Displayable.
 void setLineStyle(int lineStyle)
          Sets the style of lines in this Displayable.
 void setLineWidth(float lineWidth)
          Sets the width of lines in this Displayable.
 void setPointSize(float pointSize)
          Sets the size of points in this Displayable.
 void setRGB(double red, double green, double blue)
          Sets the RGB values to control the color of this Displayable.
 void setRGB(float[] rgb)
          Sets the RGB values to control the color of this Displayable.
 void setRGBA(double red, double green, double blue, double alpha)
          Sets the RGBA values to control the color of this Displayable.
 void setRGBA(float[] rgba)
          Sets the RGBA values to control the color of this Displayable.
 
Methods inherited from class ucar.visad.display.DisplayableData
addAction, cloneForDisplay, dataChange, destroy, getActive, getAnimationSet, getData, getDataRenderer, getName, hasData, hasDataObject, isManipulable, isPickable, myAddConstantMaps, myAddDataReferences, myRemoveDataReferences, removeAction, setActive, setData, setDataReference, setManipulable, setPickable, setPointMode, setUseFastRendering, setVisible, toString
 
Methods inherited from class ucar.visad.display.Displayable
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, isActive, isUnitCompatible, isVisible, logException, removeConstantMap, removeDataReferences, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setAdjustFlow, setColorPalette, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setDisplayUnit, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COLOR

public static String COLOR
The name of the color property.


LINE_WIDTH

public static String LINE_WIDTH
The name of the line-width property.


LINE_STYLE

public static String LINE_STYLE
The name of the line-style property.


POINT_SIZE

public static String POINT_SIZE
The name of the point-size property.

Constructor Detail

LineDrawing

public LineDrawing(String name)
            throws VisADException,
                   RemoteException
Constructs an instance with the specified name

Parameters:
name - name for the instance
Throws:
VisADException - Can't create the necessary VisAD object
RemoteException - Can't create the necessary remote object

LineDrawing

public LineDrawing(LineDrawing that)
            throws VisADException,
                   RemoteException
Constructs from another instance. The following attributes are copied from the other instance: color, line width, and point size.

Parameters:
that - The other instance.
Throws:
VisADException - Can't create the necessary VisAD object
RemoteException - Can't create the necessary remote object
Method Detail

setRGB

public void setRGB(double red,
                   double green,
                   double blue)
            throws VisADException,
                   RemoteException
Sets the RGB values to control the color of this Displayable.

Parameters:
red - red value (0 - 1)
green - green value (0 - 1)
blue - blue value (0 - 1)
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setRGBA

public void setRGBA(double red,
                    double green,
                    double blue,
                    double alpha)
             throws VisADException,
                    RemoteException
Sets the RGBA values to control the color of this Displayable.

Parameters:
red - red value (0 - 1)
green - green value (0 - 1)
blue - blue value (0 - 1)
alpha - alpha value (0 - 1)
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setRGB

public void setRGB(float[] rgb)
            throws VisADException,
                   RemoteException
Sets the RGB values to control the color of this Displayable.

Parameters:
rgb - array of red, green, blue intesities (all 0 - 1).
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setRGBA

public void setRGBA(float[] rgba)
             throws VisADException,
                    RemoteException
Sets the RGBA values to control the color of this Displayable.

Parameters:
rgba - array of red, green, blue, alpha intesities (all 0 - 1).
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setHSV

public void setHSV(double hue,
                   double saturation,
                   double value)
            throws VisADException,
                   RemoteException
Sets the HSV values to control the color of this Displayable.

Parameters:
hue - hue value (red=0, green=120, blue=240).
saturation - saturation value (0 - 1).
value - brightness value (0 - 1).
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setHSV

public void setHSV(float[] hsv)
            throws VisADException,
                   RemoteException
Sets the HSV values to control the color of this Displayable.

Parameters:
hsv - array of hue (red=0, green=120, blue=240), saturation (0-1), and brightness (0-1) values.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setColor

public void setColor(Color color)
              throws VisADException,
                     RemoteException
Sets the color of the lines for this Displayable.

Overrides:
setColor in class Displayable
Parameters:
color - color for the line.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setLineWidth

public void setLineWidth(float lineWidth)
                  throws VisADException,
                         RemoteException
Sets the width of lines in this Displayable.

Overrides:
setLineWidth in class DisplayableData
Parameters:
lineWidth - Width of lines (1 = normal)
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setLineStyle

public void setLineStyle(int lineStyle)
                  throws VisADException,
                         RemoteException
Sets the style of lines in this Displayable.

Parameters:
lineStyle - style of line
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
See Also:
GraphicsModeControl

setPointSize

public void setPointSize(float pointSize)
                  throws VisADException,
                         RemoteException
Sets the size of points in this Displayable.

Overrides:
setPointSize in class DisplayableData
Parameters:
pointSize - Size of points (2 = normal)
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getColor

public Color getColor()
Gets the current java.awt.Color associated with this LineDrawing

Returns:
color value

getLineWidth

public float getLineWidth()
Gets the current line width associated with this LineDrawing

Overrides:
getLineWidth in class DisplayableData
Returns:
line width

getLineStyle

public int getLineStyle()
Gets the current line style associated with this LineDrawing

Returns:
line style
See Also:
GraphicsModeControl

getPointSize

public float getPointSize()
Gets the point size associated with this LineDrawing

Overrides:
getPointSize in class DisplayableData
Returns:
point size