sgtplot
Class VectorAttribute
- java.lang.Object
-
- sgtplot.VectorAttribute
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Attribute
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 areVectorAttributeproperties.
Warning: The SGT implementation of Vectors requires Java2D. To use Vectors you must be using jdk1.2 or newer.- Since:
- 2.1
- See Also:
LineCartesianRenderer,ContourLevels, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static intHEADVector head style, Un-scaled (default).static intMARKVector origin style, Mark.static intNO_HEADVector head style, None.static intNO_MARKVector origin style, no mark (default).static intSCALED_HEADVector head style, Scaled.
-
Constructor Summary
Constructors Constructor and Description VectorAttribute()Default constructor.VectorAttribute(double scale, java.awt.Color color)VectorAttributeconstructor.VectorAttribute(int style, double scale, java.awt.Color color, double head_scale)VectorAttributeconstructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Add listener to changes inVectorAttributeproperties.java.lang.Objectcopy()Copy theVectorAttribute.intgetCapStyle()Get the line cap style.doublegetHeadFixedSize()Get the fixed vector head size.doublegetHeadMaxSize()Get the maximum vector head size.doublegetHeadMinSize()Get the minimum vector head size.doublegetHeadScale()Get the vector head scale.java.lang.StringgetId()Get attribute id.intgetMark()Get plot mark for the origin.java.awt.ColorgetMarkColor()Get the color for the origin mark.doublegetMarkHeightP()Get mark height for the origin.floatgetMiterLimit()Get the line miter limit.intgetMiterStyle()Get the line miter sytle.doublegetOffsetAngle()Get the vector rotation angle.intgetOriginStyle()Get vector origin style.java.awt.ColorgetVectorColor()Get the vector color.doublegetVectorMaxSize()Get the maximum vector length allowed.doublegetVectorScale()Geth the vector head scale.intgetVectorStyle()Get the vector head style.floatgetWidth()Get line width.booleanisBatch()Is the attribute in batch mode?voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Remove change listener.voidsetBatch(boolean batch)Batch the changes to the attribute.voidsetBatch(boolean batch, boolean local)Batch the changes to the attribute and set local flag.voidsetCapStyle(int style)Set the line Cap Style.voidsetHeadFixedSize(double size)Set the fixed size for a unscaled vector head.voidsetHeadMaxSize(double size)Set the maximum size for a scaled vector head.voidsetHeadMinSize(double size)Set the minimum size for a scaled vector head.voidsetHeadScale(double scale)Change the vector head scale.voidsetId(java.lang.String id)Set attribute id.voidsetMark(int mark)Set the mark for the origin.voidsetMarkColor(java.awt.Color color)Set the color for the origin mark.voidsetMarkHeightP(double markh)Set mark height for the origin.voidsetMiterLimit(float limit)Set the line miter limit.voidsetMiterStyle(int style)Set the line miter style.voidsetOffsetAngle(double angle)Set the angle (clockwize positive) to rotate the vector.voidsetOriginStyle(int style)Set the vector origin style.voidsetVectorColor(java.awt.Color color)Change the vector color.voidsetVectorMaxSize(double size)Set the maximum size for a vector.voidsetVectorScale(double scale)Change the vector scale.voidsetVectorStyle(int style)Change the head style.voidsetWidth(float t)Set the line width in physical units.java.lang.StringtoString()Get aStringrepresentation of theVectorAttribute.
-
-
-
Field Detail
-
NO_HEAD
public static final int NO_HEAD
Vector head style, None. No arrow head will be drawn.- See Also:
- Constant Field Values
-
HEAD
public static final int HEAD
Vector head style, Un-scaled (default). Head will be drawn a constant size.- See Also:
- Constant Field Values
-
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.- See Also:
- Constant Field Values
-
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.- See Also:
- Constant Field Values
-
MARK
public static final int MARK
Vector origin style, Mark. A plot mark will be drawn at the origin of the vector.- See Also:
- Constant Field Values
-
-
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)VectorAttributeconstructor. Default vector style is HEAD.- Parameters:
scale- vector scalecolor- vectorColor- See Also:
Color
-
VectorAttribute
public VectorAttribute(int style, double scale, java.awt.Color color, double head_scale)VectorAttributeconstructor.- Parameters:
style- vector stylescale- vector scalecolor- vectorColorhead_scale- scale of vector head- See Also:
Color
-
-
Method Detail
-
copy
public java.lang.Object copy()
Copy theVectorAttribute.- Returns:
- new
VectorAttribute
-
setVectorStyle
public void setVectorStyle(int style)
Change the head style. Options includeNO_HEAD,HEAD, andSCALED_HEAD.
Property Change:vectorStyle.
-
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 areNO_MARKandMARK.
Property Change:originStyle.
-
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 includeLineAttribute.CAP_BUTT,LineAttribute.CAP_ROUND, andLineAttribute.CAP_SQUARE.
Property Change:capStyle.
-
getCapStyle
public int getCapStyle()
Get the line cap style.
-
setMiterStyle
public void setMiterStyle(int style)
Set the line miter style. Styles includeLineAttribute.JOIN_BEVEL,LineAttribute.JOIN_MITER, andLineAttribute.JOIN_ROUND.
Property Change:miterStyle.
-
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 aStringrepresentation of theVectorAttribute.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add listener to changes inVectorAttributeproperties.- Specified by:
addPropertyChangeListenerin interfaceAttribute
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface:AttributeRemove change listener.- Specified by:
removePropertyChangeListenerin interfaceAttribute
-
setId
public void setId(java.lang.String id)
Description copied from interface:AttributeSet attribute id.
-
getId
public java.lang.String getId()
Description copied from interface:AttributeGet attribute id.
-
setBatch
public void setBatch(boolean batch)
Description copied from interface:AttributeBatch the changes to the attribute.
-
setBatch
public void setBatch(boolean batch, boolean local)Description copied from interface:AttributeBatch the changes to the attribute and set local flag. Determines whetherAttributeChangeEventwill be set local.
-
-
DMelt 3.0 © DataMelt by jWork.ORG