Eclipse Draw2d
2.1

org.eclipse.draw2d.text
Class LineBox

java.lang.Object
  |
  +--org.eclipse.draw2d.text.FlowBox
        |
        +--org.eclipse.draw2d.text.CompositeBox
              |
              +--org.eclipse.draw2d.text.LineBox

public class LineBox
extends CompositeBox

A composite box representing a single line. LineBox calculates its ascent and descent from the child boxes it contains. Clients can call getAscent() or FlowBox.getHeight() at any time and expect valid values. The child boxes that are added to a line have unspecied locations until commit() is called, at which time the child boxes are layed out in left-to-right order, and their baselines are all aligned vertically.

Since:
2.1

Field Summary
 
Fields inherited from class org.eclipse.draw2d.text.CompositeBox
fragments
 
Fields inherited from class org.eclipse.draw2d.text.FlowBox
x, y
 
Constructor Summary
LineBox()
           
 
Method Summary
 void commit()
          Committing a LineBox will position its children correctly.
 int getAscent()
          By default, a FlowBox is all ascent, and no descent, so the height is returned.
 int getAvailableWidth()
          Returns the width available to child fragments.
 int getBaseline()
          Returns the baseline of this LineBox, which is the y value plus the ascent.
 void makeBaseline(int value)
          Used to set the baseline of this FlowBox to the specified value.
protected  void resetInfo()
          resets fields before unioning the data from the fragments.
protected  void unionInfo(FlowBox blockInfo)
          unions the fragment's width, height, and ascent into this composite.
 
Methods inherited from class org.eclipse.draw2d.text.CompositeBox
add, clear, getFragments, getRecommendedWidth, isOccupied, setRecommendedWidth
 
Methods inherited from class org.eclipse.draw2d.text.FlowBox
containsPoint, getDescent, getHeight, getWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineBox

public LineBox()
Method Detail

commit

public void commit()
Committing a LineBox will position its children correctly. All children boxes are made to have the same baseline, and are layed out from left-to-right.


getAscent

public int getAscent()
Description copied from class: FlowBox
By default, a FlowBox is all ascent, and no descent, so the height is returned.

Overrides:
getAscent in class FlowBox
Returns:
the ascent in pixels above the baseline
See Also:
FlowBox.getAscent()

getAvailableWidth

public int getAvailableWidth()
Returns the width available to child fragments.

Returns:
the width in pixels

getBaseline

public int getBaseline()
Returns the baseline of this LineBox, which is the y value plus the ascent.

Returns:
the baseline value.

makeBaseline

public void makeBaseline(int value)
Description copied from class: FlowBox
Used to set the baseline of this FlowBox to the specified value.

Overrides:
makeBaseline in class FlowBox
Parameters:
value - the new baseline
See Also:
FlowBox.makeBaseline(int)

resetInfo

protected void resetInfo()
Description copied from class: CompositeBox
resets fields before unioning the data from the fragments.

Overrides:
resetInfo in class CompositeBox
See Also:
CompositeBox.resetInfo()

unionInfo

protected void unionInfo(FlowBox blockInfo)
Description copied from class: CompositeBox
unions the fragment's width, height, and ascent into this composite.

Overrides:
unionInfo in class CompositeBox
Parameters:
blockInfo - the fragment
See Also:
CompositeBox.unionInfo(FlowBox)

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.