Package com.luciad.gui
Interface ILcdAnchoredIcon
- All Superinterfaces:
Cloneable
,ILcdCloneable
,ILcdIcon
,Serializable
- All Known Implementing Classes:
TLcdAnchoredIcon
,TLcdBoxIcon
,TLcdHaloIcon
,TLcdResizeableIcon
,TLcdS52Text
,TLcdSingleIconProvider
An icon that provides a point within the icon that maps to the object it represents or decorates.
An an example, a crosshair is typically anchored at its center.
To make an arrow icon with its tip at (tix,tiy) and its tail at (tax, tay) point towards the object it represents,
the anchor point would be (tix, tij).
ILcdAnchoredIcon does not change the behavior of the paint method: anchored icons behave similarly as non-anchored icons in that they always paint their top-left corner at the given coordinates. Hence, it is up to the caller of the paint method to deal with the anchor coordinates. The following example paints an icon around its anchor:
// coordinates of the object you want to represent with an icon
Point p = ...;
Point anchor = new Point();
icon.anchorPointSFCT(anchor);
icon.paint(c, graphics, p.x - anchor.x, p.y - anchor.y);
-
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.Methods inherited from interface com.luciad.util.ILcdCloneable
clone
Methods inherited from interface com.luciad.gui.ILcdIcon
getIconHeight, getIconWidth, paintIcon
-
Method Details
-
anchorPointSFCT
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().- Parameters:
aPointSFCT
- the point that has to be moved to the location of the anchor point of this icon.
-