|
Eclipse Draw2d 3.1 |
||||||||||
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 figure that renders a string of text across one or more lines. A
TextFlow can not contain children. All InlineFlow
figure's must be
parented by a FlowFigure
.
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 . |
CaretInfo |
getCaretPlacement(int offset,
boolean trailing)
Returns the CaretInfo in absolute coordinates. |
int |
getFirstOffsetForLine(int y)
Returns the minimum offset whose caret location overlaps the given baseline y-coordinate. |
int |
getLastOffsetForLine(int baseline)
Returns the maximum offset whose caret location overlaps the given baseline y-coordinate. |
int |
getNextOffset(Point p,
boolean down,
int[] trailing)
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,
Dimension proximity)
Returns the offset of the character directly below or nearest the given location. |
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 text being displayed. |
String |
toString()
|
Methods inherited from class org.eclipse.draw2d.text.InlineFlow |
containsPoint, getFragments, paintBorder, postValidate, setBorder |
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, wait, wait, wait |
Constructor Detail |
public TextFlow()
Object.Object()
public TextFlow(String s)
s
- the stringMethod Detail |
public boolean addLeadingWordRequirements(int[] width)
addLeadingWordRequirements
in class InlineFlow
FlowFigure.addLeadingWordRequirements(int[])
protected void contributeBidi(BidiProcessor proc)
contributeBidi
in class FlowFigure
proc
- the BidiProcessor to which contributions should be madeFlowFigure.contributeBidi(org.eclipse.draw2d.text.BidiProcessor)
protected FlowFigureLayout createDefaultFlowLayout()
FlowFigure
createDefaultFlowLayout
in class InlineFlow
InlineFlow.createDefaultFlowLayout()
public BidiInfo getBidiInfo()
null
.
null
or the infopublic CaretInfo getCaretPlacement(int offset, boolean trailing)
offset
- the location in this figure's 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 relative y coordinate
public int getLastOffsetForLine(int baseline)
-1
is returned.
baseline
- the baseline's y coordinate
public int getNextOffset(Point p, boolean down, int[] trailing)
trailing[0]
will be set to 1 if the reference
point is closer to the trailing edge of the offset than it is to the leading edge.
p
- a reference pointdown
- true
if the search is downtrailing
- an int array
-1
public int getNextVisibleOffset(int offset)
offset
- the reference offset
public int getOffset(Point p, int[] trailing, Dimension proximity)
null
, the result may also be -1
if no offset was found within the proximity.
For a typical character, the trailing argument will be filled in to indicate whether the point is closer to the leading edge (0) or the trailing edge (1). When the point is over a cluster composed of multiple characters, the trailing argument will be filled with the position of the character in the cluster that is closest to the point.
If the proximity argument is not null
, then the location may be no further
than the proximity given. Passing null
is equivalent to passing new
Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)
. The width
field of
the proximity will contain the horizontal distance, height
will contain
vertical. Vertical proximity is more important than horizontal. The returned offset is
the lowest index with minimum vertical proximity not exceeding the given limit, with
horizontal proximity not exceeding the given limit.
p
- the point relative to this figuretrailing
- the trailing bufferproximity
- restricts and records the distance of the returned offset
public 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)
Figure
Figure.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 Figure
g
- The Graphics used to paintFigure.paintFigure(Graphics)
protected void paintSelection(Graphics graphics)
InlineFlow
paintSelection
in class InlineFlow
graphics
- the graphics to paint onInlineFlow.paintSelection(org.eclipse.draw2d.Graphics)
public void setBidiInfo(BidiInfo info)
FlowFigure
FlowFigure.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 FlowFigure
info
- the BidiInfo for this figureFlowFigure.setBidiInfo(org.eclipse.draw2d.text.BidiInfo)
public void setSelection(int start, int end)
setSelection
in class FlowFigure
start
- the start offsetend
- the end offsetpublic void setText(String s)
null
.
s
- The new textpublic String toString()
Object.toString()
|
Eclipse Draw2d 3.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |