Package cz.vutbr.fit.layout.cssbox.impl
Class BoxTransform
- java.lang.Object
-
- cz.vutbr.fit.layout.cssbox.impl.BoxTransform
-
public class BoxTransform extends Object
A transformation applied to a box according to the "transform" CSS property.- Author:
- burgetr
-
-
Constructor Summary
Constructors Constructor Description BoxTransform(BoxTransform src)BoxTransform(org.fit.cssbox.layout.Box box)Creates a transformation for the given box based on its CSS properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BoxTransformconcatenate(BoxTransform src)Concatenates another transformation to this transformation.protected AffineTransformcreateTransform(org.fit.cssbox.layout.ElementBox elem)org.fit.cssbox.layout.BoxgetBox()Obtains the source box.AffineTransformgetTransform()Obtains the transformation that should be applied.booleanisEmpty()Checks if the transformation is empty (no transformation is applied).RectangulartransformRect(Rectangular rect)Transforms a rectangle to other rectangle using the given transformation.
-
-
-
Constructor Detail
-
BoxTransform
public BoxTransform(org.fit.cssbox.layout.Box box)
Creates a transformation for the given box based on its CSS properties. An empty transformation is created for boxes that are not element boxes (they have no CSS style assigned).- Parameters:
box- the source box
-
BoxTransform
public BoxTransform(BoxTransform src)
-
-
Method Detail
-
getBox
public org.fit.cssbox.layout.Box getBox()
Obtains the source box.- Returns:
- The box that this transformation belongs to.
-
getTransform
public AffineTransform getTransform()
Obtains the transformation that should be applied.- Returns:
- The transformation object or
nullif no transformation should be applied.
-
isEmpty
public boolean isEmpty()
Checks if the transformation is empty (no transformation is applied).- Returns:
truewhen no transformation is applied.
-
concatenate
public BoxTransform concatenate(BoxTransform src)
Concatenates another transformation to this transformation.- Parameters:
src-- Returns:
- A new concatenated transformation.
-
transformRect
public Rectangular transformRect(Rectangular rect)
Transforms a rectangle to other rectangle using the given transformation.- Parameters:
rect- the source rectangle- Returns:
- the bounding box of the transformed rectangle.
-
createTransform
protected AffineTransform createTransform(org.fit.cssbox.layout.ElementBox elem)
-
-