Skip to main content



      Home
Home » Eclipse Projects » GEF » getting error: simple draw2d graphic to view
getting error: simple draw2d graphic to view [message #126804] Mon, 12 April 2004 13:02 Go to next message
Eclipse UserFriend
Originally posted by: Kay_1.gmx.de

Hello!

I'm new in eclipse programming. I'm trying to add a simple
draw2d graphic to a canvas which is located in a view. But
I'm getting an error for the following code. Do you know
where is the bug?

<----->

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.swt.widgets.Canvas;

import org.eclipse.draw2d.*;

public class LabelView extends ViewPart {
=

Canvas canvas;
=

public LabelView() {
super();
}
=

public void setFocus() {
} =

=

public void createPartControl(Composite parent) {
=

canvas =3D new Canvas(parent,0);
LightweightSystem lws =3D new LightweightSystem(canvas);
IFigure panel =3D new Figure();
lws.setContents(panel);

Shape ellipse =3D new Ellipse();
ellipse.setBackgroundColor(ColorConstants.yellow);

panel.add(ellipse);
=

}
}

<----->

-- =

Erstellt mit M2, Operas revolution=E4rem E-Mail-Modul: =

http://www.opera.com/m2/
Re: getting error: simple draw2d graphic to view [message #126831 is a reply to message #126804] Mon, 12 April 2004 14:08 Go to previous messageGo to next message
Eclipse UserFriend
Can you tell us what the error is?
In your runtime workbench, go to Windows -> Show View -> Other -> PDE
Runtime -> Error Log

"eyak" <Kay_1@gmx.de> wrote in message news:opr6csalvqegwbjz@localhost...
Hello!

I'm new in eclipse programming. I'm trying to add a simple
draw2d graphic to a canvas which is located in a view. But
I'm getting an error for the following code. Do you know
where is the bug?

<----->

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.swt.widgets.Canvas;

import org.eclipse.draw2d.*;

public class LabelView extends ViewPart {

Canvas canvas;

public LabelView() {
super();
}

public void setFocus() {
}

public void createPartControl(Composite parent) {

canvas = new Canvas(parent,0);
LightweightSystem lws = new LightweightSystem(canvas);
IFigure panel = new Figure();
lws.setContents(panel);

Shape ellipse = new Ellipse();
ellipse.setBackgroundColor(ColorConstants.yellow);

panel.add(ellipse);

}
}

<----->

--
Erstellt mit M2, Operas revolution
Re: getting error: simple draw2d graphic to view [message #126856 is a reply to message #126831] Mon, 12 April 2004 13:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Kay_1.gmx.de

Thanks for your help. The Error-Log:

java.lang.NoClassDefFoundError: org/eclipse/draw2d/IFigure
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at =

org.eclipse.core.internal.plugins.PluginDescriptor.createExe cutableExten=
sion(PluginDescriptor.java:138)
at =

org.eclipse.core.internal.plugins.PluginDescriptor.createExe cutableExten=
sion(PluginDescriptor.java:167)
at =

org.eclipse.core.internal.plugins.ConfigurationElement.creat eExecutableE=
xtension(ConfigurationElement.java:103)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugi n.java:15=
8)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)=

at =

org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Work benchPlugin.=
java:155)
at =

org.eclipse.ui.internal.registry.ViewDescriptor.createView(V iewDescripto=
r.java:51)
at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:1 15)
at =

org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.=
java:1006)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFact ory.java:=
98)
at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:8 2)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)=

at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory. java:78)
at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:1465)
at =

org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:65=
5)
at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage .java:634=
)
at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.j ava:2777)=

at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)=

at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:277=
4)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:276=
4)
at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu. java:175)=

at org.eclipse.ui.internal.ShowViewMenu.access$2(ShowViewMenu.j ava:161)
at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java :48)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:842 )
at =

org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(Ac=
tionContributionItem.java:456)
at =

org.eclipse.jface.action.ActionContributionItem.handleWidget Event(Action=
ContributionItem.java:403)
at =

org.eclipse.jface.action.ActionContributionItem.access$0(Act ionContribut=
ionItem.java:397)
at =

org.eclipse.jface.action.ActionContributionItem$ActionListen er.handleEve=
nt(ActionContributionItem.java:72)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1729)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at =

org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader=
..java:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
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.core.launcher.Main.basicRun(Main.java:291)
at org.eclipse.core.launcher.Main.run(Main.java:747)
at org.eclipse.core.launcher.Main.main(Main.java:583)


Am Mon, 12 Apr 2004 13:08:23 -0500 schrieb Pratik Shah <ppshah@us.ibm.co=
m>:

> Can you tell us what the error is?
> In your runtime workbench, go to Windows -> Show View -> Other -> PDE
> Runtime -> Error Log
Re: getting error: simple draw2d graphic to view [message #126868 is a reply to message #126856] Mon, 12 April 2004 15:15 Go to previous message
Eclipse UserFriend
So, apparently, the problem is not in your code, but in your setup. Have
you added the drawd2 plugin as required in your plugin.xml?

"eyak" <Kay_1@gmx.de> wrote in message news:opr6cti4baegwbjz@localhost...

Thanks for your help. The Error-Log:

java.lang.NoClassDefFoundError: org/eclipse/draw2d/IFigure
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at
org.eclipse.core.internal.plugins.PluginDescriptor.createExe cutableExtension
(PluginDescriptor.java:138)
at
org.eclipse.core.internal.plugins.PluginDescriptor.createExe cutableExtension
(PluginDescriptor.java:167)
at
org.eclipse.core.internal.plugins.ConfigurationElement.creat eExecutableExten
sion(ConfigurationElement.java:103)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugi n.java:158)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at
org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Work benchPlugin.java
:155)
at
org.eclipse.ui.internal.registry.ViewDescriptor.createView(V iewDescriptor.ja
va:51)
at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:1 15)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
:1006)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFact ory.java:98)
at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:8 2)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory. java:78)
at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:1465)
at
org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:655)
at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage .java:634)
at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.j ava:2777)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2774)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:2764)
at org.eclipse.ui.internal.ShowViewMenu.showOther(ShowViewMenu. java:175)
at org.eclipse.ui.internal.ShowViewMenu.access$2(ShowViewMenu.j ava:161)
at org.eclipse.ui.internal.ShowViewMenu$2.run(ShowViewMenu.java :48)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:842 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(Action
ContributionItem.java:456)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Event(ActionCont
ributionItem.java:403)
at
org.eclipse.jface.action.ActionContributionItem.access$0(Act ionContributionI
tem.java:397)
at
org.eclipse.jface.action.ActionContributionItem$ActionListen er.handleEvent(A
ctionContributionItem.java:72)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1729)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at
org.eclipse.core.internal.boot.InternalBootLoader.run(Intern alBootLoader.jav
a:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
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.core.launcher.Main.basicRun(Main.java:291)
at org.eclipse.core.launcher.Main.run(Main.java:747)
at org.eclipse.core.launcher.Main.main(Main.java:583)


Am Mon, 12 Apr 2004 13:08:23 -0500 schrieb Pratik Shah <ppshah@us.ibm.com>:

> Can you tell us what the error is?
> In your runtime workbench, go to Windows -> Show View -> Other -> PDE
> Runtime -> Error Log
Re: getting error: simple draw2d graphic to view [message #126881 is a reply to message #126868] Mon, 12 April 2004 14:55 Go to previous message
Eclipse UserFriend
Originally posted by: Kay_1.gmx.de

Yes you are right. I forgot to add the draw2d plugin.

Shame on me ;-(

Thx.

Am Mon, 12 Apr 2004 14:15:03 -0500 schrieb Pratik Shah <ppshah@us.ibm.co=
m>:

> So, apparently, the problem is not in your code, but in your setup. H=
ave
> you added the drawd2 plugin as required in your plugin.xml?
Previous Topic:hierarchy build process
Next Topic:Opportunities available in Banglore, India
Goto Forum:
  


Current Time: Fri May 09 18:52:58 EDT 2025

Powered by FUDForum. Page generated in 0.04096 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top