gov.noaa.pmel.sgt
Class VectorAttribute

java.lang.Object
  |
  +--gov.noaa.pmel.sgt.VectorAttribute
All Implemented Interfaces:
Attribute, java.lang.Cloneable, java.io.Serializable

public class VectorAttribute
extends java.lang.Object
implements Attribute, java.lang.Cloneable, java.io.Serializable

Sets the rendering style for line data. Color, width, and dash characteristics are VectorAttribute properties.
Warning: The SGT implementation of Vectors requires Java2D. To use Vectors you must be using jdk1.2 or newer.

Since:
2.1
Version:
$Revision: 1.7 $, $Date: 2001/12/13 19:07:05 $
Author:
Donald Denbo
See Also:
LineCartesianRenderer, ContourLevels, Serialized Form

Field Summary
static int HEAD
          Vector head style, Un-scaled (default).
static int MARK
          Vector origin style, Mark.
static int NO_HEAD
          Vector head style, None.
static int NO_MARK
          Vector origin style, no mark (default).
static int SCALED_HEAD
          Vector head style, Scaled.
 
Constructor Summary
VectorAttribute()
          Default constructor.
VectorAttribute(double scale, java.awt.Color color)
          VectorAttribute constructor.
VectorAttribute(int style, double scale, java.awt.Color color, double head_scale)
          VectorAttribute constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add listener to changes in VectorAttribute properties.
 java.lang.Object copy()
          Copy the VectorAttribute.
 int getCapStyle()
          Get the line cap style.
 double getHeadFixedSize()
          Get the fixed vector head size.
 double getHeadMaxSize()
          Get the maximum vector head size.
 double getHeadMinSize()
          Get the minimum vector head size.
 double getHeadScale()
          Get the vector head scale.
 int getMark()
          Get plot mark for the origin.
 java.awt.Color getMarkColor()
          Get the color for the origin mark.
 double getMarkHeightP()
          Get mark height for the origin.
 float getMiterLimit()
          Get the line miter limit.
 int getMiterStyle()
          Get the line miter sytle.
 double getOffsetAngle()
          Get the vector rotation angle.
 int getOriginStyle()
          Get vector origin style.
 java.awt.Color getVectorColor()
          Get the vector color.
 double getVectorMaxSize()
          Get the maximum vector length allowed.
 double getVectorScale()
          Geth the vector head scale.
 int getVectorStyle()
          Get the vector head style.
 float getWidth()
          Get line width.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove change listener.
 void setCapStyle(int style)
          Set the line Cap Style.
 void setHeadFixedSize(double size)
          Set the fixed size for a unscaled vector head.
 void setHeadMaxSize(double size)
          Set the maximum size for a scaled vector head.
 void setHeadMinSize(double size)
          Set the minimum size for a scaled vector head.
 void setHeadScale(double scale)
          Change the vector head scale.
 void setMark(int mark)
          Set the mark for the origin.
 void setMarkColor(java.awt.Color color)
          Set the color for the origin mark.
 void setMarkHeightP(double markh)
          Set mark height for the origin.
 void setMiterLimit(float limit)
          Set the line miter limit.
 void setMiterStyle(int style)
          Set the line miter style.
 void setOffsetAngle(double angle)
          Set the angle (clockwize positive) to rotate the vector.
 void setOriginStyle(int style)
          Set the vector origin style.
 void setVectorColor(java.awt.Color color)
          Change the vector color.
 void setVectorMaxSize(double size)
          Set the maximum size for a vector.
 void setVectorScale(double scale)
          Change the vector scale.
 void setVectorStyle(int style)
          Change the head style.
 void setWidth(float t)
          Set the line width in physical units.
 java.lang.String toString()
          Get a String representation of the VectorAttribute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_HEAD

public static final int NO_HEAD
Vector head style, None. No arrow head will be drawn.

HEAD

public static final int HEAD
Vector head style, Un-scaled (default). Head will be drawn a constant size.

SCALED_HEAD

public static final int SCALED_HEAD
Vector head style, Scaled. The size of the head will be proportional to the length of the vector.

NO_MARK

public static final int NO_MARK
Vector origin style, no mark (default). The origin of the vector will be drawn without a plot mark.

MARK

public static final int MARK
Vector origin style, Mark. A plot mark will be drawn at the origin of the vector.
Constructor Detail

VectorAttribute

public VectorAttribute()
Default constructor. Default vector style is HEAD, default color is red, and scale = 1.0;

VectorAttribute

public VectorAttribute(double scale,
                       java.awt.Color color)
VectorAttribute constructor. Default vector style is HEAD.
Parameters:
scale - vector scale
color - vector Color
See Also:
Color

VectorAttribute

public VectorAttribute(int style,
                       double scale,
                       java.awt.Color color,
                       double head_scale)
VectorAttribute constructor.
Parameters:
style - vector style
scale - vector scale
color - vector Color
head_scale - scale of vector head
See Also:
Color
Method Detail

copy

public java.lang.Object copy()
Copy the VectorAttribute.
Returns:
new VectorAttribute

setVectorStyle

public void setVectorStyle(int style)
Change the head style. Options include NO_HEAD, HEAD, and SCALED_HEAD.
Property Change: vectorStyle.
See Also:
setVectorColor(java.awt.Color), setVectorMaxSize(double), setVectorScale(double), setOffsetAngle(double)

getVectorStyle

public int getVectorStyle()
Get the vector head style.

setVectorColor

public void setVectorColor(java.awt.Color color)
Change the vector color.
Property Change: vectorColor.

getVectorColor

public java.awt.Color getVectorColor()
Get the vector color.

setVectorScale

public void setVectorScale(double scale)
Change the vector scale. The vector length is determined by the data value times the vector scale. The vector length is bounded by the maximum allowed vector length.
Property Change: vectorScale.
See Also:
setVectorMaxSize(double)

getVectorScale

public double getVectorScale()
Geth the vector head scale.

setVectorMaxSize

public void setVectorMaxSize(double size)
Set the maximum size for a vector.
Property Change: vectorMaxSize.

getVectorMaxSize

public double getVectorMaxSize()
Get the maximum vector length allowed.

setOffsetAngle

public void setOffsetAngle(double angle)
Set the angle (clockwize positive) to rotate the vector.
Property Change: offsetAngle.
Parameters:
angle - in degrees

getOffsetAngle

public double getOffsetAngle()
Get the vector rotation angle.

setHeadScale

public void setHeadScale(double scale)
Change the vector head scale. The vector head size is determined by the length of the vector times the vector head scale. The vector head size is bounded by the minimum and maximum allowed head size.
Property Change: headScale.
See Also:
setHeadMinSize(double), setHeadMaxSize(double)

getHeadScale

public double getHeadScale()
Get the vector head scale.

setHeadMaxSize

public void setHeadMaxSize(double size)
Set the maximum size for a scaled vector head.
Property Change: headMaxSize.

getHeadMaxSize

public double getHeadMaxSize()
Get the maximum vector head size.

setHeadMinSize

public void setHeadMinSize(double size)
Set the minimum size for a scaled vector head.
Property Change: headMinSize.

getHeadMinSize

public double getHeadMinSize()
Get the minimum vector head size.

setHeadFixedSize

public void setHeadFixedSize(double size)
Set the fixed size for a unscaled vector head.
Property Change: headFixedSize.

getHeadFixedSize

public double getHeadFixedSize()
Get the fixed vector head size.

setOriginStyle

public void setOriginStyle(int style)
Set the vector origin style. Options are NO_MARK and MARK.
Property Change: originStyle.
See Also:
setMarkColor(java.awt.Color), setMark(int), setMarkHeightP(double)

getOriginStyle

public int getOriginStyle()
Get vector origin style.

setMarkColor

public void setMarkColor(java.awt.Color color)
Set the color for the origin mark.
Property Change: markColor.

getMarkColor

public java.awt.Color getMarkColor()
Get the color for the origin mark.

setMark

public void setMark(int mark)
Set the mark for the origin.
Property Change: mark.
Parameters:
mark - the plot mark
See Also:
PlotMark

getMark

public int getMark()
Get plot mark for the origin.
Returns:
plot mark

setMarkHeightP

public void setMarkHeightP(double markh)
Set mark height for the origin.
Property Change: markHeightP.
Parameters:
markh - mark height

getMarkHeightP

public double getMarkHeightP()
Get mark height for the origin.
Returns:
mark height

setWidth

public void setWidth(float t)
Set the line width in physical units.
Property Change: width.
Parameters:
t - line width

getWidth

public float getWidth()
Get line width.
Returns:
line width in physcial coordinates.

setCapStyle

public void setCapStyle(int style)
Set the line Cap Style. Styles include LineAttribute.CAP_BUTT, LineAttribute.CAP_ROUND, and LineAttribute.CAP_SQUARE.
Property Change: capStyle.
See Also:
LineAttribute.CAP_BUTT, LineAttribute.CAP_ROUND, LineAttribute.CAP_SQUARE

getCapStyle

public int getCapStyle()
Get the line cap style.

setMiterStyle

public void setMiterStyle(int style)
Set the line miter style. Styles include LineAttribute.JOIN_BEVEL, LineAttribute.JOIN_MITER, and LineAttribute.JOIN_ROUND.
Property Change: miterStyle.
See Also:
LineAttribute.JOIN_BEVEL, LineAttribute.JOIN_MITER, LineAttribute.JOIN_ROUND

getMiterStyle

public int getMiterStyle()
Get the line miter sytle.

setMiterLimit

public void setMiterLimit(float limit)
Set the line miter limit.
Property Change: miterLimit.

getMiterLimit

public float getMiterLimit()
Get the line miter limit.

toString

public java.lang.String toString()
Get a String representation of the VectorAttribute.
Specified by:
toString in interface Attribute
Overrides:
toString in class java.lang.Object
Returns:
String representation

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add listener to changes in VectorAttribute properties.
Specified by:
addPropertyChangeListener in interface Attribute

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: Attribute
Remove change listener.
Specified by:
removePropertyChangeListener in interface Attribute


Send comments about the Scientific Graphics toolkit to dwd@pmel.noaa.gov. For more information about Java Development in the EPIC Group see the EPIC Software Page
Generated on December 13 2001