Class AbstractFlowLayout<T extends AbstractFlowConstraints>
java.lang.Object
com.globalmentor.beans.BoundPropertyObject
io.guise.framework.event.GuiseBoundPropertyObject
io.guise.framework.component.layout.AbstractLayout<T>
io.guise.framework.component.layout.AbstractFlowLayout<T>
- Type Parameters:
T
- The type of layout constraints associated with each component.
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
,Layout<T>
- Direct Known Subclasses:
FlowLayout
,MenuLayout
public abstract class AbstractFlowLayout<T extends AbstractFlowConstraints>
extends AbstractLayout<T>
A layout that flows information along an axis.
- Author:
- Garret Wilson
-
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 alignment.static final String
The bound property of the flow.static final String
The bound property of the gap after flowed components.static final String
The bound property of the gap before flowed components.static final String
The bound property of the gap between flowed components.static final String
The bound property of whether wrapping occurs.Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getFlow()
boolean
void
setAlignment
(double newAlignment) Sets the default alignment of components perpendicular to the flow axis.void
Sets the logical axis (line or page) along which information is flowed.void
Sets the gap before, between, and after flowed components.void
setGapAfter
(Extent newGapAfter) Sets the gap after flowed components.void
setGapBefore
(Extent newGapBefore) Sets the gap before flowed components.void
setGapBetween
(Extent newGapBetween) Sets the gap between flowed components.void
setWrapped
(boolean newWrapped) Sets whether flowed children are wrapped when the flow extent is reached.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
createDefaultConstraints, getConstraintsClass, getSession
Methods inherited from interface com.globalmentor.beans.PropertyBindable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
ALIGNMENT_PROPERTY
The bound property of the alignment. -
FLOW_PROPERTY
The bound property of the flow. -
GAP_AFTER_PROPERTY
The bound property of the gap after flowed components. -
GAP_BEFORE_PROPERTY
The bound property of the gap before flowed components. -
GAP_BETWEEN_PROPERTY
The bound property of the gap between flowed components. -
WRAPPED_PROPERTY
The bound property of whether wrapping occurs.
-
-
Constructor Details
-
AbstractFlowLayout
Flow and wrap constructor.- Parameters:
flow
- The logical axis (line or page) along which information is flowed.wrapped
- Whether flowed children should be wrapped when the flow extent is reached.- Throws:
NullPointerException
- if the flow axis isnull
.
-
-
Method Details
-
getAlignment
public double getAlignment()- Returns:
- The default alignment of components perpendicular to the flow axis in terms relative to the beginning of the alignment axis.
-
setAlignment
public void setAlignment(double newAlignment) Sets the default alignment of components perpendicular to the flow axis. For example, in a left-to-right top-to-bottom orientation flowing along theFlow.LINE
axis, alignments of 0.0, 0.5, and 1.0 would be equivalent to what are commonly known as left, center, and right alignments, respectively. In the same orientation flowing along theFlow.PAGE
axis, 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 alignment of the flow constraints of any child components of this layout's owner. This is a bound property of typeDouble
.- Parameters:
newAlignment
- The alignment of components perpendicular to the flow axis in terms relative to the beginning of the alignment axis.- See Also:
-
getFlow
- Returns:
- The logical axis (line or page) along which information is flowed.
-
setFlow
Sets the logical axis (line or page) along which information is flowed. This is a bound property.- Parameters:
newFlow
- The logical axis along which information is flowed.- Throws:
NullPointerException
- if the given flow isnull
.- See Also:
-
getGapAfter
- Returns:
- The gap after flowed components.
-
setGapAfter
Sets the gap after flowed components. This is a bound property.- Parameters:
newGapAfter
- The gap after flowed components.- Throws:
NullPointerException
- if the given gap isnull
.- See Also:
-
getGapBefore
- Returns:
- The gap before flowed components.
-
setGapBefore
Sets the gap before flowed components. This is a bound property.- Parameters:
newGapBefore
- The gap before flowed components.- Throws:
NullPointerException
- if the given gap isnull
.- See Also:
-
getGapBetween
- Returns:
- The gap between flowed components.
-
setGapBetween
Sets the gap between flowed components. This is a bound property.- Parameters:
newGapBetween
- The gap between flowed components.- Throws:
NullPointerException
- if the given gap isnull
.- See Also:
-
isWrapped
public boolean isWrapped()- Returns:
- Whether the description is displayed.
- See Also:
-
setWrapped
public void setWrapped(boolean newWrapped) Sets whether flowed children are wrapped when the flow extent is reached. This is a bound property of typeBoolean
.- Parameters:
newWrapped
- Whether flowed children should be wrapped when the flow extent is reached.- See Also:
-
setGap
Sets the gap before, between, and after flowed components. This is a convenience method that sets each of the gaps to the same value. Each gap represents a bound property.- Parameters:
newGap
- The gap before, between, and after flowed components.- Throws:
NullPointerException
- if the given gap isnull
.- See Also:
-