Package ucar.visad.display
Class LineDrawing
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.DisplayableData
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
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
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.visad.display.DisplayableData
DisplayableData.DragAdapter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String
The name of the color property.static String
The name of the line-style property.static String
The name of the line-width property.static String
The name of the point-size property.Fields inherited from class ucar.visad.display.DisplayableData
MANIPULABLE, renderer, VISIBLE
Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
-
Constructor Summary
ConstructorsConstructorDescriptionLineDrawing
(String name) Constructs an instance with the specified nameLineDrawing
(LineDrawing that) Constructs from another instance. -
Method Summary
Modifier and TypeMethodDescriptiongetColor()
Gets the current java.awt.Color associated with this LineDrawingint
Gets the current line style associated with this LineDrawingfloat
Gets the current line width associated with this LineDrawingfloat
Gets the point size associated with this LineDrawingvoid
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, setDragAdapter, setManipulable, setPickable, setPointMode, setUseFastRendering, setVisible, showme, toString
Methods inherited from class ucar.visad.display.Displayable
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, destroyDisplayable, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getDestroyed, 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
-
Field Details
-
COLOR
The name of the color property. -
LINE_WIDTH
The name of the line-width property. -
LINE_STYLE
The name of the line-style property. -
POINT_SIZE
The name of the point-size property.
-
-
Constructor Details
-
LineDrawing
Constructs an instance with the specified name- Parameters:
name
- name for the instance- Throws:
VisADException
- Can't create the necessary VisAD objectRemoteException
- Can't create the necessary remote object
-
LineDrawing
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 objectRemoteException
- Can't create the necessary remote object
-
-
Method Details
-
setRGB
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
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
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
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
Sets the color of the lines for this Displayable.- Overrides:
setColor
in classDisplayable
- Parameters:
color
- color for the line.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setLineWidth
Sets the width of lines in this Displayable.- Overrides:
setLineWidth
in classDisplayableData
- Parameters:
lineWidth
- Width of lines (1 = normal)- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setLineStyle
Sets the style of lines in this Displayable.- Parameters:
lineStyle
- style of line- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.- See Also:
-
setPointSize
Sets the size of points in this Displayable.- Overrides:
setPointSize
in classDisplayableData
- Parameters:
pointSize
- Size of points (2 = normal)- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
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 classDisplayableData
- Returns:
- line width
-
getLineStyle
public int getLineStyle()Gets the current line style associated with this LineDrawing- Returns:
- line style
- See Also:
-
getPointSize
public float getPointSize()Gets the point size associated with this LineDrawing- Overrides:
getPointSize
in classDisplayableData
- Returns:
- point size
-