模块 java.desktop

类 JRootPane.RootLayout

java.lang.Object
javax.swing.JRootPane.RootLayout
所有已实现的接口:
LayoutManager , LayoutManager2 , Serializable
封闭类:
JRootPane

protected class JRootPane.RootLayout extends Object implements LayoutManager2 , Serializable
自定义布局管理器,负责 layeredPane、glassPane 和 menuBar 的布局。

Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder

  • 构造方法详细信息

    • RootLayout

      protected RootLayout()
      构造一个 RootLayout
  • 方法详情

    • preferredLayoutSize

      public Dimension  preferredLayoutSize(Container  parent)
      返回布局想要的空间量。
      指定者:
      preferredLayoutSize 在接口 LayoutManager
      参数:
      parent - 使用此布局管理器的容器
      返回:
      包含布局首选大小的 Dimension 对象
      参见:
    • minimumLayoutSize

      public Dimension  minimumLayoutSize(Container  parent)
      返回布局所需的最小空间量。
      指定者:
      minimumLayoutSize 在接口 LayoutManager
      参数:
      parent - 使用此布局管理器的容器
      返回:
      包含布局最小尺寸的 Dimension 对象
      参见:
    • maximumLayoutSize

      public Dimension  maximumLayoutSize(Container  target)
      返回布局可以使用的最大空间量。
      指定者:
      maximumLayoutSize 在接口 LayoutManager2
      参数:
      target - 使用此布局管理器的容器
      返回:
      包含布局最大尺寸的 Dimension 对象
      参见:
    • layoutContainer

      public void layoutContainer(Container  parent)
      指示布局管理器对指定容器进行布局。
      指定者:
      layoutContainer 在接口 LayoutManager
      参数:
      parent - 使用此布局管理器的容器
    • addLayoutComponent

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

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

      public void addLayoutComponent(Component  comp, Object  constraints)
      从接口 LayoutManager2 复制的描述
      使用指定的约束对象将指定的组件添加到布局中。
      指定者:
      addLayoutComponent 在接口 LayoutManager2
      参数:
      comp - 要添加的组件
      constraints - 组件添加到布局的位置/方式。
    • getLayoutAlignmentX

      public float getLayoutAlignmentX(Container  target)
      从接口 LayoutManager2 复制的描述
      返回沿 x 轴的对齐方式。这指定组件如何相对于其他组件对齐。该值应为 0 到 1 之间的数字,其中 0 表示沿原点对齐,1 表示离原点最远,0.5 表示居中,等等。
      指定者:
      getLayoutAlignmentX 在接口 LayoutManager2
      参数:
      target - 目标容器
      返回:
      x 轴对齐首选项
    • getLayoutAlignmentY

      public float getLayoutAlignmentY(Container  target)
      从接口 LayoutManager2 复制的描述
      返回沿 y 轴的对齐方式。这指定组件如何相对于其他组件对齐。该值应为 0 到 1 之间的数字,其中 0 表示沿原点对齐,1 表示离原点最远,0.5 表示居中,等等。
      指定者:
      getLayoutAlignmentY 在接口 LayoutManager2
      参数:
      target - 目标容器
      返回:
      y 轴对齐首选项
    • invalidateLayout

      public void invalidateLayout(Container  target)
      从接口 LayoutManager2 复制的描述
      使布局无效,表示如果布局管理器缓存了信息,则应将其丢弃。
      指定者:
      invalidateLayout 在接口 LayoutManager2
      参数:
      target - 目标容器