Class TLspFXCompassNavigationControl
java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.layout.Pane
javafx.scene.layout.AnchorPane
com.luciad.view.lightspeed.javafx.navigationcontrols.TLspFXCompassNavigationControl
- All Implemented Interfaces:
Styleable
,EventTarget
A Node to control a
TLspFXView
in the following ways:
- Rotating the map can be done by dragging the outer ring. The rotation can be reset by clicking the north indicator.
- The central area off the control can be used to pan the map. In a 3D view this can also be used to change the pitch off the camera.
Customizing the appearance
The appearance of this control is specified by a number of images. The active appearance is only used when the mouse hovers over the component.The exact appearance is specified by the following images in png format:
- compass_arrows_inactive.png: the arrows that indicate the compass direction, when the navigation control is inactive.
- compass_circles_inactive.png: The center of the navigation control when it's inactive. This image will be used when the control is not in pan mode.
- compass_arrows.png: the arrows that indicate the compass direction, when the navigation control is active
- compass_circles.png: The center of the navigation control when it's active. This image will be used when the contol is not in pan mode.
- compass_indicator_selected.png: the north arrow when the mouse hovers over it.
- compass_direction.png: the direction indicator when pressing or dragging the mouse over the control.
- compass_ring_inactive.png: the draggable rotation ring when it isn't used.
- compass_ring.png: the draggable rotation ring when it is used.
Example
The following snippet adds the compass control to the overlay panel of a view. //Create a compass control for the view
TLspFXCompassNavigationControl compassControl = new TLspFXCompassNavigationControl(view);
//Get the overlay panel from the view and add the control to it
view.getOverlayNodes().stream()
.filter(TLcdOverlayPane.class::isInstance)
.map(TLcdOverlayPane.class::cast)
.findFirst()
.ifPresent(aOverlayPane -> aOverlayPane.add(compassControl, TLcdOverlayPane.Location.SOUTH_EAST));
- Since:
- 2021.0
-
Property Summary
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default name of the subfolder in the navigation controls image folder containing all compass panel images.static final String
Default name of the subfolder in the navigation controls image folder containing all compass panel images when the compass panel will be used for panning (in 2D for example).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
ConstructorDescriptionA constructor for the compass component of the navigation controls for aTLspFXView
.TLspFXCompassNavigationControl
(TLspFXView aView, boolean aPan) A constructor for the compass component of the navigation controls for aTLspFXView
.TLspFXCompassNavigationControl
(TLspFXView aView, boolean aPan, String aImagePath) A constructor for the compass component of the navigation controls for aTLspFXView
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the magnetic north map to be used to point to the magnetic north.double
Gets the maximum duration of the animation used when resetting the orientation to north.double
Gets the minimum duration of the animation used when resetting the orientation to north.boolean
Returns what view navigation happens when the inside ring of the compass navigation is used.void
setInnerRingPan
(boolean aInnerRingPan) Indicates what view navigation needs to happen when the inside ring of the compass navigation is used.void
setMagneticNorthMap
(ILcdMagneticNorthMap aMagneticNorthMap) Lets the compass point to the magnetic north instead of true north, using the given magnetic north map.void
setMaxAnimationDuration
(double aMaxAnimationDuration) Sets the maximum duration of the animation used when resetting the orientation to north.void
setMinAnimationDuration
(double aMinAnimationDuration) Sets the minimum duration of the animation used when resetting the orientation to north.Methods inherited from class javafx.scene.layout.AnchorPane
clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBottomAnchor, getLeftAnchor, getRightAnchor, getTopAnchor, layoutChildren, setBottomAnchor, setLeftAnchor, setRightAnchor, setTopAnchor
Methods inherited from class javafx.scene.layout.Pane
getChildren
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, 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
getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, 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, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, 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, isFocusVisible, isFocusWithin, 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 javafx.css.Styleable
getStyleableNode
-
Field Details
-
COMPASS_COMPONENT_DIR
Default name of the subfolder in the navigation controls image folder containing all compass panel images.- See Also:
-
COMPASSPAN_COMPONENT_DIR
Default name of the subfolder in the navigation controls image folder containing all compass panel images when the compass panel will be used for panning (in 2D for example). The default images show a hand instead of an eye then.- See Also:
-
-
Constructor Details
-
TLspFXCompassNavigationControl
A constructor for the compass component of the navigation controls for aTLspFXView
.- Parameters:
aView
- The view this panel will interact with.- Throws:
IOException
- when one of the necessary images is missing.
-
TLspFXCompassNavigationControl
A constructor for the compass component of the navigation controls for aTLspFXView
.- Parameters:
aView
- the view this panel will interact with.aPan
- determines whether the inner ring of the compass is used for panning.- Throws:
IOException
- when one of the necessary images is missing.
-
TLspFXCompassNavigationControl
public TLspFXCompassNavigationControl(TLspFXView aView, boolean aPan, String aImagePath) throws IOException A constructor for the compass component of the navigation controls for aTLspFXView
. The default image path is usually the path to the root folder of the navigation controls +COMPASS_COMPONENT_DIR
orCOMPASSPAN_COMPONENT_DIR
. The directoryCOMPASSPAN_COMPONENT_DIR
should contain a set of images to be used when the compass will be able to pan the view. These constants can be used by factory methods to create a complete set of navigation controls with a single path to a root folder.- Parameters:
aView
- the view this panel will interact with.aPan
- determines whether the inner ring of the compass is used for panning.aImagePath
- the (relative or absolute) path to the directory where the images are stored. For relative paths, the classpath and the working directory are searched.- Throws:
IOException
- when one of the necessary images is missing.
-
-
Method Details
-
getMinAnimationDuration
public double getMinAnimationDuration()Gets the minimum duration of the animation used when resetting the orientation to north.- Returns:
- the minimum duration in seconds.
- See Also:
-
setMinAnimationDuration
public void setMinAnimationDuration(double aMinAnimationDuration) Sets the minimum duration of the animation used when resetting the orientation to north. The actual duration will be linearly interpolated between the minimum and maximum duration based in the difference between the current angle and the north.By default, the minimum duration is
0.5
second. Set both this and thesetMaxAnimationDuration(double)
maximum duration } to0
if no animation is required.- Parameters:
aMinAnimationDuration
- expressed in seconds.- See Also:
-
getMaxAnimationDuration
public double getMaxAnimationDuration()Gets the maximum duration of the animation used when resetting the orientation to north.- Returns:
- the minimum duration in seconds.
- See Also:
-
setMaxAnimationDuration
public void setMaxAnimationDuration(double aMaxAnimationDuration) Sets the maximum duration of the animation used when resetting the orientation to north. The actual duration will be linearly interpolated between the minimum and maximum duration based on the difference between the current angle and the north.By default, the duration is
1.5
second. et both this and thesetMinAnimationDuration(double)
minimum duration } to0
if no animation is required.- Parameters:
aMaxAnimationDuration
- expressed in seconds.- See Also:
-
isInnerRingPan
public boolean isInnerRingPan()Returns what view navigation happens when the inside ring of the compass navigation is used.false
will trigger rotation (and pitching in a 3D view). This is the default.true
will trigger panning.
- Returns:
- the current behavior,
true
for panning,false
for rotation
-
setInnerRingPan
public void setInnerRingPan(boolean aInnerRingPan) Indicates what view navigation needs to happen when the inside ring of the compass navigation is used.false
will trigger rotation (and pitching in a 3D view). This is the default.true
will trigger panning.
- Parameters:
aInnerRingPan
-true
for panning,false
for rotation
-
setMagneticNorthMap
Lets the compass point to the magnetic north instead of true north, using the given magnetic north map.- Parameters:
aMagneticNorthMap
- the map to use. If null, the compass will point to the true north
-
getMagneticNorthMap
Returns the magnetic north map to be used to point to the magnetic north.- Returns:
- the map to use. If null, the compass will point to the true north
-