惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

博客园 - Android,服务端,移动互联网

每周感悟【2013年7月28日】 每周感悟【2013年7月21日】 Android客户端打包方案分享 转载:Endianness一点通 xmlBeans problem (From xmlBeans FAQ) 转载:JavaSE的线程synchronized关键字的用法 解决 java.lang.NoClassDefFoundError: org /apache/xmlbeans/XmlException 转载:写得蛮好的linux学习笔记 GMF中定制自己的outline 获取EObject对象的反向引用对象 转载两篇文章之二(从程序员到CTO所要培养的六种能力)作者:阿蒙 原文:http://blog.csdn.net/harrymeng/archive/2007/02/07/1503931.aspx 转载两篇文章之一(35 岁前程序员要规划好的四件事)原文:http://blog.csdn.net/oiio/archive/2007/02/12/1508001.aspx 关于解决eclipse中的插件依赖 Eclipse Modeling Projects覆盖的工业标准 Eclipse中加入自己的菜单项和工具栏项 在eclipse中获得当前所有打开的editor实例列表 关于EMF模型的操作,赶紧记下来 测试一下Windows live writer How to get projects list in eclipse
GMF中控制Figure的大小和位置
Android,服务端,移动互联网 · 2006-10-17 · via 博客园 - Android,服务端,移动互联网

在GMF中当使用XYLayout时经常会遇到这样的问题:

1。在create一个新figure时,figure会跑到它的parent figure的外面。

2。在move或者resize时跑到parent figure的外面。

如下图logic example中的问题:

一般的情况下,用户会challenge这个现象,如果在resize的时候,即便把figure的边界拖出parent,figure可以自动保持在parent的内部就比较好。

做到这个也不难,重载XYLayoutEditPolicy中的public Object getConstraintFor(Rectangle r) 方法就行了。参数r是gmf xylayout默认返回的figure的constrain,你可以根据自己的需要改变r中的width, height, x,y等参数,具体的算法就因需求而异了。

看一下XYLayoutEditPolicy还有他的父类中有许多同名不同参数的getConstrainFor(...)方法,有可以重载来定制用户的resize或move figure的行为。就不多介绍了,看源代码吧!