becker.robots.icons
Class LabelIcon
java.lang.Object
becker.robots.icons.Icon
becker.robots.icons.LabelIcon
- All Implemented Interfaces:
- ILabel
public class LabelIcon
- extends Icon
- implements ILabel
An icon that shown as a printed label. A LabelIcon is often combined with
another icon using a CompositeIcon
.
- Author:
- Byron Weber Becker
Constructor Summary |
LabelIcon()
|
LabelIcon(double xPos,
double yPos)
Create a new label icon. |
Methods inherited from class becker.robots.icons.Icon |
applyTransforms, getColor, getImage, getRotation, getSize, getTransparency, hasChanged, markChanged, paintIcon, setColor, setSize, setTransparency |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LabelIcon
public LabelIcon()
LabelIcon
public LabelIcon(double xPos,
double yPos)
- Create a new label icon.
- Parameters:
xPos
- (0.0yPos
- (0.0
setLabel
public void setLabel(String aLabel)
- Description copied from class:
Icon
- Set the label to display on this icon.
- Specified by:
setLabel
in interface ILabel
- Overrides:
setLabel
in class Icon
- Parameters:
aLabel
- The label to display.
getLabel
public String getLabel()
- Description copied from class:
Icon
- Get the label currently being displayed on this icon.
- Specified by:
getLabel
in interface ILabel
- Overrides:
getLabel
in class Icon
- Returns:
- The label currently displayed.
setFont
public void setFont(Font f)
renderImage
protected void renderImage(Graphics2D g2,
int width,
int height)
- Description copied from class:
Icon
- Override either this method or
Icon.paintIcon(java.awt.Graphics)
to specify how the
icon looks. For this method, the upper left corner
of the icon has coordinates (0,0). The width and height are both 1.0.
- Overrides:
renderImage
in class Icon
- Parameters:
g2
- the graphics context where the icon should be drawn.width
- the number of pixels wide the image will beheight
- the number of pixels high the image will be