Class DarkOptionPaneUI.DarkButtonAreaLayout
- java.lang.Object
-
- javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayout
-
- com.github.weisj.darklaf.ui.optionpane.DarkOptionPaneUI.DarkButtonAreaLayout
-
- All Implemented Interfaces:
LayoutManager
- Enclosing class:
- DarkOptionPaneUI
public static class DarkOptionPaneUI.DarkButtonAreaLayout extends BasicOptionPaneUI.ButtonAreaLayout
ButtonAreaLayout
behaves in a similar manner toFlowLayout
. It lays out all components from left to right. IfsyncAllWidths
is true, the widths of each component will be set to the largest preferred size width.This class should be treated as a "protected" inner class. Instantiate it only within subclasses of
BasicOptionPaneUI
.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
syncAllWidthOverwrite
-
Fields inherited from class javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayout
centersChildren, padding, syncAllWidths
-
-
Constructor Summary
Constructors Constructor Description DarkButtonAreaLayout(boolean syncAllWidths, int padding)
Constructs a new instance ofButtonAreaLayout
.DarkButtonAreaLayout(boolean syncAllSizes, int padding, int orientation, boolean reverseButtons)
-
Method Summary
Modifier and Type Method Description void
addLayoutComponent(String string, Component comp)
boolean
getCentersChildren()
Returns whether or not center children should be used.int
getPadding()
Returns the padding.boolean
getSyncAllWidths()
Returns if the width of children should be synchronized.void
layoutContainer(Container container)
Dimension
minimumLayoutSize(Container c)
Dimension
preferredLayoutSize(Container c)
void
removeLayoutComponent(Component c)
void
setCentersChildren(boolean newValue)
Sets whether or not center children should be used.void
setPadding(int newPadding)
Sets the padding value.void
setSyncAllWidths(boolean newValue)
Sets if the width of children should be synchronized.
-
-
-
Constructor Detail
-
DarkButtonAreaLayout
public DarkButtonAreaLayout(boolean syncAllSizes, int padding, int orientation, boolean reverseButtons)
-
DarkButtonAreaLayout
public DarkButtonAreaLayout(boolean syncAllWidths, int padding)
Constructs a new instance ofButtonAreaLayout
.- Parameters:
syncAllWidths
- if the width of children should be synchronizedpadding
- the padding value
-
-
Method Detail
-
setSyncAllWidths
public void setSyncAllWidths(boolean newValue)
Sets if the width of children should be synchronized.- Overrides:
setSyncAllWidths
in classBasicOptionPaneUI.ButtonAreaLayout
- Parameters:
newValue
- if the width of children should be synchronized
-
getSyncAllWidths
public boolean getSyncAllWidths()
Returns if the width of children should be synchronized.- Overrides:
getSyncAllWidths
in classBasicOptionPaneUI.ButtonAreaLayout
- Returns:
- if the width of children should be synchronized
-
setPadding
public void setPadding(int newPadding)
Sets the padding value.- Overrides:
setPadding
in classBasicOptionPaneUI.ButtonAreaLayout
- Parameters:
newPadding
- the new padding
-
getPadding
public int getPadding()
Returns the padding.- Overrides:
getPadding
in classBasicOptionPaneUI.ButtonAreaLayout
- Returns:
- the padding
-
setCentersChildren
public void setCentersChildren(boolean newValue)
Sets whether or not center children should be used.- Overrides:
setCentersChildren
in classBasicOptionPaneUI.ButtonAreaLayout
- Parameters:
newValue
- a new value
-
getCentersChildren
public boolean getCentersChildren()
Returns whether or not center children should be used.- Overrides:
getCentersChildren
in classBasicOptionPaneUI.ButtonAreaLayout
- Returns:
- whether or not center children should be used
-
addLayoutComponent
public void addLayoutComponent(String string, Component comp)
- Specified by:
addLayoutComponent
in interfaceLayoutManager
- Overrides:
addLayoutComponent
in classBasicOptionPaneUI.ButtonAreaLayout
-
layoutContainer
public void layoutContainer(Container container)
- Specified by:
layoutContainer
in interfaceLayoutManager
- Overrides:
layoutContainer
in classBasicOptionPaneUI.ButtonAreaLayout
-
minimumLayoutSize
public Dimension minimumLayoutSize(Container c)
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
- Overrides:
minimumLayoutSize
in classBasicOptionPaneUI.ButtonAreaLayout
-
preferredLayoutSize
public Dimension preferredLayoutSize(Container c)
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
- Overrides:
preferredLayoutSize
in classBasicOptionPaneUI.ButtonAreaLayout
-
removeLayoutComponent
public void removeLayoutComponent(Component c)
- Specified by:
removeLayoutComponent
in interfaceLayoutManager
- Overrides:
removeLayoutComponent
in classBasicOptionPaneUI.ButtonAreaLayout
-
-