Class AbstractFlowLayout<T extends AbstractFlowConstraints>

java.lang.Object
com.globalmentor.beans.BoundPropertyObject
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
  • Field Details

    • ALIGNMENT_PROPERTY

      public static final String ALIGNMENT_PROPERTY
      The bound property of the alignment.
    • FLOW_PROPERTY

      public static final String FLOW_PROPERTY
      The bound property of the flow.
    • GAP_AFTER_PROPERTY

      public static final String GAP_AFTER_PROPERTY
      The bound property of the gap after flowed components.
    • GAP_BEFORE_PROPERTY

      public static final String GAP_BEFORE_PROPERTY
      The bound property of the gap before flowed components.
    • GAP_BETWEEN_PROPERTY

      public static final String GAP_BETWEEN_PROPERTY
      The bound property of the gap between flowed components.
    • WRAPPED_PROPERTY

      public static final String WRAPPED_PROPERTY
      The bound property of whether wrapping occurs.
  • Constructor Details

    • AbstractFlowLayout

      public AbstractFlowLayout(Flow flow, boolean wrapped)
      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 is null.
  • 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 the Flow.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 the Flow.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 type Double.
      Parameters:
      newAlignment - The alignment of components perpendicular to the flow axis in terms relative to the beginning of the alignment axis.
      See Also:
    • getFlow

      public Flow getFlow()
      Returns:
      The logical axis (line or page) along which information is flowed.
    • setFlow

      public void setFlow(Flow newFlow)
      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 is null.
      See Also:
    • getGapAfter

      public Extent getGapAfter()
      Returns:
      The gap after flowed components.
    • setGapAfter

      public void setGapAfter(Extent newGapAfter)
      Sets the gap after flowed components. This is a bound property.
      Parameters:
      newGapAfter - The gap after flowed components.
      Throws:
      NullPointerException - if the given gap is null.
      See Also:
    • getGapBefore

      public Extent getGapBefore()
      Returns:
      The gap before flowed components.
    • setGapBefore

      public void setGapBefore(Extent newGapBefore)
      Sets the gap before flowed components. This is a bound property.
      Parameters:
      newGapBefore - The gap before flowed components.
      Throws:
      NullPointerException - if the given gap is null.
      See Also:
    • getGapBetween

      public Extent getGapBetween()
      Returns:
      The gap between flowed components.
    • setGapBetween

      public void setGapBetween(Extent newGapBetween)
      Sets the gap between flowed components. This is a bound property.
      Parameters:
      newGapBetween - The gap between flowed components.
      Throws:
      NullPointerException - if the given gap is null.
      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 type Boolean.
      Parameters:
      newWrapped - Whether flowed children should be wrapped when the flow extent is reached.
      See Also:
    • setGap

      public void setGap(Extent newGap)
      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 is null.
      See Also: