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 ThemedIcon
derive(int newWidth, int newHeight)
Returns a new icon that renders the same image as this icon, but at a different size.ThemedIcon
disabled()
Returns a new icon that renders the same image as this icon, but as if for a permanently disabled component.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
-
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:
getIconHeight
in interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth
in interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
- Specified by:
paintIcon
in interfacejavax.swing.Icon
-
derive
public ThemedIcon derive(int newWidth, int newHeight)
Description copied from interface:ThemedIcon
Returns a new icon that renders the same image as this icon, but at a different size.- Specified by:
derive
in 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:ThemedIcon
Returns a new icon that renders the same image as this icon, but as if for a permanently disabled component.- Specified by:
disabled
in interfaceThemedIcon
- Returns:
- a disabled verison of the icon
-
-