Package ca.cgjennings.ui.theme
Class ThemedCompoundIcon
- java.lang.Object
-
- ca.cgjennings.ui.theme.ThemedCompoundIcon
-
- All Implemented Interfaces:
ThemedIcon,javax.swing.Icon
- Direct Known Subclasses:
TaskIcon
public class ThemedCompoundIcon extends java.lang.Object implements ThemedIcon
Icon that paints a pair of icons overtop of each other.- Author:
- Chris Jennings
-
-
Field Summary
-
Fields inherited from interface ca.cgjennings.ui.theme.ThemedIcon
GIGANTIC, LARGE, MEDIUM, MEDIUM_LARGE, MEDIUM_SMALL, SMALL, TINY, VERY_LARGE
-
-
Constructor Summary
Constructors Constructor Description ThemedCompoundIcon(ThemedIcon bottom, ThemedIcon top)Create a compound icon from a pair of icons.ThemedCompoundIcon(java.lang.String bottom, java.lang.String top)Create a compound icon from a pair of icon to be fetched withResourceKit.getIcon(java.lang.String).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThemedIconderive(int width, int height)Returns a new icon that renders the same image as this icon, but at a different size.ThemedIcondisabled()Returns a new icon that renders the same image as this icon, but as if for a permanently disabled component.intgetIconHeight()intgetIconWidth()voidpaintIcon(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
-
Methods inherited from interface ca.cgjennings.ui.theme.ThemedIcon
derive, gigantic, large, medium, mediumLarge, mediumSmall, small, tiny, veryLarge
-
-
-
-
Constructor Detail
-
ThemedCompoundIcon
public ThemedCompoundIcon(ThemedIcon bottom, ThemedIcon top)
Create a compound icon from a pair of icons.- Parameters:
bottom- the icon to paint firsttop- the icon to paint over the bottom icon
-
ThemedCompoundIcon
public ThemedCompoundIcon(java.lang.String bottom, java.lang.String top)Create a compound icon from a pair of icon to be fetched withResourceKit.getIcon(java.lang.String).- Parameters:
bottom- the icon to paint firsttop- the icon to paint over the bottom icon
-
-
Method Detail
-
derive
public ThemedIcon derive(int width, int height)
Description copied from interface:ThemedIconReturns a new icon that renders the same image as this icon, but at a different size.- Specified by:
derivein interfaceThemedIcon- Parameters:
width- the new width ≥ 1height- the new height ≥ 1- Returns:
- an icon with the revised dimensions
-
disabled
public ThemedIcon disabled()
Description copied from interface:ThemedIconReturns a new icon that renders the same image as this icon, but as if for a permanently disabled component.- Specified by:
disabledin interfaceThemedIcon- Returns:
- a disabled verison of the icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)- Specified by:
paintIconin interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
-