java SWT:最有效的layout方法Control.requestLayout()
来源:互联网 发布:底特律机场免税店mac 编辑:程序博客网 时间:2024/06/06 17:29
Eclipse SWT最新的版本中org.eclipse.swt.widgets.Control增加了一个新方法requestLayout()用于更高效的处理layout请求
该方法其实只有一行代码:
public void requestLayout () { getShell ().layout (new Control[] {this}, SWT.DEFER);}
这是SWT当前最高效的触发layout的办法,但是目前大多数开发者还是习惯使用性能更差的 Composite.layout()方法,
下面是说明原文:
SWT has added a new requestLayout() method to the Control and Composite classes. This method does essentially the same thing as
widget.getShell().layout(new Control[] {widget}, SWT.DEFER);
The snippet, above, is currently the most efficient method of triggering layouts in SWT, but most developers are unaware of this. Most Eclipse developers invoke Composite.layout(), which is worse in the sense of performance. This new API is intended to make it easier for developers to adopt the more efficient mechanism as opposed to using Composite#layout().However, be aware that changing existing invocations of layout() to requestLayout() may break code that assumes that controls are completely sized and positioned at a certain point in time.
参考
《Eclipse Project Neon (4.6) M4 - New and Noteworthy》
《http://www.vogella.com/tutorials/SWT/article.html》
- java SWT:最有效的layout方法Control.requestLayout()
- view的requestLayout()方法
- AbsListView的requestLayout()方法
- view的requestLayout()方法
- view的requestLayout()方法
- view的requestLayout()方法
- view的requestLayout()方法
- RequestLayout() , Invalidate() , layout()之间的区别
- 替代 SWT GridData 更简单有效的方法
- 替代 SWT GridData 更简单有效的方法
- 替代 SWT GridData 更简单有效的方法
- 替代 SWT GridData 更简单有效的方法
- 替代 SWT GridData 更简单有效的方法
- java SWT实现最简单的加法器
- SWT Layout 的注意项
- SWT Layout 的注意项
- SWT Layout 的注意项
- SWT Layout 的注意项
- 拓扑排序
- fatal error: list: No such file or directory 生成so库出错
- LeetCode 77. Combinations
- AAMI EC57标准在ECG信号分类中的使用
- 各主流浏览器内核介绍
- java SWT:最有效的layout方法Control.requestLayout()
- 算法训练 图形显示
- 【DragonBones&Unity】关于DragonBones载入Unity的问题
- 数字图像处理的MATLAB实现[1]
- 微机个人笔记-半导体存储器(芯片的角度)概述
- C#读写XML文件
- 动态规划-矩阵链乘法(1)
- centos6.5使用源码安装samba
- 主窗体嵌套子窗体方法,可直接引用