|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensourcephysics.tools.ResourceLoader
This defines static methods for loading resources.
Field Summary | |
protected static boolean |
cacheEnabled
|
protected static java.lang.String |
launchJarName
|
protected static java.lang.String |
launchJarPath
|
protected static int |
maxPaths
|
protected static java.util.Hashtable |
resources
|
protected static java.util.ArrayList |
searchPaths
|
protected static java.net.URLClassLoader |
xsetZipLoader
|
protected static java.util.Map |
zipLoaders
|
Method Summary | |
static void |
addSearchPath(java.lang.String base)
Adds a path at the beginning of the searchPaths list. |
static java.applet.AudioClip |
getAudioClip(java.lang.String path)
|
static java.awt.image.BufferedImage |
getBufferedImage(java.lang.String path)
|
static javax.swing.ImageIcon |
getIcon(java.lang.String path)
|
static java.awt.Image |
getImage(java.lang.String path)
|
static java.lang.String |
getLaunchJarPath()
|
static Resource |
getResource(java.lang.String name)
Gets a resource specified by name. |
static Resource |
getResource(java.lang.String name,
java.lang.Class type)
Gets a resource specified by name and Class. |
static Resource |
getResource(java.lang.String basePath,
java.lang.String name)
Gets a resource specified by base path and name. |
static Resource |
getResource(java.lang.String basePath,
java.lang.String name,
java.lang.Class type)
Gets a resource specified by base path, name and class. |
static java.lang.String |
getString(java.lang.String path)
|
static boolean |
isCacheEnabled()
Gets the cacheEnabled property. |
static java.io.InputStream |
openInputStream(java.lang.String path)
|
static java.io.Reader |
openReader(java.lang.String path)
|
static void |
removeSearchPath(java.lang.String base)
Removes a path from the searchPaths list. |
static void |
setCacheEnabled(boolean enabled)
Sets the cacheEnabled property. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.util.ArrayList searchPaths
protected static int maxPaths
protected static java.util.Hashtable resources
protected static boolean cacheEnabled
protected static java.util.Map zipLoaders
protected static java.net.URLClassLoader xsetZipLoader
protected static java.lang.String launchJarName
protected static java.lang.String launchJarPath
Method Detail |
public static Resource getResource(java.lang.String name)
name
- the file or URL name
public static Resource getResource(java.lang.String name, java.lang.Class type)
name
- the file or URL nametype
- the Class providing default ClassLoader resource loading
public static Resource getResource(java.lang.String basePath, java.lang.String name)
basePath
- the base pathname
- the file or URL name
public static Resource getResource(java.lang.String basePath, java.lang.String name, java.lang.Class type)
basePath
- the base pathname
- the file or URL nametype
- the Class providing ClassLoader resource loading
public static void addSearchPath(java.lang.String base)
base
- the base path to addpublic static void removeSearchPath(java.lang.String base)
base
- the base path to removepublic static void setCacheEnabled(boolean enabled)
enabled
- true to enable the cachepublic static boolean isCacheEnabled()
public static java.io.InputStream openInputStream(java.lang.String path)
public static java.io.Reader openReader(java.lang.String path)
public static java.lang.String getString(java.lang.String path)
public static javax.swing.ImageIcon getIcon(java.lang.String path)
public static java.awt.Image getImage(java.lang.String path)
public static java.awt.image.BufferedImage getBufferedImage(java.lang.String path)
public static java.applet.AudioClip getAudioClip(java.lang.String path)
public static java.lang.String getLaunchJarPath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |