1 /* 2 Copyright aswing.org, see the LICENCE.txt. 3 */ 4 5 import org.aswing.Component; 6 import org.aswing.graphices.Graphics; 7 8 /** 9 * A small fixed size picture, typically used to decorate components. 10 * 11 * @see BaseIcon 12 * @author iiley 13 */ 14 interface org.aswing.Icon{ 15 16 /** 17 * Return the icon's width. 18 */ 19 public function getIconWidth():Number; 20 21 /** 22 * Return the icon's height. 23 */ 24 public function getIconHeight():Number; 25 26 /** 27 * Draw the icon at the specified component's specified location with the graphics. 28 * If this if the first time to paint on the specified component, there 29 * may need some install operation, for example create MC on the 30 * specified mc if needed. 31 * @param com component for which this border is being painted 32 * @param g the paint graphics 33 * @param x the x corrdinate of the icon(top left of bounds) 34 * @param y the y corrdinate of the icon(top left of bounds) 35 * @see #uninstallIcon() 36 */ 37 public function paintIcon(com:Component, g:Graphics, x:Number, y:Number):Void; 38 39 /** 40 * Remove things in the icon object related to the component. 41 * For example remove the MCs created at the first paint time. 42 * <p> 43 * There is not installIcon method, so you must install icon related things 44 * at the first time of <code>paintIcon</code>, for example attach a MC if needed. 45 * @see #paintIcon() 46 */ 47 public function uninstallIcon(com:Component):Void; 48 } 49