Class RegionConstraints

  • All Implemented Interfaces:
    com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, Constraints

    public class RegionConstraints
    extends AbstractConstraints
    Constraints on individual component region layout.
    Author:
    Garret Wilson
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getAlignment​(Flow flow)
      Returns the alignment of the indicated flow relative to the beginning of the alignment axis.
      Extent getExtent​(Flow flow)
      Returns the extent of the indicated flow.
      double getLineAlignment()  
      Extent getLineExtent()
      Returns the extent of the line flow.
      Extent getPaddingExtent​(Border border)
      Returns the padding extent of the indicated border.
      Extent getPaddingLineFarExtent()
      Returns the padding extent of the line far page near border.
      Extent getPaddingLineNearExtent()
      Returns the padding extent of the line near page near border.
      Extent getPaddingPageFarExtent()
      Returns the padding extent of the line far page far border.
      Extent getPaddingPageNearExtent()
      Returns the padding extent of the line near page far border.
      double getPageAlignment()  
      Extent getPageExtent()
      Returns the extent of the page flow.
      Region getRegion()  
      void setAlignment​(Flow flow, double newAlignment)
      Sets the alignment of a given flow.
      void setExtent​(Flow flow, Extent newExtent)
      Sets the extent of a given flow.
      void setLineAlignment​(double newAlignment)
      Sets the alignment of the line flow.
      void setLineExtent​(Extent newExtent)
      Sets the extent of the line flow.
      void setPaddingExtent​(Border border, Extent newPaddingExtent)
      Sets the padding extent of a given border.
      void setPaddingExtent​(Extent newPaddingExtent)
      Sets the padding extent of all borders.
      void setPaddingLineFarExtent​(Extent newPaddingExtent)
      Sets the padding extent of the line far border.
      void setPaddingLineNearExtent​(Extent newPaddingExtent)
      Sets the padding extent of the line near border.
      void setPaddingPageFarExtent​(Extent newPaddingExtent)
      Sets the padding extent of the page far border.
      void setPaddingPageNearExtent​(Extent newPaddingExtent)
      Sets the padding extent of the page near border.
      void setPageAlignment​(double newAlignment)
      Sets the alignment of the page flow.
      void setPageExtent​(Extent newExtent)
      Sets the extent of the page flow.
      • 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 com.globalmentor.beans.PropertyBindable

        addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
    • Field Detail

      • LINE_ALIGNMENT_PROPERTY

        public static final java.lang.String LINE_ALIGNMENT_PROPERTY
        The bound property of the line alignment.
      • PAGE_ALIGNMENT_PROPERTY

        public static final java.lang.String PAGE_ALIGNMENT_PROPERTY
        The bound property of the page alignment.
      • LINE_EXTENT_PROPERTY

        public static final java.lang.String LINE_EXTENT_PROPERTY
        The line extent (width in left-to-right top-to-bottom orientation) bound property.
      • PAGE_EXTENT_PROPERTY

        public static final java.lang.String PAGE_EXTENT_PROPERTY
        The page extent (height in left-to-right top-to-bottom orientation) bound property.
      • PADDING_LINE_NEAR_EXTENT_PROPERTY

        public static final java.lang.String PADDING_LINE_NEAR_EXTENT_PROPERTY
        The bound property of the line near padding extent.
      • PADDING_LINE_FAR_EXTENT_PROPERTY

        public static final java.lang.String PADDING_LINE_FAR_EXTENT_PROPERTY
        The bound property of the line far padding extent.
      • PADDING_PAGE_NEAR_EXTENT_PROPERTY

        public static final java.lang.String PADDING_PAGE_NEAR_EXTENT_PROPERTY
        The bound property of the page near padding extent.
      • PADDING_PAGE_FAR_EXTENT_PROPERTY

        public static final java.lang.String PADDING_PAGE_FAR_EXTENT_PROPERTY
        The bound property of the page far padding extent.
    • Constructor Detail

      • RegionConstraints

        public RegionConstraints​(Region region)
        Region constructor.
        Parameters:
        region - The layout region for the associated component.
        Throws:
        java.lang.NullPointerException - if the given region is null.
    • Method Detail

      • getRegion

        public Region getRegion()
        Returns:
        The layout region for the associated component.
      • getAlignment

        public double getAlignment​(Flow flow)
        Returns the 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 alignment of the line flow relative to the beginning of the alignment axis.
      • getPageAlignment

        public double getPageAlignment()
        Returns:
        The alignment of the page flow relative to the beginning of the alignment axis.
      • setAlignment

        public void setAlignment​(Flow flow,
                                 double newAlignment)
        Sets the alignment of a given flow. The alignment of each flow represents a bound property of type Double.
        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:
        java.lang.NullPointerException - if the given flow is null.
        See Also:
        LINE_ALIGNMENT_PROPERTY, PAGE_ALIGNMENT_PROPERTY
      • setLineAlignment

        public void setLineAlignment​(double newAlignment)
        Sets the 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 is a bound property of type Double.
        Parameters:
        newAlignment - The line alignment of the region relative to the beginning of the alignment axis.
        See Also:
        LINE_ALIGNMENT_PROPERTY
      • 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 is a bound property of type Double.
        Parameters:
        newAlignment - The page alignment of the region relative to the beginning of the alignment axis.
        See Also:
        PAGE_ALIGNMENT_PROPERTY
      • getExtent

        public Extent getExtent​(Flow flow)
        Returns the extent of the indicated flow.
        Parameters:
        flow - The flow for which an extent should be returned.
        Returns:
        The extent of the given flow.
      • getLineExtent

        public Extent getLineExtent()
        Returns the 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

        public Extent getPageExtent()
        Returns the 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

        public void setExtent​(Flow flow,
                              Extent newExtent)
        Sets the extent of a given flow. 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, or null there is no extent preference.
        Throws:
        java.lang.NullPointerException - if the given flow is null.
        See Also:
        LINE_EXTENT_PROPERTY, PAGE_EXTENT_PROPERTY
      • setLineExtent

        public void setLineExtent​(Extent newExtent)
        Sets the extent of the line flow. In left-to-right top-to-bottom orientation, this is commonly known as the width. This is a bound property.
        Parameters:
        newExtent - The new requested extent of the region, or null there is no extent preference.
        See Also:
        LINE_EXTENT_PROPERTY
      • setPageExtent

        public void setPageExtent​(Extent newExtent)
        Sets the extent of the page flow. In left-to-right top-to-bottom orientation, this is commonly known as the height. This is a bound property.
        Parameters:
        newExtent - The new requested extent of the region, or null there is no extent preference.
        See Also:
        PAGE_EXTENT_PROPERTY
      • getPaddingExtent

        public Extent getPaddingExtent​(Border border)
        Returns the 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

        public Extent getPaddingLineNearExtent()
        Returns the padding extent of the line near page near border.
        Returns:
        The padding extent of the given border.
      • getPaddingLineFarExtent

        public Extent getPaddingLineFarExtent()
        Returns the padding extent of the line far page near border.
        Returns:
        The padding extent of the given border.
      • getPaddingPageNearExtent

        public Extent getPaddingPageNearExtent()
        Returns the padding extent of the line near page far border.
        Returns:
        The padding extent of the given border.
      • getPaddingPageFarExtent

        public Extent getPaddingPageFarExtent()
        Returns the padding extent of the line far page far border.
        Returns:
        The padding extent of the given border.
      • setPaddingLineNearExtent

        public void setPaddingLineNearExtent​(Extent newPaddingExtent)
        Sets the padding extent of the line near border. This is a bound property.
        Parameters:
        newPaddingExtent - The padding extent.
        Throws:
        java.lang.NullPointerException - if the given padding extent is null.
        See Also:
        PADDING_LINE_NEAR_EXTENT_PROPERTY
      • setPaddingLineFarExtent

        public void setPaddingLineFarExtent​(Extent newPaddingExtent)
        Sets the padding extent of the line far border. This is a bound property.
        Parameters:
        newPaddingExtent - The padding extent, or null if the default padding extent should be used.
        Throws:
        java.lang.NullPointerException - if the given padding extent is null.
        See Also:
        PADDING_LINE_FAR_EXTENT_PROPERTY
      • setPaddingPageNearExtent

        public void setPaddingPageNearExtent​(Extent newPaddingExtent)
        Sets the padding extent of the page near border. This is a bound property.
        Parameters:
        newPaddingExtent - The padding extent, or null if the default padding extent should be used.
        Throws:
        java.lang.NullPointerException - if the given padding extent is null.
        See Also:
        PADDING_PAGE_NEAR_EXTENT_PROPERTY
      • setPaddingPageFarExtent

        public void setPaddingPageFarExtent​(Extent newPaddingExtent)
        Sets the padding extent of the page far border. This is a bound property.
        Parameters:
        newPaddingExtent - The padding extent, or null if the default padding extent should be used.
        Throws:
        java.lang.NullPointerException - if the given padding extent is null.
        See Also:
        PADDING_PAGE_FAR_EXTENT_PROPERTY