|
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.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 | |
String |
addJoiners(String text)
Same as invoking prependJoiner(String) and appendJoiner(String) with
the given text. |
boolean |
addLeadingWordRequirements(int[] width)
Returns the width of the text until the first line-break. |
String |
appendJoiner(String text)
Appends the Zero-Width Joiner character at the end of the given String if required. |
protected void |
contributeBidi(BidiProcessor proc)
A TextFlow contributes its text. |
protected FlowFigureLayout |
createDefaultFlowLayout()
Creates the default layout manager |
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 |
getOffset(Point p,
int[] trailing)
Returns the textual offset nearest the specified point. |
String |
getText()
|
protected void |
invalidateBidi()
Throws away the cached Bidi state for this figure and all its children. |
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. |
String |
prependJoiner(String text)
Prepends the Zero-Width Joiner character to the beginning of the given text if required. |
void |
setAppendJoiner(boolean append)
This method is invoked by the BidiProcessor if it determines that a shaping character needs to be appended to the text contributed by this Figure for it to appear properly on the screen. |
void |
setPrependJoiner(boolean prepend)
This method is invoked by the BidiProcessor if it determines that a shaping character needs to be prepended to the text contributed by this Figure for it to appear properly on the screen. |
void |
setSelection(int begin,
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, postValidate |
| Methods inherited from class org.eclipse.draw2d.text.FlowFigure |
add, getBidiValues, remove, revalidateBidi, setBidiValues, 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 String addJoiners(String text)
prependJoiner(String) and appendJoiner(String) with
the given text.
text - the text to be formatted for shaping
public boolean addLeadingWordRequirements(int[] width)
addLeadingWordRequirements in class InlineFlowFlowFigure.addLeadingWordRequirements(int[])public String appendJoiner(String text)
text - the String to be formatted for shaping
setAppendJoiner(boolean)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 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
-1
public int getOffset(Point p,
int[] trailing)
-1 is returned.
Otherwise the offset will be between 0 and getText().length() inclusively.
p - a point relative to this figure
-1public String getText()
protected void invalidateBidi()
FlowFigureBlockFlow.revalidateBidi(IFigure).
invalidateBidi in class FlowFigureFlowFigure.invalidateBidi()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)public String prependJoiner(String text)
text - the String that needs to be formatted for shaping
setPrependJoiner(boolean)public void setAppendJoiner(boolean append)
FlowFigureThis method does nothing by default. Sub-classes should override as needed.
setAppendJoiner in class FlowFigureappend - the ZWJ will be appended if trueFlowFigure.setAppendJoiner(boolean)public void setPrependJoiner(boolean prepend)
FlowFigureThis method does nothing by default. Sub-classes should override as needed.
setPrependJoiner in class FlowFigureprepend - the ZWJ will be prepended if trueFlowFigure.setPrependJoiner(boolean)
public void setSelection(int begin,
int end)
begin - the begin 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 | ||||||||||