Package org.pushingpixels.substance.internal.contrib.randelshofer.quaqua

# Class MultiIcon

java.lang.Object
org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.MultiIcon

All Implemented Interfaces:
  `Icon`

Direct Known Subclasses:
  `ButtonStateIcon`

public abstract class MultiIcon extends Object implements 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.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Icon[]`
`icons`
The icons from which we choose from.

## Constructor Summary

Constructors
Constructor
Description
`MultiIcon(Image[] images)`
Creates a new instance from an array of images.
`MultiIcon(Image tiledImage, int tileCount, boolean isTiledHorizontaly)`
Creates a new instance.
`MultiIcon(Icon[] icons)`
Creates a new instance from an array of icons.

## Method Summary

Modifier and Type
Method
Description
`protected abstract void`
`generateMissingIcons()`
`protected abstract Icon`
`getIcon(Component c)`
`int`
`getIconHeight()`
`int`
`getIconWidth()`
`void`
`paintIcon(Component c, 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 Details

### icons

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

## Constructor Details

### MultiIcon

public MultiIcon(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(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(Image tiledImage, int tileCount, boolean isTiledHorizontaly)
Creates a new instance. The icon representations are created lazily from the tiled image.

## Method Details

### getIconHeight

public int getIconHeight()

Specified by:
  `getIconHeight` in interface `Icon`

### getIconWidth

public int getIconWidth()

Specified by:
  `getIconWidth` in interface `Icon`

### paintIcon

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

Specified by:
  `paintIcon` in interface `Icon`

### getIcon

protected abstract Icon getIcon(Component c)

### generateMissingIcons

protected abstract void generateMissingIcons()