Package com.jgoodies.forms.factories
Class Paddings
java.lang.Object
com.jgoodies.forms.factories.Paddings
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 $
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
AnEmptyBorder
that uses 4 instances ofConstantSize
to define the top, left, bottom and right gap. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Paddings.Padding
A standardized reusable padding intended for the gap between a component and a button bar in its bottom.static final Paddings.Padding
A standardized reusable padding for dialogs without tabs.static final Paddings.Padding
A prepared and reusable padding with 14dlu on all sides.static final Paddings.Padding
A prepared and reusable padding with 2dlu on all sides.static final Paddings.Padding
A prepared padding with 21dlu on all sides.static final Paddings.Padding
A prepared and reusable padding with 4dlu on all sides.static final Paddings.Padding
A prepared and reusable padding with 7dlu on all sides.static final Paddings.Padding
A prepared and reusable padding with 9dlu on all sides.static final EmptyBorder
A prepared and reusable EmptyBorder without gaps.static final Paddings.Padding
A standardized reusable padding for dialogs that have tabs. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Paddings.Padding
createPadding
(ConstantSize top, ConstantSize left, ConstantSize bottom, ConstantSize right) Creates and returns a padding (an instance ofEmptyBorder
) with the specified margins.static Paddings.Padding
createPadding
(String encodedSizes, Object... args) Creates and returns a padding (an instance ofEmptyBorder
) using sizes as specified by the given string.
-
Field Details
-
EMPTY
A prepared and reusable EmptyBorder without gaps. -
DLU2
A prepared and reusable padding with 2dlu on all sides. -
DLU4
A prepared and reusable padding with 4dlu on all sides. -
DLU7
A prepared and reusable padding with 7dlu on all sides. -
DLU9
A prepared and reusable padding with 9dlu on all sides. -
DLU14
A prepared and reusable padding with 14dlu on all sides. -
DLU21
A prepared padding with 21dlu on all sides. -
BUTTON_BAR_PAD
A standardized reusable padding intended for the gap between a component and a button bar in its bottom. -
DIALOG
A standardized reusable padding for dialogs without tabs.- See Also:
-
TABBED_DIALOG
A standardized reusable padding for dialogs that have tabs.- See Also:
-
-
Constructor Details
-
Paddings
private Paddings()
-
-
Method Details
-
createPadding
public static Paddings.Padding createPadding(ConstantSize top, ConstantSize left, ConstantSize bottom, ConstantSize right) Creates and returns a padding (an instance ofEmptyBorder
) with the specified margins.- Parameters:
top
- the top marginleft
- the left side marginbottom
- the bottom marginright
- the right-hand side margin- Returns:
- a padding with the specified margins
- Throws:
NullPointerException
- if top, left, bottom, or right isnull
- See Also:
-
createPadding
Creates and returns a padding (an instance ofEmptyBorder
) using sizes as specified by the given string. This string is a comma-separated encoding of 4ConstantSize
s.- Parameters:
encodedSizes
- top, left, bottom, right gap encoded as Stringargs
- optional format arguments, used ifencodedSizes
is a format string- Returns:
- a padding with the specified margins
- See Also:
-