|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.tools.Resource
public class Resource
This represents a resource obtained from a URL or File.
| Constructor Summary | |
|---|---|
|
Resource(java.io.File file)
Constructs a resource from a file. |
|
Resource(java.net.URL url)
Constructs a resource from a url. |
protected |
Resource(java.net.URL zipURL,
java.lang.String content)
Constructs a resource from a ZIP url with content. |
| Method Summary | |
|---|---|
java.lang.String |
getAbsolutePath()
Gets the absolute path. |
java.applet.AudioClip |
getAudioClip()
Gets an AudioClip. |
java.awt.image.BufferedImage |
getBufferedImage()
Gets a buffered image. |
java.awt.image.BufferedImage |
getBufferedImage(int bufferedImageType)
Gets a buffered image. |
static java.nio.charset.Charset |
getCharset()
Gets the character set used for reading input streams. |
java.io.File |
getFile()
Gets the file associated with this resource. |
javax.swing.ImageIcon |
getIcon()
Gets an ImageIcon. |
java.awt.Image |
getImage()
Gets an Image. |
java.lang.Object |
getObject(java.lang.Class<?> type)
Gets an object of the specified type. |
java.lang.String |
getString()
Gets a String. |
java.net.URL |
getURL()
Gets the url associated with this resource. |
java.io.InputStream |
openInputStream()
Opens an InputStream. |
java.io.BufferedReader |
openReader()
Opens a BufferedReader. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Resource(java.net.URL url)
url - the URLpublic Resource(java.io.File file)
file - the file
protected Resource(java.net.URL zipURL,
java.lang.String content)
zipURL - the URLcontent - the path of the contents relative to the ZIP file| Method Detail |
|---|
public static java.nio.charset.Charset getCharset()
public java.lang.String getAbsolutePath()
public java.net.URL getURL()
public java.io.File getFile()
public java.lang.Object getObject(java.lang.Class<?> type)
type - the desired class type
public java.io.InputStream openInputStream()
public java.io.BufferedReader openReader()
public javax.swing.ImageIcon getIcon()
public java.awt.Image getImage()
public java.awt.image.BufferedImage getBufferedImage()
public java.awt.image.BufferedImage getBufferedImage(int bufferedImageType)
bufferedImageType - one of the types defined by the BufferedImage class
public java.lang.String getString()
public java.applet.AudioClip getAudioClip()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||