|
||
Groups specify their own internal coordinate system, which is used by all objects within the group. The group coordinate system is relative to the group's bounding box, so it actually provides an extra level of transformation when determining a shape's absolute coordinates.
To access a group's coordinate system use:
java.awt.Rectangle getCoordSystem()
To set a group's coordinate system use:
void setCoordSystem(java.awt.Rectangle rect)
For example, the absolute x coordinate of a shape, s, contained in a group, g, is:
x (absolute) = g.getBounds().x - g.getCoordSystem().x + s.getBounds().x
And the absolute height of the shape is:
h (absolute) = g.getBounds().height / g.getCoordSystem().height * s.getBounds().height
Normally you do not need to work directly with a group's coordinate system.
|
||
| Page generated: 2008-01-18 02:53:28 GMT | TonicPoint Builder Developer's Guide -- Version 2.3 |