Class ZoomablePane<T extends InformedIterable<?> & BoundedElement2afp<?>>
- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.layout.Pane
-
- javafx.scene.layout.BorderPane
-
- org.arakhne.afc.nodefx.ZoomablePane<T>
-
- Type Parameters:
T
- the type of the document.
- All Implemented Interfaces:
javafx.css.Styleable
,javafx.event.EventTarget
,ZoomableViewer<T>
- Direct Known Subclasses:
GisPane
public class ZoomablePane<T extends InformedIterable<?> & BoundedElement2afp<?>> extends javafx.scene.layout.BorderPane implements ZoomableViewer<T>
Panel that is displaying the document elements and supporting zooming.- Since:
- 15.0
- Version:
- 17.0 2020-01-04 14:41:52
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- nodefx
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ZoomablePane.ColorSquare
The color square at the corner of aZoomablePane
.
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
IS_TOUCH_SUPPORTED
A static final reference to whether the platform we are on supports touch.-
Fields inherited from interface org.arakhne.afc.nodefx.ZoomableViewer
DEFAULT_DRAWABLE_ELEMENT_BUDGET, DEFAULT_SCALE_CHANGE, DOCUMENT_BOUNDS_PROPERTY, DOCUMENT_DRAWER_PROPERTY, DOCUMENT_MODEL_PROPERTY, DRAWABLE_ELEMENT_BUDGET_PROPERTY, INVERTED_AXIS_X_PROPERTY, INVERTED_AXIS_Y_PROPERTY, MAX_SCALE_VALUE_PROPERTY, MAXIMUM_SCALE_VALUE, MIN_DRAWABLE_ELEMENT_BUDGET, MIN_SCALE_CHANGE, MIN_SCALE_VALUE_PROPERTY, MINIMUM_SCALE_VALUE, SCALE_CHANGE_PROPERTY, SCALE_VALUE_PROPERTY, VIEWPORT_BOUNDS_PROPERTY, VIEWPORT_CENTER_X_PROPERTY, VIEWPORT_CENTER_Y_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description ZoomablePane()
Constructor with the model to be displayed.ZoomablePane(ZoomableCanvas<T> canvas)
Constructor with the canvas.ZoomablePane(T model)
Constructor with the model to be displayed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDrawingListener(DrawingListener listener)
Add a drawing listener.javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>>
documentBoundsProperty()
Replies the property that contains the document bounds.javafx.beans.property.ObjectProperty<Drawer<? super T>>
documentDrawerProperty()
Replies the property that contains the document drawer.javafx.beans.property.ObjectProperty<T>
documentModelProperty()
Replies the property that contains the document model.javafx.beans.property.IntegerProperty
drawableElementBudgetProperty()
Replies the property that defines the maximal number of drawable elements to be render.void
drawContent()
Refresh the content of the viewer in order to have a new image drawn.static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
getClassCssMetaData()
Replies the CssMetaData associated with this class, which may include the CssMetaData of its super classes.ZoomablePane.ColorSquare
getCorner()
Replies the corner pane.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
getCssMetaData()
javafx.event.EventHandler<javafx.scene.input.MouseEvent>
getDefaultOnDragDetectedEventHandler()
Replies the default event handler that may be used for starting the panning action on the panel.javafx.event.EventHandler<javafx.scene.input.MouseEvent>
getDefaultOnMouseDraggedEventHandler()
Replies the default event handler that may be used for starting the panning action on the panel.Rectangle2afp<?,?,?,?,?,?>
getDocumentBounds()
Replies the bounds of the document.ZoomableCanvas<T>
getDocumentCanvas()
Replies the document canvas within this pane.Drawer<? super T>
getDocumentDrawer()
Replies the drawer of the document.T
getDocumentModel()
Replies the model of the document.int
getDrawableElementBudget()
Replies the maximal number of drawable elements to be render.Logger
getLogger()
Replies the logger associated to this pane.double
getMaxScaleValue()
Replies the maximum scale value.double
getMinScaleValue()
Replies the minimum scale value.javafx.scene.input.MouseButton
getPanButton()
Replies the button that serves for starting the mouse scrolling.double
getPanSensitivity()
Replies the sensibility of the panning moves.double
getPanSensitivity(boolean unitSensitivityModifier, boolean hugeSensivityModifier)
Replies the sensibility of the panning moves after applying dynamic user interaction modifiers.double
getScaleChange()
Replies the delta value that is applied when zooming in or out.double
getScaleValue()
Replies the scale value.double
getScaleValueToFit(boolean minimizeOnly)
Replies the scale value to fit the content to the viewport.Rectangle2afp<?,?,?,?,?,?>
getViewportBounds()
Replies the bounds of the viewport in document coordinates.double
getViewportCenterX()
Replies the x coordinate of the viewport center in document coordinates.double
getViewportCenterY()
Replies the y coordinate of the viewport center in document coordinates.javafx.beans.property.BooleanProperty
invertedAxisXProperty()
Replies the property that indicates if the X axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.javafx.beans.property.BooleanProperty
invertedAxisYProperty()
Replies the property that indicates if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.boolean
isInvertedAxisX()
Replies if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.boolean
isInvertedAxisY()
Replies if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.boolean
isPannable()
Replies the flag that indicates if the user could be able to pan the viewport by using the mouse.javafx.beans.property.ObjectProperty<Logger>
loggerProperty()
Replies the property that contains the logger.javafx.beans.property.DoubleProperty
maxScaleValueProperty()
Replies the property for the maximum scale value.javafx.beans.property.DoubleProperty
minScaleValueProperty()
Replies the property for the minimum scale value.void
moveDown(boolean isUnit, boolean isLarge, boolean isVeryLarge)
Move the viewport down.void
moveLeft(boolean isUnit, boolean isLarge, boolean isVeryLarge)
Move the viewport left.void
moveRight(boolean isUnit, boolean isLarge, boolean isVeryLarge)
Move the viewport right.void
moveUp(boolean isUnit, boolean isLarge, boolean isVeryLarge)
Move the viewport up.javafx.beans.property.ObjectProperty<javafx.scene.input.MouseButton>
panButtonProperty()
Replies the property for the button that serves for starting the mouse scrolling.javafx.beans.property.BooleanProperty
pannableProperty()
Replies the property that indicates if the user could be able to pan the viewport by using the mouse.javafx.beans.property.DoubleProperty
panSensitivityProperty()
Replies the property that indicates the sensibility of the panning moves.void
removeDrawingListener(DrawingListener listener)
Remove a drawing listener.javafx.beans.property.DoubleProperty
scaleChangeProperty()
Replies the property for the delta value that is applied when zooming in or out.javafx.beans.property.DoubleProperty
scaleValueProperty()
Replies the property for the scale value.void
setDocumentDrawer(Drawer<? super T> drawer)
Change the drawer of the document.void
setDocumentModel(T model)
Change the model of the document.void
setDrawableElementBudget(int budget)
Change the maximal number of drawable elements to be render.void
setInvertedAxisX(boolean inverted)
Change the flag if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.void
setInvertedAxisY(boolean inverted)
Change the flag if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.void
setLogger(Logger logger)
Change the logger associated to this pane.void
setMaxScaleValue(double value)
Change the maximum scale value.void
setMinScaleValue(double value)
Change the minimum scale value.void
setPanButton(javafx.scene.input.MouseButton button)
Change the button that serves for starting the mouse scrolling.void
setPannable(boolean value)
Change the property that indicates if the user could be able to pan the viewport by using the mouse.void
setPanSensitivity(double value)
Change the sensibility of the panning moves.void
setScaleChange(double change)
Change the change factor that is applied when zooming in or out.void
setScaleValue(double value)
Change the scale value.void
setScaleValue(double scaleValue, double centerX, double centerY)
Change the zoom factor and center the view point at the given given position.protected void
setupKeying()
Setup the response of the pane to key events.protected void
setupListeners()
Setup the response based on listeners.protected void
setupMousing()
Setup the response of the pane to mouse events.void
setViewportCenter(double x, double y)
Change the coordinates of the viewport center in document coordinates.void
setViewportCenterX(double x)
Change the x coordinate of the viewport center in document coordinates.void
setViewportCenterY(double y)
Change the y coordinate of the viewport center in document coordinates.double
toDocumentPositionX(double x)
Replies the X position inside the document that corresponds to the given X position on screen.double
toDocumentPositionY(double y)
Replies the Y position inside the document that corresponds to the given Y position on screen.double
toDocumentSize(double size)
Replies the size inside the document that corresponds to the given size on screen.double
toScreenPositionX(double x)
Replies the X position on the screen that corresponds to the given X position within the document.double
toScreenPositionY(double y)
Replies the Y position on the screen that corresponds to the given Y position within the document.double
toScreenSize(double size)
Replies the size on the screen that corresponds to the given size within the document.javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>>
viewportBoundsProperty()
Replies the property that contains the viewport bounds in the document coordinates.javafx.beans.property.DoubleProperty
viewportCenterXProperty()
Replies the property for the x coordinate of the viewport center in document coordinates.javafx.beans.property.DoubleProperty
viewportCenterYProperty()
Replies the property for the y coordinate of the viewport center in document coordinates.void
zoomIn(double centerX, double centerY)
Zoom in from a specific location, and center at the view point to the given location.void
zoomOut(double centerX, double centerY)
Zoom out from a specific location, and center at the view point to the given location.-
Methods inherited from class javafx.scene.layout.BorderPane
bottomProperty, centerProperty, clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getAlignment, getBottom, getCenter, getContentBias, getLeft, getMargin, getRight, getTop, layoutChildren, leftProperty, rightProperty, setAlignment, setBottom, setCenter, setLeft, setMargin, setRight, setTop, topProperty
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, 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, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, 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, 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 org.arakhne.afc.nodefx.ZoomableViewer
getScaleValueToFit, resetScale, resetViewportCenter, setScaleValueToFit, toDocumentPosition, toDocumentPosition, toDocumentRect, toDocumentRect, toScreenPosition, toScreenPosition, toScreenRect, toScreenRect, zoomIn, zoomOut
-
-
-
-
Constructor Detail
-
ZoomablePane
public ZoomablePane()
Constructor with the model to be displayed.- Since:
- 16.0
-
ZoomablePane
public ZoomablePane(T model)
Constructor with the model to be displayed.- Parameters:
model
- the source of the elements.
-
ZoomablePane
public ZoomablePane(ZoomableCanvas<T> canvas)
Constructor with the canvas.- Parameters:
canvas
- the pre-created canvas with the model to display inside.
-
-
Method Detail
-
getClassCssMetaData
public static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getClassCssMetaData()
Replies the CssMetaData associated with this class, which may include the CssMetaData of its super classes.- Returns:
- the metadata.
-
getCssMetaData
public List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getCssMetaData()
- Specified by:
getCssMetaData
in interfacejavafx.css.Styleable
- Overrides:
getCssMetaData
in classjavafx.scene.layout.Region
-
setupListeners
protected void setupListeners()
Setup the response based on listeners.
-
getDefaultOnDragDetectedEventHandler
public javafx.event.EventHandler<javafx.scene.input.MouseEvent> getDefaultOnDragDetectedEventHandler()
Replies the default event handler that may be used for starting the panning action on the panel.- Returns:
- the event handler.
- Since:
- 15.0
-
getDefaultOnMouseDraggedEventHandler
public javafx.event.EventHandler<javafx.scene.input.MouseEvent> getDefaultOnMouseDraggedEventHandler()
Replies the default event handler that may be used for starting the panning action on the panel.- Returns:
- the event handler.
- Since:
- 15.0
-
setupMousing
protected void setupMousing()
Setup the response of the pane to mouse events.
-
setupKeying
protected void setupKeying()
Setup the response of the pane to key events.
-
moveLeft
public void moveLeft(boolean isUnit, boolean isLarge, boolean isVeryLarge)
Move the viewport left.- Parameters:
isUnit
- indicates if the move is a unit move. Iftrue
, this argument has precedence to the other arguments.isLarge
- indicates if the move is a large move. Iftrue
, this argument has precedence to the very large argument.isVeryLarge
- indicates if the move is a very large move.
-
moveRight
public void moveRight(boolean isUnit, boolean isLarge, boolean isVeryLarge)
Move the viewport right.- Parameters:
isUnit
- indicates if the move is a unit move. Iftrue
, this argument has precedence to the other arguments.isLarge
- indicates if the move is a large move. Iftrue
, this argument has precedence to the very large argument.isVeryLarge
- indicates if the move is a very large move.
-
moveUp
public void moveUp(boolean isUnit, boolean isLarge, boolean isVeryLarge)
Move the viewport up.- Parameters:
isUnit
- indicates if the move is a unit move. Iftrue
, this argument has precedence to the other arguments.isLarge
- indicates if the move is a large move. Iftrue
, this argument has precedence to the very large argument.isVeryLarge
- indicates if the move is a very large move.
-
moveDown
public void moveDown(boolean isUnit, boolean isLarge, boolean isVeryLarge)
Move the viewport down.- Parameters:
isUnit
- indicates if the move is a unit move. Iftrue
, this argument has precedence to the other arguments.isLarge
- indicates if the move is a large move. Iftrue
, this argument has precedence to the very large argument.isVeryLarge
- indicates if the move is a very large move.
-
loggerProperty
public javafx.beans.property.ObjectProperty<Logger> loggerProperty()
Replies the property that contains the logger.- Returns:
- the logger.
-
getLogger
public Logger getLogger()
Replies the logger associated to this pane.- Returns:
- the logger.
-
setLogger
public void setLogger(Logger logger)
Change the logger associated to this pane.- Parameters:
logger
- the logger.
-
pannableProperty
public javafx.beans.property.BooleanProperty pannableProperty()
Replies the property that indicates if the user could be able to pan the viewport by using the mouse. If mouse events reach theZoomablePane
(that is, if mouse events are not blocked by the contained node or one of its children) thenpannable
is consulted to determine if the events should be used for panning.- Returns:
- the property.
-
setPannable
public final void setPannable(boolean value)
Change the property that indicates if the user could be able to pan the viewport by using the mouse. If mouse events reach theZoomablePane
(that is, if mouse events are not blocked by the contained node or one of its children) thenpannable
is consulted to determine if the events should be used for panning.- Parameters:
value
-true
to enable the panning,false
to disable the panning.
-
isPannable
public final boolean isPannable()
Replies the flag that indicates if the user could be able to pan the viewport by using the mouse. If mouse events reach theZoomablePane
(that is, if mouse events are not blocked by the contained node or one of its children) thenpannable
is consulted to determine if the events should be used for panning.- Returns:
true
to enable the panning,false
to disable the panning.
-
panButtonProperty
public javafx.beans.property.ObjectProperty<javafx.scene.input.MouseButton> panButtonProperty()
Replies the property for the button that serves for starting the mouse scrolling.- Returns:
- the property.
-
getPanButton
public final javafx.scene.input.MouseButton getPanButton()
Replies the button that serves for starting the mouse scrolling.- Returns:
- the mouse button that permits to start the panning.
-
setPanButton
public final void setPanButton(javafx.scene.input.MouseButton button)
Change the button that serves for starting the mouse scrolling.- Parameters:
button
- the mouse button that permits to start the panning.
-
panSensitivityProperty
public javafx.beans.property.DoubleProperty panSensitivityProperty()
Replies the property that indicates the sensibility of the panning moves. The sensibility is a strictly positive number that is multiplied to the distance covered by the mouse motion for obtaining the move to apply to the document. The default value is 1.- Returns:
- the property.
-
setPanSensitivity
public final void setPanSensitivity(double value)
Change the sensibility of the panning moves. The sensibility is a strictly positive number that is multiplied to the distance covered by the mouse motion for obtaining the move to apply to the document. The default value is 1.- Parameters:
value
- the sensitivity.
-
getPanSensitivity
public final double getPanSensitivity()
Replies the sensibility of the panning moves. The sensibility is a strictly positive number that is multiplied to the distance covered by the mouse motion for obtaining the move to apply to the document. The default value is 1.- Returns:
- the sensitivity.
-
getPanSensitivity
public double getPanSensitivity(boolean unitSensitivityModifier, boolean hugeSensivityModifier)
Replies the sensibility of the panning moves after applying dynamic user interaction modifiers. The sensibility is a strictly positive number that is multiplied to the distance covered by the mouse motion for obtaining the move to apply to the document. The default value is 1.This function is usually used for computing the sensibility within mouse handlers. The Shift and Control key flags may be used as the modifiers.
If
unitSensitivityModifier
istrue
, the sensibility is always1
. IfhugeSensivityModifier
istrue
, the sensibility is multiplied byLARGE_MOVE_FACTOR
. Otherwise, the value returned bygetPanSensitivity()
is returned.- Parameters:
unitSensitivityModifier
- the user chooses the unit sensitivity dynamically. Iftrue
, this parameter has precedence to the other parameters.hugeSensivityModifier
- the user chooses a huge sensitivity dynamically.- Returns:
- the sensitivity.
-
getDocumentCanvas
@Pure public ZoomableCanvas<T> getDocumentCanvas()
Replies the document canvas within this pane.- Returns:
- the document canvas.
-
getCorner
@Pure public ZoomablePane.ColorSquare getCorner()
Replies the corner pane.- Returns:
- the corner pane.
-
documentModelProperty
public final javafx.beans.property.ObjectProperty<T> documentModelProperty()
Description copied from interface:ZoomableViewer
Replies the property that contains the document model.- Specified by:
documentModelProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getDocumentModel
public final T getDocumentModel()
Description copied from interface:ZoomableViewer
Replies the model of the document.- Specified by:
getDocumentModel
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the model of the document.
-
setDocumentModel
public final void setDocumentModel(T model)
Description copied from interface:ZoomableViewer
Change the model of the document.- Specified by:
setDocumentModel
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
model
- the model of the document.
-
documentDrawerProperty
public final javafx.beans.property.ObjectProperty<Drawer<? super T>> documentDrawerProperty()
Description copied from interface:ZoomableViewer
Replies the property that contains the document drawer.- Specified by:
documentDrawerProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getDocumentDrawer
public final Drawer<? super T> getDocumentDrawer()
Description copied from interface:ZoomableViewer
Replies the drawer of the document.- Specified by:
getDocumentDrawer
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the drawer of the document.
-
setDocumentDrawer
public final void setDocumentDrawer(Drawer<? super T> drawer)
Description copied from interface:ZoomableViewer
Change the drawer of the document.- Specified by:
setDocumentDrawer
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
drawer
- the drawer of the document.
-
documentBoundsProperty
public final javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>> documentBoundsProperty()
Description copied from interface:ZoomableViewer
Replies the property that contains the document bounds.- Specified by:
documentBoundsProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getDocumentBounds
public final Rectangle2afp<?,?,?,?,?,?> getDocumentBounds()
Description copied from interface:ZoomableViewer
Replies the bounds of the document.- Specified by:
getDocumentBounds
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the bounds of the document.
-
scaleValueProperty
public final javafx.beans.property.DoubleProperty scaleValueProperty()
Description copied from interface:ZoomableViewer
Replies the property for the scale value.A scale value of
1
is neither zoom in nor zoom out. A value greater than 1 is a zoom in. A value lower than 1 is a zoom out.- Specified by:
scaleValueProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getScaleValue
public final double getScaleValue()
Description copied from interface:ZoomableViewer
Replies the scale value.A scale value of
1
is neither zoom in nor zoom out. A value greater than 1 is a zoom in. A value lower than 1 is a zoom out.- Specified by:
getScaleValue
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the scale value.
-
setScaleValue
public final void setScaleValue(double value)
Description copied from interface:ZoomableViewer
Change the scale value.A scale value of
1
is neither zoom in nor zoom out. A value greater than 1 is a zoom in. A value lower than 1 is a zoom out.- Specified by:
setScaleValue
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
value
- the scale value.
-
setScaleValue
public final void setScaleValue(double scaleValue, double centerX, double centerY)
Description copied from interface:ZoomableViewer
Change the zoom factor and center the view point at the given given position.A scale value of
1
is neither zoom in nor zoom out. A value greater than 1 is a zoom in. A value lower than 1 is a zoom out.- Specified by:
setScaleValue
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
scaleValue
- the scale value.centerX
- the position along the X axis of the viewport center. Value in [0;1].centerY
- the position along the Y axis of the viewport center. Value in [0;1].
-
minScaleValueProperty
public final javafx.beans.property.DoubleProperty minScaleValueProperty()
Description copied from interface:ZoomableViewer
Replies the property for the minimum scale value.The min scale value has always precedence on the max scale value. It means that the min value becomes greater to the max value, or the max value becomes lower than the min value, the min value will be the valid reference and the max value will be changed accordingly.
- Specified by:
minScaleValueProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getMinScaleValue
public final double getMinScaleValue()
Description copied from interface:ZoomableViewer
Replies the minimum scale value.- Specified by:
getMinScaleValue
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the minimum scale value.
-
setMinScaleValue
public final void setMinScaleValue(double value)
Description copied from interface:ZoomableViewer
Change the minimum scale value.- Specified by:
setMinScaleValue
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
value
- the minimum scale value.
-
maxScaleValueProperty
public final javafx.beans.property.DoubleProperty maxScaleValueProperty()
Description copied from interface:ZoomableViewer
Replies the property for the maximum scale value.The min scale value has always precedence on the max scale value. It means that the min value becomes greater to the max value, or the max value becomes lower than the min value, the min value will be the valid reference and the max value will be changed accordingly.
- Specified by:
maxScaleValueProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getMaxScaleValue
public final double getMaxScaleValue()
Description copied from interface:ZoomableViewer
Replies the maximum scale value.- Specified by:
getMaxScaleValue
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the maximum scale value.
-
setMaxScaleValue
public final void setMaxScaleValue(double value)
Description copied from interface:ZoomableViewer
Change the maximum scale value.- Specified by:
setMaxScaleValue
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
value
- the maximum scale value.
-
viewportCenterXProperty
public final javafx.beans.property.DoubleProperty viewportCenterXProperty()
Description copied from interface:ZoomableViewer
Replies the property for the x coordinate of the viewport center in document coordinates.- Specified by:
viewportCenterXProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getViewportCenterX
public final double getViewportCenterX()
Description copied from interface:ZoomableViewer
Replies the x coordinate of the viewport center in document coordinates.- Specified by:
getViewportCenterX
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the x coordinate of the viewport center in document coordinates.
-
setViewportCenterX
public final void setViewportCenterX(double x)
Description copied from interface:ZoomableViewer
Change the x coordinate of the viewport center in document coordinates.- Specified by:
setViewportCenterX
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
x
- the x coordinate of the viewport center in document coordinates.
-
viewportCenterYProperty
public final javafx.beans.property.DoubleProperty viewportCenterYProperty()
Description copied from interface:ZoomableViewer
Replies the property for the y coordinate of the viewport center in document coordinates.- Specified by:
viewportCenterYProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getViewportCenterY
public final double getViewportCenterY()
Description copied from interface:ZoomableViewer
Replies the y coordinate of the viewport center in document coordinates.- Specified by:
getViewportCenterY
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the y coordinate of the viewport center in document coordinates.
-
setViewportCenterY
public final void setViewportCenterY(double y)
Description copied from interface:ZoomableViewer
Change the y coordinate of the viewport center in document coordinates.- Specified by:
setViewportCenterY
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
y
- the y coordinate of the viewport center in document coordinates.
-
setViewportCenter
public final void setViewportCenter(double x, double y)
Description copied from interface:ZoomableViewer
Change the coordinates of the viewport center in document coordinates.- Specified by:
setViewportCenter
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
x
- the x coordinate of the viewport center in document coordinates.y
- the y coordinate of the viewport center in document coordinates.
-
viewportBoundsProperty
public final javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>> viewportBoundsProperty()
Description copied from interface:ZoomableViewer
Replies the property that contains the viewport bounds in the document coordinates.- Specified by:
viewportBoundsProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getViewportBounds
public final Rectangle2afp<?,?,?,?,?,?> getViewportBounds()
Description copied from interface:ZoomableViewer
Replies the bounds of the viewport in document coordinates.- Specified by:
getViewportBounds
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the bounds of the viewport.
-
getScaleValueToFit
public final double getScaleValueToFit(boolean minimizeOnly)
Description copied from interface:ZoomableViewer
Replies the scale value to fit the content to the viewport.- Specified by:
getScaleValueToFit
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
minimizeOnly
- If the content fits already into the viewport, then we don't zoom if this parameter is true.- Returns:
- the scale value to apply for fitting the content to the viewport.
-
zoomOut
public final void zoomOut(double centerX, double centerY)
Description copied from interface:ZoomableViewer
Zoom out from a specific location, and center at the view point to the given location.- Specified by:
zoomOut
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
centerX
- the x coordinate on the point to zoom in.centerY
- the y coordinate on the point to zoom in.
-
zoomIn
public final void zoomIn(double centerX, double centerY)
Description copied from interface:ZoomableViewer
Zoom in from a specific location, and center at the view point to the given location.- Specified by:
zoomIn
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
centerX
- the x coordinate on the point to zoom in.centerY
- the y coordinate on the point to zoom in.
-
scaleChangeProperty
public final javafx.beans.property.DoubleProperty scaleChangeProperty()
Description copied from interface:ZoomableViewer
Replies the property for the delta value that is applied when zooming in or out. The value is strictly greater than 1.- Specified by:
scaleChangeProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getScaleChange
public final double getScaleChange()
Description copied from interface:ZoomableViewer
Replies the delta value that is applied when zooming in or out. The value is strictly greater than 1.- Specified by:
getScaleChange
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the change positive value. The value is greater than 1.
-
setScaleChange
public final void setScaleChange(double change)
Description copied from interface:ZoomableViewer
Change the change factor that is applied when zooming in or out. The value is strictly greater than 1.- Specified by:
setScaleChange
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
change
- the change positive value. Only positive values greater than 1 are accepted.
-
invertedAxisXProperty
public final javafx.beans.property.BooleanProperty invertedAxisXProperty()
Description copied from interface:ZoomableViewer
Replies the property that indicates if the X axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
invertedAxisXProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
isInvertedAxisX
public final boolean isInvertedAxisX()
Description copied from interface:ZoomableViewer
Replies if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
isInvertedAxisX
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the x coordinate of the viewport center in document coordinates.
-
setInvertedAxisX
public final void setInvertedAxisX(boolean inverted)
Description copied from interface:ZoomableViewer
Change the flag if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
setInvertedAxisX
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
inverted
- the x coordinate of the viewport center in document coordinates.
-
invertedAxisYProperty
public final javafx.beans.property.BooleanProperty invertedAxisYProperty()
Description copied from interface:ZoomableViewer
Replies the property that indicates if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
invertedAxisYProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
isInvertedAxisY
public final boolean isInvertedAxisY()
Description copied from interface:ZoomableViewer
Replies if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
isInvertedAxisY
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the Y coordinate of the viewport center in document coordinates.
-
setInvertedAxisY
public final void setInvertedAxisY(boolean inverted)
Description copied from interface:ZoomableViewer
Change the flag if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
setInvertedAxisY
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
inverted
- the Y coordinate of the viewport center in document coordinates.
-
drawableElementBudgetProperty
public final javafx.beans.property.IntegerProperty drawableElementBudgetProperty()
Description copied from interface:ZoomableViewer
Replies the property that defines the maximal number of drawable elements to be render.The value of the budget is a strictly positive number greater than 100.
- Specified by:
drawableElementBudgetProperty
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the property.
-
getDrawableElementBudget
public final int getDrawableElementBudget()
Description copied from interface:ZoomableViewer
Replies the maximal number of drawable elements to be render.The value of the budget is a strictly positive number greater than 100.
- Specified by:
getDrawableElementBudget
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Returns:
- the budget.
-
setDrawableElementBudget
public final void setDrawableElementBudget(int budget)
Description copied from interface:ZoomableViewer
Change the maximal number of drawable elements to be render.The value of the budget is a strictly positive number greater than 100.
- Specified by:
setDrawableElementBudget
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
budget
- the maximal number of elements to draw.
-
addDrawingListener
public void addDrawingListener(DrawingListener listener)
Description copied from interface:ZoomableViewer
Add a drawing listener.- Specified by:
addDrawingListener
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
listener
- the listener.
-
removeDrawingListener
public void removeDrawingListener(DrawingListener listener)
Description copied from interface:ZoomableViewer
Remove a drawing listener.- Specified by:
removeDrawingListener
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
listener
- the listener.
-
toDocumentPositionX
public double toDocumentPositionX(double x)
Description copied from interface:ZoomableViewer
Replies the X position inside the document that corresponds to the given X position on screen.The position on the screen may be the mouse position.
- Specified by:
toDocumentPositionX
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
x
- x coordinate of the position on the screen.- Returns:
- the position in the document.
-
toDocumentPositionY
public double toDocumentPositionY(double y)
Description copied from interface:ZoomableViewer
Replies the Y position inside the document that corresponds to the given Y position on screen.The position on the screen may be the mouse position.
- Specified by:
toDocumentPositionY
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
y
- y coordinate of the position on the screen.- Returns:
- the position in the document.
-
toDocumentSize
public double toDocumentSize(double size)
Description copied from interface:ZoomableViewer
Replies the size inside the document that corresponds to the given size on screen.The size on the screen is generally given in pixels.
- Specified by:
toDocumentSize
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
size
- the size on the screen.- Returns:
- the size in the document.
-
toScreenPositionX
public double toScreenPositionX(double x)
Description copied from interface:ZoomableViewer
Replies the X position on the screen that corresponds to the given X position within the document.The position on the screen may be the mouse position.
- Specified by:
toScreenPositionX
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
x
- x coordinate of the position within the document.- Returns:
- the position on the screen.
-
toScreenPositionY
public double toScreenPositionY(double y)
Description copied from interface:ZoomableViewer
Replies the Y position on the screen that corresponds to the given Y position within the document.The position on the screen may be the mouse position.
- Specified by:
toScreenPositionY
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
y
- y coordinate of the position within the document.- Returns:
- the position on the screen.
-
toScreenSize
public double toScreenSize(double size)
Description copied from interface:ZoomableViewer
Replies the size on the screen that corresponds to the given size within the document.The size on the screen is generally given in pixels.
- Specified by:
toScreenSize
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
- Parameters:
size
- the size within the document.- Returns:
- the size on the screen.
-
drawContent
public void drawContent()
Description copied from interface:ZoomableViewer
Refresh the content of the viewer in order to have a new image drawn.- Specified by:
drawContent
in interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
-
-