Errai 3.0.1-SNAPSHOT

org.jboss.errai.orientation.client.local
Class Html5OrientationDetector

java.lang.Object
  extended by org.jboss.errai.orientation.client.local.Html5OrientationDetector
All Implemented Interfaces:
OrientationDetector

public class Html5OrientationDetector
extends Object
implements OrientationDetector

Detects device orientation through the official HTML 5 API, periodically firing CDI events with the latest orientation info.

Author:
Jonathan Fuerth

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.errai.orientation.client.local.OrientationDetector
OrientationDetector.OrientationDetectorProvider
 
Constructor Summary
Html5OrientationDetector()
           
 
Method Summary
 void fireOrientationEvent(double x, double y, double z)
           
 void setOrientationEventSource(javax.enterprise.event.Event<OrientationEvent> orientationEventSource)
          The provider class that creates the detector calls this method to give us a means of firing the event.
 void startFiringOrientationEvents()
          Starts the periodic firing of CDI OrientationEvents.
 void stopFiringOrientationEvents()
          Stops the periodic firing of CDI OrientationEvents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Html5OrientationDetector

public Html5OrientationDetector()
Method Detail

fireOrientationEvent

public void fireOrientationEvent(double x,
                                 double y,
                                 double z)
Specified by:
fireOrientationEvent in interface OrientationDetector

stopFiringOrientationEvents

public void stopFiringOrientationEvents()
Description copied from interface: OrientationDetector
Stops the periodic firing of CDI OrientationEvents. If this detector was already in the stopped state, calling this method has no effect.

Specified by:
stopFiringOrientationEvents in interface OrientationDetector

startFiringOrientationEvents

public void startFiringOrientationEvents()
Description copied from interface: OrientationDetector
Starts the periodic firing of CDI OrientationEvents. If this detector was already in the started state, calling this method has no effect.

Specified by:
startFiringOrientationEvents in interface OrientationDetector

setOrientationEventSource

public void setOrientationEventSource(javax.enterprise.event.Event<OrientationEvent> orientationEventSource)
Description copied from interface: OrientationDetector
The provider class that creates the detector calls this method to give us a means of firing the event.

Specified by:
setOrientationEventSource in interface OrientationDetector

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.