waba.sys
Class Settings

java.lang.Object
  |
  +--waba.sys.Settings

public final class Settings
extends Object

this class provides some preferences from PalmOS config and other Vm settings. All settings are read-only, unless otherwise specified. Changing their values may cause the VM to crash.


Field Summary
static String appCreatorId
          Application creator ID.
static String appSecretKey
          Application defined secret key.
static String appSettings
          Application defined setting.
static byte DATE_DMY
          Constant used in dateFormat: day month year
static byte DATE_MDY
          Constant used in dateFormat: month day year
static byte DATE_YMD
          Constant used in dateFormat: year month day
static byte dateFormat
          Can be one of the following constants: DATE_MDY, DATE_DMY, DATE_YMD; where m = month, d = day and y = year
static char dateSeparator
          The date char separator.
static boolean daylightSavings
          Returns true if the device is in daylight savings mode.
static char decimalSeparator
          The decimal separator for numbers
static boolean is24Hour
          True if the time format is 24 hour format or if it is the AM/PM format
static boolean isColor
          READ-ONLY variable that represents if the device supports color.
static int maxColors
          READ-ONLY variable that returns the number of colors supported by the device. 0 means 2^32 colors.
static boolean onDevice
          READ-ONLY variable that defines if were being runned in a handheld device or in a desktop computer.
static byte PalmOS
          Defines a PalmOS user interface style.
static String platform
          READ-ONLY variable that returns the current platform name.
static int romVersion
          READ-ONLY variable that returns the ROM version of the device, like 0x02000000 or 0x03010000.
static int screenHeight
          READ-ONLY variable that represents the device's screen height
static int screenWidth
          READ-ONLY variable that represents the device's screen width
static char thousandsSeparator
          The thousands separator for numbers
static char timeSeparator
          The time char separator
static int timeZone
          Returns the timezone used for this device.
static byte uiStyle
          The uiStyle used to define the user interface style.
static String userName
          READ-ONLY variable that returns the username of the user running the Virtual Machine.
static int version
          Returns the version of the SuperWaba Virtual Machine.
static String versionStr
          Returns the version in a string form, like "2.0b4r8"
static boolean virtualKeyboard
          True if this handheld has a virtual keyboard
static byte weekStart
          The week day start. 0 = sunday, 6 = saturday
static byte WinCE
          Defines a Windows CE user interface style.
 
Constructor Summary
protected Settings(byte dateFormat, char dateSeparator, byte weekStart, boolean is24Hour, char timeSeparator, char thousandsSeparator, char decimalSeparator, int screenWidth, int screenHeight, boolean isColor, int maxColors, boolean onDevice, int romVersion, String platform, String userName, String appSettings, String appCreatorId, boolean virtualKeyboard, String appSecretKey, boolean daylightSavings, int timeZone)
           
 
Method Summary
static void setPalmOSStyle(boolean withWhiteBackground)
          Changes the user interface style to PalmOS.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, toString, wait, wait
 

Field Detail

dateFormat

public static byte dateFormat
Can be one of the following constants: DATE_MDY, DATE_DMY, DATE_YMD; where m = month, d = day and y = year

dateSeparator

public static char dateSeparator
The date char separator.

weekStart

public static byte weekStart
The week day start. 0 = sunday, 6 = saturday

is24Hour

public static boolean is24Hour
True if the time format is 24 hour format or if it is the AM/PM format

timeSeparator

public static char timeSeparator
The time char separator

thousandsSeparator

public static char thousandsSeparator
The thousands separator for numbers

decimalSeparator

public static char decimalSeparator
The decimal separator for numbers

screenWidth

public static int screenWidth
READ-ONLY variable that represents the device's screen width

screenHeight

public static int screenHeight
READ-ONLY variable that represents the device's screen height

isColor

public static boolean isColor
READ-ONLY variable that represents if the device supports color.

maxColors

public static int maxColors
READ-ONLY variable that returns the number of colors supported by the device. 0 means 2^32 colors.

onDevice

public static boolean onDevice
READ-ONLY variable that defines if were being runned in a handheld device or in a desktop computer. Note that under Win32, onDevice is true.

romVersion

public static int romVersion
READ-ONLY variable that returns the ROM version of the device, like 0x02000000 or 0x03010000. In desktop, return the oldest version of the destination platform where SuperWaba can run.

platform

public static String platform
READ-ONLY variable that returns the current platform name. Eg: Java, PalmOS, WindowsCE, PocketPC, Win32, ...

userName

public static String userName
READ-ONLY variable that returns the username of the user running the Virtual Machine. Because of Java's security model, this method will return null when called in a Java applet. This method will also return null under most WinCE devices (that will be fixed in a future release).

appSettings

public static String appSettings
Application defined setting. If you set the value of this app to something other than null, the VM will save it when exiting and load it when restarting. Under PalmOS, the value is stored in the unsaved preferrences database, which is not backupped during hot-sync. Use this to save small strings, up to 2 or 4 kb maximum. At desktop, a file named settings4crtr.pdb stores the appSettings for the current running SW programs.

appSecretKey

public static String appSecretKey
Application defined secret key. If you set the value of this app to something other than null, the VM will save it when exiting and load it when restarting. Under PalmOS, the value is stored in the unsaved preferrences database, which is not backupped during hot-sync. Use this to save small strings, up to 2 or 4 kb maximum. At desktop, a file named settings4crtr.pdb stores the appSettings for the current running SW programs. The String is stored in the saved preferrences with a creator id different of your application's (but calculated based in it), so it will never be deleted and will be restored even after a hard-reset.

appCreatorId

public static String appCreatorId
Application creator ID. In desktop, it returns the automatically created Creator ID. In device, it will return the same or the one specified with /c option argument in Warp.

uiStyle

public static byte uiStyle
The uiStyle used to define the user interface style. It must be set by calling Settings.setPalmOSStyle(boolean whiteBackground). The possible values are WinCE (default) and PalmOS.

version

public static int version
Returns the version of the SuperWaba Virtual Machine. The major version is base 100. For example, version 1.0 has value 100. version 4 has a version value of 400. A beta 0.8 VM will have version 80. ps: Waba 1.0G will return 1.01. SuperWaba = 110 (1.1)

versionStr

public static String versionStr
Returns the version in a string form, like "2.0b4r8"

WinCE

public static final byte WinCE
Defines a Windows CE user interface style. Used in the uiStyle member. Note for grayscale devices: that WinCE user interfaces looks better with bright (non-white) background

PalmOS

public static final byte PalmOS
Defines a PalmOS user interface style. Used in the uiStyle member. Note for grayscale devices: that PalmOS user interfaces looks better with white background

DATE_MDY

public static final byte DATE_MDY
Constant used in dateFormat: month day year

DATE_DMY

public static final byte DATE_DMY
Constant used in dateFormat: day month year

DATE_YMD

public static final byte DATE_YMD
Constant used in dateFormat: year month day

daylightSavings

public static boolean daylightSavings
Returns true if the device is in daylight savings mode. Note that this is not available in all devices. Only works in desktop, WinCE and Palm OS 4.0 or newer devices; in other devices will always return false.
Since:
SuperWaba 3.4

timeZone

public static int timeZone
Returns the timezone used for this device. This is the number of hours away from GMT (E.g.: for Brazil it will return -3). Only works in desktop, WinCE and Palm OS 4.0 or newer devices; in other devices will always return 0.
Since:
SuperWaba 3.4

virtualKeyboard

public static boolean virtualKeyboard
True if this handheld has a virtual keyboard
Constructor Detail

Settings

protected Settings(byte dateFormat,
                   char dateSeparator,
                   byte weekStart,
                   boolean is24Hour,
                   char timeSeparator,
                   char thousandsSeparator,
                   char decimalSeparator,
                   int screenWidth,
                   int screenHeight,
                   boolean isColor,
                   int maxColors,
                   boolean onDevice,
                   int romVersion,
                   String platform,
                   String userName,
                   String appSettings,
                   String appCreatorId,
                   boolean virtualKeyboard,
                   String appSecretKey,
                   boolean daylightSavings,
                   int timeZone)
Method Detail

setPalmOSStyle

public static void setPalmOSStyle(boolean withWhiteBackground)
Changes the user interface style to PalmOS. The default is WinCE. If withWhiteBackground flag is true, the default back color for controls and the MainWindow backgrounds are changed to white. This method must be called in the MainWindow's constructor. E.g.:
 public class Foo extends MainWindow
 {
    public Foo()
    {
       super("Hi bar",TAB_ONLY_BORDER);
       waba.sys.Settings.setPalmOSStyle(true);