org.gnu.gtk
Class Table

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by org.gnu.gtk.GtkObject
              extended by org.gnu.gtk.Widget
                  extended by org.gnu.gtk.Container
                      extended by org.gnu.gtk.Table

public class Table
extends Container

A container that creates a grid of flexible static rectangles that you can use to position and size widgets.

The table cells are referenced by rows and columns. The top left of the table is row 0, column 0.


Constructor Summary
Table(org.gnu.glib.Handle handle)
          Construct a new Table from a handle to a native resource.
Table(int rows, int columns, boolean homogenous)
          Constructs a new table widget.
 
Method Summary
 void attach(Widget child, int leftAttach, int rightAttach, int topAttach, int bottomAttach)
          Attaches a child widget to a position in the table.
 void attach(Widget child, int leftAttach, int rightAttach, int topAttach, int bottomAttach, AttachOptions xOptions, AttachOptions yOptions, int xPadding, int yPadding)
          Attaches a child widget to a position in the table
 int getColumnSpacing(int column)
          Gets the amount of space between column column, and column column + 1.
 int getDefaultColumnSpacing()
          returns the default spacing between columns.
 int getDefaultRowSpacing()
          returns the default spacing between rows.
 boolean getHomogeneous()
          Returns whether the table cells are all constrained to the same width and height
 int getRowSpacing(int row)
          Gets the amount of space between row row, and row row + 1.
static Table getTable(org.gnu.glib.Handle handle)
          Internal static factory method to be used by Java-Gnome only.
static Type getType()
          Retrieve the runtime type used by the GLib library.
 void resize(int rows, int columns)
          Changes the size of the table after it has been created.
 void setColumnSpacing(int spacing)
          Sets the space between every column in the table.
 void setColumnSpacing(int column, int spacing)
          Changes the space between a given table column and its surrounding columns.
 void setHomogeneous(boolean homogeneous)
          Changes the homogenous property of table cells (ie whether all cells are an equal size or not).
 void setRowSpacing(int spacing)
          Sets the space between every row in the table.
 void setRowSpacing(int row, int spacing)
          Changes the space between a given table row and its surrounding rows.
 
Methods inherited from class org.gnu.gtk.Container
add, addListener, getBooleanChildProperty, getBorderWidth, getChildProperty, getChildren, getEventListenerClass, getEventType, getIntChildProperty, getResizeMode, remove, removeListener, resizeChildren, setBooleanChildProperty, setBorderWidth, setChildProperty, setIntChildProperty, setResizeMode
 
Methods inherited from class org.gnu.gtk.Widget
activate, addAccelerator, addEvents, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, draw, drawArea, drawArea, finish, getAccessible, getAllocation, getCanFocus, getColormap, getContext, getData, getDisplay, getDragData, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getWidget, getWindow, grabDefault, grabFocus, hasFocus, hasScreen, hide, hideAll, highlight, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeAccelerator, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setCanFocus, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setEvents, setExtensionEvents, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight, unHighlight
 
Methods inherited from class org.gnu.gtk.GtkObject
destroy, sink
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Table

public Table(int rows,
             int columns,
             boolean homogenous)
Constructs a new table widget. An initial size must be given by specifying how many rows and columns the table should have, although this can be changed later with the resize method. Rows and columns must both be in the range 0 .. 65535

Parameters:
rows - The initial number of rows in the table
columns - The initial number of columns for the table
homogenous - If set to TRUE, all table cells are resized to the size of the cell containing the largest widget.

Table

public Table(org.gnu.glib.Handle handle)
Construct a new Table from a handle to a native resource.

Method Detail

getTable

public static Table getTable(org.gnu.glib.Handle handle)
Internal static factory method to be used by Java-Gnome only.


resize

public void resize(int rows,
                   int columns)
Changes the size of the table after it has been created. The parameters define the requested total number of rows/columns after the resize.


attach

public void attach(Widget child,
                   int leftAttach,
                   int rightAttach,
                   int topAttach,
                   int bottomAttach,
                   AttachOptions xOptions,
                   AttachOptions yOptions,
                   int xPadding,
                   int yPadding)
Attaches a child widget to a position in the table

Parameters:
child - The widget to add.
leftAttach - The column number to attach the left side of a child widget to.
rightAttach - The column number to attach the right side of a child widget to.
topAttach - The row number to attach the top of a child widget to.
bottomAttach - The row number to attach the bottom of a child widget to.
xOptions - Used to specify the properties of the child widget when the table is resized.
yOptions - The same as xOptions, except this field determines behaviour of vertical resizing.
xPadding - An integer value specifying the padding on the left and right of the widget being added to the table.
yPadding - The amount of padding above and below the child widget.

attach

public void attach(Widget child,
                   int leftAttach,
                   int rightAttach,
                   int topAttach,
                   int bottomAttach)
Attaches a child widget to a position in the table. This is a convenience function provides the programmer with a means to add children to a table with identical padding and expansion options.

Parameters:
child - The widget to add.
leftAttach - The column number to attach the left side of a child widget to.
rightAttach - The column number to attach the right side of a child widget to.
topAttach - The row number to attach the top of a child widget to.
bottomAttach - The row number to attach the bottom of a child widget to.

setColumnSpacing

public void setColumnSpacing(int column,
                             int spacing)
Changes the space between a given table column and its surrounding columns.

Parameters:
column - Column number whose spacing will be changed.
spacing - Number of pixels that the spacing should take up.

setRowSpacing

public void setRowSpacing(int row,
                          int spacing)
Changes the space between a given table row and its surrounding rows.

Parameters:
row - Row number whose spacing will be changed.
spacing - Number of pixels that the spacing should take up.

getRowSpacing

public int getRowSpacing(int row)
Gets the amount of space between row row, and row row + 1.

Parameters:
row - A row in the table, 0 indicates the first row.

getColumnSpacing

public int getColumnSpacing(int column)
Gets the amount of space between column column, and column column + 1.

Parameters:
column - A row in the table, 0 indicates the first row.

getDefaultRowSpacing

public int getDefaultRowSpacing()
returns the default spacing between rows. The only way to change this is to use setRowSpacings, which changes the spacing of all cells, regardless of whether they have been set independently.

See Also:
setRowSpacing(int, int)

getDefaultColumnSpacing

public int getDefaultColumnSpacing()
returns the default spacing between columns. The only way to change this is to use setColumnSpacings, which changes the spacing of all cells, regardless of whether they have been set independently.

See Also:
setColumnSpacing(int, int)

setRowSpacing

public void setRowSpacing(int spacing)
Sets the space between every row in the table. This overrides any previous changes to particular cells.

Parameters:
spacing - The number of pixels of space to place between every row in the table.

setColumnSpacing

public void setColumnSpacing(int spacing)
Sets the space between every column in the table. This overrides any previous changes to particular cells.

Parameters:
spacing - The number of pixels of space to place between every column in the table.

setHomogeneous

public void setHomogeneous(boolean homogeneous)
Changes the homogenous property of table cells (ie whether all cells are an equal size or not).

Parameters:
homogeneous - Set to TRUE to ensure all table cells are the same size. Set to FALSE if this is not your desired behaviour.

getHomogeneous

public boolean getHomogeneous()
Returns whether the table cells are all constrained to the same width and height

Returns:
TRUE if the cells are all constrained to the same size
See Also:
setHomogeneous(boolean)

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.