Package resources
Class MultiIconBuilder
- java.lang.Object
-
- resources.MultiIconBuilder
-
public class MultiIconBuilder extends java.lang.Object
A builder to allow for easier creation of an icon that is composed of a base icon, with other icons overlayed. Thebuild()
method returns anImageIcon
, as this allows Java's buttons to create analogue disabled icons correctly.Note: this class is a work-in-progress. Add more methods for locating overlays as needed.
-
-
Constructor Summary
Constructors Constructor Description MultiIconBuilder(javax.swing.Icon baseIcon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiIconBuilder
addLowerLeftIcon(javax.swing.Icon icon)
Adds the given icon as an overlay to the base icon, to the lower-leftMultiIconBuilder
addLowerLeftIcon(javax.swing.Icon icon, int w, int h)
Adds the given icon as an overlay to the base icon, to the lower-left, scaled to the given width and heightMultiIconBuilder
addLowerRightIcon(javax.swing.Icon icon)
Adds the given icon as an overlay to the base icon, to the lower-rightMultiIconBuilder
addLowerRightIcon(javax.swing.Icon icon, int w, int h)
Adds the given icon as an overlay to the base icon, to the lower-right, scaled to the given width and heightjavax.swing.ImageIcon
build()
MultiIconBuilder
setDescription(java.lang.String description)
Sets a description for the icon being built.
-
-
-
Method Detail
-
addLowerRightIcon
public MultiIconBuilder addLowerRightIcon(javax.swing.Icon icon)
Adds the given icon as an overlay to the base icon, to the lower-right- Parameters:
icon
- the icon- Returns:
- this builder
-
addLowerRightIcon
public MultiIconBuilder addLowerRightIcon(javax.swing.Icon icon, int w, int h)
Adds the given icon as an overlay to the base icon, to the lower-right, scaled to the given width and height- Parameters:
icon
- the iconw
- the desired widthh
- the desired height- Returns:
- this builder
-
addLowerLeftIcon
public MultiIconBuilder addLowerLeftIcon(javax.swing.Icon icon)
Adds the given icon as an overlay to the base icon, to the lower-left- Parameters:
icon
- the icon- Returns:
- this builder
-
addLowerLeftIcon
public MultiIconBuilder addLowerLeftIcon(javax.swing.Icon icon, int w, int h)
Adds the given icon as an overlay to the base icon, to the lower-left, scaled to the given width and height- Parameters:
icon
- the iconw
- the desired widthh
- the desired height- Returns:
- this builder
-
setDescription
public MultiIconBuilder setDescription(java.lang.String description)
Sets a description for the icon being built. This is useful for debugging.- Parameters:
description
- the description- Returns:
- this builder
-
build
public javax.swing.ImageIcon build()
-
-