Class PhotoView

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
com.dlsc.gemsfx.PhotoView
All Implemented Interfaces:
javafx.css.Styleable, javafx.event.EventTarget, javafx.scene.control.Skinnable

public class PhotoView extends javafx.scene.control.Control
The photo view is mostly used to display a user profile picture.

Features

  • control can be used as read-only view or as an editor (see editableProperty())
  • picture can moved around by dragging it
  • picture can be resized by pinch zoom (touch) or via scroll wheel
  • control provides a cropped "read only" version of the original image (see @{croppedImageProperty()}). This is ideal for saving memory when saving the image to the server / a database
  • applications can set a custom "photo supplier" to replace the built-in file chooser (see photoSupplierProperty())
  • drag and drop an image file onto the view
  • circular and rectangle shape (see setClipShape(ClipShape))
  • customizable maximum zoom value
  • keyboard support: backspace and delete keys delete the picture, space or enter trigger the file supplier (default: show the file chooser)
  • pseudo class support: "empty" if the photoProperty() is null
  • an effect can be applied directly to the image (see photoEffectProperty())
Note: the values for the zoom and translate properties will all be reset when a new photo is set.
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ObjectProperty<PhotoView.ClipShape>
    The clip shape determines whether the control will clip the photo via a circle or a rectangle shape.
    final javafx.beans.property.BooleanProperty
    Specifies whether the view should constantly create a cropped image version of the original image whenever the user edits the original.
    final javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.image.Image>
    A read-only property that contains the cropped version of the original image.
    final javafx.beans.property.BooleanProperty
    Controls whether the user will be able to edit the photo / image.
    final javafx.beans.property.DoubleProperty
    Stores the maximum amount that the user will be allowed to zoom into the view.
    final javafx.beans.property.ObjectProperty<javafx.scene.effect.Effect>
    An effect that will be applied to the image, not the whole control.
    final javafx.beans.property.ObjectProperty<javafx.scene.image.Image>
    Stores the original photo.
    javafx.beans.property.ObjectProperty<Supplier<javafx.scene.image.Image>>
    The photo supplier will be invoked when the user clicks on the control (or hits space oder enter keys).
    final javafx.beans.property.DoubleProperty
    Stores the percentage-based amount of the horizontal translation.
    final javafx.beans.property.DoubleProperty
    Stores the percentage-based amount of the vertical translation.
    final javafx.beans.property.DoubleProperty
    The zoom applied to the photo so that the photo's content fills out the view as good as possible.
    final javafx.beans.property.ObjectProperty<javafx.scene.Node>
    A placeholder that will be shown when no photo / image has been specified.

    Properties inherited from class javafx.scene.control.Control

    contextMenu, skin, tooltip

    Properties inherited from class javafx.scene.layout.Region

    background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width

    Properties inherited from class javafx.scene.Parent

    needsLayout

    Properties 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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final javafx.beans.property.BooleanProperty
     

    Fields inherited from class javafx.scene.layout.Region

    USE_COMPUTED_SIZE, USE_PREF_SIZE

    Fields inherited from class javafx.scene.Node

    BASELINE_OFFSET_SAME_AS_HEIGHT
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new photo view.
  • Method Summary

    Modifier and Type
    Method
    Description
    javafx.beans.property.ObjectProperty<PhotoView.ClipShape>
    The clip shape determines whether the control will clip the photo via a circle or a rectangle shape.
    final javafx.beans.property.BooleanProperty
    Specifies whether the view should constantly create a cropped image version of the original image whenever the user edits the original.
    protected javafx.scene.control.Skin<?>
     
    final javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.image.Image>
    A read-only property that contains the cropped version of the original image.
    final javafx.beans.property.BooleanProperty
    Controls whether the user will be able to edit the photo / image.
    Gets the value of the clipShape property.
    final javafx.scene.image.Image
    Gets the value of the croppedImage property.
    final double
    Gets the value of the maxZoom property.
    final javafx.scene.image.Image
    Gets the value of the photo property.
    final javafx.scene.effect.Effect
    Gets the value of the photoEffect property.
    Supplier<javafx.scene.image.Image>
    Gets the value of the photoSupplier property.
    final double
    Gets the value of the photoTranslateX property.
    final double
    Gets the value of the photoTranslateY property.
    final double
    Gets the value of the photoZoom property.
    final javafx.scene.Node
    Gets the value of the placeholder property.
     
    final boolean
    Gets the value of the createCroppedImage property.
    final boolean
    Gets the value of the editable property.
    final javafx.beans.property.DoubleProperty
    Stores the maximum amount that the user will be allowed to zoom into the view.
    final javafx.beans.property.ObjectProperty<javafx.scene.effect.Effect>
    An effect that will be applied to the image, not the whole control.
    final javafx.beans.property.ObjectProperty<javafx.scene.image.Image>
    Stores the original photo.
    javafx.beans.property.ObjectProperty<Supplier<javafx.scene.image.Image>>
    The photo supplier will be invoked when the user clicks on the control (or hits space oder enter keys).
    final javafx.beans.property.DoubleProperty
    Stores the percentage-based amount of the horizontal translation.
    final javafx.beans.property.DoubleProperty
    Stores the percentage-based amount of the vertical translation.
    final javafx.beans.property.DoubleProperty
    The zoom applied to the photo so that the photo's content fills out the view as good as possible.
    final javafx.beans.property.ObjectProperty<javafx.scene.Node>
    A placeholder that will be shown when no photo / image has been specified.
    void
    Sets the value of the clipShape property.
    final void
    setCreateCroppedImage(boolean createCroppedImage)
    Sets the value of the createCroppedImage property.
    final void
    setEditable(boolean editable)
    Sets the value of the editable property.
    final void
    setMaxZoom(double maxZoom)
    Sets the value of the maxZoom property.
    final void
    setPhoto(javafx.scene.image.Image photo)
    Sets the value of the photo property.
    final void
    setPhotoEffect(javafx.scene.effect.Effect photoEffect)
    Sets the value of the photoEffect property.
    void
    setPhotoSupplier(Supplier<javafx.scene.image.Image> photoSupplier)
    Sets the value of the photoSupplier property.
    final void
    setPhotoTranslateX(double photoTranslateX)
    Sets the value of the photoTranslateX property.
    final void
    setPhotoTranslateY(double photoTranslateY)
    Sets the value of the photoTranslateY property.
    final void
    setPhotoZoom(double photoZoom)
    Sets the value of the photoZoom property.
    final void
    setPlaceholder(javafx.scene.Node placeholder)
    Sets the value of the placeholder property.

    Methods inherited from class javafx.scene.control.Control

    computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty

    Methods inherited from class javafx.scene.layout.Region

    backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, 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

    getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, 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, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface javafx.css.Styleable

    getStyleableNode
  • Property Details

    • createCroppedImage

      public final javafx.beans.property.BooleanProperty createCroppedImageProperty
      Specifies whether the view should constantly create a cropped image version of the original image whenever the user edits the original. Creating a cropped image can have a performance impact on slower hardware (e.g. embedded).
      See Also:
    • croppedImage

      public final javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.image.Image> croppedImageProperty
      A read-only property that contains the cropped version of the original image. An image becomes cropped when the user moves it around or zooms into it. The cropped image is a good candidate for saving it to the server or database. However, applications can choose freely whether they prefer to store the original image or not.
      See Also:
    • photoEffect

      public final javafx.beans.property.ObjectProperty<javafx.scene.effect.Effect> photoEffectProperty
      An effect that will be applied to the image, not the whole control. Applications could for example apply a sepia effect (see SepiaTone).
      See Also:
    • placeholder

      public final javafx.beans.property.ObjectProperty<javafx.scene.Node> placeholderProperty
      A placeholder that will be shown when no photo / image has been specified. The default placeholder prompts the user to "click to add or drop a file".
      See Also:
    • editable

      public final javafx.beans.property.BooleanProperty editableProperty
      Controls whether the user will be able to edit the photo / image. If editable the control will display a slider below the photo for zooming. The user will also be able to zoom in via pinch zoom or scroll wheel. Via mouse dragging the user can move the photo around.
      See Also:
    • photoSupplier

      public javafx.beans.property.ObjectProperty<Supplier<javafx.scene.image.Image>> photoSupplierProperty
      The photo supplier will be invoked when the user clicks on the control (or hits space oder enter keys). The default photo supplier registered on the control will bring up a file chooser so that the user can select the image file.
      See Also:
    • clipShape

      public javafx.beans.property.ObjectProperty<PhotoView.ClipShape> clipShapeProperty
      The clip shape determines whether the control will clip the photo via a circle or a rectangle shape.
      See Also:
    • photo

      public final javafx.beans.property.ObjectProperty<javafx.scene.image.Image> photoProperty
      Stores the original photo.
      See Also:
    • photoZoom

      public final javafx.beans.property.DoubleProperty photoZoomProperty
      The zoom applied to the photo so that the photo's content fills out the view as good as possible.
      See Also:
    • photoTranslateX

      public final javafx.beans.property.DoubleProperty photoTranslateXProperty
      Stores the percentage-based amount of the horizontal translation. We can not use pixel-based translation as the view might change its size. This value changes when the user drags the photo left or right.
      See Also:
    • photoTranslateY

      public final javafx.beans.property.DoubleProperty photoTranslateYProperty
      Stores the percentage-based amount of the vertical translation. We can not use pixel-based translation as the view might change its size. This value changes when the user drags the photo up or down.
      See Also:
    • maxZoom

      public final javafx.beans.property.DoubleProperty maxZoomProperty
      Stores the maximum amount that the user will be allowed to zoom into the view. The default value is 5.
      See Also:
  • Field Details

    • createCroppedImage

      public final javafx.beans.property.BooleanProperty createCroppedImage
  • Constructor Details

    • PhotoView

      public PhotoView()
      Constructs a new photo view.
  • Method Details

    • createDefaultSkin

      protected javafx.scene.control.Skin<?> createDefaultSkin()
      Overrides:
      createDefaultSkin in class javafx.scene.control.Control
    • getUserAgentStylesheet

      public String getUserAgentStylesheet()
      Overrides:
      getUserAgentStylesheet in class javafx.scene.layout.Region
    • isCreateCroppedImage

      public final boolean isCreateCroppedImage()
      Gets the value of the createCroppedImage property.
      Property description:
      Specifies whether the view should constantly create a cropped image version of the original image whenever the user edits the original. Creating a cropped image can have a performance impact on slower hardware (e.g. embedded).
      Returns:
      the value of the createCroppedImage property
      See Also:
    • createCroppedImageProperty

      public final javafx.beans.property.BooleanProperty createCroppedImageProperty()
      Specifies whether the view should constantly create a cropped image version of the original image whenever the user edits the original. Creating a cropped image can have a performance impact on slower hardware (e.g. embedded).
      Returns:
      true if the view should create the cropped image
      See Also:
    • setCreateCroppedImage

      public final void setCreateCroppedImage(boolean createCroppedImage)
      Sets the value of the createCroppedImage property.
      Property description:
      Specifies whether the view should constantly create a cropped image version of the original image whenever the user edits the original. Creating a cropped image can have a performance impact on slower hardware (e.g. embedded).
      Parameters:
      createCroppedImage - the value for the createCroppedImage property
      See Also:
    • getCroppedImage

      public final javafx.scene.image.Image getCroppedImage()
      Gets the value of the croppedImage property.
      Property description:
      A read-only property that contains the cropped version of the original image. An image becomes cropped when the user moves it around or zooms into it. The cropped image is a good candidate for saving it to the server or database. However, applications can choose freely whether they prefer to store the original image or not.
      Returns:
      the value of the croppedImage property
      See Also:
    • croppedImageProperty

      public final javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.image.Image> croppedImageProperty()
      A read-only property that contains the cropped version of the original image. An image becomes cropped when the user moves it around or zooms into it. The cropped image is a good candidate for saving it to the server or database. However, applications can choose freely whether they prefer to store the original image or not.
      Returns:
      the cropped image version of the original image
      See Also:
    • getPhotoEffect

      public final javafx.scene.effect.Effect getPhotoEffect()
      Gets the value of the photoEffect property.
      Property description:
      An effect that will be applied to the image, not the whole control. Applications could for example apply a sepia effect (see SepiaTone).
      Returns:
      the value of the photoEffect property
      See Also:
    • photoEffectProperty

      public final javafx.beans.property.ObjectProperty<javafx.scene.effect.Effect> photoEffectProperty()
      An effect that will be applied to the image, not the whole control. Applications could for example apply a sepia effect (see SepiaTone).
      Returns:
      the photo effect
      See Also:
    • setPhotoEffect

      public final void setPhotoEffect(javafx.scene.effect.Effect photoEffect)
      Sets the value of the photoEffect property.
      Property description:
      An effect that will be applied to the image, not the whole control. Applications could for example apply a sepia effect (see SepiaTone).
      Parameters:
      photoEffect - the value for the photoEffect property
      See Also:
    • getPlaceholder

      public final javafx.scene.Node getPlaceholder()
      Gets the value of the placeholder property.
      Property description:
      A placeholder that will be shown when no photo / image has been specified. The default placeholder prompts the user to "click to add or drop a file".
      Returns:
      the value of the placeholder property
      See Also:
    • placeholderProperty

      public final javafx.beans.property.ObjectProperty<javafx.scene.Node> placeholderProperty()
      A placeholder that will be shown when no photo / image has been specified. The default placeholder prompts the user to "click to add or drop a file".
      Returns:
      the placeholder node
      See Also:
    • setPlaceholder

      public final void setPlaceholder(javafx.scene.Node placeholder)
      Sets the value of the placeholder property.
      Property description:
      A placeholder that will be shown when no photo / image has been specified. The default placeholder prompts the user to "click to add or drop a file".
      Parameters:
      placeholder - the value for the placeholder property
      See Also:
    • isEditable

      public final boolean isEditable()
      Gets the value of the editable property.
      Property description:
      Controls whether the user will be able to edit the photo / image. If editable the control will display a slider below the photo for zooming. The user will also be able to zoom in via pinch zoom or scroll wheel. Via mouse dragging the user can move the photo around.
      Returns:
      the value of the editable property
      See Also:
    • editableProperty

      public final javafx.beans.property.BooleanProperty editableProperty()
      Controls whether the user will be able to edit the photo / image. If editable the control will display a slider below the photo for zooming. The user will also be able to zoom in via pinch zoom or scroll wheel. Via mouse dragging the user can move the photo around.
      Returns:
      "true" if the view is editable
      See Also:
    • setEditable

      public final void setEditable(boolean editable)
      Sets the value of the editable property.
      Property description:
      Controls whether the user will be able to edit the photo / image. If editable the control will display a slider below the photo for zooming. The user will also be able to zoom in via pinch zoom or scroll wheel. Via mouse dragging the user can move the photo around.
      Parameters:
      editable - the value for the editable property
      See Also:
    • getPhotoSupplier

      public Supplier<javafx.scene.image.Image> getPhotoSupplier()
      Gets the value of the photoSupplier property.
      Property description:
      The photo supplier will be invoked when the user clicks on the control (or hits space oder enter keys). The default photo supplier registered on the control will bring up a file chooser so that the user can select the image file.
      Returns:
      the value of the photoSupplier property
      See Also:
    • photoSupplierProperty

      public javafx.beans.property.ObjectProperty<Supplier<javafx.scene.image.Image>> photoSupplierProperty()
      The photo supplier will be invoked when the user clicks on the control (or hits space oder enter keys). The default photo supplier registered on the control will bring up a file chooser so that the user can select the image file.
      Returns:
      the photo supplier
      See Also:
    • setPhotoSupplier

      public void setPhotoSupplier(Supplier<javafx.scene.image.Image> photoSupplier)
      Sets the value of the photoSupplier property.
      Property description:
      The photo supplier will be invoked when the user clicks on the control (or hits space oder enter keys). The default photo supplier registered on the control will bring up a file chooser so that the user can select the image file.
      Parameters:
      photoSupplier - the value for the photoSupplier property
      See Also:
    • getClipShape

      public PhotoView.ClipShape getClipShape()
      Gets the value of the clipShape property.
      Property description:
      The clip shape determines whether the control will clip the photo via a circle or a rectangle shape.
      Returns:
      the value of the clipShape property
      See Also:
    • clipShapeProperty

      public javafx.beans.property.ObjectProperty<PhotoView.ClipShape> clipShapeProperty()
      The clip shape determines whether the control will clip the photo via a circle or a rectangle shape.
      Returns:
      the clip shape (circle, rectangle)
      See Also:
    • setClipShape

      public void setClipShape(PhotoView.ClipShape clipShape)
      Sets the value of the clipShape property.
      Property description:
      The clip shape determines whether the control will clip the photo via a circle or a rectangle shape.
      Parameters:
      clipShape - the value for the clipShape property
      See Also:
    • getPhoto

      public final javafx.scene.image.Image getPhoto()
      Gets the value of the photo property.
      Property description:
      Stores the original photo.
      Returns:
      the value of the photo property
      See Also:
    • photoProperty

      public final javafx.beans.property.ObjectProperty<javafx.scene.image.Image> photoProperty()
      Stores the original photo.
      Returns:
      the photo
      See Also:
    • setPhoto

      public final void setPhoto(javafx.scene.image.Image photo)
      Sets the value of the photo property.
      Property description:
      Stores the original photo.
      Parameters:
      photo - the value for the photo property
      See Also:
    • getPhotoZoom

      public final double getPhotoZoom()
      Gets the value of the photoZoom property.
      Property description:
      The zoom applied to the photo so that the photo's content fills out the view as good as possible.
      Returns:
      the value of the photoZoom property
      See Also:
    • photoZoomProperty

      public final javafx.beans.property.DoubleProperty photoZoomProperty()
      The zoom applied to the photo so that the photo's content fills out the view as good as possible.
      Returns:
      the photo zoom
      See Also:
    • setPhotoZoom

      public final void setPhotoZoom(double photoZoom)
      Sets the value of the photoZoom property.
      Property description:
      The zoom applied to the photo so that the photo's content fills out the view as good as possible.
      Parameters:
      photoZoom - the value for the photoZoom property
      See Also:
    • getPhotoTranslateX

      public final double getPhotoTranslateX()
      Gets the value of the photoTranslateX property.
      Property description:
      Stores the percentage-based amount of the horizontal translation. We can not use pixel-based translation as the view might change its size. This value changes when the user drags the photo left or right.
      Returns:
      the value of the photoTranslateX property
      See Also:
    • photoTranslateXProperty

      public final javafx.beans.property.DoubleProperty photoTranslateXProperty()
      Stores the percentage-based amount of the horizontal translation. We can not use pixel-based translation as the view might change its size. This value changes when the user drags the photo left or right.
      Returns:
      the translate x value (in percent)
      See Also:
    • setPhotoTranslateX

      public final void setPhotoTranslateX(double photoTranslateX)
      Sets the value of the photoTranslateX property.
      Property description:
      Stores the percentage-based amount of the horizontal translation. We can not use pixel-based translation as the view might change its size. This value changes when the user drags the photo left or right.
      Parameters:
      photoTranslateX - the value for the photoTranslateX property
      See Also:
    • getPhotoTranslateY

      public final double getPhotoTranslateY()
      Gets the value of the photoTranslateY property.
      Property description:
      Stores the percentage-based amount of the vertical translation. We can not use pixel-based translation as the view might change its size. This value changes when the user drags the photo up or down.
      Returns:
      the value of the photoTranslateY property
      See Also:
    • photoTranslateYProperty

      public final javafx.beans.property.DoubleProperty photoTranslateYProperty()
      Stores the percentage-based amount of the vertical translation. We can not use pixel-based translation as the view might change its size. This value changes when the user drags the photo up or down.
      Returns:
      the translate y value (in percent)
      See Also:
    • setPhotoTranslateY

      public final void setPhotoTranslateY(double photoTranslateY)
      Sets the value of the photoTranslateY property.
      Property description:
      Stores the percentage-based amount of the vertical translation. We can not use pixel-based translation as the view might change its size. This value changes when the user drags the photo up or down.
      Parameters:
      photoTranslateY - the value for the photoTranslateY property
      See Also:
    • getMaxZoom

      public final double getMaxZoom()
      Gets the value of the maxZoom property.
      Property description:
      Stores the maximum amount that the user will be allowed to zoom into the view. The default value is 5.
      Returns:
      the value of the maxZoom property
      See Also:
    • maxZoomProperty

      public final javafx.beans.property.DoubleProperty maxZoomProperty()
      Stores the maximum amount that the user will be allowed to zoom into the view. The default value is 5.
      Returns:
      the maximum zoom value (default 5)
      See Also:
    • setMaxZoom

      public final void setMaxZoom(double maxZoom)
      Sets the value of the maxZoom property.
      Property description:
      Stores the maximum amount that the user will be allowed to zoom into the view. The default value is 5.
      Parameters:
      maxZoom - the value for the maxZoom property
      See Also: