Class Leading


  • public class Leading
    extends java.lang.Object
    A specialized class that specifies the leading, "the vertical distance between the baselines of adjacent lines of text" (ISO-32000-1, section 9.3.5). Allows to use either an absolute (constant) leading value, or one determined by font size. Pronounce as 'ledding' (cfr. Led Zeppelin). This class is meant to be used as the value for the Property.LEADING key in an IPropertyContainer.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int FIXED
      A leading type independent of font size.
      static int MULTIPLIED
      A leading type related to the font size and the resulting bounding box.
      protected int type  
      protected float value  
    • Constructor Summary

      Constructors 
      Constructor Description
      Leading​(int type, float value)
      Creates a Leading object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int getType()
      Gets the calculation type of the Leading object.
      float getValue()
      Gets the value to be used as the basis for the leading calculation.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FIXED

        public static final int FIXED
        A leading type independent of font size.
        See Also:
        Constant Field Values
      • MULTIPLIED

        public static final int MULTIPLIED
        A leading type related to the font size and the resulting bounding box.
        See Also:
        Constant Field Values
      • type

        protected int type
      • value

        protected float value
    • Constructor Detail

      • Leading

        public Leading​(int type,
                       float value)
        Creates a Leading object.
        Parameters:
        type - a constant type that defines the calculation of actual leading distance. Either FIXED or MULTIPLIED
        value - to be used as a basis for the leading calculation.
    • Method Detail

      • getType

        public int getType()
        Gets the calculation type of the Leading object.
        Returns:
        the calculation type. Either FIXED or MULTIPLIED
      • getValue

        public float getValue()
        Gets the value to be used as the basis for the leading calculation.
        Returns:
        a calculation value
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object