Documentation of 'org.jplot2d.util.SymbolShape' Java class
SymbolShape
org.jplot2d.util

Class SymbolShape



  • public class SymbolShape
    extends java.lang.Object
    SymbolShape has an unique name and data to direct how to paint it.

    The instance is immutable! This class also maintains a internal collection to keep all created symbol shapes. User can call the static method getSymbolShapes() to get them.

    A symbol is painted in an 1-unit circle boundary. The data syntax (in EBNF):

             syntax = "{" SHAPE+ "}"
             SHAPE = FILLEDSHAPE | OUTLINESHAPE
             FILLEDSHAPE = "F" SHAPEDESC
             OUTLINESHAPE = SHAPEDESC
             SHAPEDESC = LINE | ARC | CIRCLE | ELLIPSE | RECTANGLE | POLYGON
             LINE = "L" LINE_DATA
             LINE_DATA = POINT POINT
             ARC = OPENARC | CHORDARC | PIEARC
             OPENARC = "A" ARC_DARTA
             CHORDARC = "AC" ARC_DARTA
             PIEARC = "AP" ARC_DARTA
             ARC_DARTA = RECTANGLE_DATA ANGLERANGE
             ANGLERANGE = "(" NUM "," NUM ")"
             CIRCLE = "C" CIRCLE_DATA
             CIRCLE_DATA = "(" NUM "," NUM "," NUM ")"
             ELLIPSE = "E" RECTANGLE_DATA
             RECTANGLE = "R" RECTANGLE_DATA
             RECTANGLE_DATA = DIAGONAL_DATA | XYWH_DATA
             DIAGONAL_DATA = LINE_DATA
             XYWH_DATA = "(" NUM "," NUM "," NUM "," NUM ")"
             POLYGON = "P" POINT POINT POINT+
             POINT = "(" NUM "," NUM ")"
             NUM = ("+"|"-")? (["0"-"9"])+ ("." (["0"-"9"])*)? | "." (["0"-"9"])*
     

    RECTANGLE
    is represented by a pair of end points of a diagonal or by x,y of bottom left corner point and width and height.
    ELLIPSE
    is represented by a bounding RECTANGLE.
    CIRLE
    is represented by a center point and radius.
    ARC
    is represented by a ELLIPSE bounding rectangle and a ANGLERANGE, which is defined by starting angle and angular extent in degrees.

    • Method Detail

      • getSymbolShapes

        public static SymbolShape[] getSymbolShapes()
        Returns all symbol shapes in a array.
        Returns:
        a array contains all symbol shapes.
      • createSymbolShape

        public static SymbolShape createSymbolShape(java.lang.String name,
                                                    java.lang.String data)
        Create a symbol with a name and a description string
        Parameters:
        name -
        data - the shape description string
      • getName

        public java.lang.String getName()
        Returns the symbol name
        Returns:
        the symbol name
      • getData

        public java.lang.String getData()
        Returns the data string of this SymbolShape
        Returns:
        the data string
      • draw

        public void draw(java.awt.Graphics2D g,
                         java.awt.geom.AffineTransform maf)
        Transform this shape and drawing it to the given Graphics2D.
        Parameters:
        g - the graphics context to use for drawing
        maf - the AffineTransform that transform this shape before drawing
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.