Package com.pdfjet

Class Point

java.lang.Object
com.pdfjet.Point
All Implemented Interfaces:
Drawable

public class Point extends Object implements Drawable
A point with a marker: a shape drawn around its (x, y) coordinates, which are the center of the marker. A point is drawn on a page on its own, as the marker of a table cell, or in a chart Series, and a list of points is a path for Page.drawPath. Please see Example_05.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char
    A control point of a curve drawn with the c operator, which uses both control points.
    static final char
    A control point of a curve drawn with the v operator, where the first control point is the start point.
    static final char
    A control point of a curve drawn with the y operator, where the second control point is the end point.
  • Constructor Summary

    Constructors
    Constructor
    Description
    The default constructor.
    Point(float x, float y)
    Constructor for creating point objects.
    Point(float x, float y, char controlPoint)
    Constructor for creating point objects.
    Point(Point point)
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    drawOn(Page page)
    Draws this point on the specified page.
    Returns what the point stands for.
    float[]
    Returns the fill color of this point.
    float
    Returns the radius of this point.
    Returns the shape of the marker drawn at this point.
    float[]
    Returns the stroke color of this point.
    float
    Returns the width of the lines used to draw this point.
    Returns the URI of the link opened by a click on this point.
    float
    Returns the x coordinate of this point.
    float
    Returns the y coordinate of this point.
    setAltDescription(String altDescription)
    Sets what a point that is a link stands for, like the country a point of a chart is, for a screen reader: in a tagged document, PDF/UA or a PDF/A of level A, a point of a chart that is a link is a figure of its own in the Link, described by it.
    setFillColor(float[] rgbColor)
    Sets the fill color of this point.
    setFillColor(int color)
    Sets the fill color of this point.
    setLocation(float x, float y)
    Sets the location (x, y) of this point.
    setRadius(float r)
    Sets the radius of this point.
    setShape(Shape shape)
    Sets the shape of the marker drawn at this point.
    setStrokeColor(float[] rgbColor)
    Sets the stroke color of this point.
    setStrokeColor(int color)
    Sets the stroke color of this point.
    setStrokeWidth(float strokeWidth)
    Sets the width of the lines of this point.
    Sets the URI of the link opened by a click on this point.
    setX(float x)
    Sets the x coordinate of this point.
    setY(float y)
    Sets the y coordinate of this point.

    Methods inherited from class java.lang.Object

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

    • CONTROL_POINT_C

      public static final char CONTROL_POINT_C
      A control point of a curve drawn with the c operator, which uses both control points.
      See Also:
    • CONTROL_POINT_V

      public static final char CONTROL_POINT_V
      A control point of a curve drawn with the v operator, where the first control point is the start point.
      See Also:
    • CONTROL_POINT_Y

      public static final char CONTROL_POINT_Y
      A control point of a curve drawn with the y operator, where the second control point is the end point.
      See Also:
  • Constructor Details

    • Point

      public Point()
      The default constructor.
    • Point

      public Point(Point point)
      Copy constructor. Creates a copy of the specified point, including its marker and its URI action.
      Parameters:
      point - the point to copy.
    • 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(float x, float y, char controlPoint)
      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.
      controlPoint - the type of control point specifying.
  • Method Details

    • setLocation

      public Point setLocation(float x, float y)
      Sets the location (x, y) of this point.
      Specified by:
      setLocation in interface Drawable
      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.
      Returns:
      the location of the point.
    • setX

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

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

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

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

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

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

      public Point setFillColor(int color)
      Sets the fill color of this point. Color.transparent leaves it unchanged.
      Parameters:
      color - the color as a 0xRRGGBB value, for example Color.blue.
      Returns:
      this Point object.
    • setFillColor

      public Point setFillColor(float[] rgbColor)
      Sets the fill color of this point.
      Parameters:
      rgbColor - the red, green and blue components, from 0.0 to 1.0.
      Returns:
      this Point object.
    • getFillColor

      public float[] getFillColor()
      Returns the fill color of this point.
      Returns:
      the red, green and blue components, from 0.0 to 1.0.
    • setStrokeColor

      public Point setStrokeColor(int color)
      Sets the stroke color of this point. Color.transparent leaves it unchanged.
      Parameters:
      color - the color as a 0xRRGGBB value, for example Color.blue.
      Returns:
      this Point object.
    • setStrokeColor

      public Point setStrokeColor(float[] rgbColor)
      Sets the stroke color of this point.
      Parameters:
      rgbColor - the red, green and blue components, from 0.0 to 1.0.
      Returns:
      this Point object.
    • getStrokeColor

      public float[] getStrokeColor()
      Returns the stroke color of this point.
      Returns:
      the red, green and blue components, from 0.0 to 1.0.
    • setShape

      public Point setShape(Shape shape)
      Sets the shape of the marker drawn at this point.
      Parameters:
      shape - the shape, for example Shape.CIRCLE; Shape.INVISIBLE draws no marker.
      Returns:
      this Point object.
    • getShape

      public Shape getShape()
      Returns the shape of the marker drawn at this point.
      Returns:
      the shape.
    • setStrokeWidth

      public Point setStrokeWidth(float strokeWidth)
      Sets the width of the lines of this point.
      Parameters:
      strokeWidth - the line width.
      Returns:
      this Point object.
    • getStrokeWidth

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

      public Point setURIAction(String uri)
      Sets the URI of the link opened by a click on this point.
      Parameters:
      uri - the URI.
      Returns:
      this Point object.
    • setAltDescription

      public Point setAltDescription(String altDescription)
      Sets what a point that is a link stands for, like the country a point of a chart is, for a screen reader: in a tagged document, PDF/UA or a PDF/A of level A, a point of a chart that is a link is a figure of its own in the Link, described by it. Without one it is described by its URI.
      Parameters:
      altDescription - what the point stands for.
      Returns:
      this Point object.
    • getAltDescription

      public String getAltDescription()
      Returns what the point stands for.
      Returns:
      the description, or null.
    • getURIAction

      public String getURIAction()
      Returns the URI of the link opened by a click on this point.
      Returns:
      the URI, or null.
    • 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 - If an input or output exception occurred