|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.gui2.ScreenTransformation
ScreenTransformation is the abstract root class for all transformation classes that have to convert some objects in user space to screen coordinates. A ScreenTransformation should be able to convert screen coordinate points to some objects in user space vice versa. The visible (rectangular) area can should be transformable via simple affine transformations (to allow zooming, rotation and panning of the view port).
Constructor Summary | |
ScreenTransformation()
|
Method Summary | |
java.awt.Rectangle |
bounds()
Returns the bounds of the screen in screen coordinates. |
abstract java.awt.Point |
deltaTransform(java.lang.Object point)
Transforms a relative distance vector object in user space to a relative distance vector in screen coordinates. |
java.awt.Point[] |
deltaTransform(java.lang.Object[] points)
Transforms an array of relative distance vector objects in user space to a relative distance vector array in screen coordinates. |
abstract java.awt.Point[] |
deltaTransform(java.lang.Object[] points,
int off,
int len)
Transforms a subarray of relative distance vector objects in user space to a relative distance vector array in screen coordinates. |
abstract java.lang.Object |
inverseDeltaTransform(java.awt.Point point)
Transforms a relative distance vector in screen coordinates to a relative distance vector object in user space. |
java.lang.Object |
inverseDeltaTransform(java.awt.Point[] points)
Transforms an array of relative distance vectors in screen coordinates to an array of relative distance vector objects in user space. |
abstract java.lang.Object |
inverseDeltaTransform(java.awt.Point[] points,
int off,
int len)
Transforms a subarray of relative distance vectors in screen coordinates to an array of relative distance vector objects in user space. |
abstract java.lang.Object |
inverseTransform(int x,
int y)
Transforms one point on the screen to a point object in user space. |
java.lang.Object |
inverseTransform(java.awt.Point point)
Transforms one point on the screen to a point object in user space. |
java.lang.Object[] |
inverseTransform(java.awt.Point[] points)
Transforms an array of points in screen coordinates to an array of point objects in user space. |
abstract java.lang.Object[] |
inverseTransform(java.awt.Point[] points,
int off,
int len)
Transforms a subarray of points in screen coordinates to an array of point objects in user space. |
abstract void |
resetTransform()
Resets the ScreenTransformation to its initial values (identity). |
void |
restoreStatus(java.lang.Object status)
Restores a state saved via saveStatus() . |
void |
rotate(double angle)
Rotates the ScreenTransformation around the origin. |
void |
rotate(java.awt.Point center,
double angle)
Rotates the ScreenTransformation around an anchor point. |
void |
rotate(java.awt.Point center,
java.awt.Point start,
java.awt.Point end)
Rotates the ScreenTransformation around an anchor point with the angle of rotation given by the two points start and
end . |
java.lang.Object |
saveStatus()
Returns the status of the ScreenTransformation to restore it via
restoreStatus(java.lang.Object) . |
void |
scale(double xscale,
double yscale)
Scales the ScreenTransformation with the given scale factors. |
void |
scale(java.awt.Point center,
double xscale,
double yscale)
Scales the ScreenTransformation with leaving the given center point unchanged. |
abstract void |
screenTransform(double m00,
double m01,
double m02,
double m10,
double m11,
double m12)
Transforms the ScreenTransformation with the given transformation matrix. |
abstract java.awt.Point |
transform(java.lang.Object point)
Transforms one point object in user space to a point on the screen. |
java.awt.Point[] |
transform(java.lang.Object[] points)
Transforms an array of point objects in user space to a point array in screen coordinates. |
abstract java.awt.Point[] |
transform(java.lang.Object[] points,
int off,
int len)
Transforms a subarray of point objects in user space to a point array in screen coordinates. |
java.lang.Object[] |
transformedBounds()
Returns the corner points of the screen bounds transformed into user space point objects. |
void |
translate(int dx,
int dy)
Translates the ScreenTransformation by the given vector. |
void |
zoomTo(java.awt.Rectangle border,
java.awt.Rectangle source,
boolean maintain_aspect_ration)
Scales the ScreenTransformation in that manner that the given source rectangle fully filles the specified border rectangle. if maintain_aspect_ration is true the aspect
ratio will be maintained and the zoomed source rectangle will be
centered in border. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScreenTransformation()
Method Detail |
public java.awt.Rectangle bounds()
public java.lang.Object[] transformedBounds()
public java.lang.Object saveStatus()
ScreenTransformation
to restore it via
restoreStatus(java.lang.Object)
.ScreenTransformation
.public void restoreStatus(java.lang.Object status)
saveStatus()
.status
- the status to restore (must be saved via saveStatus()
).public abstract java.awt.Point transform(java.lang.Object point)
point
- point object in user spacepublic abstract java.awt.Point[] transform(java.lang.Object[] points, int off, int len)
points
- array of point objects in user spaceoff
- offset of the subarraylen
- length of the subarraypublic java.awt.Point[] transform(java.lang.Object[] points)
points
- array of point objects in user spacepublic abstract java.lang.Object inverseTransform(int x, int y)
point
- point in screen coordinatespublic java.lang.Object inverseTransform(java.awt.Point point)
point
- point in screen coordinatespublic abstract java.lang.Object[] inverseTransform(java.awt.Point[] points, int off, int len)
points
- array of points in screen coordinatesoff
- offset of the subarraylen
- length of the subarraypublic java.lang.Object[] inverseTransform(java.awt.Point[] points)
points
- array of points in screen coordinatespublic abstract java.awt.Point deltaTransform(java.lang.Object point)
point
- vector in user spacepublic abstract java.awt.Point[] deltaTransform(java.lang.Object[] points, int off, int len)
points
- array of relative distance vector objects in user spaceoff
- offset of the subarraylen
- length of the subarraypublic java.awt.Point[] deltaTransform(java.lang.Object[] points)
points
- array of relative distance vector objects in user spacepublic abstract java.lang.Object inverseDeltaTransform(java.awt.Point point)
point
- vector in user spacepublic abstract java.lang.Object inverseDeltaTransform(java.awt.Point[] points, int off, int len)
points
- array of relative distance vectors in screen coordinatesoff
- offset of the subarraylen
- length of the subarraypublic java.lang.Object inverseDeltaTransform(java.awt.Point[] points)
points
- array of relative distance vectors in screen coordinatespublic abstract void resetTransform()
public abstract void screenTransform(double m00, double m01, double m02, double m10, double m11, double m12)
m00,m01,m02
- first row of the transformation matrixm10,m11,m12
- second row of the transformation matrixpublic void scale(java.awt.Point center, double xscale, double yscale)
center
- the center point (will be unchanged)xscale
- scale factor for the x-axisyscale
- scale factor for the y-axispublic void scale(double xscale, double yscale)
xscale
- scale factor for the x-axisyscale
- scale factor for the y-axispublic void rotate(java.awt.Point center, double angle)
center
- anchor pointangle
- the angle of rotation in radianspublic void rotate(java.awt.Point center, java.awt.Point start, java.awt.Point end)
start
and
end
.center
- anchor pointstart
- start pointend
- end pointpublic void rotate(double angle)
angle
- the angle of rotationpublic void translate(int dx, int dy)
(dx,dy)
- the translational vectorpublic void zoomTo(java.awt.Rectangle border, java.awt.Rectangle source, boolean maintain_aspect_ration)
maintain_aspect_ration
is true
the aspect
ratio will be maintained and the zoomed source rectangle will be
centered in border.source
- rectangluar area to zoomborder
- to zoom onmaintain_aspect_ration
- maintaining aspect ratio if true
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |