net.rim.device.api.lcdui.control
Interface DirectionControl

All Superinterfaces:
Control

public interface DirectionControl
extends Control

Controls the supported directions of the device display.

DIRECTION_NORTH corresponds to the direction when the top of the display is on the same side as the "BlackBerry" logo at the top of the device. The other acceptable directions, DIRECTION_EAST and DIRECTION_WEST, are similarly defined, based on standard co-ordinate systems.

This Control provides the same functionality as the UiEngineInstance and Display classes.

On BlackBerry devices running handheld software version 4.7 or greater, an object that implements the DirectionControl interface can be obtained by invoking Display.getDisplay(MIDlet), and casting the returned Display object to a Controllable object. DirectionControl features can be retrieved from this Controllable object using Controllable.getControl(java.lang.String controlType).

See Also:
UiEngineInstance, Display, Display
Since:
BlackBerry API 4.7.0

Field Summary
static int DIRECTION_EAST
          Possible direction towards which the display may be oriented.
static int DIRECTION_LANDSCAPE
          Possible direction towards which the display may be oriented.
static int DIRECTION_NORTH
          Possible direction towards which the display may be oriented.
static int DIRECTION_PORTRAIT
          Possible direction towards which the display may be oriented.
static int DIRECTION_WEST
          Possible direction towards which the display may be oriented.
static int ORIENTATION_LANDSCAPE
          Returned by getOrientation when screen resolution is greater horizontally than vertically.
static int ORIENTATION_PORTRAIT
          Returned by getOrientation when screen resolution is greater vertically than horizontally.
static int ORIENTATION_SQUARE
          Returned by getOrientation when screen resolution is the same vertically and horizontally.
 
Method Summary
 int getOrientation()
          Retrieves the graphic aspect ratio of the physical screen based on number of horizontal vs. vertical pixels.
 void setAcceptableScreenDirections(int directions)
          This function allows the setting of acceptable directions for the application, relative to the LCD.
 



Field Detail

DIRECTION_NORTH

static final int DIRECTION_NORTH
Possible direction towards which the display may be oriented.

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

DIRECTION_EAST

static final int DIRECTION_EAST
Possible direction towards which the display may be oriented.

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

DIRECTION_WEST

static final int DIRECTION_WEST
Possible direction towards which the display may be oriented.

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

DIRECTION_LANDSCAPE

static final int DIRECTION_LANDSCAPE
Possible direction towards which the display may be oriented.

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

DIRECTION_PORTRAIT

static final int DIRECTION_PORTRAIT
Possible direction towards which the display may be oriented.

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

ORIENTATION_SQUARE

static final int ORIENTATION_SQUARE
Returned by getOrientation when screen resolution is the same vertically and horizontally. This refers to the aspect ratio of the LCD in the current direction.

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

ORIENTATION_LANDSCAPE

static final int ORIENTATION_LANDSCAPE
Returned by getOrientation when screen resolution is greater horizontally than vertically. This refers to the aspect ratio of the LCD in the current direction.

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0

ORIENTATION_PORTRAIT

static final int ORIENTATION_PORTRAIT
Returned by getOrientation when screen resolution is greater vertically than horizontally. This refers to the aspect ratio of the LCD in the current direction.

See Also:
Constant Field Values
Since:
BlackBerry API 4.7.0


Method Detail

setAcceptableScreenDirections

void setAcceptableScreenDirections(int directions)
This function allows the setting of acceptable directions for the application, relative to the LCD.

The acceptable values for directions relative to the smartphone's LCD are DirectionControl.DIRECTION_NORTH, DirectionControl.DIRECTION_EAST, DirectionControl.DIRECTION_WEST, DirectionControl.DIRECTION_LANDSCAPE or DirectionControl.DIRECTION_PORTRAIT or some bit-wise ORed combination thereof, including 0. Other values will result in an IllegalArgumentException being thrown.

Parameters:
directions - The acceptable values for directions relative to the smartphone's LCD.
See Also:
UiEngineInstance.setAcceptableDirections(int)
Since:
BlackBerry API 4.7.0

getOrientation

int getOrientation()
Retrieves the graphic aspect ratio of the physical screen based on number of horizontal vs. vertical pixels.

Returns:
DirectionControl.ORIENTATION_LANDSCAPE, DirectionControl.ORIENTATION_PORTRAIT, or DirectionControl.ORIENTATION_SQUARE.
Since:
BlackBerry API 4.7.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal