Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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` True if the device supports color.
`static int` | `maxColors` Returns the number of colors supported by the device. 0 means 2^32 colors.
`static boolean` | `onDevice` 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` Returns the current platform name.
`static int` | `romVersion` Returns the ROM version of the device, like 0x02000000 or 0x03010000.
`static int` | `screenHeight` The device's screen height
`static int` | `screenWidth` 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` Returns the username of the user running the Virutal Machine.
`static int` | `version` Returns the version of the Waba 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

  The device's screen width

### screenHeight

    public static int screenHeight

  The device's screen height

### isColor

    public static boolean isColor

  True if the device supports color.

### maxColors

    public static int maxColors

  Returns the number of colors supported by the device. 0 means 2^32 colors.

### onDevice

    public static boolean onDevice

  Defines if were being runned in a handheld device or in a desktop computer

### romVersion

    public static int romVersion

  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

  Returns the current platform name. Eg: Java, PalmOS, WindowsCE, PocketPC, Win32, ...

### userName

    public static String userName

  Returns the username of the user running the Virutal 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. At desktop, it returns the Warp generated cretor id.

### 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 Waba Virtual Machine. The major version is base 100. For example, version 1.0 has value 100. version 3 has a version value of 200. 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);

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD