|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.ImageIcon
jas.util.JASIcon
public class JASIcon
A convenience class for creating small icons where the source file is stored in the CLASSPATH of the application, typically in the same JAR file as the class creating the image
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.ImageIcon |
---|
ImageIcon.AccessibleImageIcon |
Field Summary |
---|
Fields inherited from class javax.swing.ImageIcon |
---|
component, tracker |
Constructor Summary | |
---|---|
JASIcon(Class c)
Create a JASIcon without specifing the source |
|
JASIcon(Class c,
String file)
Create a JASIcon from the CLASSPATH. |
|
JASIcon(Object obj,
String file)
Create a JASIcon from the CLASSPATH. |
Method Summary | |
---|---|
static JASIcon |
create(Class c,
String file)
Create a JASIcon but do not throw an exception if the source cannot be found (just displays a "broken" icon instead) //TODO: Should create return a cached version of the JASIcon, instead of a cached // version of the image with a new JASIcon object? |
static JASIcon |
create(Object obj,
String file)
Create a JASIcon but do not throw an exception if the source cannot be found (just displays a "broken" icon instead) |
boolean |
equals(Object in)
Override Objects equals method. |
int |
hashCode()
Override Objects hashCode method |
void |
setImage(String file)
This method sets the image of the JASIcon to be that referenced by file. |
Methods inherited from class javax.swing.ImageIcon |
---|
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, loadImage, paintIcon, setDescription, setImage, setImageObserver, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JASIcon(Object obj, String file) throws ImageException
obj
- The object used as the root of the file pathfile
- The path to the image source file, relative to obj
ImageException
- Thrown if the image source file can not be foundcreate(Object obj, String file)
public JASIcon(Class c, String file) throws ImageException
c
- The class used as the root of the file pathfile
- The path to the image source file, relative to the root class
ImageException
- Thrown if the image source file can not be foundcreate(Object c, String file)
public JASIcon(Class c)
Class
- c The class used as the root of the file path when setImage is calledsetImage(String file)
Method Detail |
---|
public void setImage(String file)
file
- The path to the image source file, relative to the root classpublic int hashCode()
hashCode
in class Object
public boolean equals(Object in)
equals
in class Object
public static JASIcon create(Object obj, String file)
obj
- The object used as the root of the file pathfile
- The path to the image source file, relative to obj
public static JASIcon create(Class c, String file)
obj
- The class used as the root of the file pathfile
- The path to the image source file, relative to obj
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |