Package org.eclipse.draw2d.text
Class FlowBox
java.lang.Object
org.eclipse.draw2d.text.FlowBox
- Direct Known Subclasses:
CompositeBox
,ContentBox
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 -
Method Summary
Modifier and TypeMethodDescriptionabstract 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
getWidth()
Returns the width of the box.int
getX()
Returns the X coordinate of the box.boolean
Returnstrue
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.
-
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
- Xy
- 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()Returnstrue
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
-