|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.graphic.IlvGeneralPath
ilog.views.graphic.IlvTextPath
public class IlvTextPath
A graphic object that displays a text on any Shape.
The text is placed on the path after flattening of the outline of the
shape.
| Constructor Summary | |
|---|---|
IlvTextPath(IlvInputStream stream)
Reads the object from an IlvInputStream. |
|
IlvTextPath(IlvTextPath source)
Creates a new IlvTextPath by copying an existing one. |
|
IlvTextPath(Shape shape,
String text)
Constructs a new IlvTextPath using the specified
shape as a baseline and displaying the specified text. |
|
IlvTextPath(Shape shape,
String text,
int justification,
int verticalAlignment,
double baseLineShift)
Constructs a new IlvTextPath using the specified shape
as a baseline, with the specified justification and the specified
shift from the baseline. |
|
| Method Summary | |
|---|---|
protected Paint |
adaptPaint(Shape shape,
Paint paint)
This method is overridden in IlvTextPath to deal with
auto adaptable IlvMultipleGradientPaint
instances. |
void |
applyTransform(IlvTransformer t)
Applies a transformation to the shape of the object. |
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object. |
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests if a point lies within the shape. |
IlvGraphic |
copy()
Copies the object. |
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object. |
double |
getBaselineShift()
Returns the shift perpendicular to the baseline. |
double |
getFlatness()
Returns the flatness for iterating on the path of this object. |
Font |
getFont()
Returns the font of the object. |
int |
getJustification()
Returns the justification of the text. |
String |
getLabel()
Returns the label of the object. |
IlvRect |
getLabelBBox(IlvTransformer t)
Returns the area where the label is displayed. |
double |
getLength()
Returns the length of the shape. |
int |
getVerticalAlignment()
Returns the justification of the text. |
Shape |
getVisualBounds(IlvTransformer t)
Returns the visual bounds of this IlvTextPath. |
boolean |
isAntialiasing()
Returns true if the anti-aliasing mode
of the label is on. |
boolean |
isExtendedBaseline()
Returns true if this IlvTextPath is in
Extended baseline mode. |
boolean |
isFractionalMetrics()
Returns true if the fractional metrics mode
of the label is on. |
boolean |
isStrokeOn()
Returns true if the shape of the
object is stroked. |
void |
setAntialiasing(boolean set)
Changes the anti-aliasing mode of the label. |
void |
setBaselineShift(double shift)
Sets the shift perpendicular to the baseline. |
void |
setExtendedBaseline(boolean set)
Changes the displaying policy of this IlvTextPath. |
void |
setFillPaint(Paint paint)
Changes the paint object used to fill the shape. |
void |
setFlatness(double flatness)
Sets the flatness for iterating on the path of this IlvTextPath. |
void |
setFont(Font font)
Changes the font of the object. |
void |
setForeground(Color color)
Changes the foreground color of the object. |
void |
setFractionalMetrics(boolean set)
Changes the fraction metrics mode of the label. |
protected void |
setInternalShape(Shape shape)
Sets the internal shape. |
void |
setJustification(int direction)
Changes the justification of the text. |
void |
setLabel(String label)
Changes the label of this object. |
void |
setShape(Shape shape)
Changes the shape of the object. |
void |
setStroke(Stroke stroke)
Changes the stroke object used to stroke the text. |
void |
setStrokeOn(boolean set)
When set to true, specifies that the shape of the
object is stroked. |
void |
setVerticalAlignment(int alignment)
Sets the shift policy between the text baseline and the path this object relies on. |
boolean |
supportMultiline()
Returns true if the label can be a multiline label,
false otherwise. |
void |
write(IlvOutputStream stream)
Writes the object to an IlvOutputStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlvTextPath(Shape shape,
String text)
IlvTextPath using the specified
shape as a baseline and displaying the specified text. The text is
left justified on the path, and the baseline of the text matches the path.
public IlvTextPath(Shape shape,
String text,
int justification,
int verticalAlignment,
double baseLineShift)
IlvTextPath using the specified shape
as a baseline, with the specified justification and the specified
shift from the baseline.
public IlvTextPath(IlvTextPath source)
IlvTextPath by copying an existing one.
source - The source object.
public IlvTextPath(IlvInputStream stream)
throws IlvReadFileException
IlvInputStream.
stream - The input stream.
IlvReadFileException - if the format is not correct.| Method Detail |
|---|
public void write(IlvOutputStream stream)
throws IOException
IlvOutputStream.
You should not call this
method directly; instead, you should use the write
methods of the manager.
write in interface IlvPersistentObjectwrite in class IlvGeneralPathstream - The output stream.
IOException - thrown when an exception occurs during
the write operation for this object.
protected Paint adaptPaint(Shape shape,
Paint paint)
IlvTextPath to deal with
auto adaptable IlvMultipleGradientPaint
instances. Indeed, as the IlvTextPath is made of several
shapes, the auto adaptable will not be sufficient.
adaptPaint in class IlvGeneralPathshape - The shape parameter that the returned Paint
should fit.paint - The initial Paint object.IlvGeneralPath.isPaintAbsolute()public final void setFlatness(double flatness)
IlvTextPath.
public final double getFlatness()
0.1.
public final void setJustification(int direction)
IlvConstants.LEFT: left justified text.
IlvConstants.RIGHT: right justified text.
IlvConstants.CENTER: centered text.
public final int getJustification()
public final void setVerticalAlignment(int alignment)
IlvConstants.TOP: The text is on top of the path.
IlvConstants.BOTTOM: The text is under the path.
IlvConstants.CENTER: The text is centered on the path.
IlvConstants.TOP | IlvConstants.BOTTOM: The text
baseline and the path are merged.
public final int getVerticalAlignment()
public final void setBaselineShift(double shift)
public final double getBaselineShift()
public void setShape(Shape shape)
applyToObject
method of the manager.
setShape in class IlvGeneralPathIlvGeneralPath.getShape(),
IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)protected void setInternalShape(Shape shape)
setInternalShape in class IlvGeneralPathpublic void setFont(Font font)
setFont in interface IlvFontInterfacefont - The new font.getFont()public Font getFont()
getFont in interface IlvFontInterfacesetFont(java.awt.Font)public final boolean isAntialiasing()
true if the anti-aliasing mode
of the label is on.
public void setAntialiasing(boolean set)
public final boolean isFractionalMetrics()
true if the fractional metrics mode
of the label is on.
public void setFractionalMetrics(boolean set)
public final boolean isExtendedBaseline()
true if this IlvTextPath is in
Extended baseline mode. The default is true.
public void setExtendedBaseline(boolean set)
IlvTextPath.
Changing this mode may change the bounding box of the object.
When in Extended baseline
mode, glyphs are displayed even if they do not fit on the path limits.
Otherwise, characters that fall off the baseline are not displayed.
public double getLength()
public boolean isStrokeOn()
true if the shape of the
object is stroked.
isStrokeOn in class IlvGeneralPathsetStroke(java.awt.Stroke),
IlvGeneralPath.setStrokePaint(java.awt.Paint),
setStrokeOn(boolean)public void setStrokeOn(boolean set)
true, specifies that the shape of the
object is stroked. Note that this may
change its bounding rectangle. For this reason,
if the object is contained inside a manager,
you should modify the shape using the applyToObject
method of the manager.
setStrokeOn in class IlvGeneralPathset - Set to true to enable the stroke in your
customized graphic object.setStroke(java.awt.Stroke),
IlvGeneralPath.setStrokePaint(java.awt.Paint),
isStrokeOn()public void setStroke(Stroke stroke)
null to remove the
stroke. Note that changing the stroke may modify the
bounding rectangle of the object. For this reason,
if the object is contained inside a manager,
you should modify the shape using the applyToObject
method of the manager.
setStroke in class IlvGeneralPathIlvGeneralPath.getStrokePaint(),
IlvGeneralPath.getStroke(),
isStrokeOn()public void setFillPaint(Paint paint)
setFillPaint in class IlvGeneralPathpaint - The new filling object.IlvGeneralPath.getFillPaint(),
IlvGeneralPath.isFillOn()public void setForeground(Color color)
setFillPaint on the object.
setForeground in class IlvGeneralPathcolor - The new color.setFillPaint(java.awt.Paint)public Shape getVisualBounds(IlvTransformer t)
IlvTextPath.
The visual bounds are a composition of the visual bounds of all
GlyphVector needed to draw this IlvTextPath.
public IlvGraphic copy()
copy in class IlvGeneralPathIlvGeneralPath.IlvGraphicpublic IlvRect boundingBox(IlvTransformer t)
boundingBox in interface IlvPolyPointsInterfaceboundingBox in class IlvGeneralPatht - The transformer used to draw the object.IlvGeneralPath.getShapeBounds(IlvTransformer)
public boolean contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
contains in class IlvGeneralPathp - The point to be tested.tp - The point p transformed by the transformer
t.t - The transformation that was applied to the object when it
was drawn.
true if the point lies inside this graphic object.IlvGeneralPath.isContainsWhenNotFilled()
public void draw(Graphics dst,
IlvTransformer t)
draw in class IlvGeneralPathdst - The destination Graphics.t - The transformation used to draw the object.IlvGraphic.boundingBox(ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic void applyTransform(IlvTransformer t)
applyTransform in class IlvGeneralPatht - The transformer to be applied.IlvGeneralPath.setClip(java.awt.Shape)public String getLabel()
getLabel in interface IlvLabelInterfacepublic IlvRect getLabelBBox(IlvTransformer t)
getLabelBBox in interface IlvLabelInterfacet - the transformer used to draw the graphic object.public void setLabel(String label)
setLabel in interface IlvLabelInterfacepublic boolean supportMultiline()
true if the label can be a multiline label,
false otherwise.
supportMultiline in interface IlvLabelInterface
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||