java.lang.Object
javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayout
- 所有已实现的接口:
-
LayoutManager
- 封装类:
-
BasicOptionPaneUI
ButtonAreaLayout的行为类似于FlowLayout。它将所有组件从左到右布局。如果syncAllWidths为true,则每个组件的宽度将设置为最大的首选大小宽度。这个类应该被视为一个"protected"内部类。只能在BasicOptionPaneUI的子类中实例化它。
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean如果为true,则将子项合并在父项中。protected int填充值。protected boolean该值表示是否应同步子项的宽度。 -
Constructor Summary
ConstructorsConstructorDescriptionButtonAreaLayout(boolean syncAllWidths, int padding) 构造一个ButtonAreaLayout的新实例。 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutComponent(String string, Component comp) 如果布局管理器使用每个组件的字符串,则将组件comp添加到布局中,并将其与name指定的字符串关联。boolean返回是否应使用中心子项。int返回填充值。boolean返回是否应同步子项的宽度。voidlayoutContainer(Container container) 对指定的容器进行布局。计算指定容器的最小尺寸维度,给定它包含的组件。计算指定容器的首选尺寸维度,给定它包含的组件。void从布局中移除指定的组件。voidsetCentersChildren(boolean newValue) 设置是否应使用中心子项。voidsetPadding(int newPadding) 设置填充值。voidsetSyncAllWidths(boolean newValue) 设置是否应同步子项的宽度。
-
Field Details
-
syncAllWidths
protected boolean syncAllWidths该值表示是否应同步子项的宽度。 -
padding
protected int padding填充值。 -
centersChildren
protected boolean centersChildren如果为true,则将子项合并在父项中。
-
-
Constructor Details
-
ButtonAreaLayout
public ButtonAreaLayout(boolean syncAllWidths, int padding) 构造一个ButtonAreaLayout的新实例。- 参数:
-
syncAllWidths- 如果应同步子项的宽度 -
padding- 填充值
-
-
Method Details
-
setSyncAllWidths
public void setSyncAllWidths(boolean newValue) 设置是否应同步子项的宽度。- 参数:
-
newValue- 如果应同步子项的宽度
-
getSyncAllWidths
public boolean getSyncAllWidths()返回是否应同步子项的宽度。- 返回:
- 是否应同步子项的宽度
-
setPadding
public void setPadding(int newPadding) 设置填充值。- 参数:
-
newPadding- 新的填充值
-
getPadding
public int getPadding()返回填充值。- 返回:
- 填充值
-
setCentersChildren
public void setCentersChildren(boolean newValue) 设置是否应使用中心子项。- 参数:
-
newValue- 一个新值
-
getCentersChildren
public boolean getCentersChildren()返回是否应使用中心子项。- 返回:
- 是否应使用中心子项
-
addLayoutComponent
从接口复制的描述:LayoutManager如果布局管理器使用每个组件的字符串,则将组件comp添加到布局中,并将其与name指定的字符串关联。- 指定者:
-
addLayoutComponent在接口LayoutManager - 参数:
-
string- 与组件关联的字符串 -
comp- 要添加的组件
-
layoutContainer
从接口复制的描述:LayoutManager对指定的容器进行布局。- 指定者:
-
layoutContainer在接口LayoutManager - 参数:
-
container- 要布局的容器
-
minimumLayoutSize
从接口复制的描述:LayoutManager计算指定容器的最小尺寸维度,给定它包含的组件。- 指定者:
-
minimumLayoutSize在接口LayoutManager - 参数:
-
c- 要布局的组件 - 返回:
- 容器的最小尺寸
- 参见:
-
preferredLayoutSize
从接口复制的描述:LayoutManager计算指定容器的首选尺寸维度,给定它包含的组件。- 指定者:
-
preferredLayoutSize在接口LayoutManager - 参数:
-
c- 要布局的容器 - 返回:
- 容器的首选尺寸
- 参见:
-
removeLayoutComponent
从接口复制的描述:LayoutManager从布局中移除指定的组件。- 指定者:
-
removeLayoutComponent在接口LayoutManager - 参数:
-
c- 要移除的组件
-