public class LabelFigure extends AbstractFigure
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
contains, getInteractor, getLayer, getParent, getToolTipText, getTransformContext, getUserObject, hit, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible, translatepublic LabelFigure()
public LabelFigure(String s)
public LabelFigure(String s, String face, int style, int size)
public LabelFigure(String s, Font f)
public void autoAnchor(Shape s)
public int getAnchor()
public Point2D getAnchorPoint()
public Rectangle2D getBounds()
getBounds in interface FiguregetBounds in class AbstractFigurepublic Font getFont()
public Paint getFillPaint()
public Point2D getOrigin()
getOrigin in interface FiguregetOrigin in class AbstractFigureAbstractFigure.getBounds()public double getPadding()
public Shape getShape()
getShape in interface FiguregetShape in class AbstractFigurepublic Composite getComposite()
public String getString()
public void paint(Graphics2D g)
paint in interface VisibleComponentpaint in class AbstractFigurepublic 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 Figuretransform in class AbstractFigurepublic void translateTo(double x,
double y)
public void translateTo(Point2D pt)
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.