Package de.intarsys.tools.geometry
Class ApplySpaceChangeShape
- java.lang.Object
-
- de.intarsys.tools.geometry.TransformedShape
-
- de.intarsys.tools.geometry.ApplySpaceChangeShape
-
- All Implemented Interfaces:
IShapeWrapper,java.awt.Shape,java.lang.Cloneable
public class ApplySpaceChangeShape extends TransformedShape
The transformation is defined by two matrices, each defining a coordinate system. The source transformation is the space the shape is defined in, the target transformation is the space for the resulting shape.
-
-
Field Summary
-
Fields inherited from class de.intarsys.tools.geometry.TransformedShape
IDENTITY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedApplySpaceChangeShape(ApplySpaceChangeShape shape)protectedApplySpaceChangeShape(java.awt.Shape shape, java.awt.geom.AffineTransform sourceTransform, java.awt.geom.AffineTransform targetTransform)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.Shapeapply()java.lang.Objectclone()Returns an exact copy of thisAreaobject.static TransformedShapecreate(java.awt.Shape shape, java.awt.geom.AffineTransform transform)Create a newShapewhose coordinates are specified in the space defined by "transform".static TransformedShapecreate(java.awt.Shape shape, java.awt.geom.AffineTransform sourceTransform, java.awt.geom.AffineTransform targetTransform)java.awt.geom.AffineTransformgetSourceTransform()java.awt.geom.AffineTransformgetTargetTransform()java.awt.geom.AffineTransformgetTransform()static TransformedShapesetTransform(java.awt.Shape shape, java.awt.geom.AffineTransform targetTransform)Create a newShapethat behaves like the base shape with its coordinates relative to the new space defined by "newTransform".-
Methods inherited from class de.intarsys.tools.geometry.TransformedShape
contains, contains, contains, contains, getBaseShape, getBounds, getBounds2D, getPathIterator, getPathIterator, getShape, intersects, intersects, invalidate
-
-
-
-
Constructor Detail
-
ApplySpaceChangeShape
protected ApplySpaceChangeShape(ApplySpaceChangeShape shape)
-
ApplySpaceChangeShape
protected ApplySpaceChangeShape(java.awt.Shape shape, java.awt.geom.AffineTransform sourceTransform, java.awt.geom.AffineTransform targetTransform)
-
-
Method Detail
-
create
public static TransformedShape create(java.awt.Shape shape, java.awt.geom.AffineTransform transform)
Create a newShapewhose coordinates are specified in the space defined by "transform".- Parameters:
shape- The wrapped base shapetransform- The coordinate space where "shape" is defined.- Returns:
- The new
TransformedShape
-
create
public static TransformedShape create(java.awt.Shape shape, java.awt.geom.AffineTransform sourceTransform, java.awt.geom.AffineTransform targetTransform)
-
setTransform
public static TransformedShape setTransform(java.awt.Shape shape, java.awt.geom.AffineTransform targetTransform)
Create a newShapethat behaves like the base shape with its coordinates relative to the new space defined by "newTransform".You can use this to "view" on an already existing shape from another coordinate system.
- Parameters:
shape- The base shapetargetTransform- The new coordinate space- Returns:
- The transformed shape, showing "shape" from the space defined by "newTransform"
-
apply
protected java.awt.Shape apply()
- Specified by:
applyin classTransformedShape
-
clone
public java.lang.Object clone()
Returns an exact copy of thisAreaobject.- Specified by:
clonein classTransformedShape- Returns:
- Created clone object
-
getSourceTransform
public java.awt.geom.AffineTransform getSourceTransform()
-
getTargetTransform
public java.awt.geom.AffineTransform getTargetTransform()
-
getTransform
public java.awt.geom.AffineTransform getTransform()
- Specified by:
getTransformin classTransformedShape
-
-