|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.sys.Vm
Vm contains various system level methods.
This class contains methods to copy arrays, obtain a timestamp, sleep and get platform and version information.
Method Summary | |
static void |
clipboardCopy(java.lang.String s)
copies the specific string to the clipboard |
static java.lang.String |
clipboardPaste()
gets the last string from the clipboard. if none, returns "". |
static boolean |
copyArray(java.lang.Object srcArray,
int srcStart,
java.lang.Object dstArray,
int dstStart,
int length)
Copies the elements of one array to another array. |
static void |
debug(java.lang.String s,
int wait)
draws a text in the window, erasing all the line; increments y automatically and starts over when reach the bottom of screen. use only to debug. ps: you can delimit the area where this function draws using the method setTrace(false,0,minY,lines). |
static int |
exec(java.lang.String command,
java.lang.String args,
int launchCode,
boolean wait)
Executes a command. |
static int |
getFreeClassHeap()
returns the free class heap. calls GC before. added by guich |
static int |
getFreeObjectHeap()
returns the free object heap. dont call GC. added by guich. |
static java.lang.String |
getPlatform()
Returns the platform the Virtual Machine is running under as a string. |
static int |
getRomVersion()
returns the ROM version, like 0x02000000 or 0x03010000. added by guich |
static int |
getTimeStamp()
Returns a time stamp in milliseconds. |
static java.lang.String |
getUserName()
Returns the username of the user running the Virutal Machine. |
static int |
getVersion()
Returns the version of the Waba Virtual Machine. |
static boolean |
isColor()
Returns true if the system supports a color display and false otherwise. |
static int |
random(int seed)
returns a random number. added by guich |
static int |
setDeviceAutoOff(int seconds)
Sets the device's "auto-off" time. |
static void |
setSystemKeysUse(boolean intercept)
if true, intercepts the "hard" system keys: calc, find and the 4 hard keys. added by guich |
static void |
setTrace(boolean on,
int delay,
int minY,
int lines)
prints the current class and method that is being called by the vm. only useful for debug. the contents are printed in screen, erasing everything. |
static void |
sleep(int millis)
Causes the VM to pause execution for the given number of milliseconds. |
Methods inherited from class java.lang.Object |
hashCode,
toString |
Method Detail |
public static boolean copyArray(java.lang.Object srcArray, int srcStart, java.lang.Object dstArray, int dstStart, int length)
srcArray
- the array to copy elements fromsrcStart
- the starting position in the source arraydstArray
- the array to copy elements todstStart
- the starting position in the destination arraylength
- the number of elements to copypublic static boolean isColor()
public static int getTimeStamp()
public static java.lang.String getPlatform()
public static java.lang.String getUserName()
public static int getVersion()
public static int exec(java.lang.String command, java.lang.String args, int launchCode, boolean wait)
As an example, the following call could be used to run the command "scandir /p mydir" under Java, Win32 or WinCE:
int result = Vm.exec("scandir", "/p mydir", 0, true);This example executes the Scribble program under PalmOS:
Vm.exec("Scribble", null, 0, false);This example executes the web clipper program under PalmOS, telling it to display a web page by using launchCode 54 (CmdGoToURL).
Vm.exec("Clipper", "http://www.yahoo.com", 54, true);The args parameter passed to this method is the arguments string to pass to the program being executed.
The launchCode parameter is only used under PalmOS. Under PalmOS, it is the launch code value to use when the Vm calls SysUIAppSwitch(). If 0 is passed, the default launch code (CmdNormalLaunch) is used to execute the program.
The wait parameter passed to this method determines whether to execute the command asynchronously. If false, then the method will return without waiting for the command to complete execution. If true, the method will wait for the program to finish executing and the return value of the method will be the value returned from the application under Java, Win32 and WinCE.
Under PalmOS, the wait parameter is ignored since executing another program terminates the running program.
command
- the command to executeargs
- command argumentslaunchCode
- launch code for PalmOS applicationswait
- whether to wait for the command to complete execution before returningpublic static int setDeviceAutoOff(int seconds)
public static void sleep(int millis)
millis
- time to sleep in millisecondspublic static int getRomVersion()
public static int getFreeClassHeap()
public static int getFreeObjectHeap()
public static void setSystemKeysUse(boolean intercept)
public static int random(int seed)
seed
- if > 0, sets the seed, if = 0, uses the last seedpublic static void debug(java.lang.String s, int wait)
public static void setTrace(boolean on, int delay, int minY, int lines)
on
- true turns the trace ondelay
- delay between each step. Carefull!minY
- starting row for printing chars.lines
- number of lines that will be used to overwrite the screen.public static void clipboardCopy(java.lang.String s)
public static java.lang.String clipboardPaste()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |