Class BoxTransform


  • public class BoxTransform
    extends Object
    A transformation applied to a box according to the "transform" CSS property.
    Author:
    burgetr
    • 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
    • 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 null if no transformation should be applied.
      • isEmpty

        public boolean isEmpty()
        Checks if the transformation is empty (no transformation is applied).
        Returns:
        true when 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)