java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.layout.Pane
com.tlcsdm.core.javafx.control.PlutoExplorerExtended.ZoomDragPane
- 所有已实现的接口:
javafx.css.Styleable,javafx.event.EventTarget
private static final class PlutoExplorerExtended.ZoomDragPane
extends javafx.scene.layout.Pane
- 另请参阅:
-
属性概要
从类继承的属性 javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width从类继承的属性 javafx.scene.Parent
needsLayout从类继承的属性 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 -
字段概要
字段修饰符和类型字段说明private final doubleprivate final doubleprivate static final doubleprivate final doubleprivate final javafx.scene.image.ImageViewprivate int从类继承的字段 javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE从类继承的字段 javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
构造器概要
构造器限定符构造器说明privateZoomDragPane(javafx.scene.image.Image image, double prefWidth, double prefHeight) Create aPanecontainer for anImageViewwhich encapsulates all the Zoom, Drag 无效输入:'&' Rotation logic for an Image. -
方法概要
修饰符和类型方法说明private javafx.geometry.Point2DimageViewToImage(double viewX, double viewY) Calculate Mouse coordinates within the Image based on coordinates within the ImageView.private voidrotateAndScale(double previousRotation, double absoluteRotation) private voidrotateOrReset(double relativeRotation) The Image will either be rotated or the rotation will be reset to zero.private voidsetImageViewport(double x, double y, double width, double height) Store the new Coordinates 无效输入:'&' Size in the Viewport.
(making sure that the Viewport remains within the Image)private voidDrag the Viewport as the Mouse is moved.private voidzoom(javafx.scene.input.ScrollEvent scrollEvent) Zoom Event-Handler.private javafx.geometry.Point2DzoomCalculateNewViewportXY(javafx.geometry.Point2D imageMouse, double scale) To fix the Pixel @ the Mouse X-coordinate, the following is true:
(x - newViewportMinX) / (x - currentViewportMinX) = scaleprivate javafx.geometry.Dimension2DzoomCalculateViewportSize(int zoomLevel) Calculate the Viewport size for a particularzoomLevel.private voidzoomInCentredToLevel(int zoomLevel) Zoom in to the requestedzoomLevel.
(the Viewport will be centred within the Image)从类继承的方法 javafx.scene.layout.Pane
getChildren从类继承的方法 javafx.scene.layout.Region
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, 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从类继承的方法 javafx.scene.Parent
getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBounds从类继承的方法 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从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 javafx.css.Styleable
getStyleableNode
-
字段详细资料
-
MIN_PX
private static final double MIN_PX- 另请参阅:
-
zoomLevel
private int zoomLevel -
view
private final javafx.scene.image.ImageView view -
imageWidth
private final double imageWidth -
imageHeight
private final double imageHeight -
rotation90scale
private final double rotation90scale
-
-
构造器详细资料
-
ZoomDragPane
private ZoomDragPane(javafx.scene.image.Image image, double prefWidth, double prefHeight) Create aPanecontainer for anImageViewwhich encapsulates all the Zoom, Drag 无效输入:'&' Rotation logic for an Image.- 参数:
image- the Image to be displayedprefWidth- the desired width of the PaneprefHeight- the desired height of the Pane
-
-
方法详细资料
-
setMouseDraggedEventHandler
private void setMouseDraggedEventHandler()Drag the Viewport as the Mouse is moved. -
zoom
private void zoom(javafx.scene.input.ScrollEvent scrollEvent) Zoom Event-Handler. Zooms In or Out exactly 1 Level (if at all).Note.: the X-/Y-Coordinates returned by the ScrollEvent are relative-to-the-ImageView and need to be normalised to relative-to-the-Image for the Zoom 无效输入:'&' Viewport calculations.
- 参数:
scrollEvent-
-
zoomCalculateNewViewportXY
private javafx.geometry.Point2D zoomCalculateNewViewportXY(javafx.geometry.Point2D imageMouse, double scale) To fix the Pixel @ the Mouse X-coordinate, the following is true:
(x - newViewportMinX) / (x - currentViewportMinX) = scaleThe new Viewport X-coordinate is therefore given by:
newViewportMinX = x - (x - currentViewportMinX) * scaleThe new Viewport Y-coordinate is calculated similarly.
- 参数:
imageMouse- the Mouse coordinates relative to the Imagescale- the Zoom-factor- 返回:
- X-/Y-coordinate of the new Viewport
(whichsetImageViewport(double, double, double, double)will bring into Range if necessary)
-
zoomCalculateViewportSize
private javafx.geometry.Dimension2D zoomCalculateViewportSize(int zoomLevel) Calculate the Viewport size for a particularzoomLevel.- 参数:
zoomLevel- the Zoom Level- 返回:
-
zoomInCentredToLevel
private void zoomInCentredToLevel(int zoomLevel) Zoom in to the requestedzoomLevel.
(the Viewport will be centred within the Image)- 参数:
zoomLevel-
-
imageViewToImage
private javafx.geometry.Point2D imageViewToImage(double viewX, double viewY) Calculate Mouse coordinates within the Image based on coordinates within the ImageView.- 参数:
viewX- X-coordinate of the Mouse within the ImageViewviewY- Y-coordinate of the Mouse within the ImageView- 返回:
- Coordinates of the Mouse within the Image
-
setImageViewport
private void setImageViewport(double x, double y, double width, double height) Store the new Coordinates 无效输入:'&' Size in the Viewport.
(making sure that the Viewport remains within the Image)- 参数:
x-y-width-height-- 另请参阅:
-
rotateOrReset
private void rotateOrReset(double relativeRotation) The Image will either be rotated or the rotation will be reset to zero.Note: this rotation logic was conceived for multiples of 90 degrees.
It can, however, handle any angle, but the rotation90scale logic would need a touch of Pythagoras.- 参数:
relativeRotation- the rotation angle, in Degrees (0 = reset to zero)
-
rotateAndScale
private void rotateAndScale(double previousRotation, double absoluteRotation)
-