- 浏览: 978510 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
运乃强谦:
老哥,你确定这个wsdl 地址 可以访问?
[CXF] Server与Client实现方式五:HTTPS -
wangyudong:
由CXF实现的微服务需要有比较好的工具去测试RESTful A ...
[CXF] Server与Client实现方式四:JMS -
dengmiao:
JAXB学习三 (验证) -
panamera:
你好。可以提供maven pom配置是怎么配置的?不知道你使用 ...
[CXF] Server与Client实现方式四:JMS -
u010221220:
请问楼主一二三部分的代码都应该放在哪个函数体中。
使用JDI监听Java程序运行
1. Eclipse Zest
1.1 概述
Eclipse Zest是一个可视化的图形工具。它基于SWT/Draw2D。Zest还支持JFace中Viewer的概念,因此允许模型和视图的分离。这篇文章假设你已经熟悉了Eclipse RCP或Eclipse Plugin开发。
(我注:其实也可以在一个普通的SWT程序中使用Zest)
1.2 组件
Eclipse Zest有以下组件:
- GraphNode -- graph中,带属性的结点
- GraphConnections -- graph中,用来连接两个结点的边线
- GraphContainer -- graph中,用来包含其他结点的容器
- Graph -- 根,用来包含所有其他的结点(nodes,connections,container)
1.3 布局
Zest提供了一些布局管理器,用来决定怎么布局graph上的结点。下面列出的就是所提供的一些布局:
表1 布局管理器
TreeLayoutAlgorithm | Graph is displayed in the form of a vertical tree |
HorizontalTreeLayoutAlgorithm | Similar to TreeLayoutAlgorithm, but layout is horizontal |
RadialLayoutAlgorithm | Root is the center, the others nodes are placed around this node |
GridLayoutAlgorithm SpringLayoutAlgorithm |
layout the graph, so that all connections should have approx the same length and that the edges overlap minimal |
HorizontalShift | move overlapping nodes to the right |
CompositeLayoutAlgorithm | combines other layout algorithms, for example, HorizontalShift can be the second layout algorithm to move nodes which were still overlapping if another algorithm is used. |
1.4 Filter
可以通过调用setFilter(filter)方法,在布局上增加过滤器(org.eclipse.zest.layouts.filter),用于决定哪些结点和边线是可见的。filter收到一个LayoutItem对象,实际的graph结点可以通过方法getGraphData()得到。
2. 安装
(我注:好像现在安装完GEF后,自动就有了,所以这里略了)
3 你的第一个Zest工程
3.1 开始
创建一个Eclipse RCP应用“de.vogella.zest.first”。选择模板"Eclipse RCP with a view“。 增加"org.eclipse.zest.core" 和 "org.eclipse.zest.layouts" 依赖项。
修改"View.java"的代码如下,用于创建一个简单的graph和连接它的元素:
package de.vogella.zest.first; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.ui.part.ViewPart; import org.eclipse.zest.core.widgets.Graph; import org.eclipse.zest.core.widgets.GraphConnection; import org.eclipse.zest.core.widgets.GraphNode; import org.eclipse.zest.core.widgets.ZestStyles; import org.eclipse.zest.layouts.LayoutStyles; import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm; import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm; public class View extends ViewPart { public static final String ID = "de.vogella.zest.first.view"; private Graph graph; private int layout = 1; public void createPartControl(Composite parent) { // Graph will hold all other objects graph = new Graph(parent, SWT.NONE); // Now a few nodes GraphNode node1 = new GraphNode(graph, SWT.NONE, "Jim"); GraphNode node2 = new GraphNode(graph, SWT.NONE, "Jack"); GraphNode node3 = new GraphNode(graph, SWT.NONE, "Joe"); GraphNode node4 = new GraphNode(graph, SWT.NONE, "Bill"); // Lets have a directed connection new GraphConnection(graph, ZestStyles.CONNECTIONS_DIRECTED, node1, node2); // Lets have a dotted graph connection new GraphConnection(graph, ZestStyles.CONNECTIONS_DOT, node2, node3); // Standard connection new GraphConnection(graph, SWT.NONE, node3, node1); // Change line color and line width GraphConnection graphConnection = new GraphConnection(graph, SWT.NONE, node1, node4); graphConnection.changeLineColor(parent.getDisplay().getSystemColor( SWT.COLOR_GREEN)); // Also set a text graphConnection.setText("This is a text"); graphConnection.setHighlightColor(parent.getDisplay().getSystemColor( SWT.COLOR_RED)); graphConnection.setLineWidth(3); graphConnection.addListener(SWT.SELECTED, new Listener() { @Override public void handleEvent(Event event) { System.out.println("Selected"); } }); graph.setLayoutAlgorithm(new SpringLayoutAlgorithm( LayoutStyles.NO_LAYOUT_NODE_RESIZING), true); } public void setLayoutManager() { switch (layout) { case 1: graph.setLayoutAlgorithm(new TreeLayoutAlgorithm( LayoutStyles.NO_LAYOUT_NODE_RESIZING), true); layout++; break; case 2: graph.setLayoutAlgorithm(new SpringLayoutAlgorithm( LayoutStyles.NO_LAYOUT_NODE_RESIZING), true); layout = 1; break; } } /** * Passing the focus request to the viewer's control. */ public void setFocus() { } }
运行以后,得到下图:
3.2 通过command来改变布局
创建一个command,并把以下"de.vogella.zest.first.handler.ChangeLayout"作为它的handler,此handler用于更改布局。最后把这个command加到一个menu上:
package de.vogella.zest.first.handler; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.ui.IViewPart; import org.eclipse.ui.handlers.HandlerUtil; import de.vogella.zest.first.View; public class ChangeLayout extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { IViewPart findView = HandlerUtil.getActiveWorkbenchWindow(event) .getActivePage().findView("de.vogella.zest.first.view"); View view = (View) findView; view.setLayoutManager(); return null; } }
运行应用,如果你选择了上面的菜单,视图的布局将会改变
4.Zest和JFace
JFace提供了viewers用于分离数据和展现。请看Eclipse JFace TableViewer 或 Eclipse JFace TreeViewer 。JFace要求一个content provider和一个label provider。Zest提供了一个"GraphViewer“作为一个viewer。content provider则是基于connections或者是nodes的。
标准的Zest content providers有:
IGraphContentProvider | Based on the connections. The connections contain the information which nodes they refer to. Cannot display nodes without connections. |
IGraphEntityContentProvider | Based on the Node which contain the information about which relationship they have. These relationship are available in the label provider as EntityConnectionData objects. |
IGraphEntityRelationshipContentProvider | Node based, the content provider defines getRelationShips(sourceNode, destinationNode) which determines the connections. The advantages compared with IGraphEntityContentProvider is that you decide which objects you return. |
Zest的label provider可以是一个标准的JFace的 ILabelProvider,也可以是Zest特定的IEntityStyleProvider。
发表评论
-
GEF中用鼠标移动画布
2011-12-27 13:37 1322第一步 增加Palette项: moveTool = n ... -
Draw2d的ScrollPane的使用
2011-04-19 15:05 1586ScrollPane scrollpane = ne ... -
GEF的动态变化二
2011-04-13 10:47 1294之前有一篇文件介绍怎么实现GEF Editor中的图元的渐近、 ... -
(译)Eclipse Zest二
2011-01-07 15:41 19045. Zest和JFace的例子 5.1 创建工程 创建一 ... -
增加GEF的动态性
2011-01-06 10:25 1746在一个GEF应用中,最常的操作是移位和缩放。移位和缩放实现本身 ... -
GEF中Palette项的属性页显示
2010-11-04 14:25 1946一般来说我们只需要在GraphicalViewer部分显示在P ... -
定制GEF的Palette
2009-11-23 16:35 2498用GEF框架实现一个Editor时,会有一个默认的palett ... -
GEF增加之连接助手二
2009-10-29 16:01 1001上一篇说过怎么实现悬浮连接助手。一直想要怎么实现悬浮连接助手。 ... -
GEF功能增强之创建助手
2009-09-28 09:09 1672用过GMF就知道,GMF默认生成的editor有一个悬浮的创建 ... -
GEF功能增强之连接助手
2009-09-10 14:45 1773GEF图形编辑器中,通常 ... -
GEF中实现“拷贝为图片”
2009-09-06 09:13 1318在一个GEF的编辑器中,编辑器上是一个个的Figure,从外观 ... -
GEF中扩大、缩小时处理编辑行为
2008-12-30 10:54 1494我们为GEF应用提供了ZoomIn和ZoomOut功能之后,在 ... -
改变GEF的一些默认行为
2008-12-29 14:12 1387一、改变Layer GEF中会根据editpart的类 ... -
GEF中一个模型的多层图的问题
2008-12-26 16:00 1611一般来说,我们在做GEF的时候,通常是一个模型对应一个图,这个 ... -
GEF中增加ContextMenu的支持
2008-12-19 22:32 2605GEF中,增加对EditPart的右键菜单的支持是很普遍的一 ... -
增加Palette的拖放支持
2008-12-19 14:08 1932默认情况下,GEF中要创建一个新的结点都是通点在Palette ... -
给GEF拖放功能
2008-07-17 10:26 1859我们知道SWT支持Native的拖放。GEF使用SWT的拖放来 ... -
修改GEF中Connection的端点
2008-07-14 16:09 1790GEF中,选中一条连接线,默认的端点是两个小黑框,如下: ... -
GEF中导视图的使用
2008-07-10 17:01 2144有时增加一个导视图能给用户很大的方便性,例如在outline视 ... -
(接上篇)关于GEF Feedback的补充
2008-07-10 10:18 1375重复上篇,我们有以下类: 1、模型相关:RouteMap、H ...
相关推荐
maven_eclipse_GEF-zest-3.7.1_m2e-extras_m2e.zip maven的eclipse插件
压缩包里有maven的安装以及eclipse安装maven插件的资料,压缩包里有maven的安装以及eclipse安装maven插件的资料
旧版本eclipse,比如indigo版本要安装maven,旧的在线安装方式已经失效,因为依赖的zest和m2eclipse的location url都已经无法访问。所以从已经安装这两个包的eclipse中分离出离线的安装包,拷贝到对应的features和...
GEF-zest-3.6.1.zipGEF-zest-3.6.1.zipGEF-zest-3.6.1.zipGEF-zest-3.6.1.zipGEF-zest-3.6.1.zipGEF-zest-3.6.1.zip
Zest Creator 工具,用于创建有效的 zest 脚本并通过辅助方法与脚本交互。 使用 安装它: ```bash $ npm i zest-creator ``` 需要它并使用: ```js var ZestCreator = require('zest-creator'); var opts = { ...
自己用WDR备份的固件,WDC WD3200BPVT-80ZEST0-WD-WXB1AC064983-01.01A01-0015002M-256-1091-KL 测试完好
Zest不仅是一个内容共享平台,还比它更部落化。专业人士互相关注,查看他们建议,保存的内容,当然还可以个性化您的提炼内容流。选择与您相关的标签,并自定义Zest的主题和布局以适合您的喜好。还有一组内置功能可...
Zest不仅仅是一个内容阅读平台-拥有20,000多名营销专家的社区互相追随,为发展自己的个人品牌或博客做出贡献,并将内容带给他们的团队以提高工作效率。 通过选择与您的专业需求相关的主题来个性化您的内容提要,并...
Zest提供了一组定义明确的工具包,可以处理这些事情,使您可以专注于构建应用程序。 Zest框架的目的对于PHP,当今有许多可用PHP框架,因此提出了一个问题,即为什么我们应该使用ZestFramework。 Zest框架的主要目的...
热情 这个项目编号是由开发: APIPHP Laravel Web应用程序的VueJS和TypeScript 作者
只需单击chrome浏览器右上角的图标,输入要上色的类别,选择一种颜色,然后单击添加。 刷新Zendesk页面以查看更改生效。 更改类别的颜色也很容易,只需单击类别名称旁边的颜色,然后进行更改并刷新Zendesk页面即可。...
Zest 脚本的运行时。 使用 安装它: ```bash $ npm i zest-runner ``` 需要它并使用: ```js var ZestRunner = require('zest-runner'); var opts = { sourceType: 'file', file: 'abc.zst' }; var zr = new ...
GEF: Graphical Editing Framework <br>GEF是一套MVC Framework,它能帮你比较容易的...依赖:org.eclipse.draw2d*** 本软件GEF-ALL-3.2.2完整版包含(Draw2D, GEF and Zest) 大小:6.6M 请用于Eclipse3.2.2环境下.
python库。 资源全名:zbs.zest-1.1.24.tar.gz
ZeST是用于强调文件系统/磁盘的TUI程序。 仅对curses起作用,它可在任何POSIX系统上使用。 它为IPC使用fork()和一个命名的fifo。 如果一个进程启动太多,则可以终止单个进程,这不会中断测试。
当前的代码库是与2004年以来提供的原始Draw2d 3.x , GEF(MVC)3.x和Zest 1.x项目组件并行开发的。直到4.0版本为止。 0(Neon)在2016年发布,此代码库分别称为'GEF4'或org.eclipse.gef4 ,这就是为什么这些术语仍...
1. Spring框架:Spring是一个轻量级的Java开发框架,提供了丰富的功能和模块,用于开发企业级应用。它包括IoC(Inverse of Control,控制反转)容器、AOP(Aspect-Oriented Programming,面向切面编程)等特性,可以...
ECLIPSE相关插件 解决eclipse安装插件时提示以下错误 Java代码 Software being installed: Maven Integration for ...Software being installed: Maven Integration for Eclipse (Required) 0.12.1.20110112-1712
一个虚拟屋顶下的所有文件只需连接您的信息源,并通过统一的智能搜索即可访问文件。 Zest当前与Gmail,Google云端硬盘,Confluence,Box,GitHub,Dropbox和Pocket同步。 再也不会中断您的工作流程所有文件都只是...