Eclipse Draw2d
3.0

org.eclipse.draw2d.text
Class FlowBox

java.lang.Object
  extended byorg.eclipse.draw2d.text.FlowBox
Direct Known Subclasses:
CompositeBox, ContentBox

public abstract class FlowBox
extends Object

A Geometric object for representing a region on a line of Text. This class adds the notion of a baseline to Rectangle. Ascent is the distance above the baseline. Descent is the distance below the baseline.

This class should not be treated as a Rectangle by clients. It is important to use getters when available for lazy calculation of values.

Since:
2.1

Field Summary
 int x
          The x location
 int y
          The y location
 
Constructor Summary
FlowBox()
           
 
Method Summary
 boolean containsPoint(int x, int y)
          This method must be called on a block that is completely positioned and committed.
 int getAscent()
          Returns the amount of the box in pixels which is above the baseline.
 int getBaseline()
          Returns the baseline of this Box, which is the y value plus the ascent.
 int getDescent()
          Returns the amount of the box in pixels which is below the baseline.
 int getHeight()
          Returns the height
 int getWidth()
          Returns the width
 void makeBaseline(int value)
          Used to set the baseline of this FlowBox to the specified value.
 boolean requiresBidi()
          Returns true if any of the children are bi-directional.
 void setWidth(int width)
          Sets the width of the box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public int x
The x location


y

public int y
The y location

Constructor Detail

FlowBox

public FlowBox()
Method Detail

containsPoint

public boolean containsPoint(int x,
                             int y)
This method must be called on a block that is completely positioned and committed.

Parameters:
x - X
y - Y
Returns:
true if the FlowBox contains the point

getAscent

public int getAscent()
Returns the amount of the box in pixels which is above the baseline. By default, a FlowBox is all ascent, and no descent, so the height is returned.

Returns:
the ascent in pixels above the baseline

getBaseline

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

Returns:
the baseline value.

getDescent

public final int getDescent()
Returns the amount of the box in pixels which is below the baseline. By default, a simple FlowBox is all ascent, and no descent, so 0 is returned.

Returns:
the descent in pixels below the baseline

getHeight

public int getHeight()
Returns the height

Returns:
height

getWidth

public int getWidth()
Returns the width

Returns:
width

makeBaseline

public void makeBaseline(int value)
Used to set the baseline of this FlowBox to the specified value.

Parameters:
value - the new baseline

requiresBidi

public boolean requiresBidi()
Returns true if any of the children are bi-directional. Default implementation always returns false.

Returns:
true if the box is bi-directional
Since:
3.1

setWidth

public void setWidth(int width)
Sets the width of the box.

Parameters:
width - the new width
Since:
3.1

Eclipse Draw2d
3.0

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