Class ImageLayout

java.lang.Object
org.apache.fop.layoutmgr.inline.ImageLayout
All Implemented Interfaces:
Constants

public class ImageLayout extends Object implements Constants
Helper class which calculates the size and position in the viewport of an image.
  • Field Details

    • log

      protected static final org.apache.commons.logging.Log log
      logging instance
  • Constructor Details

    • ImageLayout

      public ImageLayout(GraphicsProperties props, PercentBaseContext percentBaseContext, Dimension intrinsicSize)
      Main constructor
      Parameters:
      props - the properties for the image
      percentBaseContext - the context object for percentage calculations
      intrinsicSize - the image's intrinsic size
  • Method Details

    • doLayout

      protected void doLayout()
      Does the actual calculations for the image.
    • computeXOffset

      public int computeXOffset(int ipd, int cwidth)
      Given the ipd and the content width calculates the required x offset based on the text-align property
      Parameters:
      ipd - the inline-progression-dimension of the object
      cwidth - the calculated content width of the object
      Returns:
      the X offset
    • computeYOffset

      public int computeYOffset(int bpd, int cheight)
      Given the bpd and the content height calculates the required y offset based on the display-align property
      Parameters:
      bpd - the block-progression-dimension of the object
      cheight - the calculated content height of the object
      Returns:
      the Y offset
    • getPlacement

      public Rectangle getPlacement()
      Returns the placement of the image inside the viewport.
      Returns:
      the placement of the image inside the viewport (coordinates in millipoints)
    • getViewportSize

      public Dimension getViewportSize()
      Returns the size of the image's viewport.
      Returns:
      the viewport size (in millipoints)
    • getIntrinsicSize

      public Dimension getIntrinsicSize()
      Returns the size of the image's intrinsic (natural) size.
      Returns:
      the intrinsic size (in millipoints)
    • isClipped

      public boolean isClipped()
      Indicates whether the image is clipped.
      Returns:
      true if the image shall be clipped