Class Point

java.lang.Object
net.atthegate.server.service.pdf.Point
All Implemented Interfaces:
Drawable

public class Point extends Object implements Drawable
Used to create point objects with different shapes and draw them on a page. Please note: When we are mentioning (x, y) coordinates of a point - we are talking about the coordinates of the center of the point. Please see Example_05.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    static final int
     
    static final int
     
    protected int
     
    static final boolean
     
    static final int
     
    static final int
     
    protected boolean
     
    static final int
     
    static final int
     
    protected boolean
     
    protected boolean
     
    static final int
     
    protected String
     
    protected float
     
    static final int
     
    static final int
     
    protected float
     
    static final int
     
    protected int
     
    static final int
     
    static final int
     
    static final int
     
    protected float
     
    static final int
     
    protected float
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    The default constructor.
    Point(double x, double y)
    Constructor for creating point objects.
    Point(double x, double y, boolean isControlPoint)
    Constructor for creating point objects.
    Point(float x, float y)
    Constructor for creating point objects.
    Point(float x, float y, boolean isControlPoint)
    Constructor for creating point objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    drawOn(Page page)
    Draws this point on the specified page.
    int
    Returns the point alignment.
    int
    Returns the point color as an integer.
    boolean
    Returns the value of the fillShape private variable.
    Returns the line dash pattern.
    float
    Returns the width of the lines used to draw this point.
    float
    Returns the radius of this point.
    int
    Returns the point shape code value.
    Returns the text associated with this point.
    int
    Returns the point's text color.
    int
    Returns the point's text direction.
    Returns the URI for the "click point" action.
    float
    Returns the x coordinate of this point.
    float
    Returns the y coordinate of this point.
    void
    placeIn(Box box)
    Places this point in the specified box at position (0f, 0f).
    void
    placeIn(Box box, double x_offset, double y_offset)
    Places this point in the specified box.
    void
    placeIn(Box box, float x_offset, float y_offset)
    Places this point in the specified box.
    void
    setAlignment(int align)
    Sets the point alignment inside table cell.
    void
    setColor(int color)
    Sets the pen color for this point.
    void
    setDrawLineTo(boolean drawLineTo)
    Deprecated.
    Please use the setStartOfPath method.
    void
    setFillShape(boolean fillShape)
    Sets the private fillShape variable.
    void
    setLinePattern(String linePattern)
    The line dash pattern controls the pattern of dashes and gaps used to stroke paths.
    void
    setLineWidth(double lineWidth)
    Sets the width of the lines of this point.
    void
    setLineWidth(float lineWidth)
    Sets the width of the lines of this point.
    void
    setLocation(float x, float y)
    Sets the location (x, y) of this point.
    void
    setPosition(double x, double y)
    Sets the position (x, y) of this point.
    void
    setPosition(float x, float y)
    Sets the position (x, y) of this point.
    void
    setRadius(double r)
    Sets the radius of this point.
    void
    setRadius(float r)
    Sets the radius of this point.
    void
    setShape(int shape)
    Sets the shape of this point.
    void
    Sets this point as the start of a path that will be drawn on the chart.
    void
    Sets the point text.
    void
    setTextColor(int textColor)
    Sets the point's text color.
    void
    setTextDirection(int textDirection)
    Sets the point's text direction.
    void
    Sets the URI for the "click point" action.
    void
    setX(double x)
    Sets the x coordinate of this point.
    void
    setX(float x)
    Sets the x coordinate of this point.
    void
    setY(double y)
    Sets the y coordinate of this point.
    void
    setY(float y)
    Sets the y coordinate of this point.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Point

      public Point()
      The default constructor.
    • Point

      public Point(double x, double y)
      Constructor for creating point objects.
      Parameters:
      x - the x coordinate of this point when drawn on the page.
      y - the y coordinate of this point when drawn on the page.
    • Point

      public Point(float x, float y)
      Constructor for creating point objects.
      Parameters:
      x - the x coordinate of this point when drawn on the page.
      y - the y coordinate of this point when drawn on the page.
    • Point

      public Point(double x, double y, boolean isControlPoint)
      Constructor for creating point objects.
      Parameters:
      x - the x coordinate of this point when drawn on the page.
      y - the y coordinate of this point when drawn on the page.
      isControlPoint - true if this point is one of the points specifying a curve.
    • Point

      public Point(float x, float y, boolean isControlPoint)
      Constructor for creating point objects.
      Parameters:
      x - the x coordinate of this point when drawn on the page.
      y - the y coordinate of this point when drawn on the page.
      isControlPoint - true if this point is one of the points specifying a curve.
  • Method Details

    • setPosition

      public void setPosition(double x, double y)
      Sets the position (x, y) of this point.
      Parameters:
      x - the x coordinate of this point when drawn on the page.
      y - the y coordinate of this point when drawn on the page.
    • setPosition

      public void setPosition(float x, float y)
      Sets the position (x, y) of this point.
      Parameters:
      x - the x coordinate of this point when drawn on the page.
      y - the y coordinate of this point when drawn on the page.
    • setLocation

      public void setLocation(float x, float y)
      Sets the location (x, y) of this point.
      Parameters:
      x - the x coordinate of this point when drawn on the page.
      y - the y coordinate of this point when drawn on the page.
    • setX

      public void setX(double x)
      Sets the x coordinate of this point.
      Parameters:
      x - the x coordinate of this point when drawn on the page.
    • setX

      public void setX(float x)
      Sets the x coordinate of this point.
      Parameters:
      x - the x coordinate of this point when drawn on the page.
    • getX

      public float getX()
      Returns the x coordinate of this point.
      Returns:
      the x coordinate of this point.
    • setY

      public void setY(double y)
      Sets the y coordinate of this point.
      Parameters:
      y - the y coordinate of this point when drawn on the page.
    • setY

      public void setY(float y)
      Sets the y coordinate of this point.
      Parameters:
      y - the y coordinate of this point when drawn on the page.
    • getY

      public float getY()
      Returns the y coordinate of this point.
      Returns:
      the y coordinate of this point.
    • setRadius

      public void setRadius(double r)
      Sets the radius of this point.
      Parameters:
      r - the radius.
    • setRadius

      public void setRadius(float r)
      Sets the radius of this point.
      Parameters:
      r - the radius.
    • getRadius

      public float getRadius()
      Returns the radius of this point.
      Returns:
      the radius of this point.
    • setShape

      public void setShape(int shape)
      Sets the shape of this point.
      Parameters:
      shape - the shape of this point. Supported values:
        Point.INVISIBLE
        Point.CIRCLE
        Point.DIAMOND
        Point.BOX
        Point.PLUS
        Point.H_DASH
        Point.V_DASH
        Point.MULTIPLY
        Point.STAR
        Point.X_MARK
        Point.UP_ARROW
        Point.DOWN_ARROW
        Point.LEFT_ARROW
        Point.RIGHT_ARROW
        
    • getShape

      public int getShape()
      Returns the point shape code value.
      Returns:
      the shape code value.
    • setFillShape

      public void setFillShape(boolean fillShape)
      Sets the private fillShape variable.
      Parameters:
      fillShape - if true - fill the point with the specified brush color.
    • getFillShape

      public boolean getFillShape()
      Returns the value of the fillShape private variable.
      Returns:
      the value of the private fillShape variable.
    • setColor

      public void setColor(int color)
      Sets the pen color for this point.
      Parameters:
      color - the color specified as an integer.
    • getColor

      public int getColor()
      Returns the point color as an integer.
      Returns:
      the color.
    • setLineWidth

      public void setLineWidth(double lineWidth)
      Sets the width of the lines of this point.
      Parameters:
      lineWidth - the line width.
    • setLineWidth

      public void setLineWidth(float lineWidth)
      Sets the width of the lines of this point.
      Parameters:
      lineWidth - the line width.
    • getLineWidth

      public float getLineWidth()
      Returns the width of the lines used to draw this point.
      Returns:
      the width of the lines used to draw this point.
    • setLinePattern

      public void setLinePattern(String linePattern)
      The line dash pattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The elements of the dash array are positive numbers that specify the lengths of alternating dashes and gaps. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the dash array and the dash phase are expressed in user space units.
        Examples of line dash patterns:
      
            "[Array] Phase"     Appearance          Description
            _______________     _________________   ____________________________________
      
            "[] 0"              -----------------   Solid line
            "[3] 0"             ---   ---   ---     3 units on, 3 units off, ...
            "[2] 1"             -  --  --  --  --   1 on, 2 off, 2 on, 2 off, ...
            "[2 1] 0"           -- -- -- -- -- --   2 on, 1 off, 2 on, 1 off, ...
            "[3 5] 6"             ---     ---       2 off, 3 on, 5 off, 3 on, 5 off, ...
            "[2 3] 11"          -   --   --   --    1 on, 3 off, 2 on, 3 off, 2 on, ...
        
      Parameters:
      linePattern - the line dash pattern.
    • getLinePattern

      public String getLinePattern()
      Returns the line dash pattern.
      Returns:
      the line dash pattern.
    • setDrawLineTo

      @Deprecated public void setDrawLineTo(boolean drawLineTo)
      Deprecated.
      Please use the setStartOfPath method. See Example_40.
      Parameters:
      drawLineTo - the boolean value.
    • setStartOfPath

      public void setStartOfPath()
      Sets this point as the start of a path that will be drawn on the chart.
    • setURIAction

      public void setURIAction(String uri)
      Sets the URI for the "click point" action.
      Parameters:
      uri - the URI
    • getURIAction

      public String getURIAction()
      Returns the URI for the "click point" action.
      Returns:
      the URI for the "click point" action.
    • setText

      public void setText(String text)
      Sets the point text.
      Parameters:
      text - the text.
    • getText

      public String getText()
      Returns the text associated with this point.
      Returns:
      the text.
    • setTextColor

      public void setTextColor(int textColor)
      Sets the point's text color.
      Parameters:
      textColor - the text color.
    • getTextColor

      public int getTextColor()
      Returns the point's text color.
      Returns:
      the text color.
    • setTextDirection

      public void setTextDirection(int textDirection)
      Sets the point's text direction.
      Parameters:
      textDirection - the text direction.
    • getTextDirection

      public int getTextDirection()
      Returns the point's text direction.
      Returns:
      the text direction.
    • setAlignment

      public void setAlignment(int align)
      Sets the point alignment inside table cell.
      Parameters:
      align - the alignment value.
    • getAlignment

      public int getAlignment()
      Returns the point alignment.
      Returns:
      align the alignment value.
    • placeIn

      public void placeIn(Box box) throws Exception
      Places this point in the specified box at position (0f, 0f).
      Parameters:
      box - the specified box.
      Throws:
      Exception
    • placeIn

      public void placeIn(Box box, double x_offset, double y_offset) throws Exception
      Places this point in the specified box.
      Parameters:
      box - the specified box.
      x_offset - the x offset from the top left corner of the box.
      y_offset - the y offset from the top left corner of the box.
      Throws:
      Exception
    • placeIn

      public void placeIn(Box box, float x_offset, float y_offset) throws Exception
      Places this point in the specified box.
      Parameters:
      box - the specified box.
      x_offset - the x offset from the top left corner of the box.
      y_offset - the y offset from the top left corner of the box.
      Throws:
      Exception
    • drawOn

      public float[] drawOn(Page page) throws Exception
      Draws this point on the specified page.
      Specified by:
      drawOn in interface Drawable
      Parameters:
      page - the page to draw this point on.
      Returns:
      x and y coordinates of the bottom right corner of this component.
      Throws:
      Exception