Package com.formdev.flatlaf.ui
Class MigLayoutVisualPadding
java.lang.Object
com.formdev.flatlaf.ui.MigLayoutVisualPadding
Support for MigLayout visual paddings.
Visual paddings are used by MigLayout to ignore the usually invisible space
around some components (e.g. buttons) that is used to paint a focus border.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Marker class to identify our visual paddings and leave paddings set from outside untouched.private static interface
Marker interface needed for listener removal. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final boolean
static String
Key of visual padding client property.private static final MigLayoutVisualPadding.FlatMigInsets
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Convenience method that checks whether component border is a FlatBorder.static void
install
(JComponent c, Insets insets) Sets the client property to the given insets.static void
install
(JComponent c, Function<JComponent, Insets> getPaddingFunction, String... propertyNames) Invokes the given function to retrieve the actual visual paddings and sets the client property.private static void
setVisualPadding
(JComponent c, Insets visualPadding) static void
Removes listeners and restores client property.
-
Field Details
-
VISUAL_PADDING_PROPERTY
Key of visual padding client property. Value must be either an integer array of size 4, or java.awt.Insets. Same as net.miginfocom.layout.PlatformDefaults.VISUAL_PADDING_PROPERTY, but we don't want to depend on miglayout library. -
ZERO
-
migLayoutAvailable
private static final boolean migLayoutAvailable
-
-
Constructor Details
-
MigLayoutVisualPadding
public MigLayoutVisualPadding()
-
-
Method Details
-
install
Sets the client property to the given insets. -
install
Convenience method that checks whether component border is a FlatBorder. -
install
public static void install(JComponent c, Function<JComponent, Insets> getPaddingFunction, String... propertyNames) Invokes the given function to retrieve the actual visual paddings and sets the client property. Also adds property change listener to component and re-invokes the function if one of the given properties have changed. -
setVisualPadding
-
uninstall
Removes listeners and restores client property.
-