模块 java.desktop

类 BasicOptionPaneUI.ButtonAreaLayout

java.lang.Object
javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayout
所有已实现的接口:
LayoutManager
封闭类:
BasicOptionPaneUI

public static class BasicOptionPaneUI.ButtonAreaLayout extends Object implements LayoutManager
ButtonAreaLayout 的行为方式与 FlowLayout 类似。它从左到右排列所有组件。如果 syncAllWidths 为真,则每个组件的宽度将设置为最大首选尺寸宽度。此类应被视为“受保护”的内部类。仅在 BasicOptionPaneUI 的子类中实例化它。
  • 字段详细信息

    • syncAllWidths

      protected boolean syncAllWidths
      该值表示是否应同步子项的宽度。
    • padding

      protected int padding
      填充值。
    • centersChildren

      protected boolean centersChildren
      如果为真,则子项将集中在父项中。
  • 构造方法详细信息

    • ButtonAreaLayout

      public ButtonAreaLayout(boolean syncAllWidths, int padding)
      构造一个 ButtonAreaLayout 新实例
      参数:
      syncAllWidths - 如果孩子的宽度应该同步
      padding - 填充值
  • 方法详情

    • 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

      public void addLayoutComponent(String  string, Component  comp)
      从接口 LayoutManager 复制的描述
      如果布局管理器使用每个组件字符串,则将组件 comp 添加到布局中,将其与 name 指定的字符串相关联。
      指定者:
      addLayoutComponent 在接口 LayoutManager
      参数:
      string - 要与组件关联的字符串
      comp - 要添加的组件
    • layoutContainer

      public void layoutContainer(Container  container)
      从接口 LayoutManager 复制的描述
      布置指定的容器。
      指定者:
      layoutContainer 在接口 LayoutManager
      参数:
      container - 要布置的容器
    • minimumLayoutSize

      public Dimension  minimumLayoutSize(Container  c)
      从接口 LayoutManager 复制的描述
      给定容器包含的组件,计算指定容器的最小尺寸。
      指定者:
      minimumLayoutSize 在接口 LayoutManager
      参数:
      c - 要布局的组件
      返回:
      容器的最小尺寸
      参见:
    • preferredLayoutSize

      public Dimension  preferredLayoutSize(Container  c)
      从接口 LayoutManager 复制的描述
      给定容器包含的组件,计算指定容器的首选尺寸。
      指定者:
      preferredLayoutSize 在接口 LayoutManager
      参数:
      c - 要布置的容器
      返回:
      容器的首选尺寸
      参见:
    • removeLayoutComponent

      public void removeLayoutComponent(Component  c)
      从接口 LayoutManager 复制的描述
      从布局中移除指定的组件。
      指定者:
      removeLayoutComponent 在接口 LayoutManager
      参数:
      c - 要删除的组件