|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Point defines a public interface for obtaining the X and Y values associated with one corner of the area that one or more characters occupy. The X value defines the horizontal position of the corner, and the Y value defines the vertical position of the corner. Both positions are relative to the upper left corner of the page, which has the X-Y coordinate 0,0.
After you create a Quad object, you can call the p1, p2, p3, or p4 method to get the X-Y coordinate associated with one corner. Afterward, you can use the methods described in this chapter to get the X and Y values of the corner.
Assuming that the locations p1, p2, p3, and p4 have been obtained, the following example shows how to get the X and Y values associated with each point:
double x1, y1, x2, y2, x3, y3, x4, y4; //Get the values for point p1. x1 = p1.x() y1 = p1.y() //Get the values for point p2. x2 = p2.x(); y2 = p2.y(); //Get the values for point p3. x3 = p3.x(); y3 = p3.y(); //Get the values for point p4. x4 = p4.x(); y4 = p4.y();
Quad| Method Summary | |
double |
x()
Gets the horizontal position of a corner. |
double |
y()
Gets the vertical position of a corner. |
| Method Detail |
public double x()
public double y()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||