Paddings (JGoodies Forms 1.9 API)
Date: 2015-02-02

com.jgoodies.forms.factories

## Class Paddings

- java.lang.Object
- - com.jgoodies.forms.factories.Paddings

-     public final class Paddings
      extends Object

  Provides constants and factory methods for paddings that use instances of `ConstantSize` to define the margins. Paddings are frequently used to add white space around forms, panels, and more generally visual designs.

  Examples:

       Paddings.DLU2
       Paddings.createPadding(Sizes.DLUY4, Sizes.DLUX2, Sizes.DLUY4, Sizes.DLUX2);
       Paddings.createPadding("4dlu, 2dlu, 4dlu, 2dlu");

  Since:
    1.9
  Version:
    $Revision: 1.14 $
  Author:
    Karsten Lentzsch
  See Also:
    `Border`, `Sizes`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Paddings.Padding` An `EmptyBorder` that uses 4 instances of `ConstantSize` to define the top, left, bottom and right gap.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Paddings.Padding` | `BUTTON_BAR_PAD` A standardized reusable padding intended for the gap between a component and a button bar in its bottom.
    `static Paddings.Padding` | `DIALOG` A standardized reusable padding for dialogs without tabs.
    `static Paddings.Padding` | `DLU14` A prepared and reusable padding with 14dlu on all sides.
    `static Paddings.Padding` | `DLU2` A prepared and reusable padding with 2dlu on all sides.
    `static Paddings.Padding` | `DLU21` A prepared padding with 21dlu on all sides.
    `static Paddings.Padding` | `DLU4` A prepared and reusable padding with 4dlu on all sides.
    `static Paddings.Padding` | `DLU7` A prepared and reusable padding with 7dlu on all sides.
    `static Paddings.Padding` | `DLU9` A prepared and reusable padding with 9dlu on all sides.
    `static EmptyBorder` | `EMPTY` A prepared and reusable EmptyBorder without gaps.
    `static Paddings.Padding` | `TABBED_DIALOG` A standardized reusable padding for dialogs that have tabs.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Paddings.Padding` | `createPadding(ConstantSize top, ConstantSize left, ConstantSize bottom, ConstantSize right)` Creates and returns a padding (an instance of `EmptyBorder`) with the specified margins.
    `static Paddings.Padding` | `createPadding(String encodedSizes, Object... args)` Creates and returns a padding (an instance of `EmptyBorder`) using sizes as specified by the given string.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY

          public static final EmptyBorder EMPTY

      A prepared and reusable EmptyBorder without gaps.

    - #### DLU2

          public static final Paddings.Padding DLU2

      A prepared and reusable padding with 2dlu on all sides.

    - #### DLU4

          public static final Paddings.Padding DLU4

      A prepared and reusable padding with 4dlu on all sides.

    - #### DLU7

          public static final Paddings.Padding DLU7

      A prepared and reusable padding with 7dlu on all sides.

    - #### DLU9

          public static final Paddings.Padding DLU9

      A prepared and reusable padding with 9dlu on all sides.

    - #### DLU14

          public static final Paddings.Padding DLU14

      A prepared and reusable padding with 14dlu on all sides.

    - #### DLU21

          public static final Paddings.Padding DLU21

      A prepared padding with 21dlu on all sides.

    - #### BUTTON_BAR_PAD

          public static final Paddings.Padding BUTTON_BAR_PAD

      A standardized reusable padding intended for the gap between a component and a button bar in its bottom.

    - #### DIALOG

          public static final Paddings.Padding DIALOG

      A standardized reusable padding for dialogs without tabs.
      See Also:
        `TABBED_DIALOG`

    - #### TABBED_DIALOG

          public static final Paddings.Padding TABBED_DIALOG

      A standardized reusable padding for dialogs that have tabs.
      See Also:
        `DIALOG`

  - ### Method Detail

    - #### createPadding

          public static Paddings.Padding createPadding(ConstantSize top,
                                       ConstantSize left,
                                       ConstantSize bottom,
                                       ConstantSize right)

      Creates and returns a padding (an instance of `EmptyBorder`) with the specified margins.
      Parameters:
        `top` - the top margin
        `left` - the left side margin
        `bottom` - the bottom margin
        `right` - the right-hand side margin
      Returns:
        a padding with the specified margins
      Throws:
        `NullPointerException` - if top, left, bottom, or right is `null`
      See Also:
        `createPadding(String, Object...)`

    - #### createPadding

          public static Paddings.Padding createPadding(String encodedSizes,
                                       Object... args)

      Creates and returns a padding (an instance of `EmptyBorder`) using sizes as specified by the given string. This string is a comma-separated encoding of 4 `ConstantSize`s.
      Parameters:
        `encodedSizes` - top, left, bottom, right gap encoded as String
        `args` - optional format arguments, used if `encodedSizes` is a format string
      Returns:
        a padding with the specified margins
      See Also:
        `createPadding(ConstantSize, ConstantSize, ConstantSize, ConstantSize)`

Copyright © 2002-2015 JGoodies Software GmbH. All Rights Reserved.