java.lang.Object
javax.swing.JRootPane.RootLayout
- 所有已实现的接口:
-
LayoutManager,LayoutManager2,Serializable
- 封装类:
-
JRootPane
负责对layeredPane、glassPane和menuBar进行布局的自定义布局管理器。
警告: 该类的序列化对象将不兼容未来的Swing版本。当前的序列化支持适用于短期存储或在运行相同Swing版本的应用程序之间的RMI。从1.4开始,已将所有JavaBeans的长期存储支持添加到java.beans包中。请参阅XMLEncoder。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutComponent(Component comp, Object constraints) 将指定的组件添加到布局中,使用指定的约束对象。voidaddLayoutComponent(String name, Component comp) 如果布局管理器使用每个组件的字符串,将组件comp添加到布局中,并将其与name指定的字符串关联起来。floatgetLayoutAlignmentX(Container target) 返回沿x轴的对齐方式。floatgetLayoutAlignmentY(Container target) 返回沿y轴的对齐方式。voidinvalidateLayout(Container target) 使布局失效,表示如果布局管理器具有缓存信息,则应将其丢弃。voidlayoutContainer(Container parent) 指示布局管理器为指定的容器执行布局。maximumLayoutSize(Container target) 返回布局可以使用的最大空间量。minimumLayoutSize(Container parent) 返回布局所需的最小空间量。preferredLayoutSize(Container parent) 返回布局希望拥有的空间量。void从布局中移除指定的组件。
-
Constructor Details
-
RootLayout
protected RootLayout()构造一个RootLayout。
-
-
Method Details
-
preferredLayoutSize
返回布局希望拥有的空间量。- 指定者:
-
preferredLayoutSize在接口LayoutManager中 - 参数:
-
parent- 正在使用此布局管理器的容器 - 返回:
- 包含布局的首选大小的Dimension对象
- 参见:
-
minimumLayoutSize
返回布局所需的最小空间量。- 指定者:
-
minimumLayoutSize在接口LayoutManager中 - 参数:
-
parent- 正在使用此布局管理器的容器 - 返回:
- 包含布局的最小大小的Dimension对象
- 参见:
-
maximumLayoutSize
返回布局可以使用的最大空间量。- 指定者:
-
maximumLayoutSize在接口LayoutManager2中 - 参数:
-
target- 正在使用此布局管理器的容器 - 返回:
- 包含布局的最大大小的Dimension对象
- 参见:
-
layoutContainer
指示布局管理器为指定的容器执行布局。- 指定者:
-
layoutContainer在接口LayoutManager中 - 参数:
-
parent- 正在使用此布局管理器的容器
-
addLayoutComponent
从接口复制的描述:LayoutManager如果布局管理器使用每个组件的字符串,将组件comp添加到布局中,并将其与name指定的字符串关联起来。- 指定者:
-
addLayoutComponent在接口LayoutManager中 - 参数:
-
name- 与组件关联的字符串 -
comp- 要添加的组件
-
removeLayoutComponent
从接口复制的描述:LayoutManager从布局中移除指定的组件。- 指定者:
-
removeLayoutComponent在接口LayoutManager中 - 参数:
-
comp- 要移除的组件
-
addLayoutComponent
从接口复制的描述:LayoutManager2将指定的组件添加到布局中,使用指定的约束对象。- 指定者:
-
addLayoutComponent在接口LayoutManager2中 - 参数:
-
comp- 要添加的组件 -
constraints- 将组件添加到布局的位置/方式
-
getLayoutAlignmentX
从接口复制的描述:LayoutManager2返回沿x轴的对齐方式。这指定了组件希望相对于其他组件对齐的方式。该值应为0到1之间的数字,其中0表示沿原点对齐,1表示与原点最远的对齐,0.5表示居中,依此类推。- 指定者:
-
getLayoutAlignmentX在接口LayoutManager2中 - 参数:
-
target- 目标容器 - 返回:
- x轴对齐偏好
-
getLayoutAlignmentY
从接口复制的描述:LayoutManager2返回沿y轴的对齐方式。这指定了组件希望相对于其他组件对齐的方式。该值应为0到1之间的数字,其中0表示沿原点对齐,1表示与原点最远的对齐,0.5表示居中,依此类推。- 指定者:
-
getLayoutAlignmentY在接口LayoutManager2中 - 参数:
-
target- 目标容器 - 返回:
- y轴对齐偏好
-
invalidateLayout
从接口复制的描述:LayoutManager2使布局失效,表示如果布局管理器具有缓存信息,则应将其丢弃。- 指定者:
-
invalidateLayout在接口LayoutManager2中 - 参数:
-
target- 目标容器
-