Package org.eclipse.draw2d.text
Class LineRoot
java.lang.Object
org.eclipse.draw2d.text.FlowBox
org.eclipse.draw2d.text.CompositeBox
org.eclipse.draw2d.text.LineBox
org.eclipse.draw2d.text.LineRoot
LineRoot is the top-most container on a line of text displayed in Draw2d.
Hence, a LineRoot can tell you of things like the highest ascent or descent
on a line, which is required to display selection and such. All
fragments
know of the LineRoot
they belong to.- Since:
- 3.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given box and updates properties of this composite box.void
commit()
Committing a LineRoot will position its children correctly.boolean
containsPoint
(int x, int y) A LineRoot cannot be targetted.int
Returns y coordinate for the box's baseline.void
setBaseline
(int baseline) Positions the line vertically by settings its baseline.void
setLineTop
(int top) 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.LineBox
getAscent, getDescent, isOccupied, requiresBidi
Methods inherited from class org.eclipse.draw2d.text.CompositeBox
getRecommendedWidth, setRecommendedWidth
-
Constructor Details
-
LineRoot
public LineRoot(boolean isMirrored) Constructor- Parameters:
isMirrored
-true
if the line is to be displayed in a mirrored control
-
-
Method Details
-
add
Description copied from class:CompositeBox
Adds the given box and updates properties of this composite box. -
commit
public void commit()Committing a LineRoot will position its children correctly. All children boxes are made to have the same baseline, and are laid out according to the Unicode BiDi Algorithm, or left-to-right if Bidi is not necessary. -
containsPoint
public boolean containsPoint(int x, int y) A LineRoot cannot be targetted.- Specified by:
containsPoint
in classFlowBox
- Parameters:
x
- Xy
- Y- Returns:
true
if the FlowBox contains the point- See Also:
-
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:
-
setBaseline
public void setBaseline(int baseline) Positions the line vertically by settings its baseline.- Parameters:
baseline
- the baseline
-
setLineTop
public void setLineTop(int top) 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:
top
- the y coordinate- See Also:
-