public interface OrientationService
The OrientationService provides a read-only orientation property
that will be updated when the orientation of the device changes. A user of the OrientationService
can listen to changes of the orientation by registering a
ChangeListener
to the
orientation property
.
Example
Services.get(OrientationService.class).ifPresent(service -> {
Orientation orientation = service.getOrientation();
System.out.println("Current orientation: " + orientation.name());
});
Android Configuration: none
iOS Configuration: none
Type | Property and Description |
---|---|
javafx.beans.property.ReadOnlyObjectProperty<javafx.geometry.Orientation> |
orientation
A read-only property containing the current orientation of the device, which will be
updated automatically whenever the device orientation changes.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<javafx.geometry.Orientation> |
getOrientation()
Returns the current orientation of the device.
|
javafx.beans.property.ReadOnlyObjectProperty<javafx.geometry.Orientation> |
orientationProperty()
A read-only property containing the current orientation of the device, which will be
updated automatically whenever the device orientation changes.
|
javafx.beans.property.ReadOnlyObjectProperty<javafx.geometry.Orientation> orientationProperty
getOrientation()
javafx.beans.property.ReadOnlyObjectProperty<javafx.geometry.Orientation> orientationProperty()
getOrientation()
java.util.Optional<javafx.geometry.Orientation> getOrientation()