目录搜索
文字
分享


JavaTM 2 Platform
Standard Ed. 6

javax.swing.plaf.basic
类 BasicSplitPaneUI.BasicHorizontalLayoutManager

1

2

java.lang.Object

  <img src="../../../../resources/inherit.gif" alt="继承者 "><b>javax.swing.plaf.basic.BasicSplitPaneUI.BasicHorizontalLayoutManager</b>

所有已实现的接口:
LayoutManager, LayoutManager2
直接已知子类:
BasicSplitPaneUI.BasicVerticalLayoutManager
正在封闭类:
BasicSplitPaneUI

1

public class <b>BasicSplitPaneUI.BasicHorizontalLayoutManager</b>

extends Object
implements LayoutManager2

具有 HORIZONTAL_SPLIT 方向的 JSplitPane 的 LayoutManager。


字段摘要
protected  Component[] components
           
protected  int[] sizes
           
 
方法摘要
 void addLayoutComponent(Component comp, Object constraints)
          使用指定的约束对象将指定组件添加到布局中。
 void addLayoutComponent(String place, Component component)
          在 place 位置添加组件。
protected  int getAvailableSize(Dimension containerSize, Insets insets)
          返回基于容器大小和 Insets 的可用宽度。
protected  int getInitialLocation(Insets insets)
          如果 Insets 不为 null,则返回左边 inset;如果其为 null,则返回 0。
 float getLayoutAlignmentX(Container target)
          返回容器沿 X 轴的对齐方式。
 float getLayoutAlignmentY(Container target)
          返回容器沿 Y 轴的对齐方式。
protected  int getPreferredSizeOfComponent(Component c)
          返回传入 Component 的首选大小的宽度。
protected  int getSizeOfComponent(Component c)
          返回传入组件的宽度。
protected  int[] getSizes()
          返回组件的大小。
 void invalidateLayout(Container c)
          不执行任何操作。
 void layoutContainer(Container container)
          进行实际布局。
 Dimension maximumLayoutSize(Container target)
          返回最大布局大小,该大小在两个方向上都是 Integer.MAX_VALUE。
 Dimension minimumLayoutSize(Container container)
          返回包含子级所需的最小大小。
 Dimension preferredLayoutSize(Container container)
          返回包含子级所需的首选大小。
 void removeLayoutComponent(Component component)
          根据了解的情况移除指定的组件。
protected  void resetSizeAt(int index)
          在传入位置重置 Component 的大小。
 void resetToPreferredSizes()
          标记接收者,以便下一次布置此实例时它将请求首选大小。
protected  void setComponentToSize(Component c, int size, int location, Insets insets, Dimension containerSize)
          将组件 c 的宽度设置为 size(将其 x 的位置放置到 location),将 y 和高度分别设置为 insets.top 和 containersize.height 减去上下 insets。
protected  void setSizes(int[] newSizes)
          将大小设置为 newSizes
protected  void updateComponents()
          确定组件。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

sizes

1

protected int[] <b>sizes</b>


components

1

protected Component[] <b>components</b>

方法详细信息

layoutContainer

1

public void <b>layoutContainer</b>(Container container)

进行实际布局。

指定者:
接口 LayoutManager 中的 layoutContainer
参数:
container - 要布置的容器

addLayoutComponent

1

2

public void <b>addLayoutComponent</b>(String place,

                               Component component)

在 place 位置添加组件。Place 必须为 JSplitPane.LEFT、RIGHT、TOP、BOTTOM 或 null(用于分隔器)之一。

指定者:
接口 LayoutManager 中的 addLayoutComponent
参数:
place - 要与组件关联的字符串
component - 要添加的组件

minimumLayoutSize

1

public Dimension <b>minimumLayoutSize</b>(Container container)

返回包含子级所需的最小大小。宽度为所有子级的最小宽度之和,高度为子级的最小高度中的最大者。

指定者:
接口 LayoutManager 中的 minimumLayoutSize
参数:
container - 要布置的组件

preferredLayoutSize

1

public Dimension <b>preferredLayoutSize</b>(Container container)

返回包含子级所需的首选大小。宽度为所有子级的首选宽度之和,高度为子级的首选高度中的最大者。

指定者:
接口 LayoutManager 中的 preferredLayoutSize
参数:
container - 要布置的容器
另请参见:
LayoutManager.minimumLayoutSize(java.awt.Container)

removeLayoutComponent

1

public void <b>removeLayoutComponent</b>(Component component)

根据了解的情况移除指定的组件。

指定者:
接口 LayoutManager 中的 removeLayoutComponent
参数:
component - 要移除的组件

addLayoutComponent

1

2

public void <b>addLayoutComponent</b>(Component comp,

                               Object constraints)

使用指定的约束对象将指定组件添加到布局中。

指定者:
接口 LayoutManager2 中的 addLayoutComponent
参数:
comp - 要添加的组件
constraints - 如何将组件添加到布局以及添加到何处。

getLayoutAlignmentX

1

public float <b>getLayoutAlignmentX</b>(Container target)

返回容器沿 X 轴的对齐方式。这指出相对于其他组件将如何排列该组件。该值应该在 0 到 1 之间,其中,0 表示沿原点进行对齐,1 表示在距原点最远的地方对齐,0.5 表示居中等等。

指定者:
接口 LayoutManager2 中的 getLayoutAlignmentX

getLayoutAlignmentY

1

public float <b>getLayoutAlignmentY</b>(Container target)

返回容器沿 Y 轴的对齐方式。这指出相对于其他组件将如何排列该组件。该值应该在 0 到 1 之间,其中,0 表示沿原点进行对齐,1 表示在距原点最远的地方对齐,0.5 表示居中等等。

指定者:
接口 LayoutManager2 中的 getLayoutAlignmentY

invalidateLayout

1

public void <b>invalidateLayout</b>(Container c)

不执行任何操作。如果开发人员确实希望更改其中某个视图的大小,应该传递 JSplitPane.resetToPreferredSizes 的消息。

指定者:
接口 LayoutManager2 中的 invalidateLayout

maximumLayoutSize

1

public Dimension <b>maximumLayoutSize</b>(Container target)

返回最大布局大小,该大小在两个方向上都是 Integer.MAX_VALUE。

指定者:
接口 LayoutManager2 中的 maximumLayoutSize
另请参见:
Component.getMaximumSize(), LayoutManager

resetToPreferredSizes

1

public void <b>resetToPreferredSizes</b>()

标记接收者,以便下一次布置此实例时它将请求首选大小。


resetSizeAt

1

protected void <b>resetSizeAt</b>(int index)

在传入位置重置 Component 的大小。


setSizes

1

protected void <b>setSizes</b>(int[] newSizes)

将大小设置为 newSizes


getSizes

1

protected int[] <b>getSizes</b>()

返回组件的大小。


getPreferredSizeOfComponent

1

protected int <b>getPreferredSizeOfComponent</b>(Component c)

返回传入 Component 的首选大小的宽度。


getSizeOfComponent

1

protected int <b>getSizeOfComponent</b>(Component c)

返回传入组件的宽度。


getAvailableSize

1

2

protected int <b>getAvailableSize</b>(Dimension containerSize,

                               Insets insets)

返回基于容器大小和 Insets 的可用宽度。


getInitialLocation

1

protected int <b>getInitialLocation</b>(Insets insets)

如果 Insets 不为 null,则返回左边 inset;如果其为 null,则返回 0。


setComponentToSize

1

2

3

4

5

protected void <b>setComponentToSize</b>(Component c,

                                  int size,

                                  int location,

                                  Insets insets,

                                  Dimension containerSize)

将组件 c 的宽度设置为 size(将其 x 的位置放置到 location),将 y 和高度分别设置为 insets.top 和 containersize.height 减去上下 insets。


updateComponents

1

protected void <b>updateComponents</b>()

确定组件。只要将其新实例安装到现有 SplitPane 中就应该调用此方法。


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。

上一篇:BasicSplitPaneUI下一篇:BasicTabbedPaneUI