|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xwt.Platform
Abstracts away the small irregularities in JVM implementations. The default Platform class supports a vanilla JDK 1.1 JVM. Subclasses are provided for other VMs. Methods whose names start with an underscore are meant to be overridden by subclasses. If you create a subclass of Platform, you should put it in the org.xwt.plat package, and add code to this file's static block to detect the new platform.
Field Summary | |
static java.lang.String |
build
the current build |
Constructor Summary | |
Platform()
|
Method Summary | |
protected java.lang.String |
_altKeyName()
|
protected Picture |
_createAlphaOnlyPicture(byte[] b,
int w,
int h)
|
protected Picture |
_createPicture(int[] b,
int w,
int h)
|
protected PixelBuffer |
_createPixelBuffer(int w,
int h,
Surface owner)
|
protected Surface |
_createSurface(Box b,
boolean framed)
this method invokes the platform _createSurface() method and then enforces a few post-call invariants |
protected void |
_criticalAbort(java.lang.String message)
used to notify the user of very serious failures; usually used when logging is not working or unavailable |
protected Picture |
_decodeJPEG(java.io.InputStream is,
java.lang.String name)
|
protected HTTP.Proxy |
_detectProxy()
detects proxy settings |
protected java.lang.String |
_fileDialog(java.lang.String suggestedFileName,
boolean write)
displays a platform-specific "open file" dialog and returns the chosen filename, or null if the user hit cancel |
protected java.io.InputStream |
_getBuiltinInputStream()
|
protected java.lang.String |
_getClipBoard()
|
protected java.lang.String |
_getEnv(java.lang.String key)
|
protected Scheduler |
_getScheduler()
returns a Scheduler instance; used to implement platform-specific schedulers |
protected int |
_getScreenHeight()
|
protected int |
_getScreenWidth()
|
protected java.net.Socket |
_getSocket(java.lang.String host,
int port,
boolean ssl,
boolean negotiate)
|
protected void |
_inputStreamToByteArray(java.io.InputStream is,
Callback c)
read an input stream into a byte array and invoke callback when ready |
protected boolean |
_isCaseSensitive()
|
protected int |
_maxThreads()
|
protected boolean |
_needsAutoClick()
|
protected boolean |
_needsAutoDoubleClick()
|
protected void |
_newBrowserWindow(java.lang.String url)
default implementation is Eric Albert's BrowserLauncher.java |
void |
_running()
|
protected void |
_setClipBoard(java.lang.String s)
|
protected boolean |
_supressDirtyOnResize()
|
static java.lang.String |
altKeyName()
the human-readable name of the key mapped to XWT's 'alt' key |
static Picture |
createAlphaOnlyPicture(byte[] data,
int w,
int h)
|
static Picture |
createPicture(int[] data,
int w,
int h)
creates and returns a picture |
static PixelBuffer |
createPixelBuffer(int w,
int h,
Surface s)
creates and returns a doublebuffer 'belonging' to owner; we need to associate PixelBuffers to surfaces due to AWT 1.1 requirements (definately for Navigator, possibly also for MSJVM). |
static Surface |
createSurface(Box b,
boolean framed,
boolean refreshable)
|
static void |
criticalAbort(java.lang.String message)
used to notify the user of very serious failures; usually used when logging is not working or unavailable |
static Picture |
decodeJPEG(java.io.InputStream is,
java.lang.String name)
convert a JPEG into an Image |
static HTTP.Proxy |
detectProxy()
|
static java.lang.String |
fileDialog(java.lang.String suggestedFileName,
boolean write)
|
static void |
forceLoad()
do-nothing method that forces <clinit> to run |
static java.io.InputStream |
getBuiltinInputStream()
returns an InputStream to the builtin xwar |
static java.lang.Object |
getClipBoard()
returns the contents of the clipboard |
protected java.lang.String |
getDescriptiveName()
a string describing the VM |
static java.lang.String |
getEnv(java.lang.String key)
returns the value of the environment variable key, or null if no such key exists |
static Scheduler |
getScheduler()
|
static int |
getScreenHeight()
returns the height of the screen, in pixels |
static int |
getScreenWidth()
returns the width of the screen, in pixels |
static java.net.Socket |
getSocket(java.lang.String host,
int port,
boolean ssl,
boolean negotiate)
creates a socket object |
protected void |
init()
this initializes the platform; code in here can invoke methods on Platform since Platform.platform has already been set |
static void |
inputStreamToByteArray(java.io.InputStream is,
Callback c)
|
static boolean |
isCaseSensitive()
returns true iff the platform has a case-sensitive filesystem |
static int |
maxThreads()
returns the maximum number of threads that the XWT engine can create without adversely affecting the host OS |
static boolean |
needsAutoClick()
if true, org.xwt.Surface will generate a Click automatically after a press and a release |
static boolean |
needsAutoDoubleClick()
if true, org.xwt.Surface will generate a DoubleClick automatically after recieving two clicks in a short period of time |
static void |
newBrowserWindow(java.lang.String url)
opens a new browser window |
protected void |
postInit()
|
static void |
running()
|
static void |
setClipBoard(java.lang.String s)
sets the contents of the clipboard |
static boolean |
supressDirtyOnResize()
should return true if it is safe to supress full-surface dirties immediately after a window resize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String build
Constructor Detail |
public Platform()
Method Detail |
public static void forceLoad()
protected java.lang.String getDescriptiveName()
protected void init()
protected void postInit()
public static PixelBuffer createPixelBuffer(int w, int h, Surface s)
protected PixelBuffer _createPixelBuffer(int w, int h, Surface owner)
public static Picture createPicture(int[] data, int w, int h)
public static Picture createAlphaOnlyPicture(byte[] data, int w, int h)
protected Picture _createPicture(int[] b, int w, int h)
protected Picture _createAlphaOnlyPicture(byte[] b, int w, int h)
public static java.net.Socket getSocket(java.lang.String host, int port, boolean ssl, boolean negotiate) throws java.io.IOException
java.io.IOException
protected java.net.Socket _getSocket(java.lang.String host, int port, boolean ssl, boolean negotiate) throws java.io.IOException
java.io.IOException
public static boolean supressDirtyOnResize()
protected boolean _supressDirtyOnResize()
public static java.lang.String altKeyName()
protected java.lang.String _altKeyName()
public static java.lang.Object getClipBoard()
protected java.lang.String _getClipBoard()
public static void setClipBoard(java.lang.String s)
protected void _setClipBoard(java.lang.String s)
public static int getScreenWidth()
protected int _getScreenWidth()
public static int getScreenHeight()
protected int _getScreenHeight()
public static int maxThreads()
protected int _maxThreads()
protected void _criticalAbort(java.lang.String message)
public static boolean needsAutoClick()
protected boolean _needsAutoClick()
public static boolean needsAutoDoubleClick()
protected boolean _needsAutoDoubleClick()
public static boolean isCaseSensitive()
protected boolean _isCaseSensitive()
public static java.io.InputStream getBuiltinInputStream()
protected java.io.InputStream _getBuiltinInputStream()
public static java.lang.String getEnv(java.lang.String key)
protected java.lang.String _getEnv(java.lang.String key)
public static Picture decodeJPEG(java.io.InputStream is, java.lang.String name)
protected Picture _decodeJPEG(java.io.InputStream is, java.lang.String name)
protected java.lang.String _fileDialog(java.lang.String suggestedFileName, boolean write)
public static java.lang.String fileDialog(java.lang.String suggestedFileName, boolean write)
protected void _newBrowserWindow(java.lang.String url)
public static void newBrowserWindow(java.lang.String url)
public static void criticalAbort(java.lang.String message)
protected Surface _createSurface(Box b, boolean framed)
public static Surface createSurface(Box b, boolean framed, boolean refreshable)
protected HTTP.Proxy _detectProxy()
public static HTTP.Proxy detectProxy()
protected Scheduler _getScheduler()
public static Scheduler getScheduler()
protected void _inputStreamToByteArray(java.io.InputStream is, Callback c)
public static void inputStreamToByteArray(java.io.InputStream is, Callback c)
public static void running()
public void _running()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |