com.gargoylesoftware.base.gui
Class TableLayoutConstraints

java.lang.Object
  extended bycom.gargoylesoftware.base.gui.TableLayoutConstraints
All Implemented Interfaces:
Serializable

public class TableLayoutConstraints
extends Object
implements Serializable

This object contains all the constraints that apply to a specific component inside a TableLayout.

We use the convention of specifying row before column to conform with the swing standards. This seems counterintuitive when specifying x,y (actually y,x) co-ordinates however we felt it was more important to conform to existing java layout standards.

Version:
$Revision: 1.6 $
Author:
Mike Bowler
See Also:
Serialized Form

Constructor Summary
TableLayoutConstraints(int row, int column)
          Create a new instance.
 
Method Summary
protected static void assertNotNull(String fieldName, Object fieldValue)
          Verify that the specified value is not null.
 int getColumn()
          Return the column.
 int getColumnSpan()
          Return the number of columns this component will span.
 int getHorizontalAlignment()
          Return the horizontalAlignment.
 boolean getHorizontalStretch()
          Return true if this component can be stretched horizontally.
 boolean getObeyMaximumSize()
          Return true if we are obeying the maximum size.
 boolean getObeyMinimumSize()
          Return true if we are obeying the minimum size.
 int getRow()
          Return the row.
 int getRowSpan()
          Return the number of rows this component will span.
 int getVerticalAlignment()
          Return the vertical alignment.
 boolean getVerticalStretch()
          Return true if this component can be stretched vertically.
 boolean isImmutable()
          Return true if this object is immutable.
static TableLayoutConstraints makeConstraints(String constraintString)
          Create an instance of TableLayoutConstraints from the specified string.
 void setColumn(int column)
          Set the column.
 void setColumnSpan(int span)
          Set the number of columns that this component will span.
 void setHorizontalAlignment(int alignment)
          Set the horizontal alignment of the component within the specified area.
 void setHorizontalStretch(boolean stretch)
          Set whether or not this component can be stretched horizontally.
 void setImmutable()
          Make this object immutable.
 void setObeyMaximumSize(boolean obey)
          Set whether or not the component should obey it's maximum size.
 void setObeyMinimumSize(boolean obey)
          Set whether or not we should obey the minimum size of the component.
 void setRow(int row)
          Set the row.
 void setRowSpan(int span)
          Set the number of rows that this component will span.
 void setVerticalAlignment(int alignment)
          Set the vertical alignment of the component within the specified area.
 void setVerticalStretch(boolean stretch)
          Set whether or not this component can be stretched vertically.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableLayoutConstraints

public TableLayoutConstraints(int row,
                              int column)
Create a new instance.

Parameters:
row - The starting row.
column - The starting column.
Method Detail

toString

public final String toString()
Return a string representation of this object.

Returns:
Return a string representation of this object.

setImmutable

public final void setImmutable()
Make this object immutable.


isImmutable

public final boolean isImmutable()
Return true if this object is immutable.

Returns:
Return true if this object is immutable.

setRow

public final void setRow(int row)
Set the row.

Parameters:
row - The row.

getRow

public final int getRow()
Return the row.

Returns:
The row.

setColumn

public final void setColumn(int column)
Set the column.

Parameters:
column - The new column.

getColumn

public final int getColumn()
Return the column.

Returns:
The column.

setRowSpan

public final void setRowSpan(int span)
Set the number of rows that this component will span. The new span must be greater than or equal to one.

Parameters:
span - The new row span.

getRowSpan

public final int getRowSpan()
Return the number of rows this component will span.

Returns:
The row span.

setColumnSpan

public final void setColumnSpan(int span)
Set the number of columns that this component will span. The new span must be greater than or equal to one.

Parameters:
span - The new span.

getColumnSpan

public final int getColumnSpan()
Return the number of columns this component will span.

Returns:
the column span.

setVerticalAlignment

public final void setVerticalAlignment(int alignment)
Set the vertical alignment of the component within the specified area. Possible values are

Parameters:
alignment - The new alignment.

getVerticalAlignment

public final int getVerticalAlignment()
Return the vertical alignment.

Returns:
Return the vertical alignment.

setHorizontalAlignment

public final void setHorizontalAlignment(int alignment)
Set the horizontal alignment of the component within the specified area. Possible values are

Parameters:
alignment - The new alignment.

getHorizontalAlignment

public final int getHorizontalAlignment()
Return the horizontalAlignment.

Returns:
Return the horizontalAlignment.

setVerticalStretch

public final void setVerticalStretch(boolean stretch)
Set whether or not this component can be stretched vertically.

Parameters:
stretch - true if the component will stretch vertically.

getVerticalStretch

public final boolean getVerticalStretch()
Return true if this component can be stretched vertically.

Returns:
Return true if this component can be stretched vertically.

setHorizontalStretch

public final void setHorizontalStretch(boolean stretch)
Set whether or not this component can be stretched horizontally.

Parameters:
stretch - true if the component will stretch horizontally.

getHorizontalStretch

public final boolean getHorizontalStretch()
Return true if this component can be stretched horizontally.

Returns:
Return true if this component can be stretched horizontally.

setObeyMaximumSize

public final void setObeyMaximumSize(boolean obey)
Set whether or not the component should obey it's maximum size. Most components do not provide sensible maximum values so always obeying these values, ends up with very strange layouts. The default value is false.

Parameters:
obey - true if we are to obey the maximum size.

getObeyMaximumSize

public final boolean getObeyMaximumSize()
Return true if we are obeying the maximum size.

Returns:
Return true if we are obeying the maximum size.

setObeyMinimumSize

public final void setObeyMinimumSize(boolean obey)
Set whether or not we should obey the minimum size of the component. Default is true.

Parameters:
obey - true if we are to obey the minimum size.

getObeyMinimumSize

public final boolean getObeyMinimumSize()
Return true if we are obeying the minimum size.

Returns:
Return true if we are obeying the minimum size.

makeConstraints

public static TableLayoutConstraints makeConstraints(String constraintString)
Create an instance of TableLayoutConstraints from the specified string. Format: "1,1"

Parameters:
constraintString - The constraints string.
Returns:
A new TableLayoutConstraints object.

assertNotNull

protected static final void assertNotNull(String fieldName,
                                          Object fieldValue)
                                   throws DetailedNullPointerException
Verify that the specified value is not null. If it is then throw an exception

Parameters:
fieldName - The name of the field to check
fieldValue - The value of the field to check
Throws:
DetailedNullPointerException - If fieldValue is null


Copyright © 1998-2005 Gargoyle Software Inc.. All Rights Reserved.