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