|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uic.model.IconFactory.ClasspathRepository
public static class IconFactory.ClasspathRepository
A repository that will load images from the classpath.
Constructor Summary | |
---|---|
IconFactory.ClasspathRepository()
This constructor will search for basic images. |
|
IconFactory.ClasspathRepository(String[] extentions)
This constructor create a repository that will search for images with the given extentions. |
|
IconFactory.ClasspathRepository(String[] prefixes,
String[] extentions)
This constructor create a repository that will search for images with the given attributes. |
Method Summary | |
---|---|
void |
addClassLoader(Class classForClassLoader)
|
void |
addClassLoader(ClassLoader classLoader)
|
void |
addPostfix(String post)
Add a postfix. |
void |
addPostfix(String post,
int sizeHint)
Add a postfix. |
void |
addPrefix(String prefix)
Add a prefix. |
void |
addPrefix(String prefix,
int sizeHint)
Add a prefix. |
InputStream |
getImage(String name,
int size)
Returns the input stream of the requested image, or null when none found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IconFactory.ClasspathRepository()
public IconFactory.ClasspathRepository(String[] extentions)
public IconFactory.ClasspathRepository(String[] prefixes, String[] extentions)
Method Detail |
---|
public void addPrefix(String prefix)
prefix
- the path leading up to the image name you plan to supply; note
that you will need to add a '/' at the end if the prefix is a directory.
Only use slash ('/') as a directory-delimiter, this is portable to all OSes.public void addPrefix(String prefix, int sizeHint)
prefix
- the path leading up to the image name you plan to supply; note
that you will need to add a '/' at the end if the prefix is a directory.
Only use slash ('/') as a directory-delimiter, this is portable to all OSes.sizeHint
- when using this prefix the size of the image will likely be
the sizeHint.public void addPostfix(String post)
post
- the part that follows the filenamepublic void addPostfix(String post, int sizeHint)
post
- the part that follows the filenamesizeHint
- when using this prefix the size of the image will likely be
the sizeHint.public void addClassLoader(Class classForClassLoader)
public void addClassLoader(ClassLoader classLoader)
public InputStream getImage(String name, int size) throws IOException
IconFactory.Repository
getImage
in interface IconFactory.Repository
name
- the name of the image, this is the name as specified in the
getIcon
method which again is the same name
as registered in an action
.size
- the requested size. If the wanted size is not found the returned
size will be used to scale to the wanted size.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |