public class PdfPoint extends Object
PdfPoint object on a page is wholly dependent on
whatever measurement unit that is currently applicable.
For example, on a page where the measurement unit is inch, the x-y coordinates of a point will be applied in inches, literally. On a page with pixel as the measurement unit, coordinates of the same point will applied in pixels, literally. As this can cause serious shifts in position, care has to be taken when reusing a point in different places or in different situations.
Some classes may have methods that specify a PdfPoint
object and a particular measurement unit as arguments. In these
cases, the coordinates of the PdfPoint object are
applied in the specified measurement unit. When no measurement unit
is specified or can be determined, the coordinates are applied in
default as points, or points as in "one inch equals 72
points equals 96 pixels."
| Constructor and Description |
|---|
PdfPoint(double x,
double y)
Constructs a point at position
(
x, y). |
PdfPoint(PdfPoint p)
Constructs a point at the same position as specified
PdfPoint object. |
PdfPoint(Point p)
Constructs a point at the same position as specified
Point object. |
PdfPoint(Point2D p)
Constructs a point at the same position as specified
Point2D object. |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
double |
getX()
Returns x-coordinate of this point.
|
double |
getY()
Returns y-coordinate of this point.
|
void |
setX(double x)
Specifies new x-coordinate for this point.
|
void |
setY(double y)
Specifies new y-coordinate for this point.
|
String |
toString()
Returns a string representation of the point.
|
public PdfPoint(double x,
double y)
x, y).x - x-coordinate of the pointy - y-coordinate of the pointpublic PdfPoint(PdfPoint p)
PdfPoint object.p - a pointpublic PdfPoint(Point p)
Point object.p - a pointpublic double getX()
public void setX(double x)
x - new x-coordinate for the pointpublic double getY()
public void setY(double y)
y - new y-coordinate for the pointpublic Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException