Package ca.cgjennings.ui
Class BlankIcon
- java.lang.Object
-
- ca.cgjennings.ui.BlankIcon
-
- All Implemented Interfaces:
ThemedIcon,javax.swing.Icon
public class BlankIcon extends java.lang.Object implements ThemedIcon
An icon that takes up space but paints nothing.- 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThemedIconderive(int newWidth, int newHeight)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
-
BlankIcon
public BlankIcon()
Creates a 16x16 blank icon.
-
BlankIcon
public BlankIcon(int size)
Creates a blank icon with equal width and height.- Parameters:
size- the width and height of the icon
-
BlankIcon
public BlankIcon(int width, int height)Creates a blank icon with the given width and height.- Parameters:
width- the width of the iconheight- the height of the icon
-
-
Method Detail
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)- Specified by:
paintIconin interfacejavax.swing.Icon
-
derive
public ThemedIcon derive(int newWidth, int newHeight)
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:
newWidth- the new width ≥ 1newHeight- 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
-
-