﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-我的世界</title><link>http://www.blogjava.net/hehui0912/</link><description>我的世界</description><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 07:55:01 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 07:55:01 GMT</pubDate><ttl>60</ttl><item><title>draw2d中的层到底有什么作用？</title><link>http://www.blogjava.net/hehui0912/archive/2007/06/27/126522.html</link><dc:creator>贺辉</dc:creator><author>贺辉</author><pubDate>Wed, 27 Jun 2007 03:19:00 GMT</pubDate><guid>http://www.blogjava.net/hehui0912/archive/2007/06/27/126522.html</guid><wfw:comment>http://www.blogjava.net/hehui0912/comments/126522.html</wfw:comment><comments>http://www.blogjava.net/hehui0912/archive/2007/06/27/126522.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hehui0912/comments/commentRss/126522.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hehui0912/services/trackbacks/126522.html</trackback:ping><description><![CDATA[<span style="COLOR: #000000"><strong>draw2d中的层到底有什么作用？<img height=20 src="http://www.blogjava.net/Emoticons/QQ/11.gif" width=20 border=0></strong></span>
<img src ="http://www.blogjava.net/hehui0912/aggbug/126522.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hehui0912/" target="_blank">贺辉</a> 2007-06-27 11:19 <a href="http://www.blogjava.net/hehui0912/archive/2007/06/27/126522.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>gef中的自己写的布局管理器，为什么出现死循环？？？</title><link>http://www.blogjava.net/hehui0912/archive/2007/06/27/gef.html</link><dc:creator>贺辉</dc:creator><author>贺辉</author><pubDate>Wed, 27 Jun 2007 00:46:00 GMT</pubDate><guid>http://www.blogjava.net/hehui0912/archive/2007/06/27/gef.html</guid><wfw:comment>http://www.blogjava.net/hehui0912/comments/126456.html</wfw:comment><comments>http://www.blogjava.net/hehui0912/archive/2007/06/27/gef.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hehui0912/comments/commentRss/126456.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hehui0912/services/trackbacks/126456.html</trackback:ping><description><![CDATA[<p style="COLOR: #ff0000">/*******************************************************************************<br>&nbsp;* Copyright (c) 2000, 2005 IBM Corporation and others.<br>&nbsp;* All rights reserved. This program and the accompanying materials<br>&nbsp;* are made available under the terms of the Eclipse Public License v1.0<br>&nbsp;* which accompanies this distribution, and is available at<br>&nbsp;* <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a><br>&nbsp;*<br>&nbsp;* Contributors:<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp; IBM Corporation - initial API and implementation<br>&nbsp;*******************************************************************************/<br>package com.example.layout;</p>
<p style="COLOR: #ff0000">import java.util.Iterator;</p>
<p style="COLOR: #ff0000">import org.eclipse.draw2d.FreeformLayout;<br>import org.eclipse.draw2d.IFigure;<br>import org.eclipse.draw2d.geometry.Point;</p>
<p style="COLOR: #ff0000">/**<br>&nbsp;* A layout for <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#123;&#64;&#108;&#105;&#110;&#107;">{@link</a> org.eclipse.draw2d.FreeformFigure FreeformFigures}.<br>&nbsp;*/<br>public class FreeformLayout2<br>&nbsp;extends FreeformLayout<br>&nbsp;{<br>int colum;<br>&nbsp;<br>int width;</p>
<p style="COLOR: #ff0000">&nbsp;<br>public FreeformLayout2(int colum, int width) {</p>
<p style="COLOR: #ff0000">&nbsp;this.colum = colum;<br>&nbsp;this.width = width;</p>
<p style="COLOR: #ff0000">}</p>
<p style="COLOR: #ff0000">&nbsp;</p>
<p style="COLOR: #ff0000">&nbsp;public void layout(IFigure parent) {<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;//&nbsp;parent.set<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;System.out.println(parent.getClass().toString());</p>
<p style="COLOR: #ff0000">&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;//parent.getBounds().x=10;<br>&nbsp;//parent.getBounds().y=20;<br>&nbsp;&nbsp;int x = parent.getBounds().x;<br>&nbsp;&nbsp;int y = parent.getBounds().y;<br>&nbsp;&nbsp;/*<br>&nbsp;&nbsp;int ph = parent.getBounds().height;<br>&nbsp;&nbsp;int pw = parent.getBounds().width;<br>&nbsp;&nbsp;int h = parent.getBounds().height / this.rows;<br>&nbsp;&nbsp;int w = parent.getBounds().width / this.colum;*/</p>
<p style="COLOR: #ff0000">&nbsp;&nbsp;Iterator children = parent.getChildren().iterator();<br>System.out.println(x+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "+y);<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;IFigure f;</p>
<p style="COLOR: #ff0000">&nbsp;&nbsp;int cx =x, cy =y;<br>&nbsp;&nbsp;int&nbsp; count=0;<br>&nbsp;&nbsp;while (children.hasNext()) {<br>&nbsp;&nbsp;&nbsp;count++;<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;//System.out.println(pw);<br>&nbsp;&nbsp;&nbsp;f = (IFigure) children.next();</p>
<p style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;f.setLocation(new Point(cx, cy));</p>
<p style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;f.setSize(width, width);<br>&nbsp;&nbsp;&nbsp;cx +=width;<br>&nbsp;&nbsp;&nbsp;if (count&gt;=colum) {<br>&nbsp;&nbsp;&nbsp;&nbsp;cx = 0;<br>&nbsp;&nbsp;&nbsp;&nbsp;cy +=width;<br>&nbsp;&nbsp;&nbsp;&nbsp;count=0;<br>&nbsp;&nbsp;&nbsp;}</p>
<p style="COLOR: #ff0000">&nbsp;&nbsp;<br>&nbsp;&nbsp;}</p>
<p style="COLOR: #ff0000">&nbsp;}</p>
<p style="COLOR: #ff0000">&nbsp;</p>
<p style="COLOR: #ff0000"><br>}<br></p>
<img src ="http://www.blogjava.net/hehui0912/aggbug/126456.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hehui0912/" target="_blank">贺辉</a> 2007-06-27 08:46 <a href="http://www.blogjava.net/hehui0912/archive/2007/06/27/gef.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>