Package com.luciad.view.gxy
Class TLcdGXYViewXYWorldTransformation
java.lang.Object
com.luciad.view.gxy.TLcdGXYViewXYWorldTransformation
- All Implemented Interfaces:
ILcdGXYViewXYWorldTransformation,Serializable,Cloneable
public class TLcdGXYViewXYWorldTransformation
extends Object
implements ILcdGXYViewXYWorldTransformation
This an implementation of the
ILcdGXYViewXYWorldTransformation interface.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a unitary transformation.TLcdGXYViewXYWorldTransformation(ILcdGXYView aGXYView) Initializes the view origin, world origin and scale of the givenILcdGXYView.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. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a clone of thisILcdGXYViewXYWorldTransformation.booleandoubleGets the rotation of thisILcdGXYViewXYWorldTransformationin degrees.doublegetScale()Returns the scaling factor from world to view coordinates.doubleReturns the scaling factor from world to view coordinates along the x-axis.doubleReturns the scaling factor from world to view coordinates along the y-axis.Returns the viewOrigin value of thisTLcdGXYViewXYWorldTransformation.Returns the worldOrigin value of thisTLcdGXYViewXYWorldTransformation.voidsetRotation(double aRotation) Sets the rotation of thisILcdGXYViewXYWorldTransformationin degrees.voidsetScale(double aScale) Sets the scaling factor from world to view coordinates.voidsetupFor(ILcdGXYView aGXYView) Setup with the view origin, world origin and scale of the givenILcdGXYView.voidsetViewOrigin(int aX, int aY) Sets the view origin.voidsetViewOrigin(Point aViewOrigin) Sets the view origin.voidsetWorldOrigin(double aX, double aY) Sets the world origin.voidsetWorldOrigin(ILcdPoint aWorldOrigin) Sets the world origin.voidviewAWTBounds2worldSFCT(Rectangle aViewRectangle, ILcd2DEditableBounds aWorldBoundsSFCT) Converts aRectanglein AWT (toolkit) view coordinates to aILcd2DEditableBoundsin world coordinates.doubleviewAWTDistance2world(int aViewDistance) Converts a distance in AWT (toolkit) view space to a distance in world space.voidviewAWTPoint2worldSFCT(Point aViewPoint, ILcd2DEditablePoint aWorldPointSFCT) Converts aPointin AWT (toolkit) view coordinates to aILcd2DEditablePointin world coordinates.voidviewXYBounds2worldSFCT(ILcdBounds aViewBounds, ILcd2DEditableBounds aWorldBoundsSFCT) Converts aILcdBoundsin AWT (toolkit) view coordinates to aILcd2DEditableBoundsin world coordinates.doubleviewXYDistance2world(double aViewDistance) Converts a distance in AWT (toolkit) view space to a distance in world space.voidviewXYPoint2worldSFCT(int aViewX, int aViewY, ILcd2DEditablePoint aWorldPointSFCT) Converts a (x,y) location in AWT (toolkit) view coordinates to aILcd2DEditablePointin world coordinates.voidviewXYPoint2worldSFCT(ILcdPoint aViewPoint, ILcd2DEditablePoint aWorldPointSFCT) Converts anILcdPointin AWT (toolkit) view coordinates to aILcd2DEditablePointin world coordinates.voidworldBounds2viewAWTSFCT(ILcdBounds aWorldBounds, Rectangle aRectangleSFCT) Converts aILcdBoundsin world coordinates to aRectanglein AWT (toolkit) view coordinates.voidworldBounds2viewXYSFCT(ILcdBounds aWorldBounds, ILcd2DEditableBounds aViewBoundsSFCT) Converts aILcdBoundsin world coordinates to aILcd2DEditableBoundsin AWT (toolkit) view coordinates.doubleworldDistance2view(double aWorldDistance) Converts a distance in world space to a distance in AWT (toolkit) view space.voidworldPoint2viewAWTPointSFCT(ILcdPoint aWorldPoint, Point aViewPointSFCT) Converts anILcdPointin world coordinates to an AWTPointin AWT (toolkit) view coordinates.voidworldPoint2viewXYPointSFCT(ILcdPoint aWorldPoint, ILcd2DEditablePoint aViewPointSFCT) Converts anILcdPointin world coordinates to aILcd2DEditablePointin AWT (toolkit) view coordinates.
-
Constructor Details
-
TLcdGXYViewXYWorldTransformation
public TLcdGXYViewXYWorldTransformation()Constructs a unitary transformation. -
TLcdGXYViewXYWorldTransformation
Constructs a transformation with the given view origin and scale. The world origin is taken to be (0,0).- Parameters:
aViewOrigin- the view origin.aScale- the scale to apply from world to view coordinates.
-
TLcdGXYViewXYWorldTransformation
Constructs a transformation with the given view origin, world origin, and scale.- Parameters:
aViewOrigin- the view origin.aWorldOrigin- the world origin.aScale- scaling factor from world to view coordinates.
-
TLcdGXYViewXYWorldTransformation
Initializes the view origin, world origin and scale of the givenILcdGXYView.- Parameters:
aGXYView- the ILcdGXYView for which to construct the transformation.
-
TLcdGXYViewXYWorldTransformation
public TLcdGXYViewXYWorldTransformation(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScale, double aRotation) Constructs a transformation with the given view origin, world origin, scale, and rotation.- Parameters:
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).
-
TLcdGXYViewXYWorldTransformation
public TLcdGXYViewXYWorldTransformation(Point aViewOrigin, ILcdPoint aWorldOrigin, double aScaleX, double aScaleY, double aRotation) Constructs a transformation with the given view origin, world origin, scale, and rotation.- Parameters:
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).
-
-
Method Details
-
setupFor
Setup with the view origin, world origin and scale of the givenILcdGXYView.- Parameters:
aGXYView- theILcdGXYViewfor which to initialize thisTLcdGXYViewXYWorldTransformation.
-
getViewOrigin
Returns the viewOrigin value of thisTLcdGXYViewXYWorldTransformation.- Returns:
- the viewOrigin value of this
TLcdGXYViewXYWorldTransformation. - See Also:
-
setViewOrigin
public void setViewOrigin(int aX, int aY) Sets the view origin.- Parameters:
aX- view x coordinate.aY- view y coordinate.- See Also:
-
setViewOrigin
Sets the view origin.- Parameters:
aViewOrigin- point to become new view origin.- See Also:
-
getWorldOrigin
Returns the worldOrigin value of thisTLcdGXYViewXYWorldTransformation.- Returns:
- the worldOrigin value of this
TLcdGXYViewXYWorldTransformation. - See Also:
-
setWorldOrigin
public void setWorldOrigin(double aX, double aY) Sets the world origin.- Parameters:
aX- world x coordinate.aY- world y coordinate.- See Also:
-
setWorldOrigin
Sets the world origin.- Parameters:
aWorldOrigin-ILcdPointthe new world origin. Only the 2 first coordinates are considered.- See Also:
-
getScale
public double getScale()Returns the scaling factor from world to view coordinates. If the scale along the x-axis differs from the scale along the y-axis, a mean value is returned. The scale corresponds to the number of pixels per world unit, as determined by theILcdXYWorldReference. For example, a view displaying geographical data could use a scale in pixels per meter.- Returns:
- the scaling factor from world to view coordinates.
- See Also:
-
getScaleX
public double getScaleX()Returns the scaling factor from world to view coordinates along the x-axis. The scale corresponds to the number of pixels per world unit, as determined by theILcdXYWorldReference. For example, a view displaying geographical data could use a scale in pixels per meter.- Returns:
- the scaling factor from world to view coordinates along the x-axis.
-
getScaleY
public double getScaleY()Returns the scaling factor from world to view coordinates along the y-axis. The scale corresponds to the number of pixels per world unit, as determined by theILcdXYWorldReference. For example, a view displaying geographical data could use a scale in pixels per meter.- Returns:
- the scaling factor from world to view coordinates along the y-axis.
-
setScale
public void setScale(double aScale) Sets the scaling factor from world to view coordinates. The scale corresponds to the number of pixels per world unit, as determined by theILcdXYWorldReference. For example, a view displaying geographical data could use a scale in pixels per meter.- Parameters:
aScale- the scaling factor from world to view coordinates.- See Also:
-
getRotation
public double getRotation()Gets the rotation of thisILcdGXYViewXYWorldTransformationin degrees. The rotation is positive counter-clockwise. The rotation is applied in the world reference system around the worldOrigin.- Returns:
- the rotation of this
ILcdGXYViewXYWorldTransformationin degrees. - See Also:
-
setRotation
public void setRotation(double aRotation) Sets the rotation of thisILcdGXYViewXYWorldTransformationin degrees. The rotation is positive counter-clockwise. The rotation is applied in the world reference system around the worldOrigin.- Parameters:
aRotation- the rotation of thisILcdGXYViewXYWorldTransformationin degrees.- See Also:
-
worldDistance2view
public double worldDistance2view(double aWorldDistance) Description copied from interface:ILcdGXYViewXYWorldTransformationConverts a distance in world space to a distance in AWT (toolkit) view space.- Specified by:
worldDistance2viewin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aWorldDistance- the distance to be converted.- Returns:
- the converted distance in view coordinates.
-
worldPoint2viewAWTPointSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformationConverts anILcdPointin world coordinates to an AWTPointin AWT (toolkit) view coordinates.- Specified by:
worldPoint2viewAWTPointSFCTin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aWorldPoint- the worldILcdPointto transform.aViewPointSFCT- the AWTPointto be set.
-
worldPoint2viewXYPointSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformationConverts anILcdPointin world coordinates to aILcd2DEditablePointin AWT (toolkit) view coordinates.- Specified by:
worldPoint2viewXYPointSFCTin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aWorldPoint- the worldILcdPointto transform.aViewPointSFCT- the AWTILcd2DEditablePointto be set.
-
viewAWTPoint2worldSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformationConverts aPointin AWT (toolkit) view coordinates to aILcd2DEditablePointin world coordinates.- Specified by:
viewAWTPoint2worldSFCTin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aViewPoint- the AWT view coordinate to transform.aWorldPointSFCT- the world point to be set.
-
viewXYPoint2worldSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformationConverts anILcdPointin AWT (toolkit) view coordinates to aILcd2DEditablePointin world coordinates.- Specified by:
viewXYPoint2worldSFCTin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aViewPoint- the AWT view coordinate to transform.aWorldPointSFCT- the world point to be set.
-
viewXYPoint2worldSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformationConverts a (x,y) location in AWT (toolkit) view coordinates to aILcd2DEditablePointin world coordinates.- Specified by:
viewXYPoint2worldSFCTin interfaceILcdGXYViewXYWorldTransformation- Parameters:
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.
-
viewAWTDistance2world
public double viewAWTDistance2world(int aViewDistance) Description copied from interface:ILcdGXYViewXYWorldTransformationConverts a distance in AWT (toolkit) view space to a distance in world space.- Specified by:
viewAWTDistance2worldin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aViewDistance- the distance to be converted.- Returns:
- the converted distance in world coordinates.
-
viewXYDistance2world
public double viewXYDistance2world(double aViewDistance) Description copied from interface:ILcdGXYViewXYWorldTransformationConverts a distance in AWT (toolkit) view space to a distance in world space.- Specified by:
viewXYDistance2worldin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aViewDistance- the distance to be converted.- Returns:
- the converted distance in world coordinates.
-
viewAWTBounds2worldSFCT
public void viewAWTBounds2worldSFCT(Rectangle aViewRectangle, ILcd2DEditableBounds aWorldBoundsSFCT) Description copied from interface:ILcdGXYViewXYWorldTransformationConverts aRectanglein AWT (toolkit) view coordinates to aILcd2DEditableBoundsin world coordinates.- Specified by:
viewAWTBounds2worldSFCTin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aViewRectangle- the bounds in AWT view coordinates to transform.aWorldBoundsSFCT- the transformed world bounds to be set by the transformation.
-
viewXYBounds2worldSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformationConverts aILcdBoundsin AWT (toolkit) view coordinates to aILcd2DEditableBoundsin world coordinates.- Specified by:
viewXYBounds2worldSFCTin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aViewBounds- the bounds in AWT view coordinates to transform.aWorldBoundsSFCT- the transformed world bounds to be set by the transformation.
-
worldBounds2viewAWTSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformationConverts aILcdBoundsin world coordinates to aRectanglein AWT (toolkit) view coordinates.- Specified by:
worldBounds2viewAWTSFCTin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aWorldBounds- the bounds in world coordinates to transform.aRectangleSFCT- the transformed AWT view bounds to be set by the transformation.
-
worldBounds2viewXYSFCT
Description copied from interface:ILcdGXYViewXYWorldTransformationConverts aILcdBoundsin world coordinates to aILcd2DEditableBoundsin AWT (toolkit) view coordinates.- Specified by:
worldBounds2viewXYSFCTin interfaceILcdGXYViewXYWorldTransformation- Parameters:
aWorldBounds- the bounds in world coordinates to transform.aViewBoundsSFCT- the transformed AWT view bounds to be set by the transformation.
-
equals
-
clone
Description copied from interface:ILcdGXYViewXYWorldTransformationReturns a clone of thisILcdGXYViewXYWorldTransformation.- Specified by:
clonein interfaceILcdGXYViewXYWorldTransformation- Overrides:
clonein classObject- Returns:
- a clone of this
ILcdGXYViewXYWorldTransformation. - Throws:
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.
-