|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.util.Platform
public class Platform
Generic platform class. It provides interface to platform-dependent functionality.
Field Summary | |
---|---|
static boolean |
isMac
|
static boolean |
isWin
|
static java.awt.Dimension |
screenRes
|
Constructor Summary | |
---|---|
Platform()
the constructor should never be called directly. |
Method Summary | |
---|---|
java.lang.String |
forceResourceFile(java.lang.String rname)
if getResourceFile returns null then this methods should create a temporary file for the resource and return the file name. |
static Platform |
getPlatform()
|
java.lang.String |
getResourceFile(java.lang.String rname)
if possible this returns full path to the specified resource file. if the platform doesn't store bundles in files, the platform should return null |
java.io.InputStream |
getResourceInput(java.lang.String rname)
every platform should provide at least this method for each resource. |
void |
handleAbout()
|
void |
handleOpenFile(java.io.File fileName)
|
void |
handlePrefs()
|
void |
handleQuit()
|
static Platform |
initPlatform()
initialize platforms with the default implementation (in org.rosuda.util) |
static Platform |
initPlatform(java.lang.String classPrefix)
initialize platforms using the specified class prefix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean isMac
public static boolean isWin
public static java.awt.Dimension screenRes
Constructor Detail |
---|
public Platform()
initPlatform()
methods.
Method Detail |
---|
public static Platform getPlatform()
public static Platform initPlatform()
public static Platform initPlatform(java.lang.String classPrefix)
classPrefix
- prefix (including the trailing dot) for the platform classes
public java.io.InputStream getResourceInput(java.lang.String rname)
public java.lang.String getResourceFile(java.lang.String rname)
null
public java.lang.String forceResourceFile(java.lang.String rname)
null
then this methods should create a temporary file for the resource and return the file name. It should return null
only if it finds no means of creating such temporary file. The current implementation first check getResourceFile, if it fails but getResourceInput is successfull, then for JDK 1.2 and above it creates a temp file using createTempFile method and copies the contents from the InputStream. If this fails (creation of tmep file - this will fail for JDK 1.1 and below) then it tries to create a file "javaRes.tmp" in the current directory. Beware: the returned filename is valid only until the next call to this method. In fact on JDK 1.2 every call creates an unique file (flagged as delete-on-exit), but on JDK 1.1 and in other cases when this procedure fails the same file is used (and is not deleted upon exit!)
public void handleAbout()
public void handleOpenFile(java.io.File fileName)
public void handlePrefs()
public void handleQuit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |