sk.uniba.euromath.editor.textEditor
Interface ITextLocator

All Superinterfaces:
IEMFigure, org.eclipse.draw2d.IFigure

public interface ITextLocator
extends IEMFigure

Locates text into (segment of) one text line. Supposed to implement by classes drawing text in segment of line. Characters of text are indexed. First character have index 0.

Author:
Tomáš Studva

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets
 
Field Summary
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Method Summary
 int getCharIndexAtPos(org.eclipse.draw2d.geometry.Point loc)
          Returns character's index at location loc.
 org.eclipse.draw2d.geometry.Point getEnd(int charIndex)
          Returns top right point of rectangle bounding character with index charIndex.
 org.eclipse.draw2d.geometry.Point getStart(int charIndex)
          Returns top left point of rectangle bounding character with index charIndex.
 String getText()
           
 org.eclipse.draw2d.geometry.Rectangle getTextBounds()
          Bounds of whole text.
 org.eclipse.draw2d.geometry.Rectangle getTextBounds(int start, int end)
          Bounds of substring of text.
 void updateText(String text)
          Stores the new Text
 
Methods inherited from interface sk.uniba.euromath.editor.figures.IEMFigure
getID, getModel, needsEditPart
 
Methods inherited from interface org.eclipse.draw2d.IFigure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setConstraint, setCursor, setEnabled, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
 

Method Detail

getStart

org.eclipse.draw2d.geometry.Point getStart(int charIndex)
Returns top left point of rectangle bounding character with index charIndex.

Parameters:
charIndex -
Returns:
most left most top point in smallest rectangle completely surrounding chracter with index charIndex.

getEnd

org.eclipse.draw2d.geometry.Point getEnd(int charIndex)
Returns top right point of rectangle bounding character with index charIndex.

Parameters:
charIndex - index of character end retreival
Returns:
most right most top point in smallest rectangle completely surrounding chracter with index charIndex.

getCharIndexAtPos

int getCharIndexAtPos(org.eclipse.draw2d.geometry.Point loc)
Returns character's index at location loc.

Parameters:
loc - 2d point
Returns:
character index from start of line at point loc

getTextBounds

org.eclipse.draw2d.geometry.Rectangle getTextBounds()
Bounds of whole text. Smallest rectangle completely surrounding located text.

Returns:
rectangle completely surrounding diplayed text.

getTextBounds

org.eclipse.draw2d.geometry.Rectangle getTextBounds(int start,
                                                    int end)
Bounds of substring of text. Substring consist of characters with indices greater or equal than start and less or equal end. Smallest rectangle completely surrounding substring.

Parameters:
start - of substring
end - of substring
Returns:
rectangle completely surrounding substring.

getText

String getText()
Returns:
Returns text located by this ITextLocator.

updateText

void updateText(String text)
Stores the new Text

Parameters:
text - newText


Copyright © 2003-2006 null. All Rights Reserved.