JavaTM 2 Platform
Standard Ed. 6

javax.swing.plaf.basic
类 BasicSplitPaneUI.BasicHorizontalLayoutManager

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

public class BasicSplitPaneUI.BasicHorizontalLayoutManager
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

protected int[] sizes

components

protected Component[] components
方法详细信息

layoutContainer

public void layoutContainer(Container container)
进行实际布局。

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

addLayoutComponent

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

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

minimumLayoutSize

public Dimension minimumLayoutSize(Container container)
返回包含子级所需的最小大小。宽度为所有子级的最小宽度之和,高度为子级的最小高度中的最大者。

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

preferredLayoutSize

public Dimension preferredLayoutSize(Container container)
返回包含子级所需的首选大小。宽度为所有子级的首选宽度之和,高度为子级的首选高度中的最大者。

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

removeLayoutComponent

public void removeLayoutComponent(Component component)
根据了解的情况移除指定的组件。

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

addLayoutComponent

public void addLayoutComponent(Component comp,
                               Object constraints)
使用指定的约束对象将指定组件添加到布局中。

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

getLayoutAlignmentX

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

指定者:
接口 LayoutManager2 中的 getLayoutAlignmentX

getLayoutAlignmentY

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

指定者:
接口 LayoutManager2 中的 getLayoutAlignmentY

invalidateLayout

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

指定者:
接口 LayoutManager2 中的 invalidateLayout

maximumLayoutSize

public Dimension maximumLayoutSize(Container target)
返回最大布局大小,该大小在两个方向上都是 Integer.MAX_VALUE。

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

resetToPreferredSizes

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


resetSizeAt

protected void resetSizeAt(int index)
在传入位置重置 Component 的大小。


setSizes

protected void setSizes(int[] newSizes)
将大小设置为 newSizes


getSizes

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


getPreferredSizeOfComponent

protected int getPreferredSizeOfComponent(Component c)
返回传入 Component 的首选大小的宽度。


getSizeOfComponent

protected int getSizeOfComponent(Component c)
返回传入组件的宽度。


getAvailableSize

protected int getAvailableSize(Dimension containerSize,
                               Insets insets)
返回基于容器大小和 Insets 的可用宽度。


getInitialLocation

protected int getInitialLocation(Insets insets)
如果 Insets 不为 null,则返回左边 inset;如果其为 null,则返回 0。


setComponentToSize

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


updateComponents

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


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only