Class Region
- All Implemented Interfaces:
LayoutMeasurable,LayoutMeasurableMixin,HasBackgroundProperty,HasBlendModeProperty,HasBorderProperty,HasClipProperty,HasEffectProperty,HasHeightProperty,HasLayoutXProperty,HasLayoutYProperty,HasManagedProperty,HasMaxHeightProperty,HasMaxWidthProperty,HasMinHeightProperty,HasMinWidthProperty,HasMouseTransparentProperty,HasOnMouseClickedProperty,HasOpacityProperty,HasPaddingProperty,HasParentProperty,HasPrefHeightProperty,HasPrefWidthProperty,HasSnapToPixelProperty,HasVisibleProperty,HasWidthProperty,Styleable,EventTarget,INode,PreferenceResizableNode
- Direct Known Subclasses:
ContextMenuContent,ContextMenuContent.MenuItemContainer,Control,Pane
- Author:
- Bruno Salmon
-
Property Summary
PropertiesTypePropertyDescriptionThe insets of the Region define the distance from the edge of the region (its layout bounds, or (0, 0, width, height)) to the edge of the content area.Properties inherited from class javafx.scene.Parent
needsLayoutProperties 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, visibleProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendModeProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clipProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effectProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
layoutXProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
layoutYProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
managedProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
mouseTransparentProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
onMouseClickedProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
opacityProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
parentProperties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
visible -
Field Summary
Fields inherited from interface javafx.scene.INode
BASELINE_OFFSET_SAME_AS_HEIGHTFields inherited from interface javafx.scene.layout.PreferenceResizableNode
USE_COMPUTED_SIZE, USE_PREF_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static doubleboundedSize(double min, double pref, double max) Computes the value based on the given min and max values.protected doublecomputeMaxHeight(double width) Computes the maximum height of this region.protected doublecomputeMaxWidth(double height) Computes the maximum width for this region.protected doublecomputeMinHeight(double width) Computes the minimum height of this region.protected doublecomputeMinWidth(double height) Computes the minimum width of this region.protected doublecomputePrefHeight(double width) Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy.protected doublecomputePrefWidth(double height) Computes the preferred width of this region for the given height.final InsetsGets the value of theinsetsproperty.impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx) This set is used to track all of the children of this group which are dirty.protected final BoundsThe layout bounds of this region:0, 0 width x heightprotected final doubleimpl_maxHeight(double width) Called during layout to determine the maximum height for this node.protected final doubleimpl_maxWidth(double height) Called during layout to determine the maximum width for this node.protected final doubleimpl_minHeight(double width) Called during layout to determine the minimum height for this node.protected final doubleimpl_minWidth(double height) Called during layout to determine the minimum width for this node.protected final doubleimpl_prefHeight(double width) Called during layout to determine the preferred height for this node.protected final doubleimpl_prefWidth(double height) Called during layout to determine the preferred width for this node.The insets of the Region define the distance from the edge of the region (its layout bounds, or (0, 0, width, height)) to the edge of the content area.protected voidlayoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, HPos halignment, VPos valignment) Utility method which lays out the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.protected voidlayoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, boolean fillWidth, boolean fillHeight, HPos halignment, VPos valignment) Utility method which lays out the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.static voidlayoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, boolean fillWidth, boolean fillHeight, HPos halignment, VPos valignment, boolean isSnapToPixel) Utility method which lays out the child within an area of it's parent defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.protected voidlayoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, HPos halignment, VPos valignment) Utility method which lays out the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.protected voidpositionInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, HPos halignment, VPos valignment) Utility method which positions the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.static voidpositionInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, HPos halignment, VPos valignment, boolean isSnapToPixel) Utility method which positions the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.voidresize(double width, double height) Invoked by the region's parent during layout to set the region's width and height.voidsetMaxSize(double maxWidth, double maxHeight) Convenience method for overriding the region's computed maximum width and height.voidsetMinSize(double minWidth, double minHeight) Convenience method for overriding the region's computed minimum width and height.voidsetPrefSize(double prefWidth, double prefHeight) Convenience method for overriding the region's computed preferred width and height.final doubleUtility method to get the bottom inset which includes padding and border inset.final doubleUtility method to get the left inset which includes padding and border inset.final doubleUtility method to get the right inset which includes padding and border inset.final doubleUtility method to get the top inset which includes padding and border inset.protected doublesnapPosition(double value) Deprecated.doublesnapPositionX(double value) If this region's snapToPixel property is true, returns a value rounded to the nearest pixel in the horizontal direction, else returns the same value.doublesnapPositionY(double value) If this region's snapToPixel property is true, returns a value rounded to the nearest pixel in the vertical direction, else returns the same value.protected doublesnapSize(double value) Deprecated.replaced bysnapSizeX()andsnapSizeY()doublesnapSizeX(double value) If this region's snapToPixel property is true, returns a value ceiled to the nearest pixel in the horizontal direction, else returns the same value.doublesnapSizeY(double value) If this region's snapToPixel property is true, returns a value ceiled to the nearest pixel in the vertical direction, else returns the same value.protected doublesnapSpace(double value) Deprecated.replaced bysnapSpaceX()andsnapSpaceY()doublesnapSpaceX(double value) If this region's snapToPixel property is true, returns a value rounded to the nearest pixel in the horizontal direction, else returns the same value.doublesnapSpaceY(double value) If this region's snapToPixel property is true, returns a value rounded to the nearest pixel in the vertical direction, else returns the same value.Methods inherited from class javafx.scene.Parent
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, isNeedsLayout, layout, layoutChildren, needsLayoutProperty, requestLayout, requestParentLayout, setLayoutFlag, setNeedsLayout, setSceneRootMethods 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_getLayoutBounds, impl_isTreeVisible, 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, onPeerSizeChanged, 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.HasBackgroundProperty
getBackground, setBackgroundMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendModeProperty, getBlendMode, setBlendModeMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBorderProperty
getBorder, setBorderMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clipProperty, getClip, setClipMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effectProperty, getEffect, setEffectMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasHeightProperty
getHeight, setHeightMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, layoutXProperty, setLayoutXMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, layoutYProperty, setLayoutYMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, managedProperty, setManagedMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxHeightProperty
getMaxHeight, setMaxHeightMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxWidthProperty
getMaxWidth, setMaxWidthMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinHeightProperty
getMinHeight, setMinHeightMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinWidthProperty
getMinWidth, setMinWidthMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, mouseTransparentProperty, setMouseTransparentMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, onMouseClickedProperty, setOnMouseClickedMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, opacityProperty, setOpacityMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPaddingProperty
getPadding, setPaddingMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, parentProperty, setParentMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefHeightProperty
getPrefHeight, setPrefHeightMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefWidthProperty
getPrefWidth, setPrefWidthMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasSnapToPixelProperty
isSnapToPixel, setSnapToPixelMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible, visiblePropertyMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasWidthProperty
getWidth, setWidthMethods inherited from interface javafx.scene.INode
autosize, getAllNodeTransforms, getBaselineOffset, getContentBias, getNodePeer, getOrCreateAndBindNodePeer, getProperties, getScene, getTransforms, hasProperties, relocate, resizeRelocateMethods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, getLayoutMeasurable, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidthMethods inherited from interface javafx.scene.layout.PreferenceResizableNode
isResizable
-
Property Details
-
width
- Specified by:
widthPropertyin interfaceHasWidthProperty- Returns:
- the
widthproperty - See Also:
-
height
- Specified by:
heightPropertyin interfaceHasHeightProperty- Returns:
- the
heightproperty - See Also:
-
maxWidth
- Specified by:
maxWidthPropertyin interfaceHasMaxWidthProperty- Returns:
- the
maxWidthproperty - See Also:
-
minWidth
- Specified by:
minWidthPropertyin interfaceHasMinWidthProperty- Returns:
- the
minWidthproperty - See Also:
-
maxHeight
- Specified by:
maxHeightPropertyin interfaceHasMaxHeightProperty- Returns:
- the
maxHeightproperty - See Also:
-
minHeight
- Specified by:
minHeightPropertyin interfaceHasMinHeightProperty- Returns:
- the
minHeightproperty - See Also:
-
prefWidth
- Specified by:
prefWidthPropertyin interfaceHasPrefWidthProperty- Returns:
- the
prefWidthproperty - See Also:
-
prefHeight
- Specified by:
prefHeightPropertyin interfaceHasPrefHeightProperty- Returns:
- the
prefHeightproperty - See Also:
-
insets
The insets of the Region define the distance from the edge of the region (its layout bounds, or (0, 0, width, height)) to the edge of the content area. All child nodes should be laid out within the content area. The insets are computed based on the Border which has been specified, if any, and also the padding.- Since:
- JavaFX 8.0
- See Also:
-
padding
- Specified by:
paddingPropertyin interfaceHasPaddingProperty- Returns:
- the
paddingproperty - See Also:
-
snapToPixel
- Specified by:
snapToPixelPropertyin interfaceHasSnapToPixelProperty- Returns:
- the
snapToPixelproperty - See Also:
-
background
- Specified by:
backgroundPropertyin interfaceHasBackgroundProperty- Returns:
- the
backgroundproperty - See Also:
-
border
- Specified by:
borderPropertyin interfaceHasBorderProperty- Returns:
- the
borderproperty - See Also:
-
-
Constructor Details
-
Region
public Region() -
Region
-
-
Method Details
-
widthProperty
- Specified by:
widthPropertyin interfaceHasWidthProperty- Returns:
- the
widthproperty - See Also:
-
heightProperty
- Specified by:
heightPropertyin interfaceHasHeightProperty- Returns:
- the
heightproperty - See Also:
-
maxWidthProperty
- Specified by:
maxWidthPropertyin interfaceHasMaxWidthProperty- Returns:
- the
maxWidthproperty - See Also:
-
minWidthProperty
- Specified by:
minWidthPropertyin interfaceHasMinWidthProperty- Returns:
- the
minWidthproperty - See Also:
-
maxHeightProperty
- Specified by:
maxHeightPropertyin interfaceHasMaxHeightProperty- Returns:
- the
maxHeightproperty - See Also:
-
minHeightProperty
- Specified by:
minHeightPropertyin interfaceHasMinHeightProperty- Returns:
- the
minHeightproperty - See Also:
-
prefWidthProperty
- Specified by:
prefWidthPropertyin interfaceHasPrefWidthProperty- Returns:
- the
prefWidthproperty - See Also:
-
prefHeightProperty
- Specified by:
prefHeightPropertyin interfaceHasPrefHeightProperty- Returns:
- the
prefHeightproperty - See Also:
-
getInsets
Gets the value of theinsetsproperty.- Property description:
- The insets of the Region define the distance from the edge of the region (its layout bounds, or (0, 0, width, height)) to the edge of the content area. All child nodes should be laid out within the content area. The insets are computed based on the Border which has been specified, if any, and also the padding.
- Returns:
- the value of the
insetsproperty - Since:
- JavaFX 8.0
- See Also:
-
insetsProperty
The insets of the Region define the distance from the edge of the region (its layout bounds, or (0, 0, width, height)) to the edge of the content area. All child nodes should be laid out within the content area. The insets are computed based on the Border which has been specified, if any, and also the padding.- Returns:
- the
insetsproperty - Since:
- JavaFX 8.0
- See Also:
-
paddingProperty
- Specified by:
paddingPropertyin interfaceHasPaddingProperty- Returns:
- the
paddingproperty - See Also:
-
snapToPixelProperty
- Specified by:
snapToPixelPropertyin interfaceHasSnapToPixelProperty- Returns:
- the
snapToPixelproperty - See Also:
-
backgroundProperty
- Specified by:
backgroundPropertyin interfaceHasBackgroundProperty- Returns:
- the
backgroundproperty - See Also:
-
borderProperty
- Specified by:
borderPropertyin interfaceHasBorderProperty- Returns:
- the
borderproperty - See Also:
-
impl_computeGeomBounds
Description copied from class:ParentThis set is used to track all of the children of this group which are dirty. It is only used in cases where the number of children is > some value (currently 10). For very wide trees, this can provide a very important speed boost. For the sake of memory consumption, this is null unless the number of children ever crosses the threshold where it will be activated.- Overrides:
impl_computeGeomBoundsin classParent
-
resize
public void resize(double width, double height) Invoked by the region's parent during layout to set the region's width and height. Applications should not invoke this method directly. If an application needs to directly set the size of the region, it should override its size constraints by callingsetMinSize(),setPrefSize(), orsetMaxSize()and it's parent will honor those overrides during layout. -
impl_minWidth
protected final double impl_minWidth(double height) Called during layout to determine the minimum width for this node. Returns the value fromcomputeMinWidth(forHeight)unless the application overrode the minimum width by setting the minWidth property.- Overrides:
impl_minWidthin classParent- Returns:
- the minimum width that this node should be resized to during layout
- See Also:
-
impl_minHeight
protected final double impl_minHeight(double width) Called during layout to determine the minimum height for this node. Returns the value fromcomputeMinHeight(forWidth)unless the application overrode the minimum height by setting the minHeight property.- Overrides:
impl_minHeightin classParent- Returns:
- the minimum height that this node should be resized to during layout
- See Also:
-
impl_prefWidth
protected final double impl_prefWidth(double height) Called during layout to determine the preferred width for this node. Returns the value fromcomputePrefWidth(forHeight)unless the application overrode the preferred width by setting the prefWidth property.- Overrides:
impl_prefWidthin classParent- Returns:
- the preferred width that this node should be resized to during layout
- See Also:
-
impl_prefHeight
protected final double impl_prefHeight(double width) Called during layout to determine the preferred height for this node. Returns the value fromcomputePrefHeight(forWidth)unless the application overrode the preferred height by setting the prefHeight property.- Overrides:
impl_prefHeightin classParent- Returns:
- the preferred height that this node should be resized to during layout
- See Also:
-
impl_maxWidth
protected final double impl_maxWidth(double height) Called during layout to determine the maximum width for this node. Returns the value fromcomputeMaxWidth(forHeight)unless the application overrode the maximum width by setting the maxWidth property.- Overrides:
impl_maxWidthin classNode- Returns:
- the maximum width that this node should be resized to during layout
- See Also:
-
impl_maxHeight
protected final double impl_maxHeight(double width) Called during layout to determine the maximum height for this node. Returns the value fromcomputeMaxHeight(forWidth)unless the application overrode the maximum height by setting the maxHeight property.- Overrides:
impl_maxHeightin classNode- Returns:
- the maximum height that this node should be resized to during layout
- See Also:
-
computeMinWidth
protected double computeMinWidth(double height) Computes the minimum width of this region. Returns the sum of the left and right insets by default. region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.- Overrides:
computeMinWidthin classParent- Parameters:
height- the height that should be used if min width depends on it- Returns:
- the computed minimum width of this region
-
computeMinHeight
protected double computeMinHeight(double width) Computes the minimum height of this region. Returns the sum of the top and bottom insets by default. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.- Overrides:
computeMinHeightin classParent- Parameters:
width- the width that should be used if min height depends on it- Returns:
- the computed minimum height for this region
-
computePrefWidth
protected double computePrefWidth(double height) Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.- Overrides:
computePrefWidthin classParent- Parameters:
height- the height that should be used if preferred width depends on it- Returns:
- the computed preferred width for this region
-
computePrefHeight
protected double computePrefHeight(double width) Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.- Overrides:
computePrefHeightin classParent- Parameters:
width- the width that should be used if preferred height depends on it- Returns:
- the computed preferred height for this region
-
computeMaxWidth
protected double computeMaxWidth(double height) Computes the maximum width for this region. Returns Double.MAX_VALUE by default. Region subclasses may override this method to return an different value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.- Returns:
- the computed maximum width for this region
-
computeMaxHeight
protected double computeMaxHeight(double width) Computes the maximum height of this region. Returns Double.MAX_VALUE by default. Region subclasses may override this method to return a different value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.- Returns:
- the computed maximum height for this region
-
impl_computeLayoutBounds
The layout bounds of this region:0, 0 width x height- Overrides:
impl_computeLayoutBoundsin classNode
-
snapSpace
protected double snapSpace(double value) Deprecated.replaced bysnapSpaceX()andsnapSpaceY()If this region's snapToPixel property is false, this method returns the same value, else it tries to return a value rounded to the nearest pixel, but since there is no indication if the value is a vertical or horizontal measurement then it may be snapped to the wrong pixel size metric on screens with different horizontal and vertical scales.- Parameters:
value- the space value to be snapped- Returns:
- value rounded to nearest pixel
-
snapSpaceX
public double snapSpaceX(double value) If this region's snapToPixel property is true, returns a value rounded to the nearest pixel in the horizontal direction, else returns the same value.- Parameters:
value- the space value to be snapped- Returns:
- value rounded to nearest pixel
- Since:
- 9
-
snapSpaceY
public double snapSpaceY(double value) If this region's snapToPixel property is true, returns a value rounded to the nearest pixel in the vertical direction, else returns the same value.- Parameters:
value- the space value to be snapped- Returns:
- value rounded to nearest pixel
- Since:
- 9
-
snapSize
protected double snapSize(double value) Deprecated.replaced bysnapSizeX()andsnapSizeY()If this region's snapToPixel property is false, this method returns the same value, else it tries to return a value ceiled to the nearest pixel, but since there is no indication if the value is a vertical or horizontal measurement then it may be snapped to the wrong pixel size metric on screens with different horizontal and vertical scales.- Parameters:
value- the size value to be snapped- Returns:
- value ceiled to nearest pixel
-
snapSizeX
public double snapSizeX(double value) If this region's snapToPixel property is true, returns a value ceiled to the nearest pixel in the horizontal direction, else returns the same value.- Parameters:
value- the size value to be snapped- Returns:
- value ceiled to nearest pixel
- Since:
- 9
-
snapSizeY
public double snapSizeY(double value) If this region's snapToPixel property is true, returns a value ceiled to the nearest pixel in the vertical direction, else returns the same value.- Parameters:
value- the size value to be snapped- Returns:
- value ceiled to nearest pixel
- Since:
- 9
-
snapPosition
protected double snapPosition(double value) Deprecated.replaced bysnapPositionX()andsnapPositionY()If this region's snapToPixel property is false, this method returns the same value, else it tries to return a value rounded to the nearest pixel, but since there is no indication if the value is a vertical or horizontal measurement then it may be snapped to the wrong pixel size metric on screens with different horizontal and vertical scales.- Parameters:
value- the position value to be snapped- Returns:
- value rounded to nearest pixel
-
snapPositionX
public double snapPositionX(double value) If this region's snapToPixel property is true, returns a value rounded to the nearest pixel in the horizontal direction, else returns the same value.- Parameters:
value- the position value to be snapped- Returns:
- value rounded to nearest pixel
- Since:
- 9
-
snapPositionY
public double snapPositionY(double value) If this region's snapToPixel property is true, returns a value rounded to the nearest pixel in the vertical direction, else returns the same value.- Parameters:
value- the position value to be snapped- Returns:
- value rounded to nearest pixel
- Since:
- 9
-
snappedTopInset
public final double snappedTopInset()Utility method to get the top inset which includes padding and border inset. Then snapped to whole pixels if isSnapToPixel() is true.- Returns:
- Rounded up insets top
- Since:
- JavaFX 8.0
-
snappedBottomInset
public final double snappedBottomInset()Utility method to get the bottom inset which includes padding and border inset. Then snapped to whole pixels if isSnapToPixel() is true.- Returns:
- Rounded up insets bottom
- Since:
- JavaFX 8.0
-
snappedLeftInset
public final double snappedLeftInset()Utility method to get the left inset which includes padding and border inset. Then snapped to whole pixels if isSnapToPixel() is true.- Returns:
- Rounded up insets left
- Since:
- JavaFX 8.0
-
snappedRightInset
public final double snappedRightInset()Utility method to get the right inset which includes padding and border inset. Then snapped to whole pixels if isSnapToPixel() is true.- Returns:
- Rounded up insets right
- Since:
- JavaFX 8.0
-
positionInArea
protected void positionInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, HPos halignment, VPos valignment) Utility method which positions the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.This function does not resize the node and uses the node's layout bounds width and height to determine how it should be positioned within the area.
If the vertical alignment is
VPos.BASELINEthen it will position the node so that its own baseline aligns with the passed inbaselineOffset, otherwise the baseline parameter is ignored.If
snapToPixelistruefor this region, then the x/y position values will be rounded to their nearest pixel boundaries.- Parameters:
child- the child being positioned within this regionareaX- the horizontal offset of the layout area relative to this regionareaY- the vertical offset of the layout area relative to this regionareaWidth- the width of the layout areaareaHeight- the height of the layout areaareaBaselineOffset- the baseline offset to be used if VPos is BASELINEhalignment- the horizontal alignment for the child within the areavalignment- the vertical alignment for the child within the area
-
positionInArea
public static void positionInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, HPos halignment, VPos valignment, boolean isSnapToPixel) Utility method which positions the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.This function does not resize the node and uses the node's layout bounds width and height to determine how it should be positioned within the area.
If the vertical alignment is
VPos.BASELINEthen it will position the node so that its own baseline aligns with the passed inbaselineOffset, otherwise the baseline parameter is ignored.If
snapToPixelistruefor this region, then the x/y position values will be rounded to their nearest pixel boundaries.If
marginis non-null, then that space will be allocated around the child within the layout area. margin may be null.- Parameters:
child- the child being positioned within this regionareaX- the horizontal offset of the layout area relative to this regionareaY- the vertical offset of the layout area relative to this regionareaWidth- the width of the layout areaareaHeight- the height of the layout areaareaBaselineOffset- the baseline offset to be used if VPos is BASELINEmargin- the margin of space to be allocated around the childhalignment- the horizontal alignment for the child within the areavalignment- the vertical alignment for the child within the area- Since:
- JavaFX 8.0
-
layoutInArea
protected void layoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, HPos halignment, VPos valignment) Utility method which lays out the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.If the child is resizable, this method will resize it to fill the specified area unless the node's maximum size prevents it. If the node's maximum size preference is less than the area size, the maximum size will be used. If node's maximum is greater than the area size, then the node will be resized to fit within the area, unless its minimum size prevents it.
If the child has a non-null contentBias, then this method will use it when resizing the child. If the contentBias is horizontal, it will set its width first to the area's width (up to the child's max width limit) and then pass that value to compute the child's height. If child's contentBias is vertical, then it will set its height to the area height (up to child's max height limit) and pass that height to compute the child's width. If the child's contentBias is null, then it's width and height have no dependencies on each other.
If the child is not resizable (Shape, Group, etc) then it will only be positioned and not resized.
If the child's resulting size differs from the area's size (either because it was not resizable or it's sizing preferences prevented it), then this function will align the node relative to the area using horizontal and vertical alignment values. If valignment is
VPos.BASELINEthen the node's baseline will be aligned with the area baseline offset parameter, otherwise the baseline parameter is ignored.If
snapToPixelistruefor this region, then the resulting x,y values will be rounded to their nearest pixel boundaries and the width/height values will be ceiled to the next pixel boundary.- Parameters:
child- the child being positioned within this regionareaX- the horizontal offset of the layout area relative to this regionareaY- the vertical offset of the layout area relative to this regionareaWidth- the width of the layout areaareaHeight- the height of the layout areaareaBaselineOffset- the baseline offset to be used if VPos is BASELINEhalignment- the horizontal alignment for the child within the areavalignment- the vertical alignment for the child within the area
-
layoutInArea
protected void layoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, HPos halignment, VPos valignment) Utility method which lays out the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.If the child is resizable, this method will resize it to fill the specified area unless the node's maximum size prevents it. If the node's maximum size preference is less than the area size, the maximum size will be used. If node's maximum is greater than the area size, then the node will be resized to fit within the area, unless its minimum size prevents it.
If the child has a non-null contentBias, then this method will use it when resizing the child. If the contentBias is horizontal, it will set its width first to the area's width (up to the child's max width limit) and then pass that value to compute the child's height. If child's contentBias is vertical, then it will set its height to the area height (up to child's max height limit) and pass that height to compute the child's width. If the child's contentBias is null, then it's width and height have no dependencies on each other.
If the child is not resizable (Shape, Group, etc) then it will only be positioned and not resized.
If the child's resulting size differs from the area's size (either because it was not resizable or it's sizing preferences prevented it), then this function will align the node relative to the area using horizontal and vertical alignment values. If valignment is
VPos.BASELINEthen the node's baseline will be aligned with the area baseline offset parameter, otherwise the baseline parameter is ignored.If
marginis non-null, then that space will be allocated around the child within the layout area. margin may be null.If
snapToPixelistruefor this region, then the resulting x,y values will be rounded to their nearest pixel boundaries and the width/height values will be ceiled to the next pixel boundary.- Parameters:
child- the child being positioned within this regionareaX- the horizontal offset of the layout area relative to this regionareaY- the vertical offset of the layout area relative to this regionareaWidth- the width of the layout areaareaHeight- the height of the layout areaareaBaselineOffset- the baseline offset to be used if VPos is BASELINEmargin- the margin of space to be allocated around the childhalignment- the horizontal alignment for the child within the areavalignment- the vertical alignment for the child within the area
-
layoutInArea
protected void layoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, boolean fillWidth, boolean fillHeight, HPos halignment, VPos valignment) Utility method which lays out the child within an area of this region defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.If the child is resizable, this method will use
fillWidthandfillHeightto determine whether to resize it to fill the area or keep the child at its preferred dimension. If fillWidth/fillHeight are true, then this method will only resize the child up to its max size limits. If the node's maximum size preference is less than the area size, the maximum size will be used. If node's maximum is greater than the area size, then the node will be resized to fit within the area, unless its minimum size prevents it.If the child has a non-null contentBias, then this method will use it when resizing the child. If the contentBias is horizontal, it will set its width first and then pass that value to compute the child's height. If child's contentBias is vertical, then it will set its height first and pass that value to compute the child's width. If the child's contentBias is null, then it's width and height have no dependencies on each other.
If the child is not resizable (Shape, Group, etc) then it will only be positioned and not resized.
If the child's resulting size differs from the area's size (either because it was not resizable or it's sizing preferences prevented it), then this function will align the node relative to the area using horizontal and vertical alignment values. If valignment is
VPos.BASELINEthen the node's baseline will be aligned with the area baseline offset parameter, otherwise the baseline parameter is ignored.If
marginis non-null, then that space will be allocated around the child within the layout area. margin may be null.If
snapToPixelistruefor this region, then the resulting x,y values will be rounded to their nearest pixel boundaries and the width/height values will be ceiled to the next pixel boundary.- Parameters:
child- the child being positioned within this regionareaX- the horizontal offset of the layout area relative to this regionareaY- the vertical offset of the layout area relative to this regionareaWidth- the width of the layout areaareaHeight- the height of the layout areaareaBaselineOffset- the baseline offset to be used if VPos is BASELINEmargin- the margin of space to be allocated around the childfillWidth- whether or not the child should be resized to fill the area width or kept to its preferred widthfillHeight- whether or not the child should e resized to fill the area height or kept to its preferred heighthalignment- the horizontal alignment for the child within the areavalignment- the vertical alignment for the child within the area
-
layoutInArea
public static void layoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, boolean fillWidth, boolean fillHeight, HPos halignment, VPos valignment, boolean isSnapToPixel) Utility method which lays out the child within an area of it's parent defined byareaX,areaY,areaWidthxareaHeight, with a baseline offset relative to that area.If the child is resizable, this method will use
fillWidthandfillHeightto determine whether to resize it to fill the area or keep the child at its preferred dimension. If fillWidth/fillHeight are true, then this method will only resize the child up to its max size limits. If the node's maximum size preference is less than the area size, the maximum size will be used. If node's maximum is greater than the area size, then the node will be resized to fit within the area, unless its minimum size prevents it.If the child has a non-null contentBias, then this method will use it when resizing the child. If the contentBias is horizontal, it will set its width first and then pass that value to compute the child's height. If child's contentBias is vertical, then it will set its height first and pass that value to compute the child's width. If the child's contentBias is null, then it's width and height have no dependencies on each other.
If the child is not resizable (Shape, Group, etc) then it will only be positioned and not resized.
If the child's resulting size differs from the area's size (either because it was not resizable or it's sizing preferences prevented it), then this function will align the node relative to the area using horizontal and vertical alignment values. If valignment is
VPos.BASELINEthen the node's baseline will be aligned with the area baseline offset parameter, otherwise the baseline parameter is ignored.If
marginis non-null, then that space will be allocated around the child within the layout area. margin may be null.If
snapToPixelistruefor this region, then the resulting x,y values will be rounded to their nearest pixel boundaries and the width/height values will be ceiled to the next pixel boundary.- Parameters:
child- the child being positioned within this regionareaX- the horizontal offset of the layout area relative to this regionareaY- the vertical offset of the layout area relative to this regionareaWidth- the width of the layout areaareaHeight- the height of the layout areaareaBaselineOffset- the baseline offset to be used if VPos is BASELINEmargin- the margin of space to be allocated around the childfillWidth- whether or not the child should be resized to fill the area width or kept to its preferred widthfillHeight- whether or not the child should e resized to fill the area height or kept to its preferred heighthalignment- the horizontal alignment for the child within the areavalignment- the vertical alignment for the child within the areaisSnapToPixel- whether to snap size and position to pixels- Since:
- JavaFX 8.0
-
boundedSize
protected static double boundedSize(double min, double pref, double max) Computes the value based on the given min and max values. We encode in this method the logic surrounding various edge cases, such as when the min is specified as greater than the max, or the max less than the min, or a pref value that exceeds either the max or min in their extremes. If the min is greater than the max, then we want to make sure the returned value is the min. In other words, in such a case, the min becomes the only acceptable return value. If the min and max values are well ordered, and the pref is less than the min then the min is returned. Likewise, if the values are well ordered and the pref is greater than the max, then the max is returned. If the pref lies between the min and the max, then the pref is returned.- Parameters:
min- The minimum boundpref- The value to be clamped between the min and maxmax- the maximum bound- Returns:
- the size bounded by min, pref, and max.
-
setMinSize
public void setMinSize(double minWidth, double minHeight) Convenience method for overriding the region's computed minimum width and height. This should only be called if the region's internally computed minimum size doesn't meet the application's layout needs.- Parameters:
minWidth- the override value for minimum widthminHeight- the override value for minimum height- See Also:
-
setPrefSize
public void setPrefSize(double prefWidth, double prefHeight) Convenience method for overriding the region's computed preferred width and height. This should only be called if the region's internally computed preferred size doesn't meet the application's layout needs.- Parameters:
prefWidth- the override value for preferred widthprefHeight- the override value for preferred height- See Also:
-
setMaxSize
public void setMaxSize(double maxWidth, double maxHeight) Convenience method for overriding the region's computed maximum width and height. This should only be called if the region's internally computed maximum size doesn't meet the application's layout needs.- Parameters:
maxWidth- the override value for maximum widthmaxHeight- the override value for maximum height- See Also:
-
snapPositionX()andsnapPositionY()