Documentation of 'sgtplot.VectorAttribute' Java class
VectorAttribute
sgtplot

Class 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 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
    See Also:
    LineCartesianRenderer, ContourLevels, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      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

      Constructors 
      Constructor and Description
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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.
      java.lang.String getId()
      Get attribute id.
      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.
      boolean isBatch()
      Is the attribute in batch mode?
      void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
      Remove change listener.
      void setBatch(boolean batch)
      Batch the changes to the attribute.
      void setBatch(boolean batch, boolean local)
      Batch the changes to the attribute and set local flag.
      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 setId(java.lang.String id)
      Set attribute id.
      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.
        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)
        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
      • 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.
      • 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.
      • getCapStyle

        public int getCapStyle()
        Get the line cap style.
      • 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
      • setId

        public void setId(java.lang.String id)
        Description copied from interface: Attribute
        Set attribute id.
        Specified by:
        setId in interface Attribute
        Since:
        3.0
      • getId

        public java.lang.String getId()
        Description copied from interface: Attribute
        Get attribute id.
        Specified by:
        getId in interface Attribute
        Since:
        3.0
      • setBatch

        public void setBatch(boolean batch)
        Description copied from interface: Attribute
        Batch the changes to the attribute.
        Specified by:
        setBatch in interface Attribute
        Since:
        3.0
      • setBatch

        public void setBatch(boolean batch,
                             boolean local)
        Description copied from interface: Attribute
        Batch the changes to the attribute and set local flag. Determines whether AttributeChangeEvent will be set local.
        Specified by:
        setBatch in interface Attribute
        Since:
        3.0
      • isBatch

        public boolean isBatch()
        Description copied from interface: Attribute
        Is the attribute in batch mode?
        Specified by:
        isBatch in interface Attribute
        Since:
        3.0

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.