Class TableLayoutConstraints

java.lang.Object
info.clearthought.layout.TableLayoutConstraints
All Implemented Interfaces:
TableLayoutConstants

public class TableLayoutConstraints
extends Object
implements TableLayoutConstants
The following inner class is used to bind components to their constraints.
Author:
Daniel E. Barbalace
  • Field Summary

    Fields
    Modifier and Type Field Description
    int col1
    Cell in which the upper left corner of the component lays
    int col2
    Cell in which the lower right corner of the component lays
    int hAlign
    Horizontal justification if component occupies just one cell
    int row1
    Cell in which the upper left corner of the component lays
    int row2
    Cell in which the lower right corner of the component lays
    int vAlign
    Verical justification if component occupies just one cell

    Fields inherited from interface info.clearthought.layout.TableLayoutConstants

    BOTTOM, CENTER, FILL, FULL, LEFT, MAX_ALIGN, MIN_ALIGN, MINIMUM, PREFERRED, RIGHT, TOP
  • Constructor Summary

    Constructors
    Constructor Description
    TableLayoutConstraints()
    Constructs an TableLayoutConstraints with the default settings.
    TableLayoutConstraints​(int col1, int row1, int col2, int row2, int hAlign, int vAlign)
    Constructs an TableLayoutConstraints a set of constraints.
    TableLayoutConstraints​(String constraints)
    Constructs an TableLayoutConstraints from a string.
  • Method Summary

    Modifier and Type Method Description
    String toString()
    Gets a string representation of this TableLayoutConstraints.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • col1

      public int col1
      Cell in which the upper left corner of the component lays
    • row1

      public int row1
      Cell in which the upper left corner of the component lays
    • col2

      public int col2
      Cell in which the lower right corner of the component lays
    • row2

      public int row2
      Cell in which the lower right corner of the component lays
    • hAlign

      public int hAlign
      Horizontal justification if component occupies just one cell
    • vAlign

      public int vAlign
      Verical justification if component occupies just one cell
  • Constructor Details

    • TableLayoutConstraints

      public TableLayoutConstraints()
      Constructs an TableLayoutConstraints with the default settings. This constructor is equivalent to TableLayoutConstraints(0, 0, 0, 0, FULL, FULL).
    • TableLayoutConstraints

      public TableLayoutConstraints​(String constraints)
      Constructs an TableLayoutConstraints from a string.
      Parameters:
      constraints - indicates TableLayoutConstraints's position and justification as a string in the form "row, column" or "row, column, horizontal justification, vertical justification" or "row 1, column 1, row 2, column 2". It is also acceptable to delimit the paramters with spaces instead of commas.
    • TableLayoutConstraints

      public TableLayoutConstraints​(int col1, int row1, int col2, int row2, int hAlign, int vAlign)
      Constructs an TableLayoutConstraints a set of constraints.
      Parameters:
      col1 - column where upper-left cornor of the component is placed
      row1 - row where upper-left cornor of the component is placed
      col2 - column where lower-right cornor of the component is placed
      row2 - row where lower-right cornor of the component is placed
      hAlign - horizontal justification of a component in a single cell
      vAlign - vertical justification of a component in a single cell
  • Method Details

    • toString

      public String toString()
      Gets a string representation of this TableLayoutConstraints.
      Overrides:
      toString in class Object
      Returns:
      a string in the form "row 1, column 1, row 2, column 2" or "row, column, horizontal justification, vertical justification"