|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object extended bydiva.canvas.AbstractFigure extended bydiva.canvas.toolbox.LabelFigure
A figure which draws a string. If the string contains newlines, then it will be broken up into multiple lines. Strings can be "anchored" in the center or on one of the edges or corners, so that when the font or text changes, the label appears to stay in the right location.
| Constructor Summary | |
LabelFigure()
Construct an empty label figure. |
|
LabelFigure(java.lang.String s)
Construct a label figure displaying the given string, using the default font. |
|
LabelFigure(java.lang.String s,
java.awt.Font f)
Construct a label figure displaying the given string in the given font. |
|
LabelFigure(java.lang.String s,
java.awt.Font font,
double padding,
int anchor)
Construct a label figure displaying the given string in the given font, with the given padding and anchor. |
|
LabelFigure(java.lang.String s,
java.lang.String face,
int style,
int size)
Construct a label figure displaying the given string in the given face, style, and size. |
|
| Method Summary | |
void |
autoAnchor(java.awt.Shape s)
Choose an anchor point so as not to intersect a given figure. |
int |
getAnchor()
Get the point at which this figure is "anchored." |
java.awt.geom.Point2D |
getAnchorPoint()
Get the location at which the anchor is currently located. |
java.awt.geom.Rectangle2D |
getBounds()
Get the bounds of this string |
java.awt.Paint |
getFillPaint()
Get the fill paint for this label. |
java.awt.Font |
getFont()
Get the font that this label is drawn in. |
java.awt.geom.Point2D |
getOrigin()
Return the origin, which is the anchor point. |
double |
getPadding()
Get the padding around the text. |
java.awt.Shape |
getShape()
Get the shape of this label figure. |
java.lang.String |
getString()
Get the string. |
void |
paint(java.awt.Graphics2D g)
Paint the figure. |
void |
setAnchor(int anchor)
Set the point at which this figure is "anchored." |
void |
setFillPaint(java.awt.Paint p)
Set the fill paint that this shape is drawn with. |
void |
setFont(java.awt.Font f)
Set the font. |
void |
setPadding(double padding)
Set the "padding" around the text. |
void |
setString(java.lang.String s)
Set the string. |
void |
transform(java.awt.geom.AffineTransform at)
Transform the label with the given transform. |
void |
translateTo(double x,
double y)
Translate the label so that the current anchor is located at the given point. |
void |
translateTo(java.awt.geom.Point2D pt)
Translate the label so that the current anchor is located at the given point. |
| Methods inherited from class diva.canvas.AbstractFigure |
contains, getInteractor, getLayer, getParent, getToolTipText, getTransformContext, getUserObject, hit, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible, translate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LabelFigure()
public LabelFigure(java.lang.String s)
public LabelFigure(java.lang.String s, java.lang.String face, int style, int size)
public LabelFigure(java.lang.String s, java.awt.Font f)
public LabelFigure(java.lang.String s, java.awt.Font font, double padding, int anchor)
| Method Detail |
public void autoAnchor(java.awt.Shape s)
public int getAnchor()
public java.awt.geom.Point2D getAnchorPoint()
public java.awt.geom.Rectangle2D getBounds()
getBounds in interface FiguregetBounds in class AbstractFigurepublic java.awt.Font getFont()
public java.awt.Paint getFillPaint()
public java.awt.geom.Point2D getOrigin()
getOrigin in interface FiguregetOrigin in class AbstractFigureAbstractFigure.getBounds()public double getPadding()
public java.awt.Shape getShape()
getShape in interface FiguregetShape in class AbstractFigurepublic java.lang.String getString()
public void paint(java.awt.Graphics2D g)
paint in interface VisibleComponentpaint in class AbstractFigurepublic void setAnchor(int anchor)
public void setFillPaint(java.awt.Paint p)
public void setFont(java.awt.Font f)
public void setPadding(double padding)
public void setString(java.lang.String s)
public void transform(java.awt.geom.AffineTransform at)
transform in interface Figuretransform in class AbstractFigurepublic void translateTo(double x, double y)
public void translateTo(java.awt.geom.Point2D pt)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||