org.gnu.gtk
Class Alignment

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.Bin
                          extended by org.gnu.gtk.Alignment

public class Alignment
extends Bin

This is a container widget that is capable of controlling the size of a single child widget. The scale values are from 0.0 to 1.0, indicating the maximum amount the child can expand to fill the space allocated to the Alignment widget. The align values determine the x and y positions relative to the top left and bottom right corners of the Alignment rectangle. The align values are from 0.0 to the top or left side, and 1.0 for the bottom or right side.


Constructor Summary
Alignment(double xAlign, double yAlign, double xScale, double yScale)
          Construct a new Alignment.
Alignment(org.gnu.glib.Handle handle)
          Construct an alignment using a handle to a native resource.
 
Method Summary
static Alignment getAlignment(org.gnu.glib.Handle handle)
          Internal static factory method to be used by Java-Gnome only.
 int getBottomPadding()
          Gets the size of the padding at the bottom of the widget.
 int getLeftPadding()
          Gets the size of the padding at the left of the widget.
 int getRightPadding()
          Gets the size of the padding at the right of the widget.
 int getTopPadding()
          Gets the size of the padding at the top of the widget.
static Type getType()
          Retrieve the runtime type used by the GLib library.
 void set(double xAlign, double yAlign, double xScale, double yScale)
          Set the alignment and scale for an already created Alignment object.
 void setPadding(int top, int bottom, int left, int right)
          Sets the padding on the different sides of the widget.
 
Methods inherited from class org.gnu.gtk.Bin
getChild
 
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

Alignment

public Alignment(double xAlign,
                 double yAlign,
                 double xScale,
                 double yScale)
Construct a new Alignment.

Parameters:
xAlign - The horizontal alignment of the child widget from 0 (left) to 1 (right).
yAlign - The vertical alignment of the child widget from 0 (top) to 1 (bottom).
xScale - The amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the Alignment.
yScale - The amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xScale.

Alignment

public Alignment(org.gnu.glib.Handle handle)
Construct an alignment using a handle to a native resource.

Method Detail

getAlignment

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


set

public void set(double xAlign,
                double yAlign,
                double xScale,
                double yScale)
Set the alignment and scale for an already created Alignment object.

Parameters:
xAlign - The horizontal alignment of the child widget from 0 (left) to 1 (right).
yAlign - The vertical alignment of the child widget from 0 (top) to 1 (bottom).
xScale - The amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the Alignment.
yScale - The amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to xScale.

setPadding

public void setPadding(int top,
                       int bottom,
                       int left,
                       int right)
Sets the padding on the different sides of the widget. The padding adds blank space to the sides of the widget. For instance, this can be used to indent the child widget towards the right by adding padding on the left.

Parameters:
top - the padding at the top of the widget
bottom - the padding at the bottom of the widget
left - the padding at the left of the widget
right - the padding at the right of the widget.

getTopPadding

public int getTopPadding()
Gets the size of the padding at the top of the widget.

Returns:
The padding at the top of the widget.

getBottomPadding

public int getBottomPadding()
Gets the size of the padding at the bottom of the widget.

Returns:
The padding at the bottom of the widget.

getLeftPadding

public int getLeftPadding()
Gets the size of the padding at the left of the widget.

Returns:
The padding at the left of the widget.

getRightPadding

public int getRightPadding()
Gets the size of the padding at the right of the widget.

Returns:
The padding at the right of the widget.

getType

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