Class RotationUtils

java.lang.Object
com.itextpdf.layout.renderer.RotationUtils

final class RotationUtils extends Object
  • Constructor Details

    • RotationUtils

      private RotationUtils()
  • Method Details

    • countRotationMinMaxWidth

      public static MinMaxWidth countRotationMinMaxWidth(MinMaxWidth minMaxWidth, AbstractRenderer renderer)
      This method tries to calculate min-max-width of rotated element using heuristics of RotationMinMaxWidth.calculate(double, double, MinMaxWidth). This method may call IRenderer.layout(LayoutContext) once in best case (if the width is set on element, or if we are really lucky) and three times in worst case.
      Parameters:
      minMaxWidth - the minMaxWidth of NOT rotated renderer
      renderer - the actual renderer
      Returns:
      minMaxWidth of rotated renderer or original value in case rotated value can not be calculated, or renderer isn't rotated.
    • retrieveRotatedLayoutWidth

      public static Float retrieveRotatedLayoutWidth(float availableWidth, AbstractRenderer renderer)
      This method tries to calculate width of not rotated renderer, so after rotation it fits availableWidth. This method uses heuristics of RotationMinMaxWidth.calculate(double, double, MinMaxWidth, double). It doesn't take into account any of height properties of renderer or height of layoutArea. The minMaxWidth calculations and initial layout may take long time, but they won't be called if the renderer have width property.
      Parameters:
      availableWidth - the width of layoutArea
      renderer - the actual renderer
      Returns:
      the width that should be set as width of layout area to properly layout element, or fallback to AbstractRenderer.retrieveWidth(float) in case it can not be calculated, or renderer isn't rotated.
    • getLayoutRotatedWidth

      private static Float getLayoutRotatedWidth(AbstractRenderer renderer, float availableWidth, Rectangle previousBBox, double angle)