Package com.luciad.gui
Class TLcdSingleIconProvider
java.lang.Object
com.luciad.gui.TLcdSingleIconProvider
- All Implemented Interfaces:
ILcdAnchoredIcon
,ILcdIcon
,ILcdObjectIconProvider
,ILcdCloneable
,Serializable
,Cloneable
public class TLcdSingleIconProvider
extends Object
implements ILcdAnchoredIcon, ILcdObjectIconProvider
Convenience wrapper for
ILcdIcon
that also implements
ILcdObjectIconProvider
by always returning itself.- Since:
- 2012.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.clone()
MakesObject.clone()
public.Returns an icon that can be used as representation for this object.int
Returns the fixed height of the icon.int
Returns the fixed width of the icon.void
Draw theILcdIcon
at the specified location.
-
Constructor Details
-
TLcdSingleIconProvider
-
-
Method Details
-
paintIcon
Description copied from interface:ILcdIcon
Draw theILcdIcon
at the specified location.ILcdIcon
implementations may use theComponent
argument to get properties useful for painting, e.g. the foreground or background color.- Specified by:
paintIcon
in interfaceILcdIcon
- Parameters:
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.
-
getIconWidth
public int getIconWidth()Description copied from interface:ILcdIcon
Returns the fixed width of the icon.- Specified by:
getIconWidth
in interfaceILcdIcon
- Returns:
- the fixed width of the icon.
-
getIconHeight
public int getIconHeight()Description copied from interface:ILcdIcon
Returns the fixed height of the icon.- Specified by:
getIconHeight
in interfaceILcdIcon
- Returns:
- the fixed height of the icon.
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.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 ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-
getIcon
Description copied from interface:ILcdObjectIconProvider
Returns an icon that can be used as representation for this object.- Specified by:
getIcon
in interfaceILcdObjectIconProvider
- Parameters:
o
- the domain object- Returns:
- null when no ILcdIcon can be found the ILcdIcon for aObject
- Throws:
IllegalArgumentException
- When aObject is of the incorrect type
-
canGetIcon
Description copied from interface:ILcdObjectIconProvider
Returns whether an icon can be returned for a given object.- Specified by:
canGetIcon
in interfaceILcdObjectIconProvider
- Parameters:
o
- to object to check whether an icon can be provided for it.- Returns:
- whether an icon can be returned for a given object.
-
anchorPointSFCT
Description copied from interface:ILcdAnchoredIcon
Updates the given point to the location of the icon's anchor point, in relative coordinates with respect to the top left. The x-coordinate of the anchor point typically lies between 0 and getWidth(). The y-coordinate typically lies between 0 and getHeight().- Specified by:
anchorPointSFCT
in interfaceILcdAnchoredIcon
- Parameters:
aPointSFCT
- the point that has to be moved to the location of the anchor point of this icon.
-