de.intarsys.tools.geometry.ApplyTransformationShape Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of isrt Show documentation
Show all versions of isrt Show documentation
The basic runtime tools and interfaces for intarsys components.
package de.intarsys.tools.geometry;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
/**
* The transformation is defined explicitly.
*
*/
public class ApplyTransformationShape extends TransformedShape {
/**
* Create a new {@link Shape} created from shape
by applying
* transform
*
* @param shape
* The wrapped base shape
* @param transform
* The coordinate space where "shape" is defined.
*
* @return The new {@link TransformedShape}
*/
public static TransformedShape create(Shape shape, AffineTransform transform) {
return new ApplyTransformationShape(shape, transform);
}
final private AffineTransform transform;
protected ApplyTransformationShape(ApplyTransformationShape shape) {
super(shape);
this.transform = shape.transform;
}
protected ApplyTransformationShape(Shape shape, AffineTransform transform) {
super(shape);
this.transform = transform;
}
@Override
protected Shape apply() {
return getTransform().createTransformedShape(getBaseShape());
}
/**
* Returns an exact copy of this Area
object.
*
* @return Created clone object
*/
@Override
public Object clone() {
return new ApplyTransformationShape(this);
}
@Override
public AffineTransform getTransform() {
return transform;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy