public class TLcdSingleIconProvider extends Object implements ILcdAnchoredIcon, ILcdObjectIconProvider
ILcdIcon
that also implements
ILcdObjectIconProvider
by always returning itself.Constructor and Description |
---|
TLcdSingleIconProvider(ILcdIcon aIcon) |
Modifier and Type | Method and Description |
---|---|
void |
anchorPointSFCT(Point aPointSFCT)
Updates the given point to the location of the icon's anchor point, in relative coordinates with respect to the top left.
|
boolean |
canGetIcon(Object o)
Returns whether an icon can be returned for a given object.
|
Object |
clone()
Makes
Object.clone() public. |
ILcdIcon |
getIcon(Object o)
Returns an icon that can be used as representation for this object.
|
int |
getIconHeight()
Returns the fixed height of the icon.
|
int |
getIconWidth()
Returns the fixed width of the icon.
|
void |
paintIcon(Component aComponent,
Graphics aGraphics,
int i,
int i1)
Draw the
ILcdIcon at the specified location. |
public TLcdSingleIconProvider(ILcdIcon aIcon)
public void paintIcon(Component aComponent, Graphics aGraphics, int i, int i1)
ILcdIcon
ILcdIcon
at the specified location. ILcdIcon
implementations
may use the Component
argument to get properties useful for
painting, e.g. the foreground or background color.paintIcon
in interface ILcdIcon
aComponent
- a Component to retrieve properties from.aGraphics
- the Graphics on which the icon will be painted.i
- the x position where the icon will be painted. x is the first coordinate of the top left
corner point of the icon.i1
- the y position where the icon will be painted. y is the second coordinate of the top left
corner point of the icon.public int getIconWidth()
ILcdIcon
getIconWidth
in interface ILcdIcon
public int getIconHeight()
ILcdIcon
getIconHeight
in interface ILcdIcon
public Object clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public ILcdIcon getIcon(Object o) throws IllegalArgumentException
ILcdObjectIconProvider
getIcon
in interface ILcdObjectIconProvider
o
- the domain objectIllegalArgumentException
- When aObject is of the incorrect typepublic boolean canGetIcon(Object o)
ILcdObjectIconProvider
canGetIcon
in interface ILcdObjectIconProvider
o
- to object to check whether an icon can be provided for it.public void anchorPointSFCT(Point aPointSFCT)
ILcdAnchoredIcon
anchorPointSFCT
in interface ILcdAnchoredIcon
aPointSFCT
- the point that has to be moved to the location of the anchor point
of this icon.