net.rim.device.api.ui
Class Ui

java.lang.Object
  |
  +--net.rim.device.api.ui.Ui

public final class Ui
extends Object

Provides functionality and data global to the entire UI system.


Field Summary
static int INCREASE_DOWN
          Alt-rolling downwards should produce higher values in rolling controls.
static int INCREASE_UP
          Alt-rolling upwards should produce higher values in rolling controls.
static int MODE_ADVANCED
          Advanced UI user mode.
static int MODE_BEGINNER
          Beginner UI user mode.
static int MODE_NORMAL
          Normal UI user mode.
static int UNITS_Ám
          Size is specified in Ám (micrometers).
static int UNITS_cm
          Size is specified in cm (centimeters).
static int UNITS_cpt
          Size is specified in cpt (centipoints).
static int UNITS_m
          Size is specified in m (meters).
static int UNITS_mm
          Size is specified in mm (millimeters).
static int UNITS_pm
          Size is specified in pm (picometers).
static int UNITS_pt
          Size is specified in pt (points).
static int UNITS_px
          Size is specified in pixels.
 
Method Summary
static int convertSize(int size, int inUnits, int outUnits)
          Converts size unit measurements.
static int getIncreaseDirection()
          Retrieves the direction for rolling controls.
static int getMode()
          Retrieves the UI user mode.
static UiEngine getUiEngine()
          Retrieves this process's UI engine.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail


INCREASE_DOWN

public static final int INCREASE_DOWN
Alt-rolling downwards should produce higher values in rolling controls.

This constant is defined as +1. Examples of controls that use this are ChoiceField and DateField.


INCREASE_UP

public static final int INCREASE_UP
Alt-rolling upwards should produce higher values in rolling controls.

This constant is defined as -1. Examples of controls that use this are ChoiceField and DateField.


MODE_ADVANCED

public static final int MODE_ADVANCED
Advanced UI user mode.

MODE_BEGINNER

public static final int MODE_BEGINNER
Beginner UI user mode.

MODE_NORMAL

public static final int MODE_NORMAL
Normal UI user mode.

UNITS_Ám

public static final int UNITS_Ám
Size is specified in Ám (micrometers).
Since:
JDE 3.7.0

UNITS_cm

public static final int UNITS_cm
Size is specified in cm (centimeters).
Since:
JDE 4.0.0

UNITS_cpt

public static final int UNITS_cpt
Size is specified in cpt (centipoints).

The point convention used is the Postscript point, 1 cpt = 0.003527777778 mm (1/7200 in).

Since:
JDE 3.7.0

UNITS_m

public static final int UNITS_m
Size is specified in m (meters).

The unit meter field is used to define the other unit fields in this class. Use these units to define the size units (UNITS_cm), millimeter (UNIT_mm), micrometer (UNIT_Ám), and picometer (UNIT_pm).

Since:
JDE 3.7.0

UNITS_mm

public static final int UNITS_mm
Size is specified in mm (millimeters).
Since:
JDE 4.0.0

UNITS_pm

public static final int UNITS_pm
Size is specified in pm (picometers).
Since:
JDE 4.0.0

UNITS_pt

public static final int UNITS_pt
Size is specified in pt (points).

The point convention used is the Postscript point, 0.3527777778 mm (1/72 inch).

Since:
JDE 3.7.0

UNITS_px

public static final int UNITS_px
Size is specified in pixels.

It is assumed to have already gone through the appropriate scaling for the device.

Since:
JDE 3.7.0
Method Detail

convertSize

public static int convertSize(int size,
                              int inUnits,
                              int outUnits)
Converts size unit measurements.
Parameters:
size - Size to convert.
inUnits - Current units for size.
outUnits - Units for converted size.
Returns:
New, converted size.
Throws:
NumericOverflowException - if the converted number is too large or too small to be represented as an integer; less than Integer.MIN_VALUE or greater than Integer.MAX_VALUE.
IllegalArgumentException - if the specified value for at least one of inUnits or outUnits is not valid.
Since:
JDE 4.0.0

getIncreaseDirection

public static int getIncreaseDirection()
Retrieves the direction for rolling controls.

A returned value of plus one indicates that, in rolling controls, alt-rolling the trackwheel towards the bottom of the device selects "higher" values in the control's list.

A returned value of minus one indicates that, in rolling controls, alt-rolling the trackwheel towards the top of the device selects "higher" values in the control's list.

Returns:
Plus one if alt-rolling towards the bottom of the device produces higher values in rolling controls; minus one if alt-rolling upwards produces higher values.

getMode

public static int getMode()
Retrieves the UI user mode.

Invoke this method to retrieve the currently set UI user mode: one of MODE_BEGINNER, MODE_NORMAL, and MODE_ADVANCED.

In advanced mode, controls should be less intrusive. In normal and beginner mode, controls should assume the user is unfamiliar with the device, and needs more assistance.

Different operating modes are not exposed at the user level. It is intended initially as a back door.

Returns:
Value corresponding to one of this class's static UI user mode members.

getUiEngine

public static UiEngine getUiEngine()
Retrieves this process's UI engine.
Returns:
Engine used by this process.


Copyright 1999-2007 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.