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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidConvenience method that checks whether component border is a FlatBorder.static voidinstall(JComponent c, Insets insets) Sets the client property to the given insets.static voidinstall(JComponent c, Function<JComponent, Insets> getPaddingFunction, String... propertyNames) Invokes the given function to retrieve the actual visual paddings and sets the client property.static voidRemoves 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.
-
-
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. -
uninstall
Removes listeners and restores client property.
-