<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Dengues Studio: Google Group:http://groups.google.com/group/dengues; QQ Group:24885404.
    一般來說我們很難計算兩個節點之間的顯示名稱的位置,而且還要包括名稱字符串的大小。這個是在Dengues里面實現的效果:
    圖一:

    圖二:

    你可以看Dengues源代碼:
    org.dengues.designer.ui.process.models.CompConnectionLabel
     1 /**
     2      * Qiang.Zhang.Adolf@gmail.com Comment method "changeLocation".
     3      */
     4     public void changeLocation() {
     5         Point point = new Point();
     6 
     7         int x = connection.getSource().getLocation().x;
     8         int x2 = connection.getTarget().getLocation().x;
     9 
    10         int width = x2 > x ? connection.getSource().getSize().width : connection.getTarget().getSize().width;
    11         int abs = Math.abs(x2 - x) / 2 - width / 2;
    12         int px = x2 > x ? x + abs + width : x2 + abs + width;
    13 //這個作用是計算字符串getCompName()的大小。
    14         GC gc = new GC(Display.getDefault());
    15         org.eclipse.swt.graphics.Point stringExtent = gc.stringExtent(getCompName());
    16         gc.dispose();
    17         px = px - stringExtent.x / 2;
    18         point.x = px;
    19 
    20         int y = connection.getSource().getLocation().y;
    21         int y2 = connection.getTarget().getLocation().y;
    22 
    23         int height = y2 > y ? connection.getSource().getSize().height : connection.getTarget().getSize().height;
    24         abs = Math.abs(y2 - y) / 2 - height / 2;
    25         int py = y2 > y ? y + abs + height : y2 + abs + height;
    26         py = py - stringExtent.y;
    27         point.y = py;
    28         setLocation(point);
    29     }
    這樣的好就可以計算中間的位置。


    Dengues論壇(http://groups.google.com/group/dengues/),一個很好的Eclipse開發者樂園.

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    Dengues Studio: Google Group:http://groups.google.com/group/dengues; QQ Group:24885404.
    主站蜘蛛池模板: 亚洲男人天堂2020| 人人公开免费超级碰碰碰视频| 国产L精品国产亚洲区久久| 最近中文字幕无吗免费高清| 久久午夜羞羞影院免费观看| 一级一片免费视频播放| 亚洲AV无码专区在线观看成人 | 无遮挡a级毛片免费看| 2020国产精品亚洲综合网 | 24小时日本韩国高清免费| 99久久婷婷免费国产综合精品| 国产亚洲美女精品久久久久| 亚洲中文字幕无码一去台湾| 亚洲日本香蕉视频| 67pao强力打造67194在线午夜亚洲| 亚洲女同成人AⅤ人片在线观看| 国产成人免费a在线视频色戒| 女人毛片a级大学毛片免费| 天天影视色香欲综合免费| 91青青国产在线观看免费| 日本免费一区二区久久人人澡| 中文字幕免费在线观看动作大片| 一级一黄在线观看视频免费| 一级特黄录像视频免费| 少妇亚洲免费精品| 九九九精品视频免费| 一本久久免费视频| 2022免费国产精品福利在线 | 亚洲制服中文字幕第一区| 精品国产_亚洲人成在线高清| 曰韩亚洲av人人夜夜澡人人爽| 在线亚洲人成电影网站色www| 久久精品国产亚洲Aⅴ香蕉| 亚洲午夜久久久久久久久久| 亚洲综合无码精品一区二区三区| 亚洲自偷自偷在线制服 | 久久国产精品免费网站| 久久一区二区三区免费播放 | 亚洲成人在线免费观看| 亚洲一区免费视频| 亚洲人成电影网站免费|