Eclipse Draw2d 3.7

## org.eclipse.draw2d.text
Class FlowBox

    java.lang.Object
      org.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

Constructor Summary
`FlowBox()`

Method Summary
`abstract boolean` `containsPoint(int x, int y)` This method must be called on a block that is completely positioned and committed.
`abstract int` `getAscent()` Returns the amount of line content in pixels which is above the baseline.
`abstract int` `getBaseline()` Returns y coordinate for the box's baseline.
`abstract int` `getDescent()` Returns the amount of line content in pixels which is below the baseline.
`int` `getWidth()` Returns the width of the box.
`int` `getX()` Returns the X coordinate of the box.
`boolean` `requiresBidi()` Returns `true` if any of the children are bi-directional.
`void` `setWidth(int width)` Sets the width of the box.
`void` `setX(int x)` Sets the x coordinate for this box.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FlowBox

    public FlowBox()

Method Detail

### containsPoint

    public abstract 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 abstract int getAscent()

  Returns the amount of line content in pixels which is above the baseline. Ascent and descent are used to space consecutive lines apart. Certain types of line content, such as borders, extend beyond the ascent and descent.

  Returns:
    the descent in pixels below the baseline

### getBaseline

    public abstract int getBaseline()

  Returns y coordinate for the box's baseline.

  Returns:
    the baseline location
  Since:
    3.1

### getDescent

    public abstract int getDescent()

  Returns the amount of line content in pixels which is below the baseline.

  Returns:
    the descent in pixels
  See Also:
    `getAscent()`

### getWidth

    public int getWidth()

  Returns the width of the box.

  Returns:
    the box's width

### getX

    public int getX()

  Returns the X coordinate of the box.

  Returns:
    the x coordinate
  Since:
    3.1

### requiresBidi

    public boolean requiresBidi()

  Returns `true` if any of the children are bi-directional. Default implementation 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

### setX

    public void setX(int x)

  Sets the x coordinate for this box.

  Parameters:
    `x` - the x coordinate
  Since:
    3.1

Eclipse Draw2d 3.7

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