Java Reference
In-Depth Information
Table 5-7. Properties of the Region Class
Name
Access
Type
Default
Description
width
The width of the Node , set by the Parent
container
Read-only
Double
height
The height of the Node , set by the Parent
container
Read-only
Double
minWidth
Read/write
Double
USE_COMPUTED_SIZE
The overridden minimum width of
this Region
minHeight
Read/write
Double
USE_COMPUTED_SIZE
The overridden minimum height of
this Region
prefWidth
Read/write
Double
USE_COMPUTED_SIZE
The overridden preferred width of
this Region
prefHeight
Read/write
Double
USE_COMPUTED_SIZE
The overridden preferred height
of this Region
maxWidth
Read/write
Double
USE_COMPUTED_SIZE
The overridden maximum width
of this Region
maxHeight
Read/write
Double
USE_COMPUTED_SIZE
The overridden maximum height
of this Region
padding
Read/write
Insets
Insets.EMPTY
The amount of space requested on the
top, bottom, left, and right of this Region
snapToPixel
Read/write
Boolean
True
If true, will round off the position and size
of the Region to integral values
The width and height of a Region are read-only properties that you can use to get the size after layout is complete.
Be careful binding directly to the width and height, because any changes that affect the size of this node or its children
will not be updated until the next layout cycle, causing artifacts.
The padding property lets you set the amount of space to surround the content of the region during layout.
Again, we use the snapToPixel property before to make sure the TilePane fits within the scene boundaries with no
rounding errors. It is defined on the Region class and the default value of true will help reduce artifacts caused by pixel
misalignment.
The remaining properties let you override the min, max, and pref width and height of this Region . They are hints
to the Parent about how it should allocate space, and default to the calculated value for this Region . Once set, these
properties can be reset to their calculated values by giving them a value of Region.USE_COMPUTED_SIZE . Also, the
min and max properties can be assigned to the same value as the respective pref property by giving them a value of
Region.USE_PREF_SIZE .
To define the calculated values for these, override the calculate* functions defined on the Region class as listed
in Table 5-8 .
 
Search WWH ::




Custom Search