ice.pilots.html4
Class LineBox

java.lang.Object
  extended byice.pilots.html4.LineBox

public class LineBox
extends Object

This object is used to calculate the LineMetrics information for all the elements of a line that fall on one physically laid out line. Multiple of these objects may be required if the content is to be laid out on more than one physical line.

The entire purpose of the line height calculations is to:

  • Determine the appropriate height of the LineBox (and thus the advance for each rendered line) based upon the css algorithm.
  • Determine the y deflection of the content box of each InlineElement making up a line from the top of the LineBox.
    This algorithm keeps track of 4 numbers for each CSSBox treated by it:
  • The top of the content box
  • The top of the InlineBox
  • The bottom of the inlineBox
  • The bottom of the contentBox
    In the first treatment, the method accepts the box, and calculates the above values attempting to preserve the information passed, since it often is not possible to determine the final values at first. The baseline of the parent element is understood to be at zero, the top of the linebox and content box will likely be negative values and the bottom values will likely be positive values.
    Once all inline values have been treated, the line can be completed, which will basically adjust all values by a (likely positive) amount to normalize the values in relation to the top of the LineBox. This is necessary because the adjustments depend on the linebox size which can only be determined from the relative positions of all inline boxes
    When going to paint the content box of a given element, the box must be deflected by an amount that is given by the y deflection of the element. This deflection represents the offset (either + or - ) of the top of the inline chunks content box in relation to the top of the line's inline box.

    Since:
    6.0

    Field Summary
     int _inheritedContentHeight
              Inherited font-size parameter from immediate parent of inline children.
     
    Method Summary
     void doneLine()
              The line analysis is complete for the given line.
     long getLineParameters()
              Retrieve the line parameters from this line object in the new wrapped value.
     int getNormalizedBaseline()
              Retrieve the position of the original InlineBoxes baseline.
     int getYDeflectionOfChunk(int aBoxId)
              Get the vertical y deflection of a portion of the line in pixels.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    _inheritedContentHeight

    public int _inheritedContentHeight
    Inherited font-size parameter from immediate parent of inline children.

    Method Detail

    doneLine

    public void doneLine()
    The line analysis is complete for the given line. Now, this object needs to go back and rationalize the floating objects, and finalize the numbers.


    getLineParameters

    public long getLineParameters()
    Retrieve the line parameters from this line object in the new wrapped value. Ah. Yes, this is broken. There is not going to be an ascent/descent in a moment. There is only the line box, and there is only the

    Returns:
    The wrapped line height of this box.

    getYDeflectionOfChunk

    public int getYDeflectionOfChunk(int aBoxId)
    Get the vertical y deflection of a portion of the line in pixels. This deflection is the deflection in pixels of the content box from the top of the line box. A positive number is a downward deflection below the top of the linebox, a negative value is an upward deflection back above the linebox.

    Returns:
    The deflection of the content box

    getNormalizedBaseline

    public int getNormalizedBaseline()
    Retrieve the position of the original InlineBoxes baseline.

    Returns:
    the y pixel deflection from the top of the LineBox, where the baseline of the original InlineBox was/is.