Class JImageCanvas
java.lang.Object
javafx.scene.Node
javafx.scene.canvas.Canvas
org.jorigin.jfx.JImageCanvas
- All Implemented Interfaces:
javafx.css.Styleable,javafx.event.EventTarget,JImageFeatureLayerListener
A JavaFX canvas that can display images.
- Since:
- 1.0.11
- Version:
- "1.0.14" - b202111241200L
- Author:
- Julien SEINTURIER - Université de Toulon / CNRS LIS umr 7020 - github.com/jorigin/jcommon (contact@jorigin.org)
-
Property Summary
Properties inherited from class javafx.scene.canvas.Canvas
height, widthProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intImage is scaled in order to fit longest dimension.static final intImage is scaled in x and Y in order to fit the canvas.static final intImage is scaled in order to the image height is fitting the canvas height.static final intNo fit is applied to the image when displayed.static final intImage is scaled in order to the image width is fitting the canvas width.static final intA mask that enable to check if a selection is active.static final intNo selection mode activated.static final intThe selection with point mode.static final intThe selection with polygon mode.static final StringThe image feature selection mode property name.static final intThe selection with rectangle mode.Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new image canvas with no attached image.JImageCanvas(javafx.scene.image.Image image) Create a new image canvas with an attached image.JImageCanvas(javafx.scene.image.Image image, double width, double height, int fit, int selection, boolean autoRepaint, boolean autoFit, boolean listeningControls) Create a new image canvas that display the given image. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd the givenlayerto this canvas.final javafx.beans.property.BooleanPropertyGet the auto fit property.javafx.beans.property.BooleanPropertyGet the auto refresh property.javafx.scene.paint.PaintGet the background paint.final javafx.beans.property.ObjectProperty<javafx.scene.paint.Paint> Get the background paint property.javafx.geometry.Point2DGet the cursor current position.javafx.beans.property.ObjectProperty<javafx.geometry.Point2D> Get the cursor current position property.javafx.scene.image.ImagegetImage()Get the image that is displayed within the canvas.javafx.geometry.BoundsGet the bounding box of the image within the view referential.javafx.geometry.Point2DgetImageCoordinate(double x, double y) Get the coordinate within the image referential of the point located at (x,y) on the panel component.javafx.geometry.Point2DgetImageCoordinate(javafx.geometry.Point2D point) Get the coordinate within the image referential of the given point expressed within the canvas component referential.intGet the image fit method.javafx.beans.property.IntegerPropertyGet the image fit method property.javafx.beans.property.BooleanPropertyGet the listening controls property.final javafx.beans.property.BooleanPropertyGet the refresh needed property.doubleGet the rotation applied to the view as an angle expressed in degree (°).doublegetScale()Get the current scale factor of the panel view.intGet the selection mode used by the panel.javafx.beans.property.IntegerPropertyGet the selection mode property.javafx.scene.shape.ShapeGet the current selection shape.javafx.geometry.Point2DGet the translation applied to the view as a2D point.javafx.geometry.Point2DgetViewCoordinate(double x, double y) Get the coordinate within the canvas referential of the given point located at (x,y) within the image referential.javafx.geometry.Point2DgetViewCoordinate(javafx.geometry.Point2D point) Get the coordinate within the canvas referential of the given point expressed within the image referential.javafx.geometry.InsetsGet the insets (in pixels) that the displayed image as to respect from the canvas borders.javafx.beans.property.BooleanPropertyGet the property that control the use of clipping during a view translation.booleanGet if the canvas is auto fitting when dimension changes occur.booleanGet if the canvas is auto refreshing when changes occur.booleanisLayerDisplayed(String layer) Check if the givenlayeris displayed.booleanGet if the canvas is listening to controls (Mouse, Keyboard, ...).booleanGet if the canvas has to be refreshed (changes have occured).booleanbooleanGet if the translation clipping is active.doublemaxHeight(double width) doublemaxWidth(double height) doubleminHeight(double width) doubleminWidth(double height) voidonImageFeatureAdded(JImageFeatureLayer layer, JImageFeature feature) voidonImageFeatureModified(JImageFeatureLayer layer, Collection<JImageFeature> features) voidonImageFeatureModified(JImageFeatureLayer layer, JImageFeature feature) voidonImageFeatureRemoved(JImageFeatureLayer layer, JImageFeature feature) voidonImageFeaturesAdded(JImageFeatureLayer layer, Collection<JImageFeature> features) voidonImageFeaturesRemoved(JImageFeatureLayer layer, Collection<JImageFeature> features) doubleprefHeight(double width) voidrefresh()Refresh the GUI componentsvoidrefreshEnqueue(Runnable task) Add the given task to add to the refresh queue.booleanRemove the givenlayerfrom this canvas.voidresize(double width, double height) voidselect(javafx.scene.shape.Shape shape) Select the features that are inside the givenshape.voidsetAutoFit(boolean autoFit) Set if the canvas has to auto fit when dimension changes occur.voidsetAutoRefresh(boolean autoRefresh) Get if the canvas has to auto refresh when changes occur.voidsetBackgroundPaint(javafx.scene.paint.Paint paint) Set the background paint.voidsetImage(javafx.scene.image.Image image) Set the image to display within the canvas.voidsetImageFitMethod(int method) Set the image fit method.voidsetLayerDisplayed(String layer, boolean displayed) Set if the givenlayerhas to be displayed.voidsetListeningControls(boolean listening) Set if the canvas has to listen to controls (Mouse, Keyboard, ...).voidsetResizable(boolean resizable) Set if the image canvas can be resized.voidsetRotation(double angle) Set the rotation to apply to the view.voidsetScale(double scale) Set the scale factor to apply to the panel view.voidsetSelectionMode(int mode) Set the selection mode that the panel has to use.voidsetTranslation(javafx.geometry.Point2D translation) Set the translation to apply to the view.voidsetViewInsets(javafx.geometry.Insets insets) Set the insets (in pixels) that the displayed image as to respect from the canvas borders.voidsetViewTranslationClipping(boolean clip) Set if the translation clipping has to be active.voidviewFit()Fit the image view according to the activefit method.voidviewRotate(double angle) Rotate the current view by the given angle.voidviewTranslate(javafx.geometry.Point2D vector) Translate the current view by the given vector.Methods inherited from class javafx.scene.canvas.Canvas
getGraphicsContext2D, getHeight, getWidth, heightProperty, setHeight, setWidth, widthPropertyMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, 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, 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, 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, prefWidth, 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, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Field Details
-
MODE_SELECTION_PROPERTY
The image feature selection mode property name. This name enable to identify the property when aproperty change eventis fired from this object.- See Also:
-
MODE_SELECTION_NONE
public static final int MODE_SELECTION_NONENo selection mode activated.- See Also:
-
MODE_SELECTION_POINT
public static final int MODE_SELECTION_POINTThe selection with point mode. This mode enable to select features on the image using a point.- See Also:
-
MODE_SELECTION_RECTANGLE
public static final int MODE_SELECTION_RECTANGLEThe selection with rectangle mode. This mode enable to select features on the image using a rectangle.- See Also:
-
MODE_SELECTION_POLYGON
public static final int MODE_SELECTION_POLYGONThe selection with polygon mode. This mode enable to select features on the image using a closed polygon.- See Also:
-
MODE_SELECTION_ACTIVE_MASK
public static final int MODE_SELECTION_ACTIVE_MASKA mask that enable to check if a selection is active.- See Also:
-
FIT_NONE
public static final int FIT_NONENo fit is applied to the image when displayed.- See Also:
-
FIT_COMPLETE
public static final int FIT_COMPLETEImage is scaled in x and Y in order to fit the canvas. Original ratio is modified.- See Also:
-
FIT_WIDTH
public static final int FIT_WIDTHImage is scaled in order to the image width is fitting the canvas width. Original ratio is preserved.- See Also:
-
FIT_HEIGHT
public static final int FIT_HEIGHTImage is scaled in order to the image height is fitting the canvas height. Original ratio is preserved.- See Also:
-
FIT_AUTO
public static final int FIT_AUTOImage is scaled in order to fit longest dimension. Original ratio is preserved.- See Also:
-
-
Constructor Details
-
JImageCanvas
public JImageCanvas()Create a new image canvas with no attached image. -
JImageCanvas
public JImageCanvas(javafx.scene.image.Image image) Create a new image canvas with an attached image.- Parameters:
image- the image to display.
-
JImageCanvas
public JImageCanvas(javafx.scene.image.Image image, double width, double height, int fit, int selection, boolean autoRepaint, boolean autoFit, boolean listeningControls) Create a new image canvas that display the given image.- Parameters:
image- the image to display.width- the width in pixels of the canvasheight- the height in pixels of the canvasfit- The fit method for the input image. Can beFIT_NONE,FIT_COMPLETE,FIT_WIDTH,FIT_HEIGHTorFIT_AUTOselection- The selection mode to use. Can beMODE_SELECTION_NONE,MODE_SELECTION_POINT,MODE_SELECTION_RECTANGLEorMODE_SELECTION_POLYGONautoRepaint-trueif the canvas GUI has to update automatically when modifications occurs (default) orfalseotherwiseautoFit-trueif the canvas GUI has to fit automatically when modifications occurs (default) orfalseotherwiselisteningControls-trueif the canvas has to listen to controls (like mouse, keyboard, ...) (default) orfalseotherwise
-
-
Method Details
-
minHeight
public double minHeight(double width) - Overrides:
minHeightin classjavafx.scene.Node
-
maxHeight
public double maxHeight(double width) - Overrides:
maxHeightin classjavafx.scene.Node
-
prefHeight
public double prefHeight(double width) - Overrides:
prefHeightin classjavafx.scene.Node
-
minWidth
public double minWidth(double height) - Overrides:
minWidthin classjavafx.scene.Node
-
maxWidth
public double maxWidth(double height) - Overrides:
maxWidthin classjavafx.scene.Node
-
resize
public void resize(double width, double height) - Overrides:
resizein classjavafx.scene.Node
-
isResizable
public boolean isResizable()- Overrides:
isResizablein classjavafx.scene.Node
-
setResizable
public void setResizable(boolean resizable) Set if the image canvas can be resized.- Parameters:
resizable-trueif the image canvas has to be resizable (default) orfalseotherwise.- See Also:
-
onImageFeatureAdded
Description copied from interface:JImageFeatureLayerListener- Specified by:
onImageFeatureAddedin interfaceJImageFeatureLayerListener- Parameters:
layer- the layer that holds the eventfeature- the feature that has been added
-
onImageFeatureRemoved
Description copied from interface:JImageFeatureLayerListener- Specified by:
onImageFeatureRemovedin interfaceJImageFeatureLayerListener- Parameters:
layer- the layer that holds the eventfeature- the feature that has been removed
-
onImageFeatureModified
Description copied from interface:JImageFeatureLayerListener- Specified by:
onImageFeatureModifiedin interfaceJImageFeatureLayerListener- Parameters:
layer- the layer that holds the eventfeature- the feature that has been removed
-
onImageFeaturesAdded
Description copied from interface:JImageFeatureLayerListenerA callback method that is triggered when a collection offeaturehas been added to the listenedlayer.- Specified by:
onImageFeaturesAddedin interfaceJImageFeatureLayerListener- Parameters:
layer- the layer that holds the eventfeatures- the collection of feature that have been added
-
onImageFeaturesRemoved
Description copied from interface:JImageFeatureLayerListenerA callback method that is triggered when a collection offeaturehas been removed from the listenedlayer.- Specified by:
onImageFeaturesRemovedin interfaceJImageFeatureLayerListener- Parameters:
layer- the layer that holds the eventfeatures- the collection of feature that have been removed
-
onImageFeatureModified
Description copied from interface:JImageFeatureLayerListenerA callback method that is triggered when a collection offeaturehas been modified from the listenedlayer.- Specified by:
onImageFeatureModifiedin interfaceJImageFeatureLayerListener- Parameters:
layer- the layer that holds the eventfeatures- the collection of feature that has been removed
-
getImage
public javafx.scene.image.Image getImage()Get the image that is displayed within the canvas.- Returns:
- the image that is displayed within the canvas
- See Also:
-
setImage
public void setImage(javafx.scene.image.Image image) Set the image to display within the canvas.- Parameters:
image- the image to display- See Also:
-
getImageFitMethodProperty
public javafx.beans.property.IntegerProperty getImageFitMethodProperty()Get the image fit method property.- Returns:
- the image fit method property
-
getImageFitMethod
public int getImageFitMethod()Get the image fit method. Possible return values areFIT_NONE,FIT_COMPLETE,FIT_WIDTH,FIT_HEIGHTorFIT_AUTO.- Returns:
- the image fit method
- See Also:
-
getImageBoundsInView
public javafx.geometry.Bounds getImageBoundsInView()Get the bounding box of the image within the view referential. The bounds can be greater / smaller than the view bounds.- Returns:
- the bounding box of the image within the view referential
-
setImageFitMethod
public void setImageFitMethod(int method) Set the image fit method. Possible return values areFIT_NONE,FIT_COMPLETE,FIT_WIDTH,FIT_HEIGHTorFIT_AUTO.- Parameters:
method- the image fit method- Throws:
IllegalArgumentException- if the given method is invalid- See Also:
-
getCursorPositionProperty
public javafx.beans.property.ObjectProperty<javafx.geometry.Point2D> getCursorPositionProperty()Get the cursor current position property. The cursor position is expressed within the canvas referential (scale, rotation and translation are taken in account).- Returns:
- the cursor position property
-
getCursorPosition
public javafx.geometry.Point2D getCursorPosition()Get the cursor current position. The cursor position is expressed within the canvas referential (scale, rotation and translation are taken in account).- Returns:
- the cursor current position
- See Also:
-
getViewInsets
public javafx.geometry.Insets getViewInsets()Get the insets (in pixels) that the displayed image as to respect from the canvas borders. Defining such insets is useful for avoiding the edge of the image to be on the edge of the canvas. This insets are expressed in pixels within view referential.- Returns:
- the margin that the displayed image as to respect from the canvas borders
- See Also:
-
setViewInsets
public void setViewInsets(javafx.geometry.Insets insets) Set the insets (in pixels) that the displayed image as to respect from the canvas borders. Defining such insets is useful for avoiding the edge of the image to be on the edge of the canvas. These insets are expressed in pixels within view referential.- Parameters:
insets- the insets that the displayed image as to respect from the canvas borders- See Also:
-
getSelectionModeProperty
public javafx.beans.property.IntegerProperty getSelectionModeProperty()Get the selection mode property.- Returns:
- the selection mode property.
-
getSelectionMode
public int getSelectionMode()Get the selection mode used by the panel. This can be one of:MODE_SELECTION_POINTfor a point selection.MODE_SELECTION_RECTANGLEfor a rectangle based selection.MODE_SELECTION_POLYGONfor a custom shape based selection.
- Returns:
- the selection mode used by the panel.
- See Also:
-
setSelectionMode
public void setSelectionMode(int mode) Set the selection mode that the panel has to use. This can be one of:MODE_SELECTION_POINTfor a point selection.MODE_SELECTION_RECTANGLEfor a rectangle based selection.MODE_SELECTION_POLYGONfor a custom shape based selection.
- Parameters:
mode- the selection mode that the panel has to use.- See Also:
-
getSelectionShape
public javafx.scene.shape.Shape getSelectionShape()Get the current selection shape. All coordinates and length are expressed within canvas referential.- Returns:
- the current selection shape
-
getViewTranslationClippingProperty
public javafx.beans.property.BooleanProperty getViewTranslationClippingProperty()Get the property that control the use of clipping during a view translation. If the clipping is active, translating the view usingviewTranslate(Point2D)will ensure that the image cannot exit the view according to theview insets.- Returns:
- the property that control the use of clipping during a view translation.
- See Also:
-
isViewTranslationClipping
public boolean isViewTranslationClipping()Get if the translation clipping is active. If the clipping is active, translating the view usingviewTranslate(Point2D)will ensure that the image cannot exit the view according to theview insets.- Returns:
trueif the clipping is active andfalseotherwise- See Also:
-
setViewTranslationClipping
public void setViewTranslationClipping(boolean clip) Set if the translation clipping has to be active. If the clipping is active, translating the view usingviewTranslate(Point2D)will ensure that the image cannot exit the view according to theview insets.- Parameters:
clip-trueif the clipping has to be active andfalseotherwise- See Also:
-
getRotation
public double getRotation()Get the rotation applied to the view as an angle expressed in degree (°).- Returns:
- the rotation applied to the view as an angle expressed in degree (°).
- See Also:
-
setRotation
public void setRotation(double angle) Set the rotation to apply to the view. For a cumulative rotation, useviewRotate(double)method.- Parameters:
angle- the rotation angle, expressed in degree (°)- See Also:
-
getScale
public double getScale()Get the current scale factor of the panel view.- Returns:
- the current scale factor of the panel view.
- See Also:
-
setScale
public void setScale(double scale) Set the scale factor to apply to the panel view.- Parameters:
scale- the scale factor applied to the image.- See Also:
-
getTranslation
public javafx.geometry.Point2D getTranslation()Get the translation applied to the view as a2D point.- Returns:
- the translation applied to the view.
- See Also:
-
setTranslation
public void setTranslation(javafx.geometry.Point2D translation) Set the translation to apply to the view. Thetranslationis expressed within view referential in pixels (px). For a cumulative translation, useviewTranslate(Point2D)method.- Parameters:
translation- the translation to apply to the view as a2D point.- See Also:
-
viewRotate
public void viewRotate(double angle) Rotate the current view by the given angle. The angle has to be expressed in degree (°). This method add the new rotation angle to the current one. If a reset of the rotation is needed, the method has to be used.- Parameters:
angle- the rotation angle, expressed in degree (°)- See Also:
-
viewTranslate
public void viewTranslate(javafx.geometry.Point2D vector) Translate the current view by the given vector. The vector is expressed within the view referential. This method substract the given vector from the existing translation. The reset of the translation can be done by callingsetTranslation(Point2D).- Parameters:
vector- the translation vector, expressed within the view referential- See Also:
-
isAutoFit
public boolean isAutoFit()Get if the canvas is auto fitting when dimension changes occur.- Returns:
trueif the canvas is auto fitting when dimension changes occur andfalseotherwise- See Also:
-
setAutoFit
public void setAutoFit(boolean autoFit) Set if the canvas has to auto fit when dimension changes occur.- Parameters:
autoFit-trueif the canvas is auto fitting when dimension changes occur andfalseotherwise- See Also:
-
getAutoFitProperty
public final javafx.beans.property.BooleanProperty getAutoFitProperty()Get the auto fit property.- Returns:
- the auto fit property
- See Also:
-
isAutoRefresh
public boolean isAutoRefresh()Get if the canvas is auto refreshing when changes occur.- Returns:
trueif the canvas is auto refreshing when changes occur andfalseotherwise- See Also:
-
setAutoRefresh
public void setAutoRefresh(boolean autoRefresh) Get if the canvas has to auto refresh when changes occur.- Parameters:
autoRefresh-trueif the canvas has to auto refresh when changes occur andfalseotherwise- See Also:
-
getAutoRefreshProperty
public javafx.beans.property.BooleanProperty getAutoRefreshProperty()Get the auto refresh property.- Returns:
- the auto refresh property
- See Also:
-
isListeningControls
public boolean isListeningControls()Get if the canvas is listening to controls (Mouse, Keyboard, ...).- Returns:
trueif the canvas is listening to controls (Mouse, Keyboard, ...) andfalseotherwise- See Also:
-
setListeningControls
public void setListeningControls(boolean listening) Set if the canvas has to listen to controls (Mouse, Keyboard, ...).- Parameters:
listening-trueif the canvas has to listen to controls (Mouse, Keyboard, ...) andfalseotherwise- See Also:
-
getListeningControlsProperty
public javafx.beans.property.BooleanProperty getListeningControlsProperty()Get the listening controls property.- Returns:
- the listening controls property
- See Also:
-
isRefreshNeeded
public boolean isRefreshNeeded()Get if the canvas has to be refreshed (changes have occured).- Returns:
trueif the canvas has to be refreshed andfalseotherwise- See Also:
-
getRefreshNeededProperty
public final javafx.beans.property.BooleanProperty getRefreshNeededProperty()Get the refresh needed property.- Returns:
- the refresh needed property
- See Also:
-
getBackgroundPaint
public javafx.scene.paint.Paint getBackgroundPaint()Get the background paint.- Returns:
- the background paint
- See Also:
-
setBackgroundPaint
public void setBackgroundPaint(javafx.scene.paint.Paint paint) Set the background paint.- Parameters:
paint- the background paint- See Also:
-
getBackgroundPaintProperty
public final javafx.beans.property.ObjectProperty<javafx.scene.paint.Paint> getBackgroundPaintProperty()Get the background paint property.- Returns:
- the background paint property
- See Also:
-
getImageCoordinate
public javafx.geometry.Point2D getImageCoordinate(double x, double y) Get the coordinate within the image referential of the point located at (x,y) on the panel component.- Parameters:
x- the x coordinate of the point on the panel component.y- the y coordinate of the point on the panel component.- Returns:
- the coordinate within the image of the point located at (x, y) on the panel component.
- See Also:
-
getImageCoordinate
public javafx.geometry.Point2D getImageCoordinate(javafx.geometry.Point2D point) Get the coordinate within the image referential of the given point expressed within the canvas component referential.- Parameters:
point- the point expressed within the canvas component referential.- Returns:
- the point expressed within the image referential.
- See Also:
-
getViewCoordinate
public javafx.geometry.Point2D getViewCoordinate(javafx.geometry.Point2D point) Get the coordinate within the canvas referential of the given point expressed within the image referential.- Parameters:
point- the point expressed within the image referential.- Returns:
- the coordinate within the canvas referential of the given point expressed within the image referential.
- See Also:
-
getViewCoordinate
public javafx.geometry.Point2D getViewCoordinate(double x, double y) Get the coordinate within the canvas referential of the given point located at (x,y) within the image referential.- Parameters:
x- the x coordinate of the point expressed within the image referential.y- the y coordinate of the point expressed within the image referential.- Returns:
- the coordinate within the canvas referential of the point located at (
x,y) within the image referential. - See Also:
-
isLayerDisplayed
Check if the givenlayeris displayed. If this method returntrue, then the features that are within the layer are visible on the image panel.- Parameters:
layer- the layer to check.- Returns:
trueif the layer is displayed andfalseotherwise- See Also:
-
setLayerDisplayed
Set if the givenlayerhas to be displayed.- Parameters:
layer- the layer to check.displayed-trueif the layer has to be displayed andfalseotherwise.
-
addImageFeatureLayer
Add the givenlayerto this canvas.- Parameters:
layer- the layer to add- Returns:
trueif the layer is successfully added andfalseotherwise- See Also:
-
removeImageFeatureLayer
Remove the givenlayerfrom this canvas.- Parameters:
layer- the layer to remove- Returns:
trueif the layer is successfully removed andfalseotherwise- See Also:
-
viewFit
-
refreshEnqueue
Add the given task to add to the refresh queue. The refresh queue is processed at the end of the refresh of the canvas.- Parameters:
task- the task to add to the refresh queue- Throws:
InterruptedException- if a error occurs during queuing- See Also:
-
refresh
public void refresh()Refresh the GUI components -
select
public void select(javafx.scene.shape.Shape shape) Select the features that are inside the givenshape. The shape is expressed within view coordinates.- Parameters:
shape- the selectionshape
-