public final class Viewer3d
extends javafx.scene.layout.Pane
| Constructor and Description |
|---|
Viewer3d()
Create a new 3d viewer
|
| Modifier and Type | Method and Description |
|---|---|
javafx.beans.property.ObjectProperty<javafx.scene.Node> |
contentProperty() |
javafx.beans.property.BooleanProperty |
contentRotateProperty() |
double |
getCameraPositionX() |
double |
getCameraPositionY() |
double |
getCameraPositionZ() |
double |
getCameraXRotation() |
double |
getCameraYRotation() |
double |
getCameraZRotation() |
javafx.scene.Node |
getContent()
Get the current content node
|
double |
getContentScaleX() |
double |
getContentScaleY() |
double |
getContentScaleZ() |
javafx.scene.Node |
getHoverNode() |
javafx.event.EventHandler<OpenItemEvent> |
getOpenItem() |
javafx.collections.ObservableList<javafx.scene.Node> |
getSelectedNodes() |
javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.Node> |
hoverNodeProperty() |
boolean |
isContentRotate()
Check if the content is rotating
|
protected void |
layoutChildren() |
void |
moveCameraBy(double deltaX,
double deltaY,
double deltaZ)
Move the camera by the provided deltas
|
void |
moveCameraTo(double x,
double y,
double z)
Move the camera to the provided positions
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<OpenItemEvent>> |
onOpenItemProperty()
Property slot to hold an open item handler
|
void |
reevaluate()
Reevaluate the 3d model
|
void |
resetZoom()
Reset the zoom
|
void |
rotateCameraBy(double deltaX,
double deltaY,
double deltaZ)
Rotate the camera by the provided deltas
|
void |
rotateCameraTo(double x,
double y,
double z)
Short hand for
setCameraXRotation(double),
setCameraYRotation(double) and
setCameraZRotation(double) |
void |
scaleBy(double delta)
Scale the x, y and z scale to the provided value
|
void |
scaleBy(double deltaX,
double deltaY,
double deltaZ)
Scale by x, y and z scale by the provided delta
|
void |
scaleTo(double scale)
Short hand method to
setContentScaleX(double),
setContentScaleY(double) and setContentScaleZ(double) |
void |
scaleTo(double scaleX,
double scaleY,
double scaleZ)
Short hand method to
setContentScaleX(double),
setContentScaleY(double) and setContentScaleZ(double) |
void |
setCameraPositionX(double positionX)
Set the x position of the camera
|
void |
setCameraPositionY(double positionY)
Set the y position of the camera
|
void |
setCameraPositionZ(double positionZ)
Set the z position of the camera
|
void |
setCameraXRotation(double xRotation)
Set the x rotation of the camera
|
void |
setCameraYRotation(double yRotation)
Set the y rotation of the camera
|
void |
setCameraZRotation(double zRotation)
Set the z rotation of the camera
|
void |
setContent(javafx.scene.Node node)
Set the content node
|
void |
setContentRotate(boolean rotate)
Start/Stop the rotation of the content
|
void |
setContentScaleX(double scaleX)
Set the x scale of the content
|
void |
setContentScaleY(double scaleY)
Set the y scale of the content
|
void |
setContentScaleZ(double scaleZ)
Set the z scale of the content
|
void |
setOnOpenItem(javafx.event.EventHandler<OpenItemEvent> value)
Set an open item handler
|
void |
zoomIn(double percentage)
Zoom out
|
void |
zoomOut(double percentage)
Zoom in
|
void |
zoomTo(double target,
javafx.util.Duration duration,
java.util.function.Consumer<javafx.event.ActionEvent> r)
Zoom to the target factor
|
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, 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, snapSize, snapSpace, snapToPixelProperty, widthPropertygetBaselineOffset, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processCSS, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBoundsaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, 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, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_cssGetFocusTraversableInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, 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, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visiblePropertypublic final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<OpenItemEvent>> onOpenItemProperty()
public final void setOnOpenItem(javafx.event.EventHandler<OpenItemEvent> value)
value - the new handlerpublic final javafx.event.EventHandler<OpenItemEvent> getOpenItem()
protected void layoutChildren()
layoutChildren in class javafx.scene.Parentpublic void zoomIn(double percentage)
percentage - the percentage to zoom outpublic void zoomOut(double percentage)
percentage - the percentage to zoom inpublic void resetZoom()
public void zoomTo(double target,
javafx.util.Duration duration,
java.util.function.Consumer<javafx.event.ActionEvent> r)
target - the target factorduration - the durationr - consumer called at the end of the zoomingpublic void reevaluate()
public void setCameraXRotation(double xRotation)
xRotation - the x rotationpublic double getCameraXRotation()
public void setCameraYRotation(double yRotation)
yRotation - the y rotationpublic double getCameraYRotation()
public void setCameraZRotation(double zRotation)
zRotation - the z rotationpublic double getCameraZRotation()
public void rotateCameraTo(double x,
double y,
double z)
setCameraXRotation(double),
setCameraYRotation(double) and
setCameraZRotation(double)x - the x rotationy - the y rotationz - the z rotationpublic void rotateCameraBy(double deltaX,
double deltaY,
double deltaZ)
deltaX - the x deltadeltaY - the y deltadeltaZ - the z deltapublic void setContentScaleX(double scaleX)
scaleX - the x scalepublic double getContentScaleX()
public void setContentScaleY(double scaleY)
scaleY - the y scalepublic double getContentScaleY()
public void setContentScaleZ(double scaleZ)
scaleZ - the z scalepublic double getContentScaleZ()
public void scaleTo(double scale)
setContentScaleX(double),
setContentScaleY(double) and setContentScaleZ(double)scale - the scalepublic void scaleTo(double scaleX,
double scaleY,
double scaleZ)
setContentScaleX(double),
setContentScaleY(double) and setContentScaleZ(double)scaleX - the x scalescaleY - the y scalescaleZ - the z scalepublic void scaleBy(double delta)
delta - the deltapublic void scaleBy(double deltaX,
double deltaY,
double deltaZ)
deltaX - the x deltadeltaY - the y deltadeltaZ - the z deltapublic void setCameraPositionX(double positionX)
positionX - the x positionpublic double getCameraPositionX()
public void setCameraPositionY(double positionY)
positionY - the y positionpublic double getCameraPositionY()
public void setCameraPositionZ(double positionZ)
positionZ - the z positionpublic double getCameraPositionZ()
public void moveCameraTo(double x,
double y,
double z)
x - the xy - the yz - the zpublic void moveCameraBy(double deltaX,
double deltaY,
double deltaZ)
deltaX - the x deltadeltaY - the y deltadeltaZ - the z deltapublic void setContent(javafx.scene.Node node)
node - the new content nodepublic javafx.scene.Node getContent()
public javafx.beans.property.ObjectProperty<javafx.scene.Node> contentProperty()
public boolean isContentRotate()
true if rotatingpublic void setContentRotate(boolean rotate)
rotate - the new valuepublic javafx.beans.property.BooleanProperty contentRotateProperty()
public javafx.collections.ObservableList<javafx.scene.Node> getSelectedNodes()
public javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.Node> hoverNodeProperty()
public javafx.scene.Node getHoverNode()