Class AlignmentContext

  • All Implemented Interfaces:
    Constants

    public class AlignmentContext
    extends java.lang.Object
    implements Constants
    The alignment context is carried within a LayoutContext and as part of the Knuth Inline elements to facilitate proper line building. All measurements are in mpt.
    • Method Detail

      • getAlignmentPoint

        public int getAlignmentPoint()
        Returns the alignment point for this context. This is the point on the start edge of the area this context applies to measured from the before edge of the area.
        Returns:
        the default alignment point
      • getBaselineShiftValue

        public int getBaselineShiftValue()
        Returns the current value of baseline shift in effect.
        Returns:
        the baseline shift
      • getAlignmentBaselineIdentifier

        public int getAlignmentBaselineIdentifier()
        Returns the current alignment baseline identifier.
        Returns:
        the alignment baseline identifier
      • getDominantBaselineIdentifier

        public int getDominantBaselineIdentifier()
        Return the dominant baseline identifier.
        Returns:
        the dominant baseline identifier
      • getParentAlignmentContext

        public AlignmentContext getParentAlignmentContext()
        Return the parent alignment context.
        Returns:
        the parent alignment context
      • getTotalAlignmentBaselineOffset

        public int getTotalAlignmentBaselineOffset()
        Return the offset between the alignment baseline and the outermost parent dominant baseline.
        Returns:
        the offset in shift direction
      • getHeight

        public int getHeight()
        Return the total height of the context.
        Returns:
        the height
      • getAltitude

        public int getAltitude()
        The altitude of the context that is the height above the alignment point.
        Returns:
        the altitude
      • getDepth

        public int getDepth()
        The depth of the context that is the height below alignment point.
        Returns:
        the altitude
      • resizeLine

        public void resizeLine​(int newLineHeight,
                               int newAlignmentPoint)
        Resizes the line as specified. Assumes that the new alignment point is on the dominant baseline, that is this function should be called for line areas only.
        Parameters:
        newLineHeight - the new height of the line
        newAlignmentPoint - the new alignment point
      • getOffset

        public int getOffset()
        Returns the offset from the before-edge of the parent to this context.
        Returns:
        the offset for rendering
      • usesInitialBaselineTable

        public boolean usesInitialBaselineTable()
        Returns an indication if we still use the initial baseline table. The initial baseline table is the table generated by the Line LM.
        Returns:
        true if this is still the initial baseline table
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object