Eclipse Draw2d
2.1

org.eclipse.draw2d.text
Class CompositeBox

java.lang.Object
  |
  +--org.eclipse.draw2d.text.FlowBox
        |
        +--org.eclipse.draw2d.text.CompositeBox
Direct Known Subclasses:
BlockBox, LineBox

public abstract class CompositeBox
extends FlowBox

A FlowBox that can contain other BlockInfos. The contained BlockInfos are called fragments.

Since:
2.1

Field Summary
protected  List fragments
          The contained fragments.
 
Fields inherited from class org.eclipse.draw2d.text.FlowBox
x, y
 
Constructor Summary
CompositeBox()
           
 
Method Summary
 void add(FlowBox block)
          Adds the specified FlowBox.
 void clear()
          Removes all owned fragments and invalidates this CompositeBox.
 List getFragments()
           
 int getRecommendedWidth()
          Returns the recommended width for this CompositeBox.
 boolean isOccupied()
           
protected  void resetInfo()
          resets fields before unioning the data from the fragments.
 void setRecommendedWidth(int w)
          Sets the recommended width for this CompositeBox.
protected  void unionInfo(FlowBox box)
          unions the fragment's width, height, and ascent into this composite.
 
Methods inherited from class org.eclipse.draw2d.text.FlowBox
containsPoint, getAscent, getDescent, getHeight, getWidth, makeBaseline
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fragments

protected List fragments
The contained fragments.

Constructor Detail

CompositeBox

public CompositeBox()
Method Detail

add

public void add(FlowBox block)
Adds the specified FlowBox. Updates the width, height, and ascent properties.

Parameters:
block - the FlowBox being added

clear

public void clear()
Removes all owned fragments and invalidates this CompositeBox.


getFragments

public List getFragments()
Returns:
the List of fragments

getRecommendedWidth

public int getRecommendedWidth()
Returns the recommended width for this CompositeBox.

Returns:
the recommended width

isOccupied

public boolean isOccupied()
See Also:
Rectangle.isEmpty()

resetInfo

protected void resetInfo()
resets fields before unioning the data from the fragments.


setRecommendedWidth

public void setRecommendedWidth(int w)
Sets the recommended width for this CompositeBox.

Parameters:
w - the width

unionInfo

protected void unionInfo(FlowBox box)
unions the fragment's width, height, and ascent into this composite.

Parameters:
box - the fragment

Eclipse Draw2d
2.1

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