模块 java.desktop

类 BasicSplitPaneUI.BasicHorizontalLayoutManager

java.lang.Object
javax.swing.plaf.basic.BasicSplitPaneUI.BasicHorizontalLayoutManager
所有已实现的接口:
LayoutManager , LayoutManager2
已知子类:
BasicSplitPaneUI.BasicVerticalLayoutManager
封闭类:
BasicSplitPaneUI

public sealed class BasicSplitPaneUI.BasicHorizontalLayoutManager extends Object implements LayoutManager2 permits BasicSplitPaneUI.BasicVerticalLayoutManager
用于方向为 HORIZONTAL_SPLIT 的 JSplitPanes 的 LayoutManager。
  • 字段详细信息

    • sizes

      protected int[] sizes
      组件的大小。
    • components

      protected Component [] components
      组件。
  • 方法详情

    • layoutContainer

      public void layoutContainer(Container  container)
      实际布局。
      指定者:
      layoutContainer 在接口 LayoutManager
      参数:
      container - 要布置的容器
    • addLayoutComponent

      public void addLayoutComponent(String  place, Component  component)
      在适当的位置添加组件。 Place 必须是 JSplitPane.LEFT、RIGHT、TOP、BOTTOM 或 null(对于分隔线)之一。
      指定者:
      addLayoutComponent 在接口 LayoutManager
      参数:
      place - 要与组件关联的字符串
      component - 要添加的组件
    • minimumLayoutSize

      public Dimension  minimumLayoutSize(Container  container)
      返回包含子项所需的最小大小。宽度是所有子级的最小宽度之和,高度是子级的最小高度中最大的一个。
      指定者:
      minimumLayoutSize 在接口 LayoutManager
      参数:
      container - 要布局的组件
      返回:
      容器的最小尺寸
      参见:
    • preferredLayoutSize

      public Dimension  preferredLayoutSize(Container  container)
      返回包含子项所需的首选大小。宽度是所有子级首选宽度的总和,高度是子级首选的最大高度。
      指定者:
      preferredLayoutSize 在接口 LayoutManager
      参数:
      container - 要布置的容器
      返回:
      容器的首选尺寸
      参见:
    • removeLayoutComponent

      public void removeLayoutComponent(Component  component)
      从我们的知识中删除指定的组件。
      指定者:
      removeLayoutComponent 在接口 LayoutManager
      参数:
      component - 要删除的组件
    • addLayoutComponent

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

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

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

      public void invalidateLayout(Container  c)
      什么也没做。如果开发人员真的想更改其中一个视图的大小,则应向 JSplitPane.resetToPreferredSizes 发送消息。
      指定者:
      invalidateLayout 在接口 LayoutManager2
      参数:
      c - 目标容器
    • maximumLayoutSize

      public Dimension  maximumLayoutSize(Container  target)
      返回最大布局大小,在两个方向上都是 Integer.MAX_VALUE。
      指定者:
      maximumLayoutSize 在接口 LayoutManager2
      参数:
      target - 目标容器
      返回:
      容器的最大尺寸
      参见:
    • resetToPreferredSizes

      public void resetToPreferredSizes()
      标记接收器,以便下次布置此实例时,它会询问首选尺寸。
    • resetSizeAt

      protected void resetSizeAt(int index)
      在传入的位置重置 Component 的大小。
      参数:
      index - 组件的索引
    • setSizes

      protected void setSizes(int[] newSizes)
      将大小设置为 newSizes
      参数:
      newSizes - 新尺寸
    • getSizes

      protected int[] getSizes()
      返回组件的大小。
      返回:
      组件的大小
    • getPreferredSizeOfComponent

      protected int getPreferredSizeOfComponent(Component  c)
      返回传入的组件首选大小的宽度。
      参数:
      c - 一个组件
      返回:
      组件的首选宽度
    • getSizeOfComponent

      protected int getSizeOfComponent(Component  c)
      返回传入组件的宽度。
      参数:
      c - 一个组件
      返回:
      组件的宽度
    • getAvailableSize

      protected int getAvailableSize(Dimension  containerSize, Insets  insets)
      根据容器大小和 Insets 返回可用宽度。
      参数:
      containerSize - 容器大小
      insets - insets
      返回:
      可用宽度
    • getInitialLocation

      protected int getInitialLocation(Insets  insets)
      返回左insets,除非 Insets 为空,在这种情况下返回 0。
      参数:
      insets - insets
      返回:
      左insets
    • setComponentToSize

      protected void setComponentToSize(Component  c, int size, int location, Insets  insets, Dimension  containerSize)
      将组件 c 的宽度设置为 size ,将其 x 位置放置在 location ,将 y 放置在 insets.top 并将高度放置在 containerSize.height 减去顶部和底部insets。
      参数:
      c - 一个组件
      size - 新宽度
      location - 新的 X 坐标
      insets - insets
      containerSize - 容器大小
    • updateComponents

      protected void updateComponents()
      确定组件。只要将其新实例安装到现有的 SplitPane 中,就应该调用它。