Class FormLayoutUtils

java.lang.Object
com.jgoodies.forms.extras.FormLayoutUtils

public final class FormLayoutUtils extends Object
Consists only of static methods that provide convenience behavior for working with the FormLayout.

Note: This class is not part of the binary Form library. It comes with the Forms distributions as an extra. The API is work in progress and may change without notice; this class may even be completely removed from future distributions. If you want to use this class, you may consider copying it into your codebase.

Version:
$Revision: 1.12 $
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Iterates over a FormLayout container's CellConstraints.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    columnContainsComponent(Container container, int columnIndex)
    Checks and answers whether the given FormLayout container contains a component in the specified column.
    private static boolean
    isGrouped(int[][] allGroupIndices, int index)
    Checks and answers whether the specified index is contained in one of the given group indices.
    static boolean
    isGroupedColumn(FormLayout layout, int columnIndex)
    Checks and answers whether the specified column is grouped in the given FormLayout.
    static boolean
    isGroupedRow(FormLayout layout, int rowIndex)
    Checks and answers whether the specified row is grouped in the given FormLayout.
    static boolean
    rowContainsComponent(Container container, int rowIndex)
    Checks and answers whether the given FormLayout container contains a component in the specified row.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FormLayoutUtils

      private FormLayoutUtils()
  • Method Details

    • columnContainsComponent

      public static boolean columnContainsComponent(Container container, int columnIndex)
      Checks and answers whether the given FormLayout container contains a component in the specified column.

      For every container child component, we look up the associated CellConstraints object from the layout and compare its horizontal grid origin with the specified column index.

      Parameters:
      container - the layout container
      columnIndex - the index of the column to test
      Returns:
      true if the column contains a component, false otherwise
      Throws:
      IllegalArgumentException - if the container's layout is not a FormLayout
    • rowContainsComponent

      public static boolean rowContainsComponent(Container container, int rowIndex)
      Checks and answers whether the given FormLayout container contains a component in the specified row.

      For every container child component, we look up the associated CellConstraints object from the layout and compare its vertical grid origin with the specified row index.

      Parameters:
      container - the layout container
      rowIndex - the index of the row to test
      Returns:
      true if the row contains a component, false otherwise
      Throws:
      IllegalArgumentException - if the container's layout is not a FormLayout
    • isGroupedColumn

      public static boolean isGroupedColumn(FormLayout layout, int columnIndex)
      Checks and answers whether the specified column is grouped in the given FormLayout. A column col is grouped, if and only if there's a column group group that includes col's index.
      Parameters:
      layout - the layout to be inspected
      columnIndex - the index of the column to be checked
      Returns:
      true if the column is grouped, false if not
    • isGroupedRow

      public static boolean isGroupedRow(FormLayout layout, int rowIndex)
      Checks and answers whether the specified row is grouped in the given FormLayout. A row row is grouped, if and only if there's a row group group that includes row's index.
      Parameters:
      layout - the layout to be inspected
      rowIndex - the index of the row to be checked
      Returns:
      true if the column is grouped, false if not
    • isGrouped

      private static boolean isGrouped(int[][] allGroupIndices, int index)
      Checks and answers whether the specified index is contained in one of the given group indices.
      Parameters:
      allGroupIndices - an array of arrays of group indices
      index - the index to be tested
      Returns:
      true if index is contained in one of the groups