javax.microedition.location
Class Orientation

java.lang.Object
  extended byjavax.microedition.location.Orientation

public class Orientation
extends Object

The Orientation class represents the physical orientation of the terminal. Orientation is described by bearing (the horizontal pointing direction), pitch (the vertical elevation angle) and roll (the rotation of the terminal around its own longitudinal axis). It is not expected that all terminals will support all of these parameters. If a terminal supports getting the Orientation, it MUST provide the compass bearing information. Providing the pitch and roll is optional. Most commonly, this class will be used to obtain the current compass direction. It is up to the terminal to define its own axes, but it is generally recommended that the longitudinal axis is aligned with the bottom-to-top direction of the screen. No accuracy data is given for Orientation. This class is only a container for the information. The constructor does not validate the parameters passed in but just retains the values. The get* methods return the values passed in the constructor. When the platform implementation returns Orientation objects, it MUST ensure that it only returns objects where the parameters have values set as described for their semantics in this class.

Version:
0.1, 26 march 2003
Author:
donsez

Field Summary
protected  float bearing
           
protected  boolean isMagnetic
           
protected  float pitch
           
protected  float roll
           
 
Constructor Summary
Orientation(float bearing, boolean isMagnetic, float pitch, float roll)
          Constructs a new Orientation object with the bearing, pitch and roll parameters specified.
 
Method Summary
 float getCompassBearing()
          Returns the terminal's surface orientation in degrees relative to either magnetic or true north.
static Orientation getOrientation()
          Returns the terminal's current orientation.
 float getPitch()
          Returns the terminal's tilt in degrees defined as an angle in the vertical plane orthogonal to the ground, and through the longitudinal axis of the terminal.
 float getRoll()
          Returns the terminal's rotation in degrees around its own longitudinal axis.
 boolean isOrientationMagnetic()
          Returns a boolean value that indicates whether this Orientation is relative to the magnetic field of the Earth or relative to true north and gravity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bearing

protected float bearing

isMagnetic

protected boolean isMagnetic

pitch

protected float pitch

roll

protected float roll
Constructor Detail

Orientation

public Orientation(float bearing,
                   boolean isMagnetic,
                   float pitch,
                   float roll)
Constructs a new Orientation object with the bearing, pitch and roll parameters specified.

Method Detail

getCompassBearing

public float getCompassBearing()
Returns the terminal's surface orientation in degrees relative to either magnetic or true north.


getOrientation

public static Orientation getOrientation()
Returns the terminal's current orientation.


getPitch

public float getPitch()
Returns the terminal's tilt in degrees defined as an angle in the vertical plane orthogonal to the ground, and through the longitudinal axis of the terminal.


getRoll

public float getRoll()
Returns the terminal's rotation in degrees around its own longitudinal axis.


isOrientationMagnetic

public boolean isOrientationMagnetic()
Returns a boolean value that indicates whether this Orientation is relative to the magnetic field of the Earth or relative to true north and gravity.