GEF回顾——shapes示例分析(View篇)
来源:互联网 发布:金域名都公寓出售 编辑:程序博客网 时间:2024/05/16 09:54
下面来简单描述一下这个工程中对应的View——视图。由于对应的图形元素(Figure)都很简单,这里没有用单独的类来描述图形元素,而是使用GEF或者Draw2D中内置的几种Figure:Ellipse(椭圆)、RectangleFigure(矩形)和PolylineConnection(连接线)。这些Figure都将作为RootFigure的children,安放在RootFigure上。这里ShapeDragram对应的图形为FreeformLayer(一个可以扩展的Layer)。
我们来把上面得model和view关联起来:
a) Connection <-->PolylineConnection
b) EllipticalShape <-->Ellipse
c) RectangularShape <-->RectangleFigure
d) ShapeDiagram <--> FreeformLayer
这里简单讲解一下Connection对应的图形元素PolylineConnection。PolylineConnection是一种基于线条的连接,是最常用的连接之一,它的主要特点有:
a) 连接线有实线、虚线、点线等之分,同时还可以设定颜色、宽度
b) 有双向连接和单向连接之分,通过设定源和目的箭头装饰
setTargetDecoration(newPolygonDecoration())
当然,不设定则默认为无箭头的连接
c) 连接可以弯曲,由Bendpoint负责
d) 可以设置连接路径,比如使用最短路径连接还是弯曲连接
setConnectionRouter(ConnectionRoutercr)
常见的ConnectionRouter为BendpointConnectionRouter, FanRouter,
ConnectionRouter.NullConnectionRouter,ManhattanConnectionRouter,ShortestPathConnectionRouter(详细见org.eclipse.draw2d类包API)
PolylineConnection和ConnectionLayer中均有此方法,注意相互设置的影响,一般以ConnectionLayer设置的优先
ManhattanConnectionRouter:
ShortestPathConnectionRouter:
ConnectionRouter.NullConnectionRouter:
- GEF回顾——shapes示例分析(View篇)
- GEF回顾——shapes示例分析(Model篇)
- GEF回顾——shapes示例分析(Controller篇)
- CSS Secret——Shapes
- GEF-GWT——GEF的JavaScript版本
- Draw Shapes——绘制图形
- GEF property view的使用
- GEFGWT——GEF的JavaScript版本
- 数据结构回顾——时间复杂度分析
- 自定义View系列教程05--示例分析
- 自定义View系列教程05--示例分析
- PhysX3学习笔记 UserGuider——shapes&geometries简译
- .Net Micro Framework研究—Shapes命名空间
- .Net Micro Framework研究—Shapes命名空间
- Eclipse GEF 和公共View ID
- gef
- API 23 view.View——属性分析
- Android自定义View示例(四)—带有动画的Dialog
- 实战Linux Bluetooth编程(一) 协议栈概述
- The "ValidateXaml" task failed unexpectedly. vb silverlight socket 错误
- vim 实用的经验
- 英国女王获赠“黑莓”定制手机
- path和classpath的区别
- GEF回顾——shapes示例分析(View篇)
- SQL中一些函数调用秘密
- mysql 中的数据类型
- openfire及其源码的开发和部署
- LinkedHashMap 和 HashMap的区别
- 测试
- sdf sdfsdf sdfsdf.org
- 需求分析
- hibernate Restrictions用法