Class BackgroundPosition

java.lang.Object
com.itextpdf.layout.properties.BackgroundPosition

public class BackgroundPosition extends Object
Class to hold background-position property.
  • Constructor Details

    • BackgroundPosition

      public BackgroundPosition()
      Creates a new BackgroundPosition instance. Fills it with default values.
  • Method Details

    • calculatePositionValues

      public void calculatePositionValues (float fullWidth, float fullHeight, UnitValue outXValue, UnitValue outYValue)
      Converts all percentage and enum values to point equivalent.
      Parameters:
      fullWidth - container width to calculate percentage.
      fullHeight - container height to calculate percentage.
      outXValue - UnitValue to store processed xPosition.
      outYValue - UnitValue to store processed yPosition.
    • getPositionX

      public BackgroundPosition.PositionX getPositionX()
      Gets horizontal position.
      Returns:
      position in x-dimension
    • setPositionX

      public BackgroundPosition setPositionX (BackgroundPosition.PositionX xPosition)
      Sets horizontal position.
      Parameters:
      xPosition - position in x-dimension
      Returns:
      BackgroundPosition
    • getPositionY

      public BackgroundPosition.PositionY getPositionY()
      Gets vertical position.
      Returns:
      position in y-dimension
    • setPositionY

      public BackgroundPosition setPositionY (BackgroundPosition.PositionY yPosition)
      Sets vertical position.
      Parameters:
      yPosition - position in y-dimension
      Returns:
      BackgroundPosition
    • getXShift

      public UnitValue getXShift()
      Gets horizontal shift.
      Returns:
      shift in x-dimension from left
    • setXShift

      public BackgroundPosition setXShift (UnitValue xShift)
      Sets horizontal shift.
      Parameters:
      xShift - shift in x-dimension from left
      Returns:
      BackgroundPosition
    • getYShift

      public UnitValue getYShift()
      Gets vertical shift.
      Returns:
      shift in y-dimension from top
    • setYShift

      public BackgroundPosition setYShift (UnitValue yShift)
      Sets vertical shift.
      Parameters:
      yShift - shift in y-dimension
      Returns:
      BackgroundPosition
    • equals

      public boolean equals (Object o)
      Overrides:
      equals in class Object
      Returns:
      true if every field equals. False otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      object's hashCode.