org.eclipse.draw2d.text
Class CaretInfo
java.lang.Object
org.eclipse.draw2d.text.CaretInfo
-
All Implemented Interfaces:
-
Translatable
- public class CaretInfo
- extends java.lang.Object
- implements
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
|
protected
|
CaretInfo
(
CaretInfo info)
Constructs a CaretInfo object by copying the values from another instance. |
protected
|
CaretInfo
(int x,
int y,
int ascent,
int descent,
int lineAscent,
int lineDescent)
Constructor for use by TextFlow. |
Method Summary
|
int
|
getBaseline
()
Returns the y location of the baseline. |
int
|
getHeight
()
Returns the total height of the caret. |
int
|
getLineHeight
()
|
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 by dx and vertically by
dy . |
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
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 location -
y
- the y location of the top of the caret -
ascent
- the ascent -
descent
- the descent -
lineAscent
- the ascent of the line on which the caret is placed -
lineDescent
- the descent of the line on which the caret is placed
CaretInfo
protected CaretInfo(
CaretInfo info)
- Constructs a CaretInfo object by copying the values from another instance.
-
Parameters:
-
info
- the reference -
Since:
- 3.2
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 interface
Translatable
-
-
Parameters:
-
factor
- The scale factor -
See Also:
-
Translatable.performScale(double)
performTranslate
public void performTranslate(int dx,
int dy)
-
Description copied from interface:
Translatable
- Translates this object horizontally by
dx
and vertically by
dy
.
-
-
Specified by:
-
performTranslate
in interface
Translatable
-
-
Parameters:
-
dx
- The amount to translate horizontally -
dy
- The amount to translate vertically -
See Also:
-
Translatable.performTranslate(int, int)
Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.