Package org.eclipse.draw2d.text
Class CaretInfo
java.lang.Object
org.eclipse.draw2d.text.CaretInfo
- All Implemented Interfaces:
Translatable
Stores positional information about where a caret should be placed. This
structure currently only offers integer precision. Scaling operations will
result in rounding.
- Since:
- 3.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the y location of the baseline.int
Returns the total height of the caret.int
int
getLineY()
int
getX()
Returns the x location of the caret.int
getY()
Returns the y location of the caret.void
performScale
(double factor) Scales this object by the scale factor.void
performTranslate
(int dx, int dy) Translates this object horizontally bydx
and vertically bydy
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.draw2d.geometry.Translatable
performTranslate, performTranslate, performTranslate
-
Constructor Details
-
CaretInfo
protected CaretInfo(int x, int y, int ascent, int descent, int lineAscent, int lineDescent) Constructor for use by TextFlow. Constructs a new CaretInfo with the figure's ascent and descent and line information.WARNING: This constructor should not be called by clients. It is for use by
TextFlow
, and may change in future releases.- Parameters:
x
- the x locationy
- the y location of the top of the caretascent
- the ascentdescent
- the descentlineAscent
- the ascent of the line on which the caret is placedlineDescent
- the descent of the line on which the caret is placed
-
CaretInfo
Constructs a CaretInfo object by copying the values from another instance.- Parameters:
info
- the reference- Since:
- 3.2
-
-
Method Details
-
getBaseline
public int getBaseline()Returns the y location of the baseline.- Returns:
- the y coordinate of the baseline
-
getHeight
public int getHeight()Returns the total height of the caret. The height is the sum of the ascent and descent.- Returns:
- the height
-
getLineHeight
public int getLineHeight()- Returns:
- the total height of the line on which the caret is placed
-
getLineY
public int getLineY()- Returns:
- the y location of the line on which the caret is placed
-
getX
public int getX()Returns the x location of the caret.- Returns:
- the x coordinate
-
getY
public int getY()Returns the y location of the caret.- Returns:
- the y coordinate
-
performScale
public void performScale(double factor) Description copied from interface:Translatable
Scales this object by the scale factor.- Specified by:
performScale
in interfaceTranslatable
- Parameters:
factor
- The scale factor- See Also:
-
performTranslate
public void performTranslate(int dx, int dy) Description copied from interface:Translatable
Translates this object horizontally bydx
and vertically bydy
.- Specified by:
performTranslate
in interfaceTranslatable
- Parameters:
dx
- The amount to translate horizontallydy
- The amount to translate vertically- See Also:
-