|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.hivegui.component.IconTools
public class IconTools
Provides miscellaneous utility functions for handling icons. There is no need to instantiate this class since it only provides static methods.
Constructor Summary | |
---|---|
protected |
IconTools()
|
Method Summary | |
---|---|
static javax.swing.ImageIcon |
centerIcon(javax.swing.Icon source,
int newWidth,
int newHeight)
|
static javax.swing.ImageIcon |
loadIcon(org.apache.hivemind.Resource resource)
Loads an icon from a HiveMind Resource. |
static javax.swing.ImageIcon |
loadIcon(java.lang.String file)
Loads an icon from a file name. |
static javax.swing.Icon |
scaleIcon(javax.swing.Icon source,
int newSize)
Scale down an Icon to a new size. |
static javax.swing.Icon |
scaleIcon(java.awt.Image source,
int newSize)
Scale down an Image to a new size. |
static java.awt.Image |
scaleImage(java.awt.Image source,
int newSize)
Scale an Image to a new size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected IconTools()
Method Detail |
---|
public static javax.swing.ImageIcon loadIcon(org.apache.hivemind.Resource resource)
resource
- HiveMind resource referring to the icon file
resource
public static javax.swing.ImageIcon loadIcon(java.lang.String file)
It is strongly recommended to always use lowercase names for image files (both in the OS and in the paths used inside the code). File paths must be relatives (else this will not work from within a JAR file).
file
- relative path (all in lowercase) to the image file
file
public static javax.swing.Icon scaleIcon(javax.swing.Icon source, int newSize)
source
- original icon to scale downnewSize
- new size to which the icon should be scaled
public static javax.swing.Icon scaleIcon(java.awt.Image source, int newSize)
source
- original image to scale downnewSize
- new size to which the image should be scaled
public static java.awt.Image scaleImage(java.awt.Image source, int newSize)
source
- original image to scale downnewSize
- new size to which the image should be scaled
public static javax.swing.ImageIcon centerIcon(javax.swing.Icon source, int newWidth, int newHeight)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |