org.gnu.gtk
Class Container

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
Direct Known Subclasses:
Bin, Box, Fixed, IconView, Layout, MenuShell, Notebook, Paned, Table, TextView, ToolBar, TreeView

public class Container
extends Widget

The Container widget is a base class for container widgets. Widgets that inherit from Container have the ability to contain, position, size, and display one or more other widgets.


Method Summary
 void add(Widget widget)
          Adds widget to the Container.
 void addListener(ContainerListener listener)
          Register an object to handle container events.
 boolean getBooleanChildProperty(Widget child, java.lang.String name)
          Convenience method for retrieving boolean child properties.
 int getBorderWidth()
          Retrieves the border width for the Container.
 Value getChildProperty(Widget child, java.lang.String name)
          Get the Value of the given child property (name).
 Widget[] getChildren()
          Get an array of all children of this container.
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 EventType getEventType(java.lang.String signal)
           
 int getIntChildProperty(Widget child, java.lang.String name)
          Convenience method for retrieving int child properties.
 ResizeMode getResizeMode()
          Returns the ResizeMode for the Container.
static Type getType()
          Retrieve the runtime type used by the GLib library.
 void remove(Widget widget)
          Remove a Widget from the Container.
 void removeListener(ContainerListener listener)
          Removes a listener
 void resizeChildren()
          Informs the container to resize all of its' children based on the size requirements of the children.
 void setBooleanChildProperty(Widget child, java.lang.String name, boolean value)
          Convenience method for setting boolean child properties.
 void setBorderWidth(int width)
          Sets the border width for the Container.
 void setChildProperty(Widget child, java.lang.String name, Value val)
          Set the given child property (name) with the given Value in this container.
 void setIntChildProperty(Widget child, java.lang.String name, int value)
          Convenience method for setting int child properties.
 void setResizeMode(ResizeMode mode)
          Sets the ResizeMode for the Container.
 
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
 

Method Detail

add

public void add(Widget widget)
Adds widget to the Container.

Parameters:
widget - The Widget to be added to this Container.

remove

public void remove(Widget widget)
Remove a Widget from the Container.

Parameters:
widget - The Widget to remove from the Container.

getResizeMode

public ResizeMode getResizeMode()
Returns the ResizeMode for the Container.

Returns:
The ResizeMode for the Container.

setResizeMode

public void setResizeMode(ResizeMode mode)
Sets the ResizeMode for the Container.

Parameters:
mode - The ResizeMode.

getBorderWidth

public int getBorderWidth()
Retrieves the border width for the Container.

Returns:
The border width.

setBorderWidth

public void setBorderWidth(int width)
Sets the border width for the Container.

Parameters:
width - The border width.

setChildProperty

public void setChildProperty(Widget child,
                             java.lang.String name,
                             Value val)
Set the given child property (name) with the given Value in this container. Container introduces child properties - these are object properties that are not specific to either the container or the contained widget, but rather to their relation. Typical examples of child properties are the position or pack-type of a widget which is contained in a Box.

NOTE: Prefer using one of the convenience methods over using this method directly.

Parameters:
child - a widget which is a child of container.
name - The name of the property to set.
val - The value to set in the property.

setIntChildProperty

public void setIntChildProperty(Widget child,
                                java.lang.String name,
                                int value)
Convenience method for setting int child properties.

Parameters:
child - A widget which is a child of container.
name - The name of the property to set.
value - The value to set in the property.
See Also:
setChildProperty( Widget, String, Value )

setBooleanChildProperty

public void setBooleanChildProperty(Widget child,
                                    java.lang.String name,
                                    boolean value)
Convenience method for setting boolean child properties.

Parameters:
child - A widget which is a child of container.
name - The name of the property to set.
value - The value to set in the property.
See Also:
setChildProperty( Widget, String, Value )

getChildProperty

public Value getChildProperty(Widget child,
                              java.lang.String name)
Get the Value of the given child property (name). Container introduces child properties - these are object properties that are not specific to either the container or the contained widget, but rather to their relation. Typical examples of child properties are the position or pack-type of a widget which is contained in a Box.

NOTE: Prefer using one of the convenience methods over using this method directly.

Parameters:
child - A widget which is a child of container.
name - The name of the child property to retrieve.
Returns:
The value of the given child property.

getIntChildProperty

public int getIntChildProperty(Widget child,
                               java.lang.String name)
Convenience method for retrieving int child properties.

Parameters:
child - A widget which is a child of container.
name - The name of the property to retrieve.
Returns:
The value of the given child property.

getBooleanChildProperty

public boolean getBooleanChildProperty(Widget child,
                                       java.lang.String name)
Convenience method for retrieving boolean child properties.

Parameters:
child - A widget which is a child of container.
name - The name of the property to retrieve.
Returns:
The value of the given child property.

resizeChildren

public void resizeChildren()
Informs the container to resize all of its' children based on the size requirements of the children.


getChildren

public Widget[] getChildren()
Get an array of all children of this container.

Returns:
An array contain all children of this container or null.

getType

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


addListener

public void addListener(ContainerListener listener)
Register an object to handle container events.

See Also:
ContainerListener

removeListener

public void removeListener(ContainerListener listener)
Removes a listener

See Also:
addListener(ContainerListener)

getEventListenerClass

public java.lang.Class getEventListenerClass(java.lang.String signal)
Overrides:
getEventListenerClass in class Widget

getEventType

public EventType getEventType(java.lang.String signal)
Overrides:
getEventType in class Widget