net.sf.vex.layout
Class LineBox

java.lang.Object
  |
  +--net.sf.vex.layout.AbstractBox
        |
        +--net.sf.vex.layout.CompositeInlineBox
              |
              +--net.sf.vex.layout.LineBox
All Implemented Interfaces:
Box, InlineBox

public class LineBox
extends CompositeInlineBox

Represents a line of text and inline images.


Nested Class Summary
 
Nested classes inherited from class net.sf.vex.layout.InlineBox
InlineBox.Pair
 
Constructor Summary
LineBox(LayoutContext context, Element element, InlineBox[] children)
          Class constructor.
 
Method Summary
 boolean canBreakAtEnd()
          Returns true if a line break can occur after this box.
 int getBaseline()
          Returns the distance from the top of the inline box to the baseline.
 Box[] getChildren()
          Returns an array of this box's children.
 Element getElement()
          Returns the Element with which this box is associated, or null if there is no such box.
 int getEndOffset()
          Returns the offset of the end of the content that the box covers.
 int getStartOffset()
          Returns the offset of the start of the content that the box covers.
 boolean hasContent()
          Returns true if this box represents a portion of the XML document's content.
 InlineBox.Pair split(LayoutContext context, InlineBox[] lefts, InlineBox[] rights)
          Creates a Pair of InlineBoxes, each with its own set of children.
 java.lang.String toString()
           
 
Methods inherited from class net.sf.vex.layout.CompositeInlineBox
getCaretShapes, split, viewToModel
 
Methods inherited from class net.sf.vex.layout.AbstractBox
containsOffset, getHeight, getWidth, getX, getY, paint, setHeight, setWidth, setX, setY, skipPaint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.vex.layout.Box
containsOffset, getHeight, getWidth, getX, getY, paint, setX, setY
 

Constructor Detail

LineBox

public LineBox(LayoutContext context,
               Element element,
               InlineBox[] children)
Class constructor.

Parameters:
context - LayoutContext for this layout.
children - InlineBoxes that make up this line.
Method Detail

canBreakAtEnd

public boolean canBreakAtEnd()
Description copied from interface: InlineBox
Returns true if a line break can occur after this box. For example, this would be true for text boxes that end with a space.

See Also:
InlineBox.canBreakAtEnd()

getBaseline

public int getBaseline()
Description copied from interface: InlineBox
Returns the distance from the top of the inline box to the baseline.

See Also:
InlineBox.getBaseline()

getChildren

public Box[] getChildren()
Description copied from interface: Box
Returns an array of this box's children.

Specified by:
getChildren in interface Box
Overrides:
getChildren in class AbstractBox
See Also:
Box.getChildren()

getElement

public Element getElement()
Description copied from interface: Box
Returns the Element with which this box is associated, or null if there is no such box. The box may directly represent the Element, or simply use it for formatting information.

Specified by:
getElement in interface Box
Overrides:
getElement in class AbstractBox
See Also:
Box.getElement()

getEndOffset

public int getEndOffset()
Description copied from interface: Box
Returns the offset of the end of the content that the box covers.

Specified by:
getEndOffset in interface Box
Overrides:
getEndOffset in class AbstractBox
See Also:
Box.getEndOffset()

getStartOffset

public int getStartOffset()
Description copied from interface: Box
Returns the offset of the start of the content that the box covers.

Specified by:
getStartOffset in interface Box
Overrides:
getStartOffset in class AbstractBox
See Also:
Box.getStartOffset()

hasContent

public boolean hasContent()
Description copied from interface: Box
Returns true if this box represents a portion of the XML document's content. If false is returned, the following methods are not supported by this box.

Specified by:
hasContent in interface Box
Overrides:
hasContent in class AbstractBox
See Also:
Box.hasContent()

split

public InlineBox.Pair split(LayoutContext context,
                            InlineBox[] lefts,
                            InlineBox[] rights)
Description copied from class: CompositeInlineBox
Creates a Pair of InlineBoxes, each with its own set of children.

Specified by:
split in class CompositeInlineBox
Parameters:
context - LayoutContext used for this layout.
lefts - Child boxes to be given to the left box.
rights - Child boxes to be given to the right box.
Returns:
See Also:
CompositeInlineBox.split(net.sf.vex.layout.LayoutContext, net.sf.vex.layout.InlineBox[], net.sf.vex.layout.InlineBox[])

toString

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