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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the y location of the baseline.intReturns the total height of the caret.intintgetLineY()intgetX()Returns the x location of the caret.intgetY()Returns the y location of the caret.voidperformScale(double factor) Scales this object by the scale factor.voidperformTranslate(int dx, int dy) Translates this object horizontally bydxand vertically bydy.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.draw2d.geometry.TranslatableperformTranslate, performTranslate, performTranslate
- 
Constructor Details- 
CaretInfoprotected 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
 
- 
CaretInfoConstructs a CaretInfo object by copying the values from another instance.- Parameters:
- info- the reference
- Since:
- 3.2
 
 
- 
- 
Method Details- 
getBaselinepublic int getBaseline()Returns the y location of the baseline.- Returns:
- the y coordinate of the baseline
 
- 
getHeightpublic int getHeight()Returns the total height of the caret. The height is the sum of the ascent and descent.- Returns:
- the height
 
- 
getLineHeightpublic int getLineHeight()- Returns:
- the total height of the line on which the caret is placed
 
- 
getLineYpublic int getLineY()- Returns:
- the y location of the line on which the caret is placed
 
- 
getXpublic int getX()Returns the x location of the caret.- Returns:
- the x coordinate
 
- 
getYpublic int getY()Returns the y location of the caret.- Returns:
- the y coordinate
 
- 
performScalepublic void performScale(double factor) Description copied from interface:TranslatableScales this object by the scale factor.- Specified by:
- performScalein interface- Translatable
- Parameters:
- factor- The scale factor
- See Also:
 
- 
performTranslatepublic void performTranslate(int dx, int dy) Description copied from interface:TranslatableTranslates this object horizontally bydxand vertically bydy.- Specified by:
- performTranslatein interface- Translatable
- Parameters:
- dx- The amount to translate horizontally
- dy- The amount to translate vertically
- See Also:
 
 
-