|
JGraphpad Pro
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jgraph.editor.JGraphEditorResources
Manages a set of resource bundles to retrieve keys and reads images and streams from the classpath. In order to find a key, the class searches all bundles in inverse insertion order (last inserted first).
| Field Summary | |
protected static LinkedList |
bundles
Ordered list of the inserted resource bundles. |
| Constructor Summary | |
JGraphEditorResources()
|
|
| Method Summary | |
static void |
addBundle(String basename)
Adds a resource bundle. |
static void |
addBundles(String[] basenames)
Adds an array of resource bundles using addBundle(String). |
static LinkedList |
getBundles()
Returns the bundles. |
static ImageIcon |
getImage(String uri)
Returns the specified file as an image or null if there
was an exception. |
static InputStream |
getInputStream(String uri)
Returns the specified file as a buffered input stream or null if there was an exception. |
static OutputStream |
getOutputStream(String uri)
Returns a buffered output stream for the specified URI or null if there was an exception. |
static String |
getString(String key)
Returns the value for key by searching the resource
bundles in inverse order or null if no value can be found
for key. |
static String |
getString(String key,
Object param)
Returns the value for key replacing every occurrence of
{0} with param. |
static String |
getString(String key,
Object[] params)
Returns the value for key replacing every occurrence of
{i} with params[i] where i is an integer (i =
0, 1, ..., n). |
static void |
setBundles(LinkedList bundles)
Sets the bundles. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static LinkedList bundles
| Constructor Detail |
public JGraphEditorResources()
| Method Detail |
public static void addBundle(String basename)
basename - The basename of the resource bundle to add.public static void addBundles(String[] basenames)
addBundle(String).
basenames - The array of basenames to add.public static String getString(String key)
key by searching the resource
bundles in inverse order or null if no value can be found
for key.
key - The key to be searched for.
key or null.ResourceBundle.getString(java.lang.String)
public static String getString(String key,
Object param)
key replacing every occurrence of
{0} with param. This is a shortcut method
for values with only one placeholder.
key.getString(String, Object[])
public static String getString(String key,
Object[] params)
key replacing every occurrence of
{i} with params[i] where i is an integer (i =
0, 1, ..., n).
key.public static ImageIcon getImage(String uri)
null if there
was an exception. Exceptions are silently ignored by this method. This
implementation first tries to load the specified filename from the
classpath. If the file cannot be found, it tries loading it as external
file or URL.
uri - The URI to load the image from.
filename.ImageIO.read(java.net.URL),
Class.getResource(java.lang.String)
public static InputStream getInputStream(String uri)
throws MalformedURLException,
FileNotFoundException,
IOException
null if there was an exception. Exceptions are silently
ignored by this method. This implementation first tries to load the
specified filename from the classpath. If the file cannot be found, it
tries loading it as external file or URL.
uri - The URI to return the input stream for.
filename.
IOException - If the URI can not be read.
FileNotFoundException - If the URI can not be found.
MalformedURLException - If the URI is an invalid URL.Class.getResource(java.lang.String),
URL.openStream(),
BufferedInputStream
public static OutputStream getOutputStream(String uri)
throws FileNotFoundException
uri - The URI to return the output stream for.
FileNotFoundException - If the specified URI can not be found.public static LinkedList getBundles()
public static void setBundles(LinkedList bundles)
bundles - The bundles to set.
|
JGraphpad Pro
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||