1. /*
  2. * @(#)Icon.java 1.16 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing;
  8. import java.awt.Graphics;
  9. import java.awt.Component;
  10. /**
  11. * A small fixed size picture, typically used to decorate components.
  12. *
  13. * @see ImageIcon
  14. */
  15. public interface Icon
  16. {
  17. /**
  18. * Draw the icon at the specified location. Icon implementations
  19. * may use the Component argument to get properties useful for
  20. * painting, e.g. the foreground or background color.
  21. */
  22. void paintIcon(Component c, Graphics g, int x, int y);
  23. /**
  24. * Returns the icon's width.
  25. *
  26. * @return an int specifying the fixed width of the icon.
  27. */
  28. int getIconWidth();
  29. /**
  30. * Returns the icon's height.
  31. *
  32. * @return an int specifying the fixed height of the icon.
  33. */
  34. int getIconHeight();
  35. }