Class MobileAccelerometerService
- java.lang.Object
-
- com.gluonhq.attach.accelerometer.impl.MobileAccelerometerService
-
- All Implemented Interfaces:
AccelerometerService
- Direct Known Subclasses:
AndroidAccelerometerService
,IOSAccelerometerService
public abstract class MobileAccelerometerService extends java.lang.Object implements AccelerometerService
-
-
Field Summary
Fields Modifier and Type Field Description protected static javafx.beans.property.ReadOnlyObjectWrapper<Acceleration>
reading
-
Fields inherited from interface com.gluonhq.attach.accelerometer.AccelerometerService
DEFAULT_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description MobileAccelerometerService()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ReadOnlyObjectProperty<Acceleration>
accelerationProperty()
A frequently-updated reading from the accelerometer.Acceleration
getCurrentAcceleration()
Returns a single reading from the accelerometer.void
start()
Starts the service withAccelerometerService.DEFAULT_PARAMETERS
.void
start(Parameters parameters)
Starts the service with given parameters.protected abstract void
startAccelerometerImpl(boolean isFilterGravity, double frequency)
void
stop()
Stops the service.protected abstract void
stopAccelerometerImpl()
protected static java.time.LocalDateTime
toLocalDateTime(double t)
-
-
-
Field Detail
-
reading
protected static final javafx.beans.property.ReadOnlyObjectWrapper<Acceleration> reading
-
-
Method Detail
-
getCurrentAcceleration
public Acceleration getCurrentAcceleration()
Description copied from interface:AccelerometerService
Returns a single reading from the accelerometer.- Specified by:
getCurrentAcceleration
in interfaceAccelerometerService
- Returns:
- the current accelerometer reading
-
accelerationProperty
public javafx.beans.property.ReadOnlyObjectProperty<Acceleration> accelerationProperty()
Description copied from interface:AccelerometerService
A frequently-updated reading from the accelerometer.- Specified by:
accelerationProperty
in interfaceAccelerometerService
- Returns:
- A property containing a frequently-updated accelerometer reading.
-
start
public void start()
Description copied from interface:AccelerometerService
Starts the service withAccelerometerService.DEFAULT_PARAMETERS
.- Specified by:
start
in interfaceAccelerometerService
-
start
public void start(Parameters parameters)
Description copied from interface:AccelerometerService
Starts the service with given parameters.- Specified by:
start
in interfaceAccelerometerService
- Parameters:
parameters
- Parameters for configuring the service
-
stop
public void stop()
Description copied from interface:AccelerometerService
Stops the service.- Specified by:
stop
in interfaceAccelerometerService
-
toLocalDateTime
protected static java.time.LocalDateTime toLocalDateTime(double t)
-
startAccelerometerImpl
protected abstract void startAccelerometerImpl(boolean isFilterGravity, double frequency)
-
stopAccelerometerImpl
protected abstract void stopAccelerometerImpl()
-
-