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
TypePropertyDescriptionfinal BooleanProperty
Indicates 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
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Gets the value of thepreserveRatio
property.void
final BooleanProperty
Indicates whether to preserve the aspect ratio of the source image when scaling to fit the image within the fitting bounding box.final void
setPreserveRatio
(boolean value) Sets the value of thepreserveRatio
property.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, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
getBlendMode, setBlendMode
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
getClip, setClip
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
getEffect, setEffect
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFitHeightProperty
getFitHeight, setFitHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFitWidthProperty
getFitWidth, setFitWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasImageProperty
getImage, setImage
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasImageUrlProperty
getImageUrl, setImageUrl
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, setLayoutX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, setLayoutY
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, setManaged
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, setMouseTransparent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, setOnMouseClicked
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, setOpacity
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, setParent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasXProperty
getX, setX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasYProperty
getY, setY
Methods inherited from interface javafx.scene.INode
getBaselineOffset, getContentBias, isResizable, relocate, resize, resizeRelocate
Methods 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:
imageProperty
in interfaceHasImageProperty
- Returns:
- the
image
property - See Also:
-
imageUrl
- Specified by:
imageUrlProperty
in interfaceHasImageUrlProperty
- Returns:
- the
imageUrl
property - See Also:
-
fitWidth
- Specified by:
fitWidthProperty
in interfaceHasFitWidthProperty
- Returns:
- the
fitWidth
property - See Also:
-
fitHeight
- Specified by:
fitHeightProperty
in interfaceHasFitHeightProperty
- Returns:
- the
fitHeight
property - See Also:
-
x
- Specified by:
xProperty
in interfaceHasXProperty
- Returns:
- the
x
property - See Also:
-
y
- Specified by:
yProperty
in interfaceHasYProperty
- Returns:
- the
y
property - 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 thisImageView
in the following way *- If only
fitWidth
is set, height is scaled to preserve ratio - If only
fitHeight
is 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 thisImageView
in the following way *- If only
fitWidth
is set, image's view width is scaled to match and height is unchanged; - If only
fitHeight
is 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 fitHeight
bonding box.- Default value:
- false
- See Also:
- If only
-
-
Constructor Details
-
ImageView
public ImageView() -
ImageView
-
ImageView
-
-
Method Details
-
imageProperty
- Specified by:
imageProperty
in interfaceHasImageProperty
- Returns:
- the
image
property - See Also:
-
imageUrlProperty
- Specified by:
imageUrlProperty
in interfaceHasImageUrlProperty
- Returns:
- the
imageUrl
property - See Also:
-
fitWidthProperty
- Specified by:
fitWidthProperty
in interfaceHasFitWidthProperty
- Returns:
- the
fitWidth
property - See Also:
-
fitHeightProperty
- Specified by:
fitHeightProperty
in interfaceHasFitHeightProperty
- Returns:
- the
fitHeight
property - See Also:
-
xProperty
- Specified by:
xProperty
in interfaceHasXProperty
- Returns:
- the
x
property - See Also:
-
yProperty
- Specified by:
yProperty
in interfaceHasYProperty
- Returns:
- the
y
property - See Also:
-
setPreserveRatio
public final void setPreserveRatio(boolean value) Sets the value of thepreserveRatio
property.- 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 thisImageView
in the following way *- If only
fitWidth
is set, height is scaled to preserve ratio - If only
fitHeight
is 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 thisImageView
in the following way *- If only
fitWidth
is set, image's view width is scaled to match and height is unchanged; - If only
fitHeight
is 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 fitHeight
bonding box. - If only
- Default value:
- false
- Parameters:
value
- the value for thepreserveRatio
property- See Also:
-
isPreserveRatio
public final boolean isPreserveRatio()Gets the value of thepreserveRatio
property.- 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 thisImageView
in the following way *- If only
fitWidth
is set, height is scaled to preserve ratio - If only
fitHeight
is 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 thisImageView
in the following way *- If only
fitWidth
is set, image's view width is scaled to match and height is unchanged; - If only
fitHeight
is 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 fitHeight
bonding box. - If only
- Default value:
- false
- Returns:
- the value of the
preserveRatio
property - 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 thisImageView
in the following way *- If only
fitWidth
is set, height is scaled to preserve ratio - If only
fitHeight
is 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 thisImageView
in the following way *- If only
fitWidth
is set, image's view width is scaled to match and height is unchanged; - If only
fitHeight
is 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 fitHeight
bonding box.- Default value:
- false
- Returns:
- the
preserveRatio
property - See Also:
- If only
-
onPeerSizeChanged
public void onPeerSizeChanged()- Overrides:
onPeerSizeChanged
in classNode
-