Package net.atthegate.server.service.pdf
Class Point
java.lang.Object
net.atthegate.server.service.pdf.Point
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprotected 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
ConstructorsConstructorDescriptionPoint()
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 TypeMethodDescriptionfloat[]
Draws this point on the specified page.int
Returns the point alignment.int
getColor()
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
getShape()
Returns the point shape code value.getText()
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
getX()
Returns the x coordinate of this point.float
getY()
Returns the y coordinate of this point.void
Places this point in the specified box at position (0f, 0f).void
Places this point in the specified box.void
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
setURIAction
(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.
-
Field Details
-
INVISIBLE
public static final int INVISIBLE- See Also:
-
CIRCLE
public static final int CIRCLE- See Also:
-
DIAMOND
public static final int DIAMOND- See Also:
-
BOX
public static final int BOX- See Also:
-
PLUS
public static final int PLUS- See Also:
-
H_DASH
public static final int H_DASH- See Also:
-
V_DASH
public static final int V_DASH- See Also:
-
MULTIPLY
public static final int MULTIPLY- See Also:
-
STAR
public static final int STAR- See Also:
-
X_MARK
public static final int X_MARK- See Also:
-
UP_ARROW
public static final int UP_ARROW- See Also:
-
DOWN_ARROW
public static final int DOWN_ARROW- See Also:
-
LEFT_ARROW
public static final int LEFT_ARROW- See Also:
-
RIGHT_ARROW
public static final int RIGHT_ARROW- See Also:
-
CONTROL_POINT
public static final boolean CONTROL_POINT- See Also:
-
x
protected float x -
y
protected float y -
r
protected float r -
shape
protected int shape -
color
protected int color -
align
protected int align -
lineWidth
protected float lineWidth -
linePattern
-
fillShape
protected boolean fillShape -
isControlPoint
protected boolean isControlPoint -
isStartOfPath
protected boolean isStartOfPath
-
-
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
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
Returns the line dash pattern.- Returns:
- the line dash pattern.
-
setDrawLineTo
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
Sets the URI for the "click point" action.- Parameters:
uri
- the URI
-
getURIAction
Returns the URI for the "click point" action.- Returns:
- the URI for the "click point" action.
-
setText
Sets the point text.- Parameters:
text
- the text.
-
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
Places this point in the specified box at position (0f, 0f).- Parameters:
box
- the specified box.- Throws:
Exception
-
placeIn
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
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
Draws this point on the specified page.
-