StocksMonitor 1.5.0

hirondelle.stocks.util.ui
Class EmptyIcon

Object
  extended by EmptyIcon
All Implemented Interfaces:
Icon

final class EmptyIcon
extends Object
implements 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.


Field Summary
(package private) static EmptyIcon SIZE_16
          Convenience object for small icons, whose size matches the size of small icons in Sun's graphics repository.
(package private) static EmptyIcon SIZE_24
          Convenience object for large icons, whose size matches the size of large icons in Sun's graphics repository.
 
Constructor Summary
EmptyIcon(int aSize)
          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(Component c, Graphics g, int x, int y)
          This implementation is empty, and paints nothing.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE_16

static final EmptyIcon SIZE_16
Convenience object for small icons, whose size matches the size of small icons in Sun's graphics repository.


SIZE_24

static final EmptyIcon SIZE_24
Convenience object for large icons, whose size matches the size of large icons in Sun's graphics repository.

Constructor Detail

EmptyIcon

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

Parameters:
aSize - 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 Icon

getIconHeight

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

Specified by:
getIconHeight in interface Icon

paintIcon

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

Specified by:
paintIcon in interface Icon

StocksMonitor 1.5.0

Copyright Hirondelle Systems - License - Generated 2008Jul12.10.53