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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
    containsPoint(int x, int y)
    This method must be called on a block that is completely positioned and committed.
    abstract int
    Returns the amount of line content in pixels which is above the baseline.
    abstract int
    Returns y coordinate for the box's baseline.
    abstract int
    Returns the amount of line content in pixels which is below the baseline.
    int
    Returns the width of the box.
    int
    Returns the X coordinate of the box.
    boolean
    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 Details

    • FlowBox

      public FlowBox()
  • Method Details

    • 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:
    • 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