Java 如何在Eclipse插件视图中使用Jfreechart绘制XY折线图

Java 如何在Eclipse插件视图中使用Jfreechart绘制XY折线图,java,eclipse,eclipse-plugin,jfreechart,Java,Eclipse,Eclipse Plugin,Jfreechart,我试图在eclipse插件视图中绘制XY图表,但代码中有一个错误,我无法找到它所在的位置。 我在这个链接中使用了这个例子 .log文件内容 !SESSION 2016-06-13 16:10:18.594 ----------------------------------------------- eclipse.buildId=4.5.1.M20150904-0015 java.version=1.8.0_66 java.vendor=Oracle Corporation BootLoad

我试图在eclipse插件视图中绘制XY图表,但代码中有一个错误,我无法找到它所在的位置。

我在这个链接中使用了这个例子

.log文件内容

!SESSION 2016-06-13 16:10:18.594 -----------------------------------------------
eclipse.buildId=4.5.1.M20150904-0015
java.version=1.8.0_66
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.committers.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.committers.product

!ENTRY org.eclipse.epp.logging.aeri.ui 2 19 2016-06-13 16:11:14.840
!MESSAGE Updating the index from remote failed. Version: 1.0.1.v20150913-0716
!STACK 0
java.io.EOFException: Unexpected end of ZLIB input stream
    at java.util.zip.InflaterInputStream.fill(Unknown Source)
    at java.util.zip.InflaterInputStream.read(Unknown Source)
    at java.util.zip.ZipInputStream.read(Unknown Source)
    at java.io.FilterInputStream.read(Unknown Source)
    at com.google.common.io.ByteStreams.copy(ByteStreams.java:169)
    at com.google.common.io.ByteSink.writeFrom(ByteSink.java:134)
    at org.eclipse.epp.internal.logging.aeri.ui.utils.Zips.unzip(Zips.java:83)
    at org.eclipse.epp.internal.logging.aeri.ui.log.ProblemsDatabaseUpdateJob.run(ProblemsDatabaseUpdateJob.java:71)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.egit.ui 2 0 2016-06-13 16:11:35.087
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Amr'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.ui.monitoring 2 0 2016-06-13 16:11:45.478
!MESSAGE UI freeze of 0.71s at 16:11:44.762

!ENTRY org.eclipse.ui.monitoring 2 0 2016-06-13 16:11:47.920
!MESSAGE UI freeze of 0.58s at 16:11:47.334

!ENTRY org.eclipse.ui.monitoring 2 0 2016-06-13 16:11:52.904
!MESSAGE UI freeze of 0.63s at 16:11:52.256
控制台输出

!SESSION 2016-06-13 16:23:58.435 -----------------------------------------------
eclipse.buildId=4.5.1.M20150904-0015
java.version=1.8.0_66
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.platform.ide
Command-line arguments:  -product org.eclipse.platform.ide -data E:\Intense\GitHub/runtime-NatTableExamples -dev file:E:/Intense/GitHub/.metadata/.plugins/org.eclipse.pde.core/NatTableExamples/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.ui 4 4 2016-06-13 16:24:07.361
!MESSAGE Unable to create part

!ENTRY org.eclipse.ui 4 1 2016-06-13 16:24:07.366
!MESSAGE Plug-in "diagnostictool" was unable to instantiate class "Views.XYplot".
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in "diagnostictool" was unable to instantiate class "Views.XYplot".
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:188)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
    at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:58)

“为这个工作台部件创建SWT控件”的具体实现。您正在创建一个,
JFrame
的子类,它是一个Swing。您可能需要创建一个
图表组合。虽然我没有尝试过,但在发行版中包含的
swt/org/jfree/experimental
目录中有一些示例

查看workspace.metadata目录中的.log文件,查看是否有更详细的消息。如果存在“编辑您的问题”以添加.log中的详细信息。我编辑了问题并添加了.log文件内容,该日志看起来不相关。如果您使用'launch as eclipse application'运行此插件,那么要查看的工作区是测试工作区,而不是主工作区。查看启动的运行配置,看看它在哪里。我删除了元数据文件夹,再次运行插件,得到了相同的错误。我用.log内容和控制台输出编辑了这个问题。
!SESSION 2016-06-13 16:23:58.435 -----------------------------------------------
eclipse.buildId=4.5.1.M20150904-0015
java.version=1.8.0_66
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.platform.ide
Command-line arguments:  -product org.eclipse.platform.ide -data E:\Intense\GitHub/runtime-NatTableExamples -dev file:E:/Intense/GitHub/.metadata/.plugins/org.eclipse.pde.core/NatTableExamples/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.ui 4 4 2016-06-13 16:24:07.361
!MESSAGE Unable to create part

!ENTRY org.eclipse.ui 4 1 2016-06-13 16:24:07.366
!MESSAGE Plug-in "diagnostictool" was unable to instantiate class "Views.XYplot".
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in "diagnostictool" was unable to instantiate class "Views.XYplot".
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:188)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
    at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:58)