|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.AbstractFigure
diva.canvas.toolbox.LabelFigure
public class 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(String s)
Construct a label figure displaying the given string, using the default font. |
|
LabelFigure(String s,
Font f)
Construct a label figure displaying the given string in the given font. |
|
LabelFigure(String s,
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(String s,
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(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." This will be one of the positioning constants defined in javax.swing.SwingConstants. |
Point2D |
getAnchorPoint()
Get the location at which the anchor is currently located. |
Rectangle2D |
getBounds()
Get the bounds of this string |
Composite |
getComposite()
Get the compositing operator |
Paint |
getFillPaint()
Get the fill paint for this label. |
Font |
getFont()
Get the font that this label is drawn in. |
Point2D |
getOrigin()
Return the origin, which is the anchor point. |
double |
getPadding()
Get the padding around the text. |
Shape |
getShape()
Get the shape of this label figure. |
String |
getString()
Get the string. |
void |
paint(Graphics2D g)
Paint the figure. |
void |
setAnchor(int anchor)
Set the point at which this figure is "anchored." This must be one of the positioning constants defined in javax.swing.SwingConstants. |
void |
setComposite(AlphaComposite c)
Set the compositing operation for this figure. |
void |
setFillPaint(Paint p)
Set the fill paint that this shape is drawn with. |
void |
setFont(Font f)
Set the font. |
void |
setPadding(double padding)
Set the "padding" around the text. |
void |
setString(String s)
Set the string. |
void |
transform(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(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(String s)
public LabelFigure(String s, String face, int style, int size)
public LabelFigure(String s, Font f)
public LabelFigure(String s, Font font, double padding, int anchor)
Method Detail |
---|
public void autoAnchor(Shape s)
public int getAnchor()
public Point2D getAnchorPoint()
public Rectangle2D getBounds()
getBounds
in interface Figure
getBounds
in class AbstractFigure
public Font getFont()
public Paint getFillPaint()
public Point2D getOrigin()
getOrigin
in interface Figure
getOrigin
in class AbstractFigure
AbstractFigure.getBounds()
public double getPadding()
public Shape getShape()
getShape
in interface Figure
getShape
in class AbstractFigure
public Composite getComposite()
public String getString()
public void paint(Graphics2D g)
paint
in interface VisibleComponent
paint
in class AbstractFigure
public void setComposite(AlphaComposite c)
public void setAnchor(int anchor)
public void setFillPaint(Paint p)
public void setFont(Font f)
public void setPadding(double padding)
public void setString(String s)
public void transform(AffineTransform at)
transform
in interface Figure
transform
in class AbstractFigure
public void translateTo(double x, double y)
public void translateTo(Point2D pt)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |