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.

Since:
JDE 4.7.0
See Also:
UiEngineInstance, Display

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_EAST

public static final int DIRECTION_EAST
Possible direction towards which the display may be oriented.
Since:
JDE 4.7.0

DIRECTION_LANDSCAPE

public static final int DIRECTION_LANDSCAPE
Possible direction towards which the display may be oriented.
Since:
JDE 4.7.0

DIRECTION_NORTH

public static final int DIRECTION_NORTH
Possible direction towards which the display may be oriented.
Since:
JDE 4.7.0

DIRECTION_PORTRAIT

public static final int DIRECTION_PORTRAIT
Possible direction towards which the display may be oriented.
Since:
JDE 4.7.0

DIRECTION_WEST

public static final int DIRECTION_WEST
Possible direction towards which the display may be oriented.
Since:
JDE 4.7.0

ORIENTATION_LANDSCAPE

public 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.
Since:
JDE 4.7.0

ORIENTATION_PORTRAIT

public 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.
Since:
JDE 4.7.0

ORIENTATION_SQUARE

public 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.
Since:
JDE 4.7.0
Method Detail

getOrientation

public int getOrientation()
Retrieves the graphic aspect ratio of the physical screen based on number of horizontal vs. vertical pixels.
Returns:
ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, or ORIENTATION_SQUARE.
Since:
JDE 4.7.0

setAcceptableScreenDirections

public 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 DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_WEST, DIRECTION_LANDSCAPE or 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.
Since:
JDE 4.7.0
See Also:
net.rim.device.api.ui.UiEngineInstance.setAcceptableDirections(int)



Copyright 1999-2009 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.