Zest Graph - 可编辑还是不可编辑?如何开始上课?

时间:2012-08-27 10:27:31

标签: java eclipse zest

我正在开发一个项目,我打算在JAVA中创建一个可以创建图形的类。详细说来,我想创建2个接口--VERTEX和EDGE,每个接口都有addVertex(),addEdge(),neighborVertex(),numOfNeighbors()等方法,以及我的类(称之为Graph)将实现上述接口。

我现在是JAVA的真正新手,并且想知道如何继续使用ZEST?另外,如果我使用ZEST,图表是否可以编辑?

Lars Vogel的教程帮助了我,但我仍然无法让它工作。如何解决以下错误?

    !SESSION 2012-08-30 13:00:20.498 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -application first.prog.zest.jface.application
Command-line arguments:  -application first.prog.zest.jface.application -data D:\Workspace/../runtime-first.prog.zest.jface.application -dev file:D:/Workspace/.metadata/.plugins/org.eclipse.pde.core/first.prog.zest.jface.application/dev.properties -os win32 -ws win32 -arch x86 -consoleLog

!ENTRY org.eclipse.osgi 2 0 2012-08-30 13:01:06.592
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-08-30 13:01:06.592
!MESSAGE Bundle reference:file:/D:/Workspace/first.prog.zest.jface/ was not resolved.
!SUBENTRY 2 first.prog.zest.jface 2 0 2012-08-30 13:01:06.592
!MESSAGE Missing required bundle org.eclipse.zest.layouts.source_1.1.0.
!SUBENTRY 2 first.prog.zest.jface 2 0 2012-08-30 13:01:06.592
!MESSAGE Missing required bundle org.eclipse.zest.core.source_1.3.0.

!ENTRY org.eclipse.osgi 2 0 2012-08-30 13:01:06.608
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-08-30 13:01:06.608
!MESSAGE Bundle first.prog.zest.jface_1.0.0.qualifier [93] was not resolved.
!SUBENTRY 2 first.prog.zest.jface 2 0 2012-08-30 13:01:06.608
!MESSAGE Missing required bundle org.eclipse.zest.core.source_1.3.0.
!SUBENTRY 2 first.prog.zest.jface 2 0 2012-08-30 13:01:06.608
!MESSAGE Missing required bundle org.eclipse.zest.layouts.source_1.1.0.

!ENTRY org.eclipse.osgi 2 0 2012-08-30 13:01:06.749
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-08-30 13:01:06.749
!MESSAGE Bundle reference:file:/D:/Workspace/first.prog.zest.jface/ was not resolved.
!SUBENTRY 2 first.prog.zest.jface 2 0 2012-08-30 13:01:06.749
!MESSAGE Missing required bundle org.eclipse.zest.layouts.source_1.1.0.
!SUBENTRY 2 first.prog.zest.jface 2 0 2012-08-30 13:01:06.749
!MESSAGE Missing required bundle org.eclipse.zest.core.source_1.3.0.

!ENTRY org.eclipse.osgi 2 0 2012-08-30 13:01:06.749
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-08-30 13:01:06.749
!MESSAGE Bundle first.prog.zest.jface_1.0.0.qualifier [93] was not resolved.
!SUBENTRY 2 first.prog.zest.jface 2 0 2012-08-30 13:01:06.749
!MESSAGE Missing required bundle org.eclipse.zest.core.source_1.3.0.
!SUBENTRY 2 first.prog.zest.jface 2 0 2012-08-30 13:01:06.749
!MESSAGE Missing required bundle org.eclipse.zest.layouts.source_1.1.0.

!ENTRY org.eclipse.osgi 4 0 2012-08-30 13:01:06.764
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: Application "first.prog.zest.jface.application" could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.ant.ui.antRunner, org.eclipse.cdt.codan.core.application, org.eclipse.cdt.core.GeneratePDOM, org.eclipse.cdt.managedbuilder.core.headlessbuild, org.eclipse.e4.ui.workbench.swt.E4Application, org.eclipse.e4.ui.workbench.swt.GenTopic, org.eclipse.emf.codegen.CodeGen, org.eclipse.emf.codegen.JMerger, org.eclipse.emf.codegen.ecore.Generator, org.eclipse.emf.importer.ecore.Ecore2GenModel, org.eclipse.emf.importer.java.Java2GenModel, org.eclipse.emf.importer.rose.Rose2GenModel, org.eclipse.equinox.app.error, org.eclipse.equinox.p2.director, org.eclipse.equinox.p2.garbagecollector.application, org.eclipse.equinox.p2.publisher.InstallPublisher, org.eclipse.equinox.p2.publisher.EclipseGenerator, org.eclipse.equinox.p2.publisher.ProductPublisher, org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher, org.eclipse.equinox.p2.reconciler.application, org.eclipse.equinox.p2.repository.repo2runnable, org.eclipse.equinox.p2.repository.metadataverifier, org.eclipse.equinox.p2.artifact.repository.mirrorApplication, org.eclipse.equinox.p2.metadata.repository.mirrorApplication, org.eclipse.equinox.p2.updatesite.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.CategoryPublisher, org.eclipse.help.base.infocenterApplication, org.eclipse.help.base.helpApplication, org.eclipse.help.base.indexTool, org.eclipse.jdt.apt.core.aptBuild, org.eclipse.jdt.core.JavaCodeFormatter, org.eclipse.jdt.core.JavaIndexer, org.eclipse.pde.build.Build, org.eclipse.pde.junit.runtime.uitestapplication, org.eclipse.pde.junit.runtime.legacytestapplication, org.eclipse.pde.junit.runtime.coretestapplication, org.eclipse.pde.junit.runtime.coretestapplicationnonmain, org.eclipse.pde.junit.runtime.nonuithreadtestapplication, org.eclipse.ui.ide.workbench.
    at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
    at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

错误日志内容如下:

java.lang.RuntimeException: Application "first.prog.zest.jface.application" could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.ant.ui.antRunner, org.eclipse.cdt.codan.core.application, org.eclipse.cdt.core.GeneratePDOM, org.eclipse.cdt.managedbuilder.core.headlessbuild, org.eclipse.e4.ui.workbench.swt.E4Application, org.eclipse.e4.ui.workbench.swt.GenTopic, org.eclipse.emf.codegen.CodeGen, org.eclipse.emf.codegen.JMerger, org.eclipse.emf.codegen.ecore.Generator, org.eclipse.emf.importer.ecore.Ecore2GenModel, org.eclipse.emf.importer.java.Java2GenModel, org.eclipse.emf.importer.rose.Rose2GenModel, org.eclipse.equinox.app.error, org.eclipse.equinox.p2.director, org.eclipse.equinox.p2.garbagecollector.application, org.eclipse.equinox.p2.publisher.InstallPublisher, org.eclipse.equinox.p2.publisher.EclipseGenerator, org.eclipse.equinox.p2.publisher.ProductPublisher, org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher, org.eclipse.equinox.p2.reconciler.application, org.eclipse.equinox.p2.repository.repo2runnable, org.eclipse.equinox.p2.repository.metadataverifier, org.eclipse.equinox.p2.artifact.repository.mirrorApplication, org.eclipse.equinox.p2.metadata.repository.mirrorApplication, org.eclipse.equinox.p2.updatesite.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.CategoryPublisher, org.eclipse.help.base.infocenterApplication, org.eclipse.help.base.helpApplication, org.eclipse.help.base.indexTool, org.eclipse.jdt.apt.core.aptBuild, org.eclipse.jdt.core.JavaCodeFormatter, org.eclipse.jdt.core.JavaIndexer, org.eclipse.pde.build.Build, org.eclipse.pde.junit.runtime.uitestapplication, org.eclipse.pde.junit.runtime.legacytestapplication, org.eclipse.pde.junit.runtime.coretestapplication, org.eclipse.pde.junit.runtime.coretestapplicationnonmain, org.eclipse.pde.junit.runtime.nonuithreadtestapplication, org.eclipse.ui.ide.workbench.
    at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
    at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

1 个答案:

答案 0 :(得分:1)

如果要使用Zest可视化图形,则必须将自己的图形对象转换为Zest图形,或者首先使用Zest对象。请查看Eclipse wikithis tutorial中的一些示例。

Zest(专注于可视化)不能编辑图形,但基于SWT可以使图形交互(将监听器添加到节点等)。如果您想要图表编辑,请查看Graphiti或类似JUNG