public class TLcdGXYViewXYWorldTransformation extends Object implements ILcdGXYViewXYWorldTransformation
ILcdGXYViewXYWorldTransformation
interface.Constructor and Description |
---|
TLcdGXYViewXYWorldTransformation()
Constructs a unitary transformation.
|
TLcdGXYViewXYWorldTransformation(ILcdGXYView aGXYView)
Initializes the view origin, world origin and scale of
the given
ILcdGXYView . |
TLcdGXYViewXYWorldTransformation(Point aViewOrigin,
double aScale)
Constructs a transformation with the given view origin and scale.
|
TLcdGXYViewXYWorldTransformation(Point aViewOrigin,
ILcdPoint aWorldOrigin,
double aScale)
Constructs a transformation with the given view origin, world origin, and scale.
|
TLcdGXYViewXYWorldTransformation(Point aViewOrigin,
ILcdPoint aWorldOrigin,
double aScale,
double aRotation)
Constructs a transformation with the given view origin, world origin, scale, and rotation.
|
TLcdGXYViewXYWorldTransformation(Point aViewOrigin,
ILcdPoint aWorldOrigin,
double aScaleX,
double aScaleY,
double aRotation)
Constructs a transformation with the given view origin, world origin, scale, and rotation.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a clone of this
ILcdGXYViewXYWorldTransformation . |
boolean |
equals(Object aGXYViewXYWorldTransformation) |
double |
getRotation()
Gets the rotation of this
ILcdGXYViewXYWorldTransformation in degrees. |
double |
getScale()
Returns the scaling factor from world to view coordinates.
|
double |
getScaleX()
Returns the scaling factor from world to view coordinates along the x-axis.
|
double |
getScaleY()
Returns the scaling factor from world to view coordinates along the y-axis.
|
Point |
getViewOrigin()
Returns the viewOrigin value of this
TLcdGXYViewXYWorldTransformation . |
ILcdPoint |
getWorldOrigin()
Returns the worldOrigin value of this
TLcdGXYViewXYWorldTransformation . |
void |
setRotation(double aRotation)
Sets the rotation of this
ILcdGXYViewXYWorldTransformation in degrees. |
void |
setScale(double aScale)
Sets the scaling factor from world to view coordinates.
|
void |
setupFor(ILcdGXYView aGXYView)
Setup with the view origin, world origin and scale of the given
ILcdGXYView . |
void |
setViewOrigin(int aX,
int aY)
Sets the view origin.
|
void |
setViewOrigin(Point aViewOrigin)
Sets the view origin.
|
void |
setWorldOrigin(double aX,
double aY)
Sets the world origin.
|
void |
setWorldOrigin(ILcdPoint aWorldOrigin)
Sets the world origin.
|
void |
viewAWTBounds2worldSFCT(Rectangle aViewRectangle,
ILcd2DEditableBounds aWorldBoundsSFCT)
Converts a
Rectangle in AWT view coordinates to a
ILcd2DEditableBounds in world coordinates. |
double |
viewAWTDistance2world(int aViewDistance)
Converts a distance in AWT view space to a distance in world space.
|
void |
viewAWTPoint2worldSFCT(Point aViewPoint,
ILcd2DEditablePoint aWorldPointSFCT)
Converts a
Point in AWT view coordinates to a
ILcd2DEditablePoint in world coordinates. |
void |
viewXYBounds2worldSFCT(ILcdBounds aViewBounds,
ILcd2DEditableBounds aWorldBoundsSFCT)
Converts a
ILcdBounds in AWT view coordinates to a
ILcd2DEditableBounds in world coordinates. |
double |
viewXYDistance2world(double aViewDistance)
Converts a distance in AWT view space to a distance in world space.
|
void |
viewXYPoint2worldSFCT(ILcdPoint aViewPoint,
ILcd2DEditablePoint aWorldPointSFCT)
Converts an
ILcdPoint in AWT view coordinates to a
ILcd2DEditablePoint in world coordinates. |
void |
viewXYPoint2worldSFCT(int aViewX,
int aViewY,
ILcd2DEditablePoint aWorldPointSFCT)
Converts a (x,y) location in AWT view coordinates to a
ILcd2DEditablePoint in world coordinates. |
void |
worldBounds2viewAWTSFCT(ILcdBounds aWorldBounds,
Rectangle aRectangleSFCT)
Converts a
ILcdBounds in world coordinates to a
Rectangle in AWT view coordinates. |
void |
worldBounds2viewXYSFCT(ILcdBounds aWorldBounds,
ILcd2DEditableBounds aViewBoundsSFCT)
Converts a
ILcdBounds in world coordinates to a
ILcd2DEditableBounds in AWT view coordinates. |
double |
worldDistance2view(double aWorldDistance)
Converts a distance in world space to a distance in AWT view space.
|
void |
worldPoint2viewAWTPointSFCT(ILcdPoint aWorldPoint,
Point aViewPointSFCT)
Converts an
ILcdPoint in world coordinates to an AWT
Point in AWT view coordinates. |
void |
worldPoint2viewXYPointSFCT(ILcdPoint aWorldPoint,
ILcd2DEditablePoint aViewPointSFCT)
Converts an
ILcdPoint in world coordinates to a
ILcd2DEditablePoint in AWT view coordinates. |
public TLcdGXYViewXYWorldTransformation()
public TLcdGXYViewXYWorldTransformation(Point aViewOrigin, double aScale)
aViewOrigin
- the view origin.aScale
- the scale to apply from world to view coordinates.public TLcdGXYViewXYWorldTransformation(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScale)
aViewOrigin
- the view origin.aWorldOrigin
- the world origin.aScale
- scaling factor from world to view coordinates.public TLcdGXYViewXYWorldTransformation(ILcdGXYView aGXYView)
ILcdGXYView
.aGXYView
- the ILcdGXYView for which to construct the transformation.public TLcdGXYViewXYWorldTransformation(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScale, double aRotation)
aViewOrigin
- the view origin.aWorldOrigin
- the world origin.aScale
- scaling factor from world to view coordinates.aRotation
- the rotation to apply around the world origin (in degrees).public TLcdGXYViewXYWorldTransformation(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScaleX, double aScaleY, double aRotation)
aViewOrigin
- the view origin.aWorldOrigin
- the world origin.aScaleX
- scaling factor from world to view coordinates along x-axis.aScaleY
- scaling factor from world to view coordinates along y-axis.aRotation
- the rotation to apply around the world origin (in degrees).public void setupFor(ILcdGXYView aGXYView)
ILcdGXYView
.aGXYView
- the ILcdGXYView
for which to initialize this TLcdGXYViewXYWorldTransformation
.public Point getViewOrigin()
TLcdGXYViewXYWorldTransformation
.TLcdGXYViewXYWorldTransformation
.setViewOrigin(int, int)
public void setViewOrigin(int aX, int aY)
aX
- view x coordinate.aY
- view y coordinate.getViewOrigin()
public void setViewOrigin(Point aViewOrigin)
aViewOrigin
- point to become new view origin.getViewOrigin()
public ILcdPoint getWorldOrigin()
TLcdGXYViewXYWorldTransformation
.TLcdGXYViewXYWorldTransformation
.setWorldOrigin(double, double)
public void setWorldOrigin(double aX, double aY)
aX
- world x coordinate.aY
- world y coordinate.getWorldOrigin()
public void setWorldOrigin(ILcdPoint aWorldOrigin)
aWorldOrigin
- ILcdPoint
the new world origin. Only
the 2 first coordinates are considered.getWorldOrigin()
public double getScale()
ILcdXYWorldReference
. For example, a view displaying geographical data
could use a scale in pixels per meter.setScale(double)
public double getScaleX()
ILcdXYWorldReference
. For example, a view displaying geographical data
could use a scale in pixels per meter.public double getScaleY()
ILcdXYWorldReference
. For example, a view displaying geographical data
could use a scale in pixels per meter.public void setScale(double aScale)
ILcdXYWorldReference
. For example, a view displaying geographical data
could use a scale in pixels per meter.aScale
- the scaling factor from world to view coordinates.getScale()
public double getRotation()
ILcdGXYViewXYWorldTransformation
in degrees. The rotation is
positive counter-clockwise. The rotation is applied in the world reference system
around the worldOrigin.ILcdGXYViewXYWorldTransformation
in degrees.ILcdGXYView
,
setRotation(double)
public void setRotation(double aRotation)
ILcdGXYViewXYWorldTransformation
in degrees. The rotation is
positive counter-clockwise. The rotation is applied in the world reference system
around the worldOrigin.aRotation
- the rotation of this ILcdGXYViewXYWorldTransformation
in degrees.ILcdGXYView
,
getRotation()
public double worldDistance2view(double aWorldDistance)
ILcdGXYViewXYWorldTransformation
worldDistance2view
in interface ILcdGXYViewXYWorldTransformation
aWorldDistance
- the distance to be converted.public void worldPoint2viewAWTPointSFCT(ILcdPoint aWorldPoint, Point aViewPointSFCT)
ILcdGXYViewXYWorldTransformation
ILcdPoint
in world coordinates to an AWT
Point
in AWT view coordinates.worldPoint2viewAWTPointSFCT
in interface ILcdGXYViewXYWorldTransformation
aWorldPoint
- the world ILcdPoint
to transform.aViewPointSFCT
- the AWT Point
to be set.public void worldPoint2viewXYPointSFCT(ILcdPoint aWorldPoint, ILcd2DEditablePoint aViewPointSFCT)
ILcdGXYViewXYWorldTransformation
ILcdPoint
in world coordinates to a
ILcd2DEditablePoint
in AWT view coordinates.worldPoint2viewXYPointSFCT
in interface ILcdGXYViewXYWorldTransformation
aWorldPoint
- the world ILcdPoint
to transform.aViewPointSFCT
- the AWT ILcd2DEditablePoint
to be set.public void viewAWTPoint2worldSFCT(Point aViewPoint, ILcd2DEditablePoint aWorldPointSFCT)
ILcdGXYViewXYWorldTransformation
Point
in AWT view coordinates to a
ILcd2DEditablePoint
in world coordinates.viewAWTPoint2worldSFCT
in interface ILcdGXYViewXYWorldTransformation
aViewPoint
- the AWT view coordinate to transform.aWorldPointSFCT
- the world point to be set.public void viewXYPoint2worldSFCT(ILcdPoint aViewPoint, ILcd2DEditablePoint aWorldPointSFCT)
ILcdGXYViewXYWorldTransformation
ILcdPoint
in AWT view coordinates to a
ILcd2DEditablePoint
in world coordinates.viewXYPoint2worldSFCT
in interface ILcdGXYViewXYWorldTransformation
aViewPoint
- the AWT view coordinate to transform.aWorldPointSFCT
- the world point to be set.public void viewXYPoint2worldSFCT(int aViewX, int aViewY, ILcd2DEditablePoint aWorldPointSFCT)
ILcdGXYViewXYWorldTransformation
ILcd2DEditablePoint
in world coordinates.viewXYPoint2worldSFCT
in interface ILcdGXYViewXYWorldTransformation
aViewX
- the x-value of the AWT view coordinate to transform.aViewY
- the y-value of the AWT view coordinate to transform.aWorldPointSFCT
- the world point to be set.public double viewAWTDistance2world(int aViewDistance)
ILcdGXYViewXYWorldTransformation
viewAWTDistance2world
in interface ILcdGXYViewXYWorldTransformation
aViewDistance
- the distance to be converted.public double viewXYDistance2world(double aViewDistance)
ILcdGXYViewXYWorldTransformation
viewXYDistance2world
in interface ILcdGXYViewXYWorldTransformation
aViewDistance
- the distance to be converted.public void viewAWTBounds2worldSFCT(Rectangle aViewRectangle, ILcd2DEditableBounds aWorldBoundsSFCT)
ILcdGXYViewXYWorldTransformation
Rectangle
in AWT view coordinates to a
ILcd2DEditableBounds
in world coordinates.viewAWTBounds2worldSFCT
in interface ILcdGXYViewXYWorldTransformation
aViewRectangle
- the bounds in AWT view coordinates to transform.aWorldBoundsSFCT
- the transformed world bounds to be set by the transformation.public void viewXYBounds2worldSFCT(ILcdBounds aViewBounds, ILcd2DEditableBounds aWorldBoundsSFCT)
ILcdGXYViewXYWorldTransformation
ILcdBounds
in AWT view coordinates to a
ILcd2DEditableBounds
in world coordinates.viewXYBounds2worldSFCT
in interface ILcdGXYViewXYWorldTransformation
aViewBounds
- the bounds in AWT view coordinates to transform.aWorldBoundsSFCT
- the transformed world bounds to be set by the transformation.public void worldBounds2viewAWTSFCT(ILcdBounds aWorldBounds, Rectangle aRectangleSFCT)
ILcdGXYViewXYWorldTransformation
ILcdBounds
in world coordinates to a
Rectangle
in AWT view coordinates.worldBounds2viewAWTSFCT
in interface ILcdGXYViewXYWorldTransformation
aWorldBounds
- the bounds in world coordinates to transform.aRectangleSFCT
- the transformed AWT view bounds to be set by the transformation.public void worldBounds2viewXYSFCT(ILcdBounds aWorldBounds, ILcd2DEditableBounds aViewBoundsSFCT)
ILcdGXYViewXYWorldTransformation
ILcdBounds
in world coordinates to a
ILcd2DEditableBounds
in AWT view coordinates.worldBounds2viewXYSFCT
in interface ILcdGXYViewXYWorldTransformation
aWorldBounds
- the bounds in world coordinates to transform.aViewBoundsSFCT
- the transformed AWT view bounds to be set by the transformation.public boolean equals(Object aGXYViewXYWorldTransformation)
public Object clone() throws CloneNotSupportedException
ILcdGXYViewXYWorldTransformation
ILcdGXYViewXYWorldTransformation
.clone
in interface ILcdGXYViewXYWorldTransformation
clone
in class Object
ILcdGXYViewXYWorldTransformation
.CloneNotSupportedException
- if the object's class does not support cloning.
Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.