Class ZoomableCanvas<T extends InformedIterable<?> & BoundedElement2afp<?>>
- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.canvas.Canvas
-
- org.arakhne.afc.nodefx.ZoomableCanvas<T>
-
- Type Parameters:
T- the type of the document.
- All Implemented Interfaces:
javafx.css.Styleable,javafx.event.EventTarget,ZoomableViewer<T>
- Direct Known Subclasses:
GisCanvas
public class ZoomableCanvas<T extends InformedIterable<?> & BoundedElement2afp<?>> extends javafx.scene.canvas.Canvas implements ZoomableViewer<T>
Resizeable canvas for rendering a document and that support zoom in and out.The document elements are displayed within this
ZoomableCanvasby thedrawersthat are declared as services.The
ZoomableCanvasprovides a tool for displaying document elements. It does not provide advanced UI components (scroll bars, etc.) and interaction means (mouse support, etc.).- 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
-
-
Field Summary
-
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 ZoomableCanvas()Constructor.ZoomableCanvas(T model)Constructor.ZoomableCanvas(T model, Drawer<? super T> drawer)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDrawingListener(DrawingListener listener)Add a drawing listener.protected voidbindModel(T model)Invoked when the given model is binded to this canvas.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.IntegerPropertydrawableElementBudgetProperty()Replies the property that defines the maximal number of drawable elements to be render.voiddrawContent()Refresh the content of the viewer in order to have a new image drawn.protected voidfireDrawingEnd()Notifies listeners on drawing finishing.protected voidfireDrawingStart()Notifies listeners on drawing start.Rectangle2afp<?,?,?,?,?,?>getDocumentBounds()Replies the bounds of the document.Drawer<? super T>getDocumentDrawer()Replies the drawer of the document.ZoomableGraphicsContextgetDocumentGraphicsContext2D()Replies the document graphics context.TgetDocumentModel()Replies the model of the document.intgetDrawableElementBudget()Replies the maximal number of drawable elements to be render.doublegetMaxScaleValue()Replies the maximum scale value.doublegetMinScaleValue()Replies the minimum scale value.doublegetScaleChange()Replies the delta value that is applied when zooming in or out.doublegetScaleValue()Replies the scale value.doublegetScaleValueToFit(boolean minimizeOnly)Replies the scale value to fit the content to the viewport.Rectangle2afp<?,?,?,?,?,?>getViewportBounds()Replies the bounds of the viewport in document coordinates.doublegetViewportCenterX()Replies the x coordinate of the viewport center in document coordinates.doublegetViewportCenterY()Replies the y coordinate of the viewport center in document coordinates.javafx.beans.property.BooleanPropertyinvertedAxisXProperty()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.BooleanPropertyinvertedAxisYProperty()Replies the property that indicates if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.booleanisInvertedAxisX()Replies if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.booleanisInvertedAxisY()Replies if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.booleanisRenderingEnable()Replies the rendering state of the canvas.booleanisResizable()doublemaxHeight(double width)javafx.beans.property.DoublePropertymaxScaleValueProperty()Replies the property for the maximum scale value.doublemaxWidth(double height)doubleminHeight(double width)javafx.beans.property.DoublePropertyminScaleValueProperty()Replies the property for the minimum scale value.doubleminWidth(double height)doubleprefHeight(double width)doubleprefWidth(double height)voidremoveDrawingListener(DrawingListener listener)Remove a drawing listener.voidresize(double width, double height)javafx.beans.property.DoublePropertyscaleChangeProperty()Replies the property for the delta value that is applied when zooming in or out.javafx.beans.property.DoublePropertyscaleValueProperty()Replies the property for the scale value.voidsetDocumentDrawer(Drawer<? super T> drawer)Change the drawer of the document.voidsetDocumentModel(T model)Change the model of the document.voidsetDrawableElementBudget(int budget)Change the maximal number of drawable elements to be render.voidsetInvertedAxisX(boolean inverted)Change the flag if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.voidsetInvertedAxisY(boolean inverted)Change the flag if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.voidsetMaxScaleValue(double value)Change the maximum scale value.voidsetMinScaleValue(double value)Change the minimum scale value.protected booleansetRenderingEnable(boolean newState)Change the rendering state of the canvas.voidsetScaleChange(double change)Change the change factor that is applied when zooming in or out.voidsetScaleValue(double value)Change the scale value.voidsetScaleValue(double scaleValue, double centerX, double centerY)Change the zoom factor and center the view point at the given given position.voidsetViewportCenter(double x, double y)Change the coordinates of the viewport center in document coordinates.voidsetViewportCenterX(double x)Change the x coordinate of the viewport center in document coordinates.voidsetViewportCenterY(double y)Change the y coordinate of the viewport center in document coordinates.doubletoDocumentPositionX(double x)Replies the X position inside the document that corresponds to the given X position on screen.doubletoDocumentPositionY(double y)Replies the Y position inside the document that corresponds to the given Y position on screen.doubletoDocumentSize(double size)Replies the size inside the document that corresponds to the given size on screen.doubletoScreenPositionX(double x)Replies the X position on the screen that corresponds to the given X position within the document.doubletoScreenPositionY(double y)Replies the Y position on the screen that corresponds to the given Y position within the document.doubletoScreenSize(double size)Replies the size on the screen that corresponds to the given size within the document.protected voidunbindModel(T model)Invoked when the given model is unbinded from this canvas.booleanusesMirroring()javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>>viewportBoundsProperty()Replies the property that contains the viewport bounds in the document coordinates.javafx.beans.property.DoublePropertyviewportCenterXProperty()Replies the property for the x coordinate of the viewport center in document coordinates.javafx.beans.property.DoublePropertyviewportCenterYProperty()Replies the property for the y coordinate of the viewport center in document coordinates.-
Methods inherited from class javafx.scene.canvas.Canvas
getGraphicsContext2D, getHeight, getWidth, heightProperty, setHeight, setWidth, widthProperty
-
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, getBaselineOffset, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getContentBias, getCssMetaData, 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, lookup, 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, queryAccessibleAttribute, 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, 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, zoomIn, zoomOut, zoomOut
-
-
-
-
Constructor Detail
-
ZoomableCanvas
public ZoomableCanvas(T model)
Constructor. The renderer is detected with the type replied byInformedIterable.getElementType()on the model.- Parameters:
model- the source of the elements.
-
ZoomableCanvas
public ZoomableCanvas()
Constructor. The renderer is detected with the type replied byInformedIterable.getElementType()on the model.- Since:
- 16.0
-
-
Method Detail
-
isResizable
public boolean isResizable()
- Overrides:
isResizablein classjavafx.scene.Node
-
minWidth
public double minWidth(double height)
- Overrides:
minWidthin classjavafx.scene.Node
-
minHeight
public double minHeight(double width)
- Overrides:
minHeightin classjavafx.scene.Node
-
maxWidth
public double maxWidth(double height)
- Overrides:
maxWidthin classjavafx.scene.Node
-
maxHeight
public double maxHeight(double width)
- Overrides:
maxHeightin classjavafx.scene.Node
-
prefWidth
public double prefWidth(double height)
- Overrides:
prefWidthin classjavafx.scene.Node
-
prefHeight
public double prefHeight(double width)
- Overrides:
prefHeightin classjavafx.scene.Node
-
resize
public void resize(double width, double height)- Overrides:
resizein classjavafx.scene.Node
-
usesMirroring
public boolean usesMirroring()
- Overrides:
usesMirroringin classjavafx.scene.Node
-
getDocumentGraphicsContext2D
public ZoomableGraphicsContext getDocumentGraphicsContext2D()
Replies the document graphics context.- Returns:
- the graphics context.
-
isRenderingEnable
public boolean isRenderingEnable()
Replies the rendering state of the canvas.If the replied value is evaluated to
true, thedrawContent()function does nothing.- Returns:
trueif the drawing function is active;falseif it is inactive.- Since:
- 15.0
-
setRenderingEnable
protected boolean setRenderingEnable(boolean newState)
Change the rendering state of the canvas.If the replied value is evaluated to
true, thedrawContent()function does nothing.- Parameters:
newState-trueif the drawing function is active;falseif it is inactive.- Returns:
- the value of the state before the change.
- Since:
- 15.0
-
drawContent
public final void drawContent()
Description copied from interface:ZoomableViewerRefresh the content of the viewer in order to have a new image drawn.- Specified by:
drawContentin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>
-
documentModelProperty
public javafx.beans.property.ObjectProperty<T> documentModelProperty()
Description copied from interface:ZoomableViewerReplies the property that contains the document model.- Specified by:
documentModelPropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getDocumentModel
public final T getDocumentModel()
Description copied from interface:ZoomableViewerReplies the model of the document.- Specified by:
getDocumentModelin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the model of the document.
-
setDocumentModel
public final void setDocumentModel(T model)
Description copied from interface:ZoomableViewerChange the model of the document.- Specified by:
setDocumentModelin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
model- the model of the document.
-
bindModel
protected void bindModel(T model)
Invoked when the given model is binded to this canvas.This function is defined in order to be overridden by sub-classes for adding observers on the model.
- Parameters:
model- the model that is binded to this canvas.- Since:
- 16.0
-
unbindModel
protected void unbindModel(T model)
Invoked when the given model is unbinded from this canvas.This function is defined in order to be overridden by sub-classes for removing observers on the model.
- Parameters:
model- the model that is unbinded to this canvas.- Since:
- 16.0
-
documentDrawerProperty
public javafx.beans.property.ObjectProperty<Drawer<? super T>> documentDrawerProperty()
Description copied from interface:ZoomableViewerReplies the property that contains the document drawer.- Specified by:
documentDrawerPropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getDocumentDrawer
public final Drawer<? super T> getDocumentDrawer()
Description copied from interface:ZoomableViewerReplies the drawer of the document.- Specified by:
getDocumentDrawerin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the drawer of the document.
-
setDocumentDrawer
public final void setDocumentDrawer(Drawer<? super T> drawer)
Description copied from interface:ZoomableViewerChange the drawer of the document.- Specified by:
setDocumentDrawerin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
drawer- the drawer of the document.
-
documentBoundsProperty
public javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>> documentBoundsProperty()
Description copied from interface:ZoomableViewerReplies the property that contains the document bounds.- Specified by:
documentBoundsPropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getDocumentBounds
public final Rectangle2afp<?,?,?,?,?,?> getDocumentBounds()
Description copied from interface:ZoomableViewerReplies the bounds of the document.- Specified by:
getDocumentBoundsin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the bounds of the document.
-
scaleValueProperty
public javafx.beans.property.DoubleProperty scaleValueProperty()
Description copied from interface:ZoomableViewerReplies the property for the scale value.A scale value of
1is 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:
scaleValuePropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getScaleValue
public final double getScaleValue()
Description copied from interface:ZoomableViewerReplies the scale value.A scale value of
1is 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:
getScaleValuein interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the scale value.
-
setScaleValue
public final void setScaleValue(double value)
Description copied from interface:ZoomableViewerChange the scale value.A scale value of
1is 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:
setScaleValuein 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:ZoomableViewerChange the zoom factor and center the view point at the given given position.A scale value of
1is 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:
setScaleValuein 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 javafx.beans.property.DoubleProperty minScaleValueProperty()
Description copied from interface:ZoomableViewerReplies 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:
minScaleValuePropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getMinScaleValue
public final double getMinScaleValue()
Description copied from interface:ZoomableViewerReplies the minimum scale value.- Specified by:
getMinScaleValuein interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the minimum scale value.
-
setMinScaleValue
public final void setMinScaleValue(double value)
Description copied from interface:ZoomableViewerChange the minimum scale value.- Specified by:
setMinScaleValuein interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
value- the minimum scale value.
-
maxScaleValueProperty
public javafx.beans.property.DoubleProperty maxScaleValueProperty()
Description copied from interface:ZoomableViewerReplies 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:
maxScaleValuePropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getMaxScaleValue
public final double getMaxScaleValue()
Description copied from interface:ZoomableViewerReplies the maximum scale value.- Specified by:
getMaxScaleValuein interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the maximum scale value.
-
setMaxScaleValue
public final void setMaxScaleValue(double value)
Description copied from interface:ZoomableViewerChange the maximum scale value.- Specified by:
setMaxScaleValuein interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
value- the maximum scale value.
-
viewportCenterXProperty
public javafx.beans.property.DoubleProperty viewportCenterXProperty()
Description copied from interface:ZoomableViewerReplies the property for the x coordinate of the viewport center in document coordinates.- Specified by:
viewportCenterXPropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getViewportCenterX
public final double getViewportCenterX()
Description copied from interface:ZoomableViewerReplies the x coordinate of the viewport center in document coordinates.- Specified by:
getViewportCenterXin 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:ZoomableViewerChange the x coordinate of the viewport center in document coordinates.- Specified by:
setViewportCenterXin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
x- the x coordinate of the viewport center in document coordinates.
-
viewportCenterYProperty
public javafx.beans.property.DoubleProperty viewportCenterYProperty()
Description copied from interface:ZoomableViewerReplies the property for the y coordinate of the viewport center in document coordinates.- Specified by:
viewportCenterYPropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getViewportCenterY
public final double getViewportCenterY()
Description copied from interface:ZoomableViewerReplies the y coordinate of the viewport center in document coordinates.- Specified by:
getViewportCenterYin 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:ZoomableViewerChange the y coordinate of the viewport center in document coordinates.- Specified by:
setViewportCenterYin 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:ZoomableViewerChange the coordinates of the viewport center in document coordinates.- Specified by:
setViewportCenterin 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 javafx.beans.property.ReadOnlyObjectProperty<Rectangle2afp<?,?,?,?,?,?>> viewportBoundsProperty()
Description copied from interface:ZoomableViewerReplies the property that contains the viewport bounds in the document coordinates.- Specified by:
viewportBoundsPropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getViewportBounds
public final Rectangle2afp<?,?,?,?,?,?> getViewportBounds()
Description copied from interface:ZoomableViewerReplies the bounds of the viewport in document coordinates.- Specified by:
getViewportBoundsin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the bounds of the viewport.
-
getScaleValueToFit
public double getScaleValueToFit(boolean minimizeOnly)
Description copied from interface:ZoomableViewerReplies the scale value to fit the content to the viewport.- Specified by:
getScaleValueToFitin 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.
-
scaleChangeProperty
public javafx.beans.property.DoubleProperty scaleChangeProperty()
Description copied from interface:ZoomableViewerReplies the property for the delta value that is applied when zooming in or out. The value is strictly greater than 1.- Specified by:
scaleChangePropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getScaleChange
public final double getScaleChange()
Description copied from interface:ZoomableViewerReplies the delta value that is applied when zooming in or out. The value is strictly greater than 1.- Specified by:
getScaleChangein 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:ZoomableViewerChange the change factor that is applied when zooming in or out. The value is strictly greater than 1.- Specified by:
setScaleChangein interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
change- the change positive value. Only positive values greater than 1 are accepted.
-
invertedAxisXProperty
public javafx.beans.property.BooleanProperty invertedAxisXProperty()
Description copied from interface:ZoomableViewerReplies the property that indicates if the X axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
invertedAxisXPropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
isInvertedAxisX
public final boolean isInvertedAxisX()
Description copied from interface:ZoomableViewerReplies if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
isInvertedAxisXin 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:ZoomableViewerChange the flag if the x axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
setInvertedAxisXin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
inverted- the x coordinate of the viewport center in document coordinates.
-
invertedAxisYProperty
public javafx.beans.property.BooleanProperty invertedAxisYProperty()
Description copied from interface:ZoomableViewerReplies the property that indicates if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
invertedAxisYPropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
isInvertedAxisY
public final boolean isInvertedAxisY()
Description copied from interface:ZoomableViewerReplies if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
isInvertedAxisYin 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:ZoomableViewerChange the flag if the Y axis of the displayed data is inverted regarding to the standard JavaFX coordinate system.- Specified by:
setInvertedAxisYin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
inverted- the Y coordinate of the viewport center in document coordinates.
-
drawableElementBudgetProperty
public javafx.beans.property.IntegerProperty drawableElementBudgetProperty()
Description copied from interface:ZoomableViewerReplies 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:
drawableElementBudgetPropertyin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the property.
-
getDrawableElementBudget
public final int getDrawableElementBudget()
Description copied from interface:ZoomableViewerReplies the maximal number of drawable elements to be render.The value of the budget is a strictly positive number greater than 100.
- Specified by:
getDrawableElementBudgetin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Returns:
- the budget.
-
setDrawableElementBudget
public final void setDrawableElementBudget(int budget)
Description copied from interface:ZoomableViewerChange the maximal number of drawable elements to be render.The value of the budget is a strictly positive number greater than 100.
- Specified by:
setDrawableElementBudgetin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
budget- the maximal number of elements to draw.
-
addDrawingListener
public void addDrawingListener(DrawingListener listener)
Description copied from interface:ZoomableViewerAdd a drawing listener.- Specified by:
addDrawingListenerin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
listener- the listener.
-
removeDrawingListener
public void removeDrawingListener(DrawingListener listener)
Description copied from interface:ZoomableViewerRemove a drawing listener.- Specified by:
removeDrawingListenerin interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
listener- the listener.
-
fireDrawingStart
protected void fireDrawingStart()
Notifies listeners on drawing start.
-
fireDrawingEnd
protected void fireDrawingEnd()
Notifies listeners on drawing finishing.
-
toDocumentPositionX
public double toDocumentPositionX(double x)
Description copied from interface:ZoomableViewerReplies 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:
toDocumentPositionXin 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:ZoomableViewerReplies 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:
toDocumentPositionYin 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:ZoomableViewerReplies 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:
toDocumentSizein 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:ZoomableViewerReplies 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:
toScreenPositionXin 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:ZoomableViewerReplies 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:
toScreenPositionYin 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:ZoomableViewerReplies 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:
toScreenSizein interfaceZoomableViewer<T extends InformedIterable<?> & BoundedElement2afp<?>>- Parameters:
size- the size within the document.- Returns:
- the size on the screen.
-
-