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 TypeMethodDescriptionvoidAdds the given box and updates properties of this composite box.booleancontainsPoint(int x, int y) This method must be called on a block that is completely positioned and committed.intReturns the amount of line content in pixels which is above the baseline.intReturns y coordinate for the box's baseline.intReturns the amount of line content in pixels which is below the baseline.intvoidsetHeight(int h) Sets the height.voidsetLineTop(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:CompositeBoxAdds the given box and updates properties of this composite box.- Specified by:
addin classCompositeBox- Parameters:
box- the child being added- See Also:
-
containsPoint
public boolean containsPoint(int x, int y) Description copied from class:FlowBoxThis method must be called on a block that is completely positioned and committed.- Specified by:
containsPointin classFlowBox- Parameters:
x- Xy- Y- Returns:
trueif the FlowBox contains the point- See Also:
-
getAscent
public int getAscent()Description copied from class:FlowBoxReturns 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:FlowBoxReturns y coordinate for the box's baseline.- Specified by:
getBaselinein classFlowBox- Returns:
- the baseline location
- See Also:
-
getDescent
public int getDescent()Description copied from class:FlowBoxReturns the amount of line content in pixels which is below the baseline.- Specified by:
getDescentin 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:CompositeBoxPositions the box vertically by setting the y coordinate for the top of the content of the line. For internal use only.- Specified by:
setLineTopin classCompositeBox- Parameters:
y- the y coordinate- See Also:
-