eu.beesoft.gaia.swing
Class EmptyIcon

java.lang.Object
  extended by eu.beesoft.gaia.swing.EmptyIcon
All Implemented Interfaces:
javax.swing.Icon

public class EmptyIcon
extends java.lang.Object
implements javax.swing.Icon

Represents a square icon having no graphical content.

Intended for use with Action and JMenuItem. Alignment of text is poor when the same menu mixes menu items without an icon with menu items having an icon. In such cases, items without an icon can use an EmptyIcon to take up the proper amount of space, and allow for alignment of all text in the menu.


Constructor Summary
EmptyIcon(int size)
          EmptyIcon objects are always square, having identical height and width.
 
Method Summary
 int getIconHeight()
          Return the icon size (width is same as height).
 int getIconWidth()
          Return the icon size (width is same as height).
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          This implementation is empty, and paints nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyIcon

public EmptyIcon(int size)
EmptyIcon objects are always square, having identical height and width.

Parameters:
size - length of any side of the icon in pixels, must be in the range 1..100 (inclusive).
Method Detail

getIconWidth

public int getIconWidth()
Return the icon size (width is same as height).

Specified by:
getIconWidth in interface javax.swing.Icon

getIconHeight

public int getIconHeight()
Return the icon size (width is same as height).

Specified by:
getIconHeight in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
This implementation is empty, and paints nothing.

Specified by:
paintIcon in interface javax.swing.Icon