java-gnome version 4.0.15

org.gnome.gtk
Class Alignment

Object
  extended by org.freedesktop.bindings.Pointer
      extended by org.freedesktop.bindings.Proxy
          extended by org.gnome.glib.Object
              extended by org.gnome.gtk.Object
                  extended by org.gnome.gtk.Widget
                      extended by org.gnome.gtk.Container
                          extended by org.gnome.gtk.Bin
                              extended by org.gnome.gtk.Alignment

public class Alignment
extends Bin

Control the alignment and size of a child Widget. It has four settings: xscale, yscale, xalign, and yalign. You can also specify padding around the child.

The alignment settings are used to place the child within the available area. The values range from 0.0f (top or left) to 1.0f (bottom or right).

The scale settings are used to specify how much the child should expand to fill the space allocated to the Alignment. The values can range from 0.0f (meaning the child doesn't expand at all) to 1.0f (meaning the child will expand to fill all of the allocated space). If both scale settings are set to 1.0f, the two alignment values will have no effect on the child Widget.

Since:
4.0.4
Author:
Nat Pryce, Andrew Cowie

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.EnterNotifyEvent, Widget.ExposeEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.UnmapEvent, Widget.VisibilityNotifyEvent
 
Field Summary
static float BOTTOM
          Align to the bottom.
static float CENTER
          Align to the center.
static float LEFT
          Align to the left.
static float RIGHT
          Align to the right.
static float TOP
          Align to the top.
 
Constructor Summary
Alignment(float xalign, float yalign, float xscale, float yscale)
          Creates an empty Alignment.
Alignment(float xalign, float yalign, float xscale, float yscale, Widget child)
          Creates an Alignment wrapping an existing Widget.
 
Method Summary
 float getAlignmentX()
          Get the xalign value.
 float getAlignmentY()
          Get the yalign value.
 int getPaddingBottom()
          Returns the padding being added below the bottom of the child.
 int getPaddingLeft()
          Returns the padding being added to the left of the child.
 int getPaddingRight()
          Returns the padding being added to the right of the child.
 int getPaddingTop()
          Returns the padding being added to the top of the child.
 float getScaleX()
          Get the xscale value.
 float getScaleY()
          Get the yscale value.
 void setAlignment(float xalign, float yalign, float xscale, float yscale)
          Set the alignment and scale values.
 void setPadding(int paddingTop, int paddingBottom, int paddingLeft, int paddingRight)
          Set the padding on the different sides of the Widget.
 
Methods inherited from class org.gnome.gtk.Bin
getChild
 
Methods inherited from class org.gnome.gtk.Container
add, getChildren, remove, setBorderWidth
 
Methods inherited from class org.gnome.gtk.Widget
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getRequisition, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
 
Methods inherited from class org.freedesktop.bindings.Pointer
toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BOTTOM

public static final float BOTTOM
Align to the bottom. A convenience constant for the value 1.0f.

See Also:
Constant Field Values

CENTER

public static final float CENTER
Align to the center. A convenience constant for the value 0.5f.

See Also:
Constant Field Values

LEFT

public static final float LEFT
Align to the left. A convenience constant for the value 0.0f.

See Also:
Constant Field Values

RIGHT

public static final float RIGHT
Align to the right. A convenience constant for the value 1.0f.

See Also:
Constant Field Values

TOP

public static final float TOP
Align to the top. A convenience constant for the value 0.0f.

See Also:
Constant Field Values
Constructor Detail

Alignment

public Alignment(float xalign,
                 float yalign,
                 float xscale,
                 float yscale)
Creates an empty Alignment. The child Widget can later be added by calling the add() method.


Alignment

public Alignment(float xalign,
                 float yalign,
                 float xscale,
                 float yscale,
                 Widget child)
Creates an Alignment wrapping an existing Widget.

Method Detail

getAlignmentX

public float getAlignmentX()
Get the xalign value.


getAlignmentY

public float getAlignmentY()
Get the yalign value.


getPaddingBottom

public int getPaddingBottom()
Returns the padding being added below the bottom of the child.


getPaddingLeft

public int getPaddingLeft()
Returns the padding being added to the left of the child.


getPaddingRight

public int getPaddingRight()
Returns the padding being added to the right of the child.


getPaddingTop

public int getPaddingTop()
Returns the padding being added to the top of the child.


getScaleX

public float getScaleX()
Get the xscale value.


getScaleY

public float getScaleY()
Get the yscale value.


setAlignment

public void setAlignment(float xalign,
                         float yalign,
                         float xscale,
                         float yscale)
Set the alignment and scale values. See the discussion at top for the interpretation of the values. All parameters must be within the range of 0.0f to 1.0f.


setPadding

public void setPadding(int paddingTop,
                       int paddingBottom,
                       int paddingLeft,
                       int paddingRight)
Set 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 towards the right by adding padding on the left.



java-gnome