|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.util.IconUtils
public class IconUtils
Utility functions related to Icons.
Method Summary | |
---|---|
static javax.swing.Icon |
colorIcon(javax.swing.Icon icon,
java.awt.Color color)
Modifies an existing icon by changing its colour. |
static javax.swing.Icon |
createTextIcon(java.lang.String line,
java.awt.Graphics g)
Returns an icon that paints a line of text. |
static javax.swing.Icon |
emptyIcon(int width,
int height)
Returns an icon with a given size and no content. |
static javax.swing.ImageIcon |
toImageIcon(javax.swing.Icon icon)
Returns an ImageIcon based on a given Icon object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static javax.swing.Icon emptyIcon(int width, int height)
width
- icon widthheight
- icon heightpublic static javax.swing.Icon colorIcon(javax.swing.Icon icon, java.awt.Color color)
icon
- input iconcolor
- colour to use as default for painting
public static javax.swing.ImageIcon toImageIcon(javax.swing.Icon icon)
icon
is already an ImageIcon, it is returned. Otherwise,
it is painted to an Image and an ImageIcon is constructed from that.
The reason this is useful is that some Swing components will only
grey out disabled icons if they are ImageIcon subclasses (which is
naughty).
icon
- input icon
public static javax.swing.Icon createTextIcon(java.lang.String line, java.awt.Graphics g)
line
- text stringg
- graphics context
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |