Class RegionLayout
java.lang.Object
com.globalmentor.beans.BoundPropertyObject
io.guise.framework.event.GuiseBoundPropertyObject
io.guise.framework.component.layout.AbstractLayout<RegionConstraints>
io.guise.framework.component.layout.RegionLayout
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
,Layout<RegionConstraints>
A layout that defines locations of components in internationalized relative terms. This layout uses default constraints of
Region.CENTER
.
The region will span two of the components, if present, across the perpendicular flow. Which flow is spanned across the other is determined by setting
setSpanFlow(Flow)
. For example, in a right-to-left top-to-bottom orientation, a span flow of Flow.LINE
(the default) will result in the top
and bottom components spanning across the space used by the left, center, and right components.
- Author:
- Garret Wilson
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.guise.framework.component.layout.AbstractLayout
AbstractLayout.ConstraintsPropertyChangeListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The bound property of the fixed setting.static final String
The bound property of the line alignment.static final String
The line extent (width in left-to-right top-to-bottom orientation) bound property.static final String
The bound property of the line far padding extent.static final String
The bound property of the line near padding extent.static final String
The bound property of the page far padding extent.static final String
The bound property of the page near padding extent.static final String
The bound property of the page alignment.static final String
The page extent (height in left-to-right top-to-bottom orientation) bound property.static final String
The bound property of the span flow.Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor withFlow.LINE
span flow.RegionLayout
(Flow spanFlow) Span flow constructor. -
Method Summary
Modifier and TypeMethodDescriptionCreates default constraints for the layout component.double
getAlignment
(Flow flow) Returns the default alignment of the indicated flow relative to the beginning of the alignment axis.getComponent
(Region region) Retrieves a component for a given region.Class<? extends RegionConstraints>
Returns the default extent of the indicated flow.double
Returns the default extent of the line flow.getPaddingExtent
(Border border) Returns the default padding extent of the indicated border.Returns the default padding extent of the line far page near border.Returns the default padding extent of the line near page near border.Returns the default padding extent of the line far page far border.Returns the default padding extent of the line near page far border.double
Returns the default extent of the page flow.boolean
isFixed()
void
setAlignment
(Flow flow, double newAlignment) Sets the alignment of a given flow.void
Sets the default extent of a given flow.void
setFixed
(boolean newFixed) Sets whether the sizes of the regions are fixed or will dynamically change to support the given content.void
setLineAlignment
(double newAlignment) Sets the default alignment of the line flow.void
setLineExtent
(Extent newExtent) Sets the default extent of the line flow.void
setPaddingExtent
(Border border, Extent newPaddingExtent) Sets the default padding extent of a given border.void
setPaddingExtent
(Extent newPaddingExtent) Sets the default padding extent of all borders.void
setPaddingLineFarExtent
(Extent newPaddingExtent) Sets the default padding extent of the line far border.void
setPaddingLineNearExtent
(Extent newPaddingExtent) Sets the default padding extent of the line near border.void
setPaddingPageFarExtent
(Extent newPaddingExtent) Sets the default padding extent of the page far border.void
setPaddingPageNearExtent
(Extent newPaddingExtent) Sets the default padding extent of the page near border.void
setPageAlignment
(double newAlignment) Sets the alignment of the page flow.void
setPageExtent
(Extent newExtent) Sets the default extent of the page flow.void
setSpanFlow
(Flow newSpanFlow) Sets the logical axis which will span components across the other logical axis.Methods inherited from class io.guise.framework.component.layout.AbstractLayout
addComponent, componentConstraintsChanged, fireConstraintsPropertyChange, getComponentConstraintsChangeListener, getConstraints, getConstraintsPropertyChangeListener, getOwner, removeComponent, setOwner
Methods inherited from class io.guise.framework.event.GuiseBoundPropertyObject
getSession
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.guise.framework.component.layout.Layout
getSession
Methods inherited from interface com.globalmentor.beans.PropertyBindable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
FIXED_PROPERTY
The bound property of the fixed setting. -
LINE_ALIGNMENT_PROPERTY
The bound property of the line alignment. -
PAGE_ALIGNMENT_PROPERTY
The bound property of the page alignment. -
LINE_EXTENT_PROPERTY
The line extent (width in left-to-right top-to-bottom orientation) bound property. -
PAGE_EXTENT_PROPERTY
The page extent (height in left-to-right top-to-bottom orientation) bound property. -
PADDING_LINE_NEAR_EXTENT_PROPERTY
The bound property of the line near padding extent. -
PADDING_LINE_FAR_EXTENT_PROPERTY
The bound property of the line far padding extent. -
PADDING_PAGE_NEAR_EXTENT_PROPERTY
The bound property of the page near padding extent. -
PADDING_PAGE_FAR_EXTENT_PROPERTY
The bound property of the page far padding extent. -
SPAN_FLOW_PROPERTY
The bound property of the span flow.
-
-
Constructor Details
-
RegionLayout
public RegionLayout()Default constructor withFlow.LINE
span flow. -
RegionLayout
Span flow constructor.- Parameters:
spanFlow
- The logical axis which will span components across the other logical axis.- Throws:
NullPointerException
- if the given span flow isnull
.
-
-
Method Details
-
isFixed
public boolean isFixed()- Returns:
- whether the sizes of the regions are fixed or will dynamically change to support the given content.
-
setFixed
public void setFixed(boolean newFixed) Sets whether the sizes of the regions are fixed or will dynamically change to support the given content. This is a bound property of typeBoolean
.- Parameters:
newFixed
-true
if the sizes of the regions are fixed, orfalse
if the regions will dynamically change to support the given content.- See Also:
-
getAlignment
Returns the default alignment of the indicated flow relative to the beginning of the alignment axis.- Parameters:
flow
- The flow for which an alignment should be returned.- Returns:
- The alignment of the given flow.
-
getLineAlignment
public double getLineAlignment()- Returns:
- The default alignment of the line flow relative to the beginning of the alignment axis.
-
getPageAlignment
public double getPageAlignment()- Returns:
- The default alignment of the page flow relative to the beginning of the alignment axis.
-
setAlignment
Sets the alignment of a given flow. This method also acts as a convenience method by unconditionally updating the flow alignment of the region constraints of any child components of this layout's owner. The alignment of each flow represents a bound property of typeDouble
.- Parameters:
flow
- The flow for which the alignment should be set.newAlignment
- The alignment of the region relative to the beginning of the given flow.- Throws:
NullPointerException
- if the given flow isnull
.- See Also:
-
setLineAlignment
public void setLineAlignment(double newAlignment) Sets the default alignment of the line flow. For example, in a left-to-right top-to-bottom orientation, line alignments of 0.0, 0.5, and 1.0 would be equivalent to what are commonly known as left, center, and right alignments, respectively. This method also acts as a convenience method by unconditionally updating the line alignment of the region constraints of any child components of this layout's owner. This is a bound property of typeDouble
.- Parameters:
newAlignment
- The line alignment of the region relative to the beginning of the alignment axis.- See Also:
-
setPageAlignment
public void setPageAlignment(double newAlignment) Sets the alignment of the page flow. For example, in a left-to-right top-to-bottom orientation, page alignments of 0.0, 0.5, and 1.0 would be equivalent to what are commonly known as top, middle, and bottom alignments, respectively. This method also acts as a convenience method by unconditionally updating the page alignment of the region constraints of any child components of this layout's owner. This is a bound property of typeDouble
.- Parameters:
newAlignment
- The page alignment of the region relative to the beginning of the alignment axis.- See Also:
-
getExtent
Returns the default extent of the indicated flow.- Parameters:
flow
- The flow for which an extent should be returned.- Returns:
- The extent of the given flow.
-
getLineExtent
Returns the default extent of the line flow. In left-to-right top-to-bottom orientation, this is commonly known as the width.- Returns:
- The extent of the flow, or
null
if no preferred extent has been specified
-
getPageExtent
Returns the default extent of the page flow. In left-to-right top-to-bottom orientation, this is commonly known as the height.- Returns:
- The extent of the flow, or
null
if no preferred extent has been specified
-
setExtent
Sets the default extent of a given flow. This method also acts as a convenience method by unconditionally updating the extent of any child components of this layout's owner. The extent of each flow represents a bound property.- Parameters:
flow
- The flow for which the extent should be set.newExtent
- The new requested extent of the region, ornull
there is no extent preference.- Throws:
NullPointerException
- if the given flow isnull
.- See Also:
-
setLineExtent
Sets the default extent of the line flow. In left-to-right top-to-bottom orientation, this is commonly known as the width. This method also acts as a convenience method by unconditionally updating the extent of any child components of this layout's owner. This is a bound property.- Parameters:
newExtent
- The new requested extent of the region, ornull
there is no extent preference.- See Also:
-
setPageExtent
Sets the default extent of the page flow. In left-to-right top-to-bottom orientation, this is commonly known as the height. This method also acts as a convenience method by unconditionally updating the extent of any child components of this layout's owner. This is a bound property.- Parameters:
newExtent
- The new requested extent of the region, ornull
there is no extent preference.- See Also:
-
getPaddingExtent
Returns the default padding extent of the indicated border.- Parameters:
border
- The border for which a padding extent should be returned.- Returns:
- The padding extent of the given border.
-
getPaddingLineNearExtent
Returns the default padding extent of the line near page near border.- Returns:
- The padding extent of the given border.
-
getPaddingLineFarExtent
Returns the default padding extent of the line far page near border.- Returns:
- The padding extent of the given border.
-
getPaddingPageNearExtent
Returns the default padding extent of the line near page far border.- Returns:
- The padding extent of the given border.
-
getPaddingPageFarExtent
Returns the default padding extent of the line far page far border.- Returns:
- The padding extent of the given border.
-
setPaddingExtent
Sets the default padding extent of a given border. This method also acts as a convenience method by unconditionally updating the padding extent of the region constraints of any child components of this layout's owner. The padding extent of each border represents a bound property.- Parameters:
border
- The border for which the padding extent should be set.newPaddingExtent
- The padding extent.- Throws:
NullPointerException
- if the given border and/or padding extent isnull
.- See Also:
-
setPaddingLineNearExtent
Sets the default padding extent of the line near border. This method also acts as a convenience method by unconditionally updating the padding extent of the region constraints of any child components of this layout's owner. This is a bound property.- Parameters:
newPaddingExtent
- The padding extent.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
setPaddingLineFarExtent
Sets the default padding extent of the line far border. This method also acts as a convenience method by unconditionally updating the padding extent of the region constraints of any child components of this layout's owner. This is a bound property.- Parameters:
newPaddingExtent
- The padding extent, ornull
if the default padding extent should be used.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
setPaddingPageNearExtent
Sets the default padding extent of the page near border. This method also acts as a convenience method by unconditionally updating the padding extent of the region constraints of any child components of this layout's owner. This is a bound property.- Parameters:
newPaddingExtent
- The padding extent, ornull
if the default padding extent should be used.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
setPaddingPageFarExtent
Sets the default padding extent of the page far border. This method also acts as a convenience method by unconditionally updating the padding extent of the region constraints of any child components of this layout's owner. This is a bound property.- Parameters:
newPaddingExtent
- The padding extent, ornull
if the default padding extent should be used.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
setPaddingExtent
Sets the default padding extent of all borders. This method also acts as a convenience method by unconditionally updating the padding extent of the region constraints of any child components of this layout's owner. The padding extent of each border represents a bound property. This is a convenience method that callssetPaddingExtent(Border, Extent)
for each border.- Parameters:
newPaddingExtent
- The padding extent.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
getSpanFlow
- Returns:
- The logical axis which will span components across the other logical axis.
-
setSpanFlow
Sets the logical axis which will span components across the other logical axis. This is a bound property.- Parameters:
newSpanFlow
- The logical axis which will span components across the other logical axis.- Throws:
NullPointerException
- if the given span flow isnull
.- See Also:
-
getConstraintsClass
- Returns:
- The class representing the type of constraints appropriate for this layout.
-
createDefaultConstraints
Creates default constraints for the layout component.This implementation returns
Region.CENTER
. The new extents will have the default alignment, extent, and padding.- Returns:
- New default constraints for the layout component.
-
getComponent
Retrieves a component for a given region.- Parameters:
region
- The region for which a component should be returned.- Returns:
- The component with which the given region is associated, or
null
if no component has the given region specified.
-