Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## contrib.ch.randelshofer.quaqua
Class MultiIcon

    java.lang.Object
      contrib.ch.randelshofer.quaqua.MultiIcon

All Implemented Interfaces:
  javax.swing.Icon

Direct Known Subclasses:
  ButtonStateIcon

    public abstract class MultiIcon

extends java.lang.Object
implements javax.swing.Icon

An icon which paints one out of multiple icons depending on the state of the component. MultiIcon can lazily create the icons from a tiled image.

Version:
  1.0.1 2006-02-14 Created tileCount icons from image.
  1.0 October 17, 2005 Created.
Author:
  Werner Randelshofer

Field Summary
`protected javax.swing.Icon[]` | `icons` The icons from which we choose from.

Constructor Summary
`MultiIcon(javax.swing.Icon[] icons)` Creates a new instance from an array of icons.
`MultiIcon(java.awt.Image[] images)` Creates a new instance from an array of images.
`MultiIcon(java.awt.Image tiledImage, int tileCount, boolean isTiledHorizontaly)` Creates a new instance.

Method Summary
`protected abstract void` | `generateMissingIcons()`
`protected abstract javax.swing.Icon` | `getIcon(java.awt.Component c)`
`int` | `getIconHeight()`
`int` | `getIconWidth()`
`void` | `paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### icons

    protected javax.swing.Icon[] icons

  The icons from which we choose from. This variable is null, if we are using a tiled image as our base.

Constructor Detail

### MultiIcon

    public MultiIcon(javax.swing.Icon[] icons)

  Creates a new instance from an array of icons. All icons must have the same dimensions. If an icon is null, an icon is derived for the state from the other icons.

### MultiIcon

    public MultiIcon(java.awt.Image[] images)

  Creates a new instance from an array of images. All icons must have the same dimensions. If an icon is null, an icon is derived for the state from the other icons.

### MultiIcon

    public MultiIcon(java.awt.Image tiledImage,
                     int tileCount,
                     boolean isTiledHorizontaly)

  Creates a new instance. The icon representations are created lazily from the tiled image.

Method Detail

### getIconHeight

    public int getIconHeight()

  Specified by:
    `getIconHeight` in interface `javax.swing.Icon`

### getIconWidth

    public int getIconWidth()

  Specified by:
    `getIconWidth` in interface `javax.swing.Icon`

### paintIcon

    public void paintIcon(java.awt.Component c,
                          java.awt.Graphics g,
                          int x,
                          int y)

  Specified by:
    `paintIcon` in interface `javax.swing.Icon`

### getIcon

    protected abstract javax.swing.Icon getIcon(java.awt.Component c)

### generateMissingIcons

    protected abstract void generateMissingIcons()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD