Package javafx.scene.image
Class ImageView
java.lang.Object
javafx.scene.Node
javafx.scene.image.ImageView
- All Implemented Interfaces:
LayoutMeasurable,LayoutMeasurableMixin,HasBlendModeProperty,HasClipProperty,HasEffectProperty,HasFitHeightProperty,HasFitWidthProperty,HasImageProperty,HasImageUrlProperty,HasLayoutXProperty,HasLayoutYProperty,HasManagedProperty,HasMouseTransparentProperty,HasOnMouseClickedProperty,HasOpacityProperty,HasParentProperty,HasVisibleProperty,HasXProperty,HasYProperty,Styleable,EventTarget,INode
public class ImageView
extends Node
implements HasImageProperty, HasImageUrlProperty, HasFitWidthProperty, HasFitHeightProperty, HasXProperty, HasYProperty
- Author:
- Bruno Salmon
-
Property Summary
PropertiesTypePropertyDescriptionfinal BooleanPropertyIndicates whether to preserve the aspect ratio of the source image when scaling to fit the image within the fitting bounding box.Properties inherited from class javafx.scene.Node
blendMode, cacheHint, cache, clip, cursor, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, layoutBounds, layoutX, layoutY, managed, mouseTransparent, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onScroll, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, opacity, parent, pressed, rotate, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, visible -
Field Summary
Fields inherited from interface javafx.scene.INode
BASELINE_OFFSET_SAME_AS_HEIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanGets the value of thepreserveRatioproperty.voidfinal BooleanPropertyIndicates whether to preserve the aspect ratio of the source image when scaling to fit the image within the fitting bounding box.final voidsetPreserveRatio(boolean value) Sets the value of thepreserveRatioproperty.Methods inherited from class javafx.scene.Node
addEventFilter, addEventHandler, autosize, blendModeProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, createLayoutMeasurable, cursorProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAllNodeTransforms, getBoundsInLocal, getCacheHint, getCursor, getEventDispatcher, getId, getLayoutMeasurable, getNodePeer, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOrCreateAndBindNodePeer, getProperties, getRotate, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getUserData, hasProperties, hoverProperty, idProperty, impl_computeLayoutBounds, impl_getLayoutBounds, impl_isTreeVisible, impl_maxHeight, impl_maxWidth, impl_minHeight, impl_minWidth, impl_prefHeight, impl_prefWidth, impl_traverse, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isPressed, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScreen, localToScreen, localToScreen, localToScreen, managedProperty, mouseTransparentProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onNodePeerReady, onScrollProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, opacityProperty, parentProperty, parentToLocal, pressedProperty, removeEventFilter, removeEventHandler, requestFocus, requestPeerFocus, rotateProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setCache, setCacheHint, setCursor, setDisable, setDisabled, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setNodePeer, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setPressed, setRotate, setScaleX, setScaleY, setScaleZ, setScene, setStyle, setTranslateX, setTranslateY, setUserData, shouldUseLayoutMeasurable, snapshot, startDragAndDrop, styleProperty, toBack, toFront, translateXProperty, translateYProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
getBlendMode, setBlendModeMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
getClip, setClipMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
getEffect, setEffectMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFitHeightProperty
getFitHeight, setFitHeightMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFitWidthProperty
getFitWidth, setFitWidthMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasImageProperty
getImage, setImageMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasImageUrlProperty
getImageUrl, setImageUrlMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, setLayoutXMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, setLayoutYMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, setManagedMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, setMouseTransparentMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, setOnMouseClickedMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, setOpacityMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, setParentMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisibleMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasXProperty
getX, setXMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasYProperty
getY, setYMethods inherited from interface javafx.scene.INode
getBaselineOffset, getContentBias, isResizable, relocate, resize, resizeRelocateMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth
-
Property Details
-
image
- Specified by:
imagePropertyin interfaceHasImageProperty- Returns:
- the
imageproperty - See Also:
-
imageUrl
- Specified by:
imageUrlPropertyin interfaceHasImageUrlProperty- Returns:
- the
imageUrlproperty - See Also:
-
fitWidth
- Specified by:
fitWidthPropertyin interfaceHasFitWidthProperty- Returns:
- the
fitWidthproperty - See Also:
-
fitHeight
- Specified by:
fitHeightPropertyin interfaceHasFitHeightProperty- Returns:
- the
fitHeightproperty - See Also:
-
x
- Specified by:
xPropertyin interfaceHasXProperty- Returns:
- the
xproperty - See Also:
-
y
- Specified by:
yPropertyin interfaceHasYProperty- Returns:
- the
yproperty - See Also:
-
preserveRatio
Indicates whether to preserve the aspect ratio of the source image when scaling to fit the image within the fitting bounding box. If set totrue, it affects the dimensions of thisImageViewin the following way *- If only
fitWidthis set, height is scaled to preserve ratio - If only
fitHeightis set, width is scaled to preserve ratio - If both are set, they both may be scaled to get the best fit in a width by height rectangle while preserving the original aspect ratio
false, it affects the dimensions of thisImageViewin the following way *- If only
fitWidthis set, image's view width is scaled to match and height is unchanged; - If only
fitHeightis set, image's view height is scaled to match and height is unchanged; - If both are set, the image view is scaled to match both.
fitWidth x fitHeightbonding box.- Default value:
- false
- See Also:
- If only
-
-
Constructor Details
-
ImageView
public ImageView() -
ImageView
-
ImageView
-
-
Method Details
-
imageProperty
- Specified by:
imagePropertyin interfaceHasImageProperty- Returns:
- the
imageproperty - See Also:
-
imageUrlProperty
- Specified by:
imageUrlPropertyin interfaceHasImageUrlProperty- Returns:
- the
imageUrlproperty - See Also:
-
fitWidthProperty
- Specified by:
fitWidthPropertyin interfaceHasFitWidthProperty- Returns:
- the
fitWidthproperty - See Also:
-
fitHeightProperty
- Specified by:
fitHeightPropertyin interfaceHasFitHeightProperty- Returns:
- the
fitHeightproperty - See Also:
-
xProperty
- Specified by:
xPropertyin interfaceHasXProperty- Returns:
- the
xproperty - See Also:
-
yProperty
- Specified by:
yPropertyin interfaceHasYProperty- Returns:
- the
yproperty - See Also:
-
setPreserveRatio
public final void setPreserveRatio(boolean value) Sets the value of thepreserveRatioproperty.- Property description:
- Indicates whether to preserve the aspect ratio of the source image when
scaling to fit the image within the fitting bounding box.
If set to
true, it affects the dimensions of thisImageViewin the following way *- If only
fitWidthis set, height is scaled to preserve ratio - If only
fitHeightis set, width is scaled to preserve ratio - If both are set, they both may be scaled to get the best fit in a width by height rectangle while preserving the original aspect ratio
false, it affects the dimensions of thisImageViewin the following way *- If only
fitWidthis set, image's view width is scaled to match and height is unchanged; - If only
fitHeightis set, image's view height is scaled to match and height is unchanged; - If both are set, the image view is scaled to match both.
fitWidth x fitHeightbonding box. - If only
- Default value:
- false
- Parameters:
value- the value for thepreserveRatioproperty- See Also:
-
isPreserveRatio
public final boolean isPreserveRatio()Gets the value of thepreserveRatioproperty.- Property description:
- Indicates whether to preserve the aspect ratio of the source image when
scaling to fit the image within the fitting bounding box.
If set to
true, it affects the dimensions of thisImageViewin the following way *- If only
fitWidthis set, height is scaled to preserve ratio - If only
fitHeightis set, width is scaled to preserve ratio - If both are set, they both may be scaled to get the best fit in a width by height rectangle while preserving the original aspect ratio
false, it affects the dimensions of thisImageViewin the following way *- If only
fitWidthis set, image's view width is scaled to match and height is unchanged; - If only
fitHeightis set, image's view height is scaled to match and height is unchanged; - If both are set, the image view is scaled to match both.
fitWidth x fitHeightbonding box. - If only
- Default value:
- false
- Returns:
- the value of the
preserveRatioproperty - See Also:
-
preserveRatioProperty
Indicates whether to preserve the aspect ratio of the source image when scaling to fit the image within the fitting bounding box. If set totrue, it affects the dimensions of thisImageViewin the following way *- If only
fitWidthis set, height is scaled to preserve ratio - If only
fitHeightis set, width is scaled to preserve ratio - If both are set, they both may be scaled to get the best fit in a width by height rectangle while preserving the original aspect ratio
false, it affects the dimensions of thisImageViewin the following way *- If only
fitWidthis set, image's view width is scaled to match and height is unchanged; - If only
fitHeightis set, image's view height is scaled to match and height is unchanged; - If both are set, the image view is scaled to match both.
fitWidth x fitHeightbonding box.- Default value:
- false
- Returns:
- the
preserveRatioproperty - See Also:
- If only
-
onPeerSizeChanged
public void onPeerSizeChanged()- Overrides:
onPeerSizeChangedin classNode
-