com.jgoodies.forms.layout

## Class BoundedSize

- java.lang.Object
- - com.jgoodies.forms.layout.BoundedSize

- All Implemented Interfaces:
    Size, Serializable

      public final class BoundedSize
      extends Object
      implements Size, Serializable

  Describes sizes that provide lower and upper bounds as used by the JGoodies FormLayout.
  Version:
    $Revision: 1.21 $
  Author:
    Karsten Lentzsch
  See Also:
    `Sizes`, `ConstantSize`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BoundedSize(Size basis, Size lowerBound, Size upperBound)` Constructs a BoundedSize for the given basis using the specified lower and upper bounds.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `compressible()` Describes if this Size can be compressed, if container space gets scarce.
    `String` | `encode()` Returns a parseable string representation of this bounded size.
    `boolean` | `equals(Object object)` Indicates whether some other BoundedSize is "equal to" this one.
    `Size` | `getBasis()` Returns the base size, which is not-`null`.
    `Size` | `getLowerBound()` Returns the optional lower bound.
    `Size` | `getUpperBound()` Returns the optional upper bound.
    `int` | `hashCode()` Returns a hash code value for the object.
    `int` | `maximumSize(Container container, List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure)` Returns this size as pixel size.
    `String` | `toString()` Returns a string representation of this size object.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BoundedSize

          public BoundedSize(Size basis,
                     Size lowerBound,
                     Size upperBound)

      Constructs a BoundedSize for the given basis using the specified lower and upper bounds.
      Parameters:
        `basis` - the base size
        `lowerBound` - the lower bound size
        `upperBound` - the upper bound size
      Throws:
        `NullPointerException` - if `basis`, `lowerBound`, or `upperBound` is `null`
      Since:
        1.1

  - ### Method Detail

    - #### getBasis

          public Size getBasis()

      Returns the base size, which is not-`null`.
      Returns:
        the base size
      Since:
        1.1

    - #### getLowerBound

          public Size getLowerBound()

      Returns the optional lower bound.
      Returns:
        the optional lower bound
      Since:
        1.1

    - #### getUpperBound

          public Size getUpperBound()

      Returns the optional upper bound.
      Returns:
        the optional upper bound
      Since:
        1.1

    - #### maximumSize

          public int maximumSize(Container container,
                        List components,
                        FormLayout.Measure minMeasure,
                        FormLayout.Measure prefMeasure,
                        FormLayout.Measure defaultMeasure)

      Returns this size as pixel size. Neither requires the component list nor the specified measures. Honors the lower and upper bound.

      Invoked by `FormSpec` to determine the size of a column or row.

      Specified by:
        `maximumSize` in interface `Size`
      Parameters:
        `container` - the layout container
        `components` - the list of components to measure
        `minMeasure` - the measure used to determine the minimum size
        `prefMeasure` - the measure used to determine the preferred size
        `defaultMeasure` - the measure used to determine the default size
      Returns:
        the maximum size in pixels
      See Also:
        `FormSpec.maximumSize(Container, List, FormLayout.Measure, FormLayout.Measure, FormLayout.Measure)`

    - #### compressible

          public boolean compressible()

      Describes if this Size can be compressed, if container space gets scarce. Used by the FormLayout size computations in `#compressedSizes` to check whether a column or row can be compressed or not.

      BoundedSizes are compressible if the base Size is compressible.

      Specified by:
        `compressible` in interface `Size`
      Returns:
        `true` if and only if the basis is compressible
      Since:
        1.1

    - #### equals

          public boolean equals(Object object)

      Indicates whether some other BoundedSize is "equal to" this one.
      Overrides:
        `equals` in class `Object`
      Parameters:
        `object` - the object with which to compare
      Returns:
        `true` if this object is the same as the object argument, `false` otherwise.
      See Also:
        `Object.hashCode()`, `Hashtable`

    - #### hashCode

          public int hashCode()

      Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by `java.util.Hashtable`.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        a hash code value for this object.
      See Also:
        `Object.equals(Object)`, `Hashtable`

    - #### toString

          public String toString()

      Returns a string representation of this size object.

      Note: This string representation may change at any time. It is intended for debugging purposes. For parsing, use `encode()` instead.

      Overrides:
        `toString` in class `Object`
      Returns:
        a string representation of this bounded size

    - #### encode

          public String encode()

      Returns a parseable string representation of this bounded size.
      Specified by:
        `encode` in interface `Size`
      Returns:
        a String that can be parsed by the Forms parser
      Since:
        1.2

Copyright © 2002-2014 JGoodies Software GmbH. All Rights Reserved.