|
Eclipse Draw2d 3.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.draw2d.Figure
org.eclipse.draw2d.text.FlowFigure
org.eclipse.draw2d.text.InlineFlow
org.eclipse.draw2d.text.TextFlow
An inline flow that renders a string of text across one or more lines. A TextFlow must
not have any children. It does not provide a FlowContext.
The TextFlow's fragments are sized using the text plus any required joiners. Clients should add the joiners to the text before breaking it up according to fragments.
WARNING: This class is not intended to be subclassed by clients.
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.draw2d.Figure |
Figure.FigureIterator, Figure.IdentitySearch |
| Nested classes inherited from class org.eclipse.draw2d.IFigure |
IFigure.NoInsets |
| Field Summary |
| Fields inherited from class org.eclipse.draw2d.text.FlowFigure |
selectionStart |
| Fields inherited from class org.eclipse.draw2d.Figure |
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip |
| Fields inherited from interface org.eclipse.draw2d.IFigure |
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS |
| Constructor Summary | |
TextFlow()
Constructs a new TextFlow with the empty String. |
|
TextFlow(String s)
Constructs a new TextFlow with the specified String. |
|
| Method Summary | |
boolean |
addLeadingWordRequirements(int[] width)
Returns the width of the text until the first line-break. |
protected void |
contributeBidi(BidiProcessor proc)
A TextFlow contributes its text. |
protected FlowFigureLayout |
createDefaultFlowLayout()
Creates the default layout manager |
BidiInfo |
getBidiInfo()
Returns the BidiInfo for this figure or null. |
Rectangle |
getCaretPlacement(int offset,
boolean trailing)
Returns the rectangular bounds for placing a Caret at the given offset. |
int |
getFirstOffsetForLine(int y)
Returns the first caret position which occupies the line at the given y location. |
int |
getLastOffsetForLine(int y)
Returns the last caret position which occupies the line at the given y location. |
int |
getNextOffset(Point p,
boolean down)
Returns the offset nearest the given point either up or down one line. |
int |
getNextVisibleOffset(int offset)
Returns the next offset which is visible in at least one fragment or -1 if there is not one. |
int |
getOffset(Point p,
int[] trailing)
Returns the textual offset nearest the specified point. |
int |
getPreviousVisibleOffset(int offset)
Returns the previous offset which is visible in at least one fragment or -1 if there is not one. |
String |
getText()
|
boolean |
isTextTruncated()
Returns true if a portion if the text is truncated using ellipses ("..."). |
protected void |
paintFigure(Graphics g)
Paints this Figure's primary representation, or background. |
protected void |
paintSelection(Graphics graphics)
Renders the XOR selection rectangles to the graphics. |
void |
setBidiInfo(BidiInfo info)
Sets the bidi information for this figure. |
void |
setSelection(int start,
int end)
Sets the extent of selection. |
void |
setText(String s)
Sets the string being displayed. |
| Methods inherited from class org.eclipse.draw2d.text.InlineFlow |
containsPoint, getFragments, paintBorder, postValidate |
| Methods inherited from class org.eclipse.draw2d.text.FlowFigure |
add, remove, revalidateBidi, setBounds, setFlowContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TextFlow()
Object.Object()public TextFlow(String s)
s - the string| Method Detail |
public boolean addLeadingWordRequirements(int[] width)
addLeadingWordRequirements in class InlineFlowFlowFigure.addLeadingWordRequirements(int[])protected void contributeBidi(BidiProcessor proc)
contributeBidi in class FlowFigureproc - the BidiProcessor to which contributions should be madeFlowFigure.contributeBidi(org.eclipse.draw2d.text.BidiProcessor)protected FlowFigureLayout createDefaultFlowLayout()
FlowFigure
createDefaultFlowLayout in class InlineFlowInlineFlow.createDefaultFlowLayout()public BidiInfo getBidiInfo()
null.
null or the info
public Rectangle getCaretPlacement(int offset,
boolean trailing)
Caret at the given offset. The offset must be between 0 and the length of the String
being displayed.
offset - the location in this figures texttrailing - true if the caret is being placed after the offset
IllegalArgumentException - If the offset is not between 0 and the
length of the string inclusivelypublic int getFirstOffsetForLine(int y)
-1 is returned.
y - the baseline's y coordinate
public int getLastOffsetForLine(int y)
-1 is returned.
y - the baseline's y coordinate
public int getNextOffset(Point p,
boolean down)
p - a reference pointdown - true if the search is down
-1public int getNextVisibleOffset(int offset)
offset - the reference offset
public int getOffset(Point p,
int[] trailing)
-1 is returned.
Otherwise the offset will be between 0 and getText().length() inclusively.
Trailing information for bidi applications is provided by SWT's TextLayout.
p - a point relative to this figuretrailing - trailing information
-1public int getPreviousVisibleOffset(int offset)
getNextVisibleOffset(int) for more.
offset - a reference offset
public String getText()
public boolean isTextTruncated()
true if a portion if the text is truncated using ellipses ("...").
true if the text is truncated with ellipsesprotected void paintFigure(Graphics g)
FigureFigure.paintClientArea(Graphics) and Figure.paintBorder(Graphics). Furthermore, it is safe
to call graphics.restoreState() within this method, and doing so will
restore the graphics to its original state upon entry.
paintFigure in class Figureg - The Graphics used to paintFigure.paintFigure(Graphics)protected void paintSelection(Graphics graphics)
InlineFlow
paintSelection in class InlineFlowgraphics - the graphics to paint onInlineFlow.paintSelection(org.eclipse.draw2d.Graphics)public void setBidiInfo(BidiInfo info)
FlowFigureFlowFigure.contributeBidi(BidiProcessor). If the figure contributes text associated with
it, this method is called back to indicate the bidi properties for that text within its
block.
setBidiInfo in class FlowFigureinfo - the BidiInfo for this figureorg.eclipse.draw2d.text.FlowFigure#setBidiValues(int[])
public void setSelection(int start,
int end)
setSelection in class FlowFigurestart - the start offsetend - the end offsetpublic void setText(String s)
revalidate() to occur.
s - The new String. It cannot be null.
|
Eclipse Draw2d 3.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||