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
TypePropertyDescriptionThe 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
needsLayout
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
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendMode
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clip
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effect
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
layoutX
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
layoutY
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
managed
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
mouseTransparent
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
onMouseClicked
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
opacity
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
parent
Properties 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_HEIGHT
Fields inherited from interface javafx.scene.layout.PreferenceResizableNode
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static double
boundedSize
(double min, double pref, double max) Computes the value based on the given min and max values.protected double
computeMaxHeight
(double width) Computes the maximum height of this region.protected double
computeMaxWidth
(double height) Computes the maximum width for this region.protected double
computeMinHeight
(double width) Computes the minimum height of this region.protected double
computeMinWidth
(double height) Computes the minimum width of this region.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.protected double
computePrefWidth
(double height) Computes the preferred width of this region for the given height.final Insets
Gets the value of theinsets
property.impl_computeGeomBounds
(BaseBounds bounds, BaseTransform tx) This set is used to track all of the children of this group which are dirty.protected final Bounds
The layout bounds of this region:0, 0 width x height
protected final double
impl_maxHeight
(double width) Called during layout to determine the maximum height for this node.protected final double
impl_maxWidth
(double height) Called during layout to determine the maximum width for this node.protected final double
impl_minHeight
(double width) Called during layout to determine the minimum height for this node.protected final double
impl_minWidth
(double height) Called during layout to determine the minimum width for this node.protected final double
impl_prefHeight
(double width) Called during layout to determine the preferred height for this node.protected final double
impl_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 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
,areaWidth
xareaHeight
, with a baseline offset relative to that area.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
,areaWidth
xareaHeight
, with a baseline offset relative to that area.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
,areaWidth
xareaHeight
, with a baseline offset relative to that area.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
,areaWidth
xareaHeight
, with a baseline offset relative to that area.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
,areaWidth
xareaHeight
, with a baseline offset relative to that area.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
,areaWidth
xareaHeight
, with a baseline offset relative to that area.void
resize
(double width, double height) Invoked by the region's parent during layout to set the region's width and height.void
setMaxSize
(double maxWidth, double maxHeight) Convenience method for overriding the region's computed maximum width and height.void
setMinSize
(double minWidth, double minHeight) Convenience method for overriding the region's computed minimum width and height.void
setPrefSize
(double prefWidth, double prefHeight) Convenience method for overriding the region's computed preferred width and height.final double
Utility method to get the bottom inset which includes padding and border inset.final double
Utility method to get the left inset which includes padding and border inset.final double
Utility method to get the right inset which includes padding and border inset.final double
Utility method to get the top inset which includes padding and border inset.protected double
snapPosition
(double value) Deprecated.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.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.protected double
snapSize
(double value) Deprecated.replaced bysnapSizeX()
andsnapSizeY()
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.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.protected double
snapSpace
(double value) Deprecated.replaced bysnapSpaceX()
andsnapSpaceY()
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.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.Methods inherited from class javafx.scene.Parent
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, isNeedsLayout, layout, layoutChildren, needsLayoutProperty, requestLayout, requestParentLayout, setLayoutFlag, setNeedsLayout, setSceneRoot
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_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, 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.HasBackgroundProperty
getBackground, setBackground
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendModeProperty, getBlendMode, setBlendMode
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBorderProperty
getBorder, setBorder
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clipProperty, getClip, setClip
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effectProperty, getEffect, setEffect
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasHeightProperty
getHeight, setHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, layoutXProperty, setLayoutX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, layoutYProperty, setLayoutY
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, managedProperty, setManaged
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxHeightProperty
getMaxHeight, setMaxHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxWidthProperty
getMaxWidth, setMaxWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinHeightProperty
getMinHeight, setMinHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinWidthProperty
getMinWidth, setMinWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, mouseTransparentProperty, setMouseTransparent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, onMouseClickedProperty, setOnMouseClicked
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, opacityProperty, setOpacity
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPaddingProperty
getPadding, setPadding
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, parentProperty, setParent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefHeightProperty
getPrefHeight, setPrefHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefWidthProperty
getPrefWidth, setPrefWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasSnapToPixelProperty
isSnapToPixel, setSnapToPixel
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible, visibleProperty
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasWidthProperty
getWidth, setWidth
Methods inherited from interface javafx.scene.INode
autosize, getAllNodeTransforms, getBaselineOffset, getContentBias, getNodePeer, getOrCreateAndBindNodePeer, getProperties, getScene, getTransforms, hasProperties, relocate, resizeRelocate
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, getLayoutMeasurable, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth
Methods inherited from interface javafx.scene.layout.PreferenceResizableNode
isResizable
-
Property Details
-
width
- Specified by:
widthProperty
in interfaceHasWidthProperty
- Returns:
- the
width
property - See Also:
-
height
- Specified by:
heightProperty
in interfaceHasHeightProperty
- Returns:
- the
height
property - See Also:
-
maxWidth
- Specified by:
maxWidthProperty
in interfaceHasMaxWidthProperty
- Returns:
- the
maxWidth
property - See Also:
-
minWidth
- Specified by:
minWidthProperty
in interfaceHasMinWidthProperty
- Returns:
- the
minWidth
property - See Also:
-
maxHeight
- Specified by:
maxHeightProperty
in interfaceHasMaxHeightProperty
- Returns:
- the
maxHeight
property - See Also:
-
minHeight
- Specified by:
minHeightProperty
in interfaceHasMinHeightProperty
- Returns:
- the
minHeight
property - See Also:
-
prefWidth
- Specified by:
prefWidthProperty
in interfaceHasPrefWidthProperty
- Returns:
- the
prefWidth
property - See Also:
-
prefHeight
- Specified by:
prefHeightProperty
in interfaceHasPrefHeightProperty
- Returns:
- the
prefHeight
property - 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:
paddingProperty
in interfaceHasPaddingProperty
- Returns:
- the
padding
property - See Also:
-
snapToPixel
- Specified by:
snapToPixelProperty
in interfaceHasSnapToPixelProperty
- Returns:
- the
snapToPixel
property - See Also:
-
background
- Specified by:
backgroundProperty
in interfaceHasBackgroundProperty
- Returns:
- the
background
property - See Also:
-
border
- Specified by:
borderProperty
in interfaceHasBorderProperty
- Returns:
- the
border
property - See Also:
-
-
Constructor Details
-
Region
public Region() -
Region
-
-
Method Details
-
widthProperty
- Specified by:
widthProperty
in interfaceHasWidthProperty
- Returns:
- the
width
property - See Also:
-
heightProperty
- Specified by:
heightProperty
in interfaceHasHeightProperty
- Returns:
- the
height
property - See Also:
-
maxWidthProperty
- Specified by:
maxWidthProperty
in interfaceHasMaxWidthProperty
- Returns:
- the
maxWidth
property - See Also:
-
minWidthProperty
- Specified by:
minWidthProperty
in interfaceHasMinWidthProperty
- Returns:
- the
minWidth
property - See Also:
-
maxHeightProperty
- Specified by:
maxHeightProperty
in interfaceHasMaxHeightProperty
- Returns:
- the
maxHeight
property - See Also:
-
minHeightProperty
- Specified by:
minHeightProperty
in interfaceHasMinHeightProperty
- Returns:
- the
minHeight
property - See Also:
-
prefWidthProperty
- Specified by:
prefWidthProperty
in interfaceHasPrefWidthProperty
- Returns:
- the
prefWidth
property - See Also:
-
prefHeightProperty
- Specified by:
prefHeightProperty
in interfaceHasPrefHeightProperty
- Returns:
- the
prefHeight
property - See Also:
-
getInsets
Gets the value of theinsets
property.- 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
insets
property - 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
insets
property - Since:
- JavaFX 8.0
- See Also:
-
paddingProperty
- Specified by:
paddingProperty
in interfaceHasPaddingProperty
- Returns:
- the
padding
property - See Also:
-
snapToPixelProperty
- Specified by:
snapToPixelProperty
in interfaceHasSnapToPixelProperty
- Returns:
- the
snapToPixel
property - See Also:
-
backgroundProperty
- Specified by:
backgroundProperty
in interfaceHasBackgroundProperty
- Returns:
- the
background
property - See Also:
-
borderProperty
- Specified by:
borderProperty
in interfaceHasBorderProperty
- Returns:
- the
border
property - See Also:
-
impl_computeGeomBounds
Description copied from class:Parent
This 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_computeGeomBounds
in 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_minWidth
in 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_minHeight
in 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_prefWidth
in 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_prefHeight
in 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_maxWidth
in 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_maxHeight
in 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:
computeMinWidth
in 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:
computeMinHeight
in 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:
computePrefWidth
in 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:
computePrefHeight
in 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_computeLayoutBounds
in 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
,areaWidth
xareaHeight
, 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.BASELINE
then it will position the node so that its own baseline aligns with the passed inbaselineOffset
, otherwise the baseline parameter is ignored.If
snapToPixel
istrue
for 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
,areaWidth
xareaHeight
, 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.BASELINE
then it will position the node so that its own baseline aligns with the passed inbaselineOffset
, otherwise the baseline parameter is ignored.If
snapToPixel
istrue
for this region, then the x/y position values will be rounded to their nearest pixel boundaries.If
margin
is 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
,areaWidth
xareaHeight
, 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.BASELINE
then the node's baseline will be aligned with the area baseline offset parameter, otherwise the baseline parameter is ignored.If
snapToPixel
istrue
for 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
,areaWidth
xareaHeight
, 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.BASELINE
then the node's baseline will be aligned with the area baseline offset parameter, otherwise the baseline parameter is ignored.If
margin
is non-null, then that space will be allocated around the child within the layout area. margin may be null.If
snapToPixel
istrue
for 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
,areaWidth
xareaHeight
, with a baseline offset relative to that area.If the child is resizable, this method will use
fillWidth
andfillHeight
to 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.BASELINE
then the node's baseline will be aligned with the area baseline offset parameter, otherwise the baseline parameter is ignored.If
margin
is non-null, then that space will be allocated around the child within the layout area. margin may be null.If
snapToPixel
istrue
for 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
,areaWidth
xareaHeight
, with a baseline offset relative to that area.If the child is resizable, this method will use
fillWidth
andfillHeight
to 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.BASELINE
then the node's baseline will be aligned with the area baseline offset parameter, otherwise the baseline parameter is ignored.If
margin
is non-null, then that space will be allocated around the child within the layout area. margin may be null.If
snapToPixel
istrue
for 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()