org.gnome.gtk

## Class Alignment

- Object
- - org.freedesktop.bindings.Pointer
  - - org.freedesktop.bindings.Proxy
    - - org.gnome.glib.Object
      - - org.gnome.gtk.Widget
        - - org.gnome.gtk.Container
          - - org.gnome.gtk.Bin
            - - 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.Destroy, Widget.Draw, Widget.EnterNotifyEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.SizeAllocate, Widget.UnmapEvent, Widget.VisibilityNotifyEvent`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `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

    Constructors
    Constructor and Description
    `Alignment()` Creates an empty Alignment.
    `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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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, connect, connect, destroy, getAllocatedHeight, getAllocatedWidth, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getPreferredHeightForWidthMinimum, getPreferredHeightForWidthNatural, getPreferredHeightMinimum, getPreferredHeightNatural, getPreferredWidthForHeightMinimum, getPreferredWidthForHeightNatural, getPreferredWidthMinimum, getPreferredWidthNatural, getRequestMode, getRequisition, getSensitive, getStyleContext, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, overrideBackground, overrideColor, overrideFont, queueDraw, queueDrawArea, realize, setAlignHorizontal, setAlignVertical, setCanDefault, setCanFocus, setEvents, setExpandHorizontal, setExpandVertical, 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()

      Creates an empty Alignment. This is essentially a no-op; the Widget will be top/left which may well be what would have happened if you had not used an Alignment in the first place.

      This is here so that calling `setAlignment()` after constructing looks a little cleaner. It's not more "efficient" to use this.

      Since:
        4.0.17

    - #### 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.
      Since:
        4.0.4

    - #### Alignment

          public Alignment(float xalign,
                   float yalign,
                   float xscale,
                   float yscale,
                   Widget child)

      Creates an Alignment wrapping an existing Widget.
      Since:
        4.0.4

  - ### Method Detail

    - #### getAlignmentX

          public float getAlignmentX()

      Get the xalign value.
      Since:
        4.0.4

    - #### getAlignmentY

          public float getAlignmentY()

      Get the yalign value.
      Since:
        4.0.4

    - #### 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.
      Since:
        4.0.4

    - #### getPaddingRight

          public int getPaddingRight()

      Returns the padding being added to the right of the child.
      Since:
        4.0.4

    - #### getPaddingTop

          public int getPaddingTop()

      Returns the padding being added to the top of the child.
      Since:
        4.0.4

    - #### getScaleX

          public float getScaleX()

      Get the xscale value.
      Since:
        4.0.4

    - #### getScaleY

          public float getScaleY()

      Get the yscale value.
      Since:
        4.0.4

    - #### 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.

      WARNING
      Pay close attention to the order of the sides; it might be different than you are expecting.

      Since:
        4.0.4