org.basex.gui.layout
Class TableLayout

java.lang.Object
  extended by org.basex.gui.layout.TableLayout
All Implemented Interfaces:
LayoutManager

public final class TableLayout
extends Object
implements LayoutManager

This LayoutManager is similar to the GridLayout. The added components keep their minimum size even when the parent container is resized.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

Constructor Summary
TableLayout(int r, int c)
          Creates a grid layout with the specified number of rows and columns.
TableLayout(int r, int c, int ix, int iy)
          Creates a grid layout with the specified number of rows and columns.
 
Method Summary
 void addLayoutComponent(String name, Component comp)
          Adds the specified component with the specified name to the layout.
 void layoutContainer(Container p)
          Lays out the specified container using this layout.
 Dimension minimumLayoutSize(Container parent)
          Determines the minimum size of the container argument using this grid layout.
 Dimension preferredLayoutSize(Container parent)
          Determines the preferred size of the container argument using this grid layout.
 void removeLayoutComponent(Component comp)
          Removes the specified component from the layout.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableLayout

public TableLayout(int r,
                   int c)
Creates a grid layout with the specified number of rows and columns. When displayed, the grid has the minimum size.

Parameters:
r - number of rows
c - number of columns

TableLayout

public TableLayout(int r,
                   int c,
                   int ix,
                   int iy)
Creates a grid layout with the specified number of rows and columns. When displayed, the grid has the minimum size.

Parameters:
r - number of rows
c - number of columns
ix - horizontal inset size
iy - vertical inset size
Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Adds the specified component with the specified name to the layout.

Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
name - the component name
comp - the component to be added

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.

Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
comp - the component to be removed

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Determines the preferred size of the container argument using this grid layout.

Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
parent - the layout container
Returns:
the preferred dimensions for painting the container

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Determines the minimum size of the container argument using this grid layout.

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
parent - the layout container
Returns:
the preferred dimensions for painting the container

layoutContainer

public void layoutContainer(Container p)
Lays out the specified container using this layout.

Specified by:
layoutContainer in interface LayoutManager
Parameters:
p - the layout container