(DM)用DRAW2D画多边形的例子
来源:百度文库 编辑:神马文学网 时间:2024/06/03 10:48:14
public class Polygon{
public static void main(String[] args) {
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setSize(500, 375);
shell.setText("SWT Application");
LightweightSystem lws = new LightweightSystem(shell);
Figure contents = new Figure();
XYLayout contentsLayout = new XYLayout();
contents.setLayoutManager(contentsLayout);
Polygon p1 = new Polygon();
PointList list = new PointList();
list.addPoint(160, 0);
list.addPoint(240, 80);
list.addPoint(320, 80);
list.addPoint(240, 0);
p1.setPoints(list);
p1.setBackgroundColor(display.getSystemColor(SWT.COLOR_BLUE));
contents.add(p1);
p1.setFill(true);//使设置背景色生效【p1.setBackgroundColor(display.getSystemColor(SWT.COLOR_BLUE)); 】
lws.setContents(contents);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}
public static void main(String[] args) {
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setSize(500, 375);
shell.setText("SWT Application");
LightweightSystem lws = new LightweightSystem(shell);
Figure contents = new Figure();
XYLayout contentsLayout = new XYLayout();
contents.setLayoutManager(contentsLayout);
Polygon p1 = new Polygon();
PointList list = new PointList();
list.addPoint(160, 0);
list.addPoint(240, 80);
list.addPoint(320, 80);
list.addPoint(240, 0);
p1.setPoints(list);
p1.setBackgroundColor(display.getSystemColor(SWT.COLOR_BLUE));
contents.add(p1);
p1.setFill(true);//使设置背景色生效【p1.setBackgroundColor(display.getSystemColor(SWT.COLOR_BLUE)); 】
lws.setContents(contents);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}
(DM)用DRAW2D画多边形的例子
(DM)用DRAW2D画多边形的例子
Draw2d中Label的使用
draw2d里的MouseEvent的consume()
draw2d里面的一函数 translateToAbsolute(rect)
知识结构(有厚度的多边形)
DM的用法
DM的使用方法
DM万用版及图解和DM的基本使用
DM万用版及图解和DM的基本
DM硬盘分区教程 DM万用版及图解DM的基本使用方法
DM硬盘分区教程 DM万用版及图解DM的基本使用方法1
全面介绍Draw2d的Blog 中国Eclipse社区 论坛
小学五年级奥数专题讲座20:多边形的面积
抽象工厂的例子
类的简单例子
一个BPEL的例子
一个BPEL的例子
CommomDialog使用的例子
管理人性化的例子
犹太人的小例子
致命的例子?
dbutils 的例子
中美文化差异的例子