1

我正在做一个项目,我打算在 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)
4

1 回答 1

1

如果您想使用 Zest 可视化您的图表,您必须将您自己的图表对象转换为 Zest 图表,或者首先使用 Zest 对象。查看Eclipse wiki本教程中的一些示例。

该图无法使用 Zest(专注于可视化)进行编辑,但是基于 SWT,您可以使您的图具有交互性(向节点添加侦听器等)。如果您想编辑图形,请查看GraphitiJUNG 之类的东西。

于 2012-08-27T22:45:57.420 回答