Package org.eclipse.draw2d.text
Class BlockBox
java.lang.Object
org.eclipse.draw2d.text.FlowBox
org.eclipse.draw2d.text.CompositeBox
org.eclipse.draw2d.text.BlockBox
A CompositeBox suitable for containing multiple LineBox fragments.
- Since:
- 2.1
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given box and updates properties of this composite box.boolean
containsPoint
(int x, int y) This method must be called on a block that is completely positioned and committed.int
Returns the amount of line content in pixels which is above the baseline.int
Returns y coordinate for the box's baseline.int
Returns the amount of line content in pixels which is below the baseline.int
void
setHeight
(int h) Sets the height.void
setLineTop
(int y) Positions the box vertically by setting the y coordinate for the top of the content of the line.Methods inherited from class org.eclipse.draw2d.text.CompositeBox
getRecommendedWidth, setRecommendedWidth
-
Method Details
-
add
Description copied from class:CompositeBox
Adds the given box and updates properties of this composite box.- Specified by:
add
in classCompositeBox
- Parameters:
box
- the child being added- See Also:
-
containsPoint
public boolean containsPoint(int x, int y) Description copied from class:FlowBox
This method must be called on a block that is completely positioned and committed.- Specified by:
containsPoint
in classFlowBox
- Parameters:
x
- Xy
- Y- Returns:
true
if the FlowBox contains the point- See Also:
-
getAscent
public int getAscent()Description copied from class:FlowBox
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. -
getBaseline
public int getBaseline()Description copied from class:FlowBox
Returns y coordinate for the box's baseline.- Specified by:
getBaseline
in classFlowBox
- Returns:
- the baseline location
- See Also:
-
getDescent
public int getDescent()Description copied from class:FlowBox
Returns the amount of line content in pixels which is below the baseline.- Specified by:
getDescent
in classFlowBox
- Returns:
- the descent in pixels
- See Also:
-
getHeight
public int getHeight()- Returns:
- Returns the height.
-
setHeight
public void setHeight(int h) Sets the height.- Parameters:
h
- The height
-
setLineTop
public void setLineTop(int y) Description copied from class:CompositeBox
Positions the box vertically by setting the y coordinate for the top of the content of the line. For internal use only.- Specified by:
setLineTop
in classCompositeBox
- Parameters:
y
- the y coordinate- See Also:
-