Class SceneView
- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- com.esri.arcgisruntime.mapping.view.GeoView
-
- com.esri.arcgisruntime.mapping.view.SceneView
-
- All Implemented Interfaces:
SceneViewNavigation
,Styleable
,EventTarget
,Skinnable
public final class SceneView extends GeoView implements SceneViewNavigation
A SceneView renders data from an ArcGISScene in 3-dimensional space and allows users to interact with the scene. In an MVC architecture, a SceneView represents the view and an ArcGISScene represents the model. This class must only be created and used on the UI thread.ArcGISScene scene = new ArcGISScene(Basemap.createImagery()); SceneView sceneView = new SceneView(); sceneView.setArcGISScene(scene);
- Since:
- 100.0.0
- See Also:
ArcGISScene
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SceneView.DefaultInteractionListener
Default listener to handle input events on the scene view.
-
Field Summary
-
Fields inherited from class com.esri.arcgisruntime.mapping.view.GeoView
mCallout, mGeoViewImpl
-
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
-
Constructor Summary
Constructors Constructor Description SceneView()
Creates a new scene view
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAmbientLightColor()
Returns the color of the ambient light.ListenableList<AnalysisOverlay>
getAnalysisOverlays()
Gets a modifiable list of the analysis overlays.ArcGISScene
getArcGISScene()
Gets theArcGISScene
displayed in this view.AtmosphereEffect
getAtmosphereEffect()
Returns the atmosphere effect on the scene view.CameraController
getCameraController()
Gets the current camera controller.Camera
getCurrentViewpointCamera()
Gets the current camera.List<ImageOverlay>
getImageOverlays()
Gets a modifiable list of overlays for displaying images in the scene view.SpaceEffect
getSpaceEffect()
Gets the space effect on the scene view.SpatialReference
getSpatialReference()
Gets the spatial reference.LightingMode
getSunLighting()
Returns the type of Sun lighting applied to the scene view.Calendar
getSunTime()
Returns the time that indicates the position of the Sun.LocationToScreenResult
locationToScreen(Point location)
Returns the result of converting a scene location to JavaFX local coordinates contained in aLocationToScreenResult
.Point
screenToBaseSurface(Point2D screenPoint)
Returns the scene location of a point in JavaFX local coordinates on the base surface i.e.ListenableFuture<Point>
screenToLocationAsync(Point2D screenPoint)
Asynchronously converts a screen coordinate to a location coordinate in the spatial reference of the scene view.void
setAmbientLightColor(int color)
Sets the color of the ambient light.void
setArcGISScene(ArcGISScene scene)
Sets theArcGISScene
to be displayed in this view.void
setAtmosphereEffect(AtmosphereEffect atmosphereEffect)
Sets the effect to be applied to the scene view's atmosphere.void
setCameraController(CameraController cameraController)
Sets the camera controller.void
setSpaceEffect(SpaceEffect spaceEffect)
Sets the effect to be applied to the scene view's background.void
setSunLighting(LightingMode lightingMode)
Sets the type of sun lighting to be applied to the scene view.void
setSunTime(Calendar sunTime)
Sets the position of the Sun based on time.void
setViewpointCamera(Camera camera)
Sets the viewpoint based on the given camera.ListenableFuture<Boolean>
setViewpointCameraAsync(Camera camera)
Sets the viewpoint asynchronously, based on the given camera.ListenableFuture<Boolean>
setViewpointCameraAsync(Camera camera, float durationSeconds)
Sets the viewpoint camera asynchronously with a specified animation duration.-
Methods inherited from class com.esri.arcgisruntime.mapping.view.GeoView
addAttributionTextChangedListener, addDrawStatusChangedListener, addLayerViewStateChangedListener, addNavigationChangedListener, addSpatialReferenceChangedListener, addTimeExtentChangedListener, addViewpointChangedListener, attributionTextVisibleProperty, attributionTopProperty, createDefaultSkin, dispose, enableKeyboardNavigationProperty, enableMousePanProperty, enableMouseZoomProperty, enableTouchPanProperty, enableTouchRotateProperty, enableTouchZoomProperty, exportImageAsync, getAttributionText, getAttributionTop, getCallout, getCurrentViewpoint, getDrawStatus, getGraphicsOverlays, getInteractionListener, getLabeling, getLayerViewState, getSelectionProperties, getTimeExtent, getViewStateForLayer, identifyGraphicsOverlayAsync, identifyGraphicsOverlayAsync, identifyGraphicsOverlaysAsync, identifyGraphicsOverlaysAsync, identifyLayerAsync, identifyLayerAsync, identifyLayersAsync, identifyLayersAsync, isAttributionTextVisible, isEnableKeyboardNavigation, isEnableMousePan, isEnableMouseZoom, isEnableTouchPan, isEnableTouchRotate, isEnableTouchZoom, isLogoVisible, isNavigating, isResizable, isWrapAroundEnabled, removeAttributionTextChangedListener, removeDrawStatusChangedListener, removeLayerViewStateChangedListener, removeNavigationChangedListener, removeSpatialReferenceChangedListener, removeTimeExtentChangedListener, removeViewpointChangedListener, setAttributionTextVisible, setBookmarkAsync, setEnableKeyboardNavigation, setEnableMousePan, setEnableMouseZoom, setEnableTouchPan, setEnableTouchRotate, setEnableTouchZoom, setInteractionListener, setLabeling, setLogoVisible, setTimeExtent, setViewpoint, setViewpointAsync, setViewpointAsync
-
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
-
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.esri.arcgisruntime.mapping.view.SceneViewNavigation
addDrawStatusChangedListener, addNavigationChangedListener, getCurrentViewpoint, removeDrawStatusChangedListener, removeNavigationChangedListener, setViewpoint, setViewpointAsync, setViewpointAsync
-
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
-
-
-
Method Detail
-
setArcGISScene
public void setArcGISScene(ArcGISScene scene)
Sets theArcGISScene
to be displayed in this view. Null is allowed.- Parameters:
scene
- the new ArcGISScene- Since:
- 100.0.0
-
getArcGISScene
public ArcGISScene getArcGISScene()
Gets theArcGISScene
displayed in this view.- Returns:
- the ArcGISScene
- Since:
- 100.0.0
-
setViewpointCamera
public void setViewpointCamera(Camera camera)
Sets the viewpoint based on the given camera.- Specified by:
setViewpointCamera
in interfaceSceneViewNavigation
- Parameters:
camera
- the camera to set- Throws:
IllegalArgumentException
- if camera is null- Since:
- 100.0.0
-
setViewpointCameraAsync
public ListenableFuture<Boolean> setViewpointCameraAsync(Camera camera)
Sets the viewpoint asynchronously, based on the given camera.- Parameters:
camera
- the new viewpoint camera- Returns:
- a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
- Throws:
IllegalArgumentException
- if the camera is null- Since:
- 100.0.0
-
setViewpointCameraAsync
public ListenableFuture<Boolean> setViewpointCameraAsync(Camera camera, float durationSeconds)
Sets the viewpoint camera asynchronously with a specified animation duration.- Parameters:
camera
- the new viewpoint cameradurationSeconds
- the duration seconds- Returns:
- a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
- Throws:
IllegalArgumentException
- if the camera is null- Since:
- 100.0.0
-
getCurrentViewpointCamera
public Camera getCurrentViewpointCamera()
Gets the current camera.- Specified by:
getCurrentViewpointCamera
in interfaceSceneViewNavigation
- Returns:
- the current camera
- Since:
- 100.0.0
-
getSpatialReference
public SpatialReference getSpatialReference()
Gets the spatial reference.- Specified by:
getSpatialReference
in classGeoView
- Returns:
- the spatial reference, null if the ArcGISScene is null
- Since:
- 100.0.0
-
setAmbientLightColor
public void setAmbientLightColor(int color)
Sets the color of the ambient light.- Parameters:
color
- the color of the ambient light, in 0xAARRGGBB format- Since:
- 100.0.0
-
getAmbientLightColor
public int getAmbientLightColor()
Returns the color of the ambient light. Default is 0.- Returns:
- the color of the ambient light, in 0xAARRGGBB format
- Since:
- 100.0.0
-
setAtmosphereEffect
public void setAtmosphereEffect(AtmosphereEffect atmosphereEffect)
Sets the effect to be applied to the scene view's atmosphere.- Parameters:
atmosphereEffect
- the atmosphere effect- Throws:
IllegalArgumentException
- if atmosphereEffect is null- Since:
- 100.0.0
-
getAtmosphereEffect
public AtmosphereEffect getAtmosphereEffect()
Returns the atmosphere effect on the scene view. The default value isAtmosphereEffect.HORIZON_ONLY
.- Returns:
- the atmosphere effect on the scene view
- Since:
- 100.0.0
-
setSunTime
public void setSunTime(Calendar sunTime)
Sets the position of the Sun based on time.- Parameters:
sunTime
- the time to use to calculate the Sun's position- Throws:
IllegalArgumentException
- if sunTime is null- Since:
- 100.0.0
- See Also:
setSunLighting(com.esri.arcgisruntime.mapping.view.LightingMode)
-
getSunTime
public Calendar getSunTime()
Returns the time that indicates the position of the Sun. Default is Fri Sep 22 2000 12:00:00 GMT+0000.- Returns:
- the time that indicates the position of the Sun
- Since:
- 100.0.0
-
setSunLighting
public void setSunLighting(LightingMode lightingMode)
Sets the type of sun lighting to be applied to the scene view. For example, this can be used to control whether the shadows of terrain and 3D models are cast.- Parameters:
lightingMode
- the lighting mode to be applied for this scene view- Throws:
IllegalArgumentException
- if lightingMode is null- Since:
- 100.0.0
- See Also:
setSunTime(java.util.Calendar)
-
getSunLighting
public LightingMode getSunLighting()
Returns the type of Sun lighting applied to the scene view. Default isLightingMode.NO_LIGHT
.- Returns:
- the type of Sun lighting
- Since:
- 100.0.0
-
locationToScreen
public LocationToScreenResult locationToScreen(Point location)
Returns the result of converting a scene location to JavaFX local coordinates contained in aLocationToScreenResult
.- Specified by:
locationToScreen
in interfaceSceneViewNavigation
- Parameters:
location
- the scene location to convert to a screen point- Returns:
- the location to screen result
- Throws:
IllegalArgumentException
- if location is null- Since:
- 100.0.0
-
screenToBaseSurface
public Point screenToBaseSurface(Point2D screenPoint)
Returns the scene location of a point in JavaFX local coordinates on the base surface i.e. ignoring any elevation.- Specified by:
screenToBaseSurface
in interfaceSceneViewNavigation
- Parameters:
screenPoint
- the JavaFX local coordinates- Returns:
- the scene location on the base surface
- Throws:
IllegalArgumentException
- if screenPoint is null- Since:
- 100.0.0
-
screenToLocationAsync
public ListenableFuture<Point> screenToLocationAsync(Point2D screenPoint)
Asynchronously converts a screen coordinate to a location coordinate in the spatial reference of the scene view. This method will wait for the next drawing cycle to get the exact point (location coordinate) from the graphic card that is at this JavaFX local coordinate (screen coordinate). That could be on the surface, on a building, or on a feature, e.g. aircraft.This is a high performance calculation executed on the GPU using a triangular mesh. Note that elevation values are approximated, and as the distance between the camera and the surface increases, the precision of the elevation value decreases.
- Parameters:
screenPoint
- the JavaFX local coordinates- Returns:
- a ListenableFuture. Add a listener to this to know when the result is ready. The result of the future is the location of the screen point.
- Throws:
IllegalArgumentException
- if screenPoint is null- Since:
- 100.0.0
-
setCameraController
public void setCameraController(CameraController cameraController)
Sets the camera controller. The default is an instance ofGlobeCameraController
.- Parameters:
cameraController
- camera controller- Throws:
IllegalArgumentException
- if cameraController is null- Since:
- 100.1.0
-
getCameraController
public CameraController getCameraController()
Gets the current camera controller. The default is an instance ofGlobeCameraController
.- Returns:
- the current camera controller
- Since:
- 100.1.0
-
getAnalysisOverlays
public ListenableList<AnalysisOverlay> getAnalysisOverlays()
Gets a modifiable list of the analysis overlays. Add or remove analysis overlays from this list to modify what is displayed. The list returned can be empty but not null. You can add listeners to this list to monitor changes to the list.An analysis overlay can only be in the list once.
- Returns:
- the analysis overlays
- Since:
- 100.2.0
-
getSpaceEffect
public SpaceEffect getSpaceEffect()
Gets the space effect on the scene view. The default value is SpaceEffect.STARS.- Returns:
- the space effect on the scene view
- Since:
- 100.6.0
-
setSpaceEffect
public void setSpaceEffect(SpaceEffect spaceEffect)
Sets the effect to be applied to the scene view's background.- Parameters:
spaceEffect
- the space effect- Throws:
IllegalArgumentException
- if spaceEffect is null- Since:
- 100.6.0
-
getImageOverlays
public List<ImageOverlay> getImageOverlays()
Gets a modifiable list of overlays for displaying images in the scene view.An image overlay collection cannot belong to more than one SceneView. If the collection contains multiple image overlays, they display in the order in which they were added to the collection. So the first overlay in the collection (at index 0) displays at the bottom and each one that follows displays on top of the previous ones. If the SceneView also has a GraphicsOverlay, it displays on top of the ImageOverlay.
- Returns:
- the image overlays
- Since:
- 100.8.0
-
-