Spec-Zone .ru
спецификации, руководства, описания, API
|
public class Region extends Parent
It can have multiple backgrounds under its contents and multiple borders
around its content. By default it's a rectangle with possible rounded corners,
depending on borders. It can be made into any shape by specifying the shape
.
It is designed to support as much of the CSS3 specification for backgrounds
and borders as is relevant to JavaFX.
By default a Region inherits the layout behavior of its superclass, Parent
,
which means that it will resize any resizable child nodes to their preferred
size, but will not reposition them. If an application needs more specific
layout behavior, then it should use one of the Region subclasses:
StackPane
, HBox
, VBox
, TilePane
, FlowPane
,
BorderPane
, GridPane
, or AnchorPane
.
To implement more custom layout, a Region subclass must override
computePrefWidth
, computePrefHeight
, and layoutChildren
.
Note that layoutChildren
is called automatically by the scene graph while
executing a top-down layout pass and it should not be invoked directly by the
region subclass.
Region subclasses which layout their children will position nodes by setting
layoutX
/layoutY
and do not alter
translateX
/translateY
, which are reserved for
adjustments and animation.
Type | Property and Description |
---|---|
ReadOnlyDoubleProperty |
height
The height of this resizable node.
|
DoubleProperty |
maxHeight
Property for overriding the region's computed maximum height.
|
DoubleProperty |
maxWidth
Property for overriding the region's computed maximum width.
|
DoubleProperty |
minHeight
Property for overriding the region's computed minimum height.
|
DoubleProperty |
minWidth
Property for overriding the region's computed minimum width.
|
ObjectProperty<Insets> |
padding
The top,right,bottom,left padding around the region's content.
|
DoubleProperty |
prefHeight
Property for overriding the region's computed preferred height.
|
DoubleProperty |
prefWidth
Property for overriding the region's computed preferred width.
|
BooleanProperty |
snapToPixel
Defines whether this region rounds position/spacing and ceils size
values to pixel boundaries when laying out its children.
|
ReadOnlyDoubleProperty |
width
The width of this resizable node.
|
needsLayout
blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, visible
Modifier and Type | Field and Description |
---|---|
static double |
USE_COMPUTED_SIZE
Sentinel value which can be passed to a region's
setMinWidth , setMinHeight ,
setPrefWidth , setPrefHeight , setMaxWidth , setMaxHeight methods
to reset the region's size constraint back to it's intrinsic size returned
by computeMinWidth , computeMinHeight ,
computePrefWidth , computePrefHeight ,
computeMaxWidth , or computeMaxHeight . |
static double |
USE_PREF_SIZE
Sentinel value which can be passed to a region's
setMinWidth , setMinHeight ,
setMaxWidth or setMaxHeight methods to indicate that the preferred dimension
should be used for that max and/or min constraint. |
Constructor and Description |
---|
Region()
Creates a Region layout.
|
Modifier and Type | Method and Description |
---|---|
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.
|
double |
getHeight()
Gets the value of the property height.
|
Insets |
getInsets()
Gets the space around content, which will include any borders plus padding if set.
|
double |
getMaxHeight()
Gets the value of the property maxHeight.
|
double |
getMaxWidth()
Gets the value of the property maxWidth.
|
double |
getMinHeight()
Gets the value of the property minHeight.
|
double |
getMinWidth()
Gets the value of the property minWidth.
|
Insets |
getPadding()
Gets the value of the property padding.
|
double |
getPrefHeight()
Gets the value of the property prefHeight.
|
double |
getPrefWidth()
Gets the value of the property prefWidth.
|
double |
getWidth()
Gets the value of the property width.
|
ReadOnlyDoubleProperty |
heightProperty()
The height of this resizable node.
|
boolean |
isResizable()
Returns
true since all Regions are resizable. |
boolean |
isSnapToPixel()
Gets the value of the property snapToPixel.
|
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 by
areaX , areaY , areaWidth x areaHeight ,
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 by
areaX , areaY , areaWidth x areaHeight ,
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 by
areaX , areaY , areaWidth x areaHeight ,
with a baseline offset relative to that area. |
double |
maxHeight(double width)
Called during layout to determine the maximum height for this node.
|
DoubleProperty |
maxHeightProperty()
Property for overriding the region's computed maximum height.
|
double |
maxWidth(double height)
Called during layout to determine the maximum width for this node.
|
DoubleProperty |
maxWidthProperty()
Property for overriding the region's computed maximum width.
|
double |
minHeight(double width)
Called during layout to determine the minimum height for this node.
|
DoubleProperty |
minHeightProperty()
Property for overriding the region's computed minimum height.
|
double |
minWidth(double height)
Called during layout to determine the minimum width for this node.
|
DoubleProperty |
minWidthProperty()
Property for overriding the region's computed minimum width.
|
ObjectProperty<Insets> |
paddingProperty()
The top,right,bottom,left padding around the region's content.
|
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 by
areaX , areaY , areaWidth x areaHeight ,
with a baseline offset relative to that area. |
protected void |
positionInArea(Node child,
double areaX,
double areaY,
double areaWidth,
double areaHeight,
double areaBaselineOffset,
Insets margin,
HPos halignment,
VPos valignment)
Utility method which positions the child within an area of this
region defined by
areaX , areaY , areaWidth x areaHeight ,
with a baseline offset relative to that area. |
double |
prefHeight(double width)
Called during layout to determine the preferred height for this node.
|
DoubleProperty |
prefHeightProperty()
Property for overriding the region's computed preferred height.
|
double |
prefWidth(double height)
Called during layout to determine the preferred width for this node.
|
DoubleProperty |
prefWidthProperty()
Property for overriding the region's computed preferred width.
|
void |
resize(double width,
double height)
Invoked by the region's parent during layout to set the region's
width and height.
|
protected void |
setHeight(double value)
Sets the value of the property height.
|
void |
setMaxHeight(double value)
Sets the value of the property maxHeight.
|
void |
setMaxSize(double maxWidth,
double maxHeight)
Convenience method for overriding the region's computed maximum width and height.
|
void |
setMaxWidth(double value)
Sets the value of the property maxWidth.
|
void |
setMinHeight(double value)
Sets the value of the property minHeight.
|
void |
setMinSize(double minWidth,
double minHeight)
Convenience method for overriding the region's computed minimum width and height.
|
void |
setMinWidth(double value)
Sets the value of the property minWidth.
|
void |
setPadding(Insets value)
Sets the value of the property padding.
|
void |
setPrefHeight(double value)
Sets the value of the property prefHeight.
|
void |
setPrefSize(double prefWidth,
double prefHeight)
Convenience method for overriding the region's computed preferred width and height.
|
void |
setPrefWidth(double value)
Sets the value of the property prefWidth.
|
void |
setSnapToPixel(boolean value)
Sets the value of the property snapToPixel.
|
protected void |
setWidth(double value)
Sets the value of the property width.
|
protected double |
snapPosition(double value)
If this region's snapToPixel property is true, returns a value rounded
to the nearest pixel, else returns the same value.
|
protected double |
snapSize(double value)
If this region's snapToPixel property is true, returns a value ceiled
to the nearest pixel, else returns the same value.
|
protected double |
snapSpace(double value)
If this region's snapToPixel property is true, returns a value rounded
to the nearest pixel, else returns the same value.
|
BooleanProperty |
snapToPixelProperty()
Defines whether this region rounds position/spacing and ceils size
values to pixel boundaries when laying out its children.
|
ReadOnlyDoubleProperty |
widthProperty()
The width of this resizable node.
|
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, lookup, needsLayoutProperty, requestLayout, setNeedsLayout
addEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToSceneTransformProperty, lookupAll, managedProperty, mouseTransparentProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, visibleProperty
public final BooleanProperty snapToPixelProperty
isSnapToPixel()
,
setSnapToPixel(boolean)
public final ObjectProperty<Insets> paddingProperty
getPadding()
,
setPadding(Insets)
public final ReadOnlyDoubleProperty widthProperty
minWidth
, prefWidth
,
and maxWidth
properties.getWidth()
,
setWidth(double)
public final ReadOnlyDoubleProperty heightProperty
minHeight
, prefHeight
,
and maxHeight
properties.getHeight()
,
setHeight(double)
public final DoubleProperty minWidthProperty
Defaults to the USE_COMPUTED_SIZE
flag, which means that
minWidth(forHeight)
will return the region's internally
computed minimum width.
Setting this value to the USE_PREF_SIZE
flag will cause
minWidth(forHeight)
to return the region's preferred width,
enabling applications to easily restrict the resizability of the region.
getMinWidth()
,
setMinWidth(double)
public final DoubleProperty minHeightProperty
Defaults to the USE_COMPUTED_SIZE
flag, which means that
minHeight(forWidth)
will return the region's internally
computed minimum height.
Setting this value to the USE_PREF_SIZE
flag will cause
minHeight(forWidth)
to return the region's preferred height,
enabling applications to easily restrict the resizability of the region.
getMinHeight()
,
setMinHeight(double)
public final DoubleProperty prefWidthProperty
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefWidth(forHeight)
will return the region's internally
computed preferred width.
getPrefWidth()
,
setPrefWidth(double)
public final DoubleProperty prefHeightProperty
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefHeight(forWidth)
will return the region's internally
computed preferred width.
getPrefHeight()
,
setPrefHeight(double)
public final DoubleProperty maxWidthProperty
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxWidth(forHeight)
will return the region's internally
computed maximum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxWidth(forHeight)
to return the region's preferred width,
enabling applications to easily restrict the resizability of the region.
getMaxWidth()
,
setMaxWidth(double)
public final DoubleProperty maxHeightProperty
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxHeight(forWidth)
will return the region's internally
computed maximum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxHeight(forWidth)
to return the region's preferred height,
enabling applications to easily restrict the resizability of the region.
getMaxHeight()
,
setMaxHeight(double)
public static final double USE_PREF_SIZE
setMinWidth
, setMinHeight
,
setMaxWidth
or setMaxHeight
methods to indicate that the preferred dimension
should be used for that max and/or min constraint.public static final double USE_COMPUTED_SIZE
setMinWidth
, setMinHeight
,
setPrefWidth
, setPrefHeight
, setMaxWidth
, setMaxHeight
methods
to reset the region's size constraint back to it's intrinsic size returned
by computeMinWidth
, computeMinHeight
,
computePrefWidth
, computePrefHeight
,
computeMaxWidth
, or computeMaxHeight
.public final BooleanProperty snapToPixelProperty()
isSnapToPixel()
,
setSnapToPixel(boolean)
public final void setSnapToPixel(boolean value)
public final boolean isSnapToPixel()
public final ObjectProperty<Insets> paddingProperty()
getPadding()
,
setPadding(Insets)
public final void setPadding(Insets value)
public final Insets getPadding()
public Insets getInsets()
public final ReadOnlyDoubleProperty widthProperty()
minWidth
, prefWidth
,
and maxWidth
properties.getWidth()
,
setWidth(double)
protected void setWidth(double value)
minWidth
, prefWidth
,
and maxWidth
properties.public final double getWidth()
minWidth
, prefWidth
,
and maxWidth
properties.public final ReadOnlyDoubleProperty heightProperty()
minHeight
, prefHeight
,
and maxHeight
properties.getHeight()
,
setHeight(double)
protected void setHeight(double value)
minHeight
, prefHeight
,
and maxHeight
properties.public final double getHeight()
minHeight
, prefHeight
,
and maxHeight
properties.public final DoubleProperty minWidthProperty()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
minWidth(forHeight)
will return the region's internally
computed minimum width.
Setting this value to the USE_PREF_SIZE
flag will cause
minWidth(forHeight)
to return the region's preferred width,
enabling applications to easily restrict the resizability of the region.
getMinWidth()
,
setMinWidth(double)
public final void setMinWidth(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
minWidth(forHeight)
will return the region's internally
computed minimum width.
Setting this value to the USE_PREF_SIZE
flag will cause
minWidth(forHeight)
to return the region's preferred width,
enabling applications to easily restrict the resizability of the region.
public final double getMinWidth()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
minWidth(forHeight)
will return the region's internally
computed minimum width.
Setting this value to the USE_PREF_SIZE
flag will cause
minWidth(forHeight)
to return the region's preferred width,
enabling applications to easily restrict the resizability of the region.
public final DoubleProperty minHeightProperty()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
minHeight(forWidth)
will return the region's internally
computed minimum height.
Setting this value to the USE_PREF_SIZE
flag will cause
minHeight(forWidth)
to return the region's preferred height,
enabling applications to easily restrict the resizability of the region.
getMinHeight()
,
setMinHeight(double)
public final void setMinHeight(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
minHeight(forWidth)
will return the region's internally
computed minimum height.
Setting this value to the USE_PREF_SIZE
flag will cause
minHeight(forWidth)
to return the region's preferred height,
enabling applications to easily restrict the resizability of the region.
public final double getMinHeight()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
minHeight(forWidth)
will return the region's internally
computed minimum height.
Setting this value to the USE_PREF_SIZE
flag will cause
minHeight(forWidth)
to return the region's preferred height,
enabling applications to easily restrict the resizability of the region.
public void setMinSize(double minWidth, double minHeight)
minWidth
- the override value for minimum widthminHeight
- the override value for minimum heightsetMinWidth(double)
,
setMinHeight(double)
public final DoubleProperty prefWidthProperty()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefWidth(forHeight)
will return the region's internally
computed preferred width.
getPrefWidth()
,
setPrefWidth(double)
public final void setPrefWidth(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefWidth(forHeight)
will return the region's internally
computed preferred width.
public final double getPrefWidth()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefWidth(forHeight)
will return the region's internally
computed preferred width.
public final DoubleProperty prefHeightProperty()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefHeight(forWidth)
will return the region's internally
computed preferred width.
getPrefHeight()
,
setPrefHeight(double)
public final void setPrefHeight(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefHeight(forWidth)
will return the region's internally
computed preferred width.
public final double getPrefHeight()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getPrefHeight(forWidth)
will return the region's internally
computed preferred width.
public void setPrefSize(double prefWidth, double prefHeight)
prefWidth
- the override value for preferred widthprefHeight
- the override value for preferred heightsetPrefWidth(double)
,
setPrefHeight(double)
public final DoubleProperty maxWidthProperty()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxWidth(forHeight)
will return the region's internally
computed maximum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxWidth(forHeight)
to return the region's preferred width,
enabling applications to easily restrict the resizability of the region.
getMaxWidth()
,
setMaxWidth(double)
public final void setMaxWidth(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxWidth(forHeight)
will return the region's internally
computed maximum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxWidth(forHeight)
to return the region's preferred width,
enabling applications to easily restrict the resizability of the region.
public final double getMaxWidth()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxWidth(forHeight)
will return the region's internally
computed maximum width.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxWidth(forHeight)
to return the region's preferred width,
enabling applications to easily restrict the resizability of the region.
public final DoubleProperty maxHeightProperty()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxHeight(forWidth)
will return the region's internally
computed maximum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxHeight(forWidth)
to return the region's preferred height,
enabling applications to easily restrict the resizability of the region.
getMaxHeight()
,
setMaxHeight(double)
public final void setMaxHeight(double value)
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxHeight(forWidth)
will return the region's internally
computed maximum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxHeight(forWidth)
to return the region's preferred height,
enabling applications to easily restrict the resizability of the region.
public final double getMaxHeight()
Defaults to the USE_COMPUTED_SIZE
flag, which means that
getMaxHeight(forWidth)
will return the region's internally
computed maximum height.
Setting this value to the USE_PREF_SIZE
flag will cause
getMaxHeight(forWidth)
to return the region's preferred height,
enabling applications to easily restrict the resizability of the region.
public void setMaxSize(double maxWidth, double maxHeight)
maxWidth
- the override value for maximum widthmaxHeight
- the override value for maximum heightsetMaxWidth(double)
,
setMaxHeight(double)
public boolean isResizable()
true
since all Regions are resizable.isResizable
in class Node
Node.getContentBias()
,
Node.minWidth(double)
,
Node.minHeight(double)
,
Node.prefWidth(double)
,
Node.prefHeight(double)
,
Node.maxWidth(double)
,
Node.maxHeight(double)
,
Node.resize(double, double)
,
Node.getLayoutBounds()
public void resize(double width, double height)
setMinSize()
,
setPrefSize()
, or setMaxSize()
and it's parent
will honor those overrides during layout.resize
in class Node
width
- the target layout bounds widthheight
- the target layout bounds heightNode.isResizable()
,
Node.getContentBias()
,
Node.autosize()
,
Node.minWidth(double)
,
Node.minHeight(double)
,
Node.prefWidth(double)
,
Node.prefHeight(double)
,
Node.maxWidth(double)
,
Node.maxHeight(double)
,
Node.getLayoutBounds()
public final double minWidth(double height)
computeMinWidth(forHeight)
unless
the application overrode the minimum width by setting the minWidth property.minWidth
in class Parent
height
- the height that should be used if minimum width depends on itsetMinWidth(double)
public final double minHeight(double width)
computeMinHeight(forWidth)
unless
the application overrode the minimum height by setting the minHeight property.minHeight
in class Parent
width
- the width that should be used if minimum height depends on itsetMinHeight(double)
public final double prefWidth(double height)
computePrefWidth(forHeight)
unless
the application overrode the preferred width by setting the prefWidth property.prefWidth
in class Parent
height
- the height that should be used if preferred width depends on itsetPrefWidth(double)
public final double prefHeight(double width)
computePrefHeight(forWidth)
unless
the application overrode the preferred height by setting the prefHeight property.prefHeight
in class Parent
width
- the width that should be used if preferred height depends on itsetPrefHeight(double)
public final double maxWidth(double height)
computeMaxWidth(forHeight)
unless
the application overrode the maximum width by setting the maxWidth property.maxWidth
in class Node
height
- the height that should be used if maximum width depends on itsetMaxWidth(double)
public final double maxHeight(double width)
computeMaxHeight(forWidth)
unless
the application overrode the maximum height by setting the maxHeight property.maxHeight
in class Node
width
- the width that should be used if maximum height depends on itsetMaxHeight(double)
protected double computeMinWidth(double height)
computeMinWidth
in class Parent
height
- the height that should be used if min width depends
on itprotected double computeMinHeight(double width)
computeMinHeight
in class Parent
width
- the width that should be used if min height depends
on itprotected double computePrefWidth(double height)
computePrefWidth
in class Parent
height
- the height that should be used if preferred width depends
on itprotected double computePrefHeight(double width)
computePrefHeight
in class Parent
width
- the width that should be used if preferred height depends
on itprotected double computeMaxWidth(double height)
protected double computeMaxHeight(double width)
protected double snapSpace(double value)
value
- the space value to be snappedprotected double snapSize(double value)
value
- the size value to be snappedprotected double snapPosition(double value)
value
- the position value to be snappedprotected void positionInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, HPos halignment, VPos valignment)
areaX
, areaY
, areaWidth
x areaHeight
,
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 in
baselineOffset
, otherwise the baseline parameter is ignored.
If snapToPixel
is true
for this region, then the x/y position
values will be rounded to their nearest pixel boundaries.
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 areaprotected void positionInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, HPos halignment, VPos valignment)
areaX
, areaY
, areaWidth
x areaHeight
,
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 in
baselineOffset
, otherwise the baseline parameter is ignored.
If snapToPixel
is true
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.
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 areaprotected void layoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, HPos halignment, VPos valignment)
areaX
, areaY
, areaWidth
x areaHeight
,
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
is true
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.
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 areaprotected void layoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, HPos halignment, VPos valignment)
areaX
, areaY
, areaWidth
x areaHeight
,
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
is true
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.
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 areaprotected void layoutInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double areaBaselineOffset, Insets margin, boolean fillWidth, boolean fillHeight, HPos halignment, VPos valignment)
areaX
, areaY
, areaWidth
x areaHeight
,
with a baseline offset relative to that area.
If the child is resizable, this method will use fillWidth
and fillHeight
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
is true
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.
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 areaCopyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to