com.pdfjet
Class Point

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

public class Point
extends java.lang.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
static int BOX
           
static int CIRCLE
           
static boolean CONTROL_POINT
           
static int DIAMOND
           
static int DOWN_ARROW
           
static int H_DASH
           
static int INVISIBLE
           
static int LEFT_ARROW
           
static int MULTIPLY
           
static int PLUS
           
static int RIGHT_ARROW
           
static int STAR
           
static int UP_ARROW
           
static int V_DASH
           
static int X_MARK
           
 
Constructor Summary
Point()
          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
 float[] drawOn(Page page)
          Draws this point on the specified page.
 int getAlignment()
          Returns the point alignment.
 int getColor()
          Returns the point color as an integer.
 boolean getFillShape()
          Returns the value of the fillShape private variable.
 java.lang.String getLinePattern()
          Returns the line dash pattern.
 float getLineWidth()
          Returns the width of the lines used to draw this point.
 float getRadius()
          Returns the radius of this point.
 int getShape()
          Returns the point shape code value.
 java.lang.String getText()
          Returns the text associated with this point.
 int getTextColor()
          Returns the point's text color.
 int getTextDirection()
          Returns the point's text direction.
 java.lang.String getURIAction()
          Returns the URI for the "click point" action.
 float getX()
          Returns the x coordinate of this point.
 float getY()
          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. See Example_40.
 void setFillShape(boolean fillShape)
          Sets the private fillShape variable.
 void setLinePattern(java.lang.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 setStartOfPath()
          Sets this point as the start of a path that will be drawn on the chart.
 void setText(java.lang.String text)
          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 setURIAction(java.lang.String uri)
          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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVISIBLE

public static final int INVISIBLE
See Also:
Constant Field Values

CIRCLE

public static final int CIRCLE
See Also:
Constant Field Values

DIAMOND

public static final int DIAMOND
See Also:
Constant Field Values

BOX

public static final int BOX
See Also:
Constant Field Values

PLUS

public static final int PLUS
See Also:
Constant Field Values

H_DASH

public static final int H_DASH
See Also:
Constant Field Values

V_DASH

public static final int V_DASH
See Also:
Constant Field Values

MULTIPLY

public static final int MULTIPLY
See Also:
Constant Field Values

STAR

public static final int STAR
See Also:
Constant Field Values

X_MARK

public static final int X_MARK
See Also:
Constant Field Values

UP_ARROW

public static final int UP_ARROW
See Also:
Constant Field Values

DOWN_ARROW

public static final int DOWN_ARROW
See Also:
Constant Field Values

LEFT_ARROW

public static final int LEFT_ARROW
See Also:
Constant Field Values

RIGHT_ARROW

public static final int RIGHT_ARROW
See Also:
Constant Field Values

CONTROL_POINT

public static final boolean CONTROL_POINT
See Also:
Constant Field Values
Constructor Detail

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 Detail

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(java.lang.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 java.lang.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(java.lang.String uri)
Sets the URI for the "click point" action.

Parameters:
uri - the URI

getURIAction

public java.lang.String getURIAction()
Returns the URI for the "click point" action.

Returns:
the URI for the "click point" action.

setText

public void setText(java.lang.String text)
Sets the point text.

Parameters:
text - the text.

getText

public java.lang.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 java.lang.Exception
Places this point in the specified box at position (0f, 0f).

Parameters:
box - the specified box.
Throws:
java.lang.Exception

placeIn

public void placeIn(Box box,
                    double x_offset,
                    double y_offset)
             throws java.lang.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:
java.lang.Exception

placeIn

public void placeIn(Box box,
                    float x_offset,
                    float y_offset)
             throws java.lang.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:
java.lang.Exception

drawOn

public float[] drawOn(Page page)
               throws java.lang.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:
java.lang.Exception