org.dishevelled.iconbundle
Class IconSize

java.lang.Object
  extended by org.dishevelled.iconbundle.IconSize
All Implemented Interfaces:
java.io.Serializable

public abstract class IconSize
extends java.lang.Object
implements java.io.Serializable

Extensible typesafe enumeration of icon sizes.

To create a non-default icon size, subclass IconSize as follows:

  IconSize CUSTOM_48X52 = new IconSize(48, 52) { }
 
and optionally override readResolve to support serialization.

Version:
$Revision: 404 $ $Date: 2008-01-02 13:19:59 -0600 (Wed, 02 Jan 2008) $
Author:
Michael Heuer
See Also:
Serialized Form

Field Summary
static IconSize DEFAULT_128X128
          Default 128x128 icon size.
static IconSize DEFAULT_16X16
          Default 16x16 icon size.
static IconSize DEFAULT_24X24
          Default 24x24 icon size.
static IconSize DEFAULT_32X32
          Default 32x32 icon size.
static IconSize DEFAULT_48X48
          Default 48x48 icon size.
static IconSize DEFAULT_64X64
          Default 64x64 icon size.
static IconSize DEFAULT_96X96
          Default 96x96 icon size.
static java.util.List VALUES
          Public list of default enumeration values.
 
Constructor Summary
protected IconSize(int width, int height)
          Create a new icon size with the specified width and height.
 
Method Summary
 boolean equals(java.lang.Object o)
          Override equals and make it final to prevent subclasses from changing the implementation.
 int getHeight()
          Return the icon height.
 int getWidth()
          Return the icon width.
 int hashCode()
          Override hashCode and make it final to prevent subclasses from changing the implementation.
 java.lang.String toString()
          Return the string value of width + "x" + height.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_16X16

public static final IconSize DEFAULT_16X16
Default 16x16 icon size.


DEFAULT_24X24

public static final IconSize DEFAULT_24X24
Default 24x24 icon size.


DEFAULT_32X32

public static final IconSize DEFAULT_32X32
Default 32x32 icon size.


DEFAULT_48X48

public static final IconSize DEFAULT_48X48
Default 48x48 icon size.


DEFAULT_64X64

public static final IconSize DEFAULT_64X64
Default 64x64 icon size.


DEFAULT_96X96

public static final IconSize DEFAULT_96X96
Default 96x96 icon size.


DEFAULT_128X128

public static final IconSize DEFAULT_128X128
Default 128x128 icon size.


VALUES

public static final java.util.List VALUES
Public list of default enumeration values.

Constructor Detail

IconSize

protected IconSize(int width,
                   int height)
Create a new icon size with the specified width and height.

Parameters:
width - icon width
height - icon height
Method Detail

toString

public final java.lang.String toString()
Return the string value of width + "x" + height.

Overrides:
toString in class java.lang.Object
Returns:
the string value of the icon width and height

getWidth

public final int getWidth()
Return the icon width.

Returns:
the icon width

getHeight

public final int getHeight()
Return the icon height.

Returns:
the icon height

equals

public final boolean equals(java.lang.Object o)
Override equals and make it final to prevent subclasses from changing the implementation.

Overrides:
equals in class java.lang.Object
Parameters:
o - object
Returns:
super.equals(o)

hashCode

public final int hashCode()
Override hashCode and make it final to prevent subclasses from changing the implementation.

Overrides:
hashCode in class java.lang.Object
Returns:
super.hashCode()


Copyright (c) 2003-2008 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).