Skip to main content



      Home
Home » Eclipse Projects » GEF » Connections in GEF with EMF: ClassCastException
Connections in GEF with EMF: ClassCastException [message #132633] Tue, 18 May 2004 05:28 Go to next message
Eclipse UserFriend
Originally posted by: dev.philippschill.de

Hi!
I implemented a model with EMF.
No I want to paint the model with gef.

There are Actions which have as children one or more Forwards.
You can navigate from the Actions to the Forwards an vice-versa.
I implemented for each "node" an AbstractGraphicalEditPart and a
AbstractGraphicalConnection.

In the ActionEditPart I implemented the method:
protected List getModelSourceConnections() {
return getAction().getForwards();
}

and in the ForwardEditPart the method:

protected List getModelTargetConnections() {
List l=new LinkedList();
l.add(getForward().getAction());
return l;
}

as described in the ibm redbook...

Now i get each time a ClassCastException when the second method is called.

Where is the problem

phil
Re: Connections in GEF with EMF: ClassCastException [message #132711 is a reply to message #132633] Tue, 18 May 2004 10:46 Go to previous messageGo to next message
Eclipse UserFriend
Got a stack trace?

"Philipp Schill" <dev@philippschill.de> wrote in message
news:c8cklt$l9e$1@eclipse.org...
> Hi!
> I implemented a model with EMF.
> No I want to paint the model with gef.
>
> There are Actions which have as children one or more Forwards.
> You can navigate from the Actions to the Forwards an vice-versa.
> I implemented for each "node" an AbstractGraphicalEditPart and a
> AbstractGraphicalConnection.
>
> In the ActionEditPart I implemented the method:
> protected List getModelSourceConnections() {
> return getAction().getForwards();
> }
>
> and in the ForwardEditPart the method:
>
> protected List getModelTargetConnections() {
> List l=new LinkedList();
> l.add(getForward().getAction());
> return l;
> }
>
> as described in the ibm redbook...
>
> Now i get each time a ClassCastException when the second method is called.
>
> Where is the problem
>
> phil
>
>
Re: Connections in GEF with EMF: ClassCastException [message #132750 is a reply to message #132711] Tue, 18 May 2004 11:54 Go to previous message
Eclipse UserFriend
Originally posted by: dev.philippschill.de

!SESSION Mai 18, 2004 17:52:02.250
---------------------------------------------
java.version=1.4.2_04
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
!ENTRY org.eclipse.core.runtime 4 2 Mai 18, 2004 17:52:02.250
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.core.runtime".
!STACK 0
java.lang.ClassCastException
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.createOr FindConnection(AbstractGraphicalEditPart.java:285)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refreshT argetConnections(AbstractGraphicalEditPart.java:640)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:540)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:221)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:196)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:184)
at
org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(A bstractEditPart.java:742)
at
org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractE ditPart.java:694)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh( AbstractGraphicalEditPart.java:538)
at
org.eclipse.gef.editparts.AbstractEditPart.addNotify(Abstrac tEditPart.java:221)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotif y(AbstractGraphicalEditPart.java:196)
at
org.eclipse.gef.editparts.AbstractEditPart.addChild(Abstract EditPart.java:184)
at
org.eclipse.gef.editparts.ScalableRootEditPart.setContents(S calableRootEditPart.java:349)
at
org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents( AbstractEditPartViewer.java:557)
at
org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents( AbstractEditPartViewer.java:566)
at
de.strutsbox.strutsplugin.visualizer.VisualizerEditor.initia lizeGraphicalViewer(VisualizerEditor.java:41)
at
org.eclipse.gef.ui.parts.GraphicalEditor.createGraphicalView er(GraphicalEditor.java:114)
at
org.eclipse.gef.ui.parts.GraphicalEditor.createPartControl(G raphicalEditor.java:124)
at org.eclipse.ui.internal.PartPane$1.run(PartPane.java:94)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:610)
at org.eclipse.core.runtime.Platform.run(Platform.java:521)
at org.eclipse.ui.internal.PartPane.createChildControl(PartPane .java:90)
at org.eclipse.ui.internal.PartPane.createControl(PartPane.java :154)
at org.eclipse.ui.internal.EditorWorkbook.showPart(EditorWorkbo ok.java:470)
at org.eclipse.ui.internal.EditorWorkbook.add(EditorWorkbook.ja va:292)
at org.eclipse.ui.internal.EditorArea.addEditor(EditorArea.java :56)
at
org.eclipse.ui.internal.EditorPresentation.openEditor(Editor Presentation.java:225)
at org.eclipse.ui.internal.EditorManager$2.run(EditorManager.ja va:550)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:84)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:539)
at
org.eclipse.ui.internal.EditorManager.openInternalEditor(Edi torManager.java:635)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:438)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:426)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2129)
at org.eclipse.ui.internal.WorkbenchPage.access$6(WorkbenchPage .java:2072)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.ja va:2059)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:84)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2054)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:265)
at
org.eclipse.ui.internal.ide.EditorAreaDropAdapter.openNonExt ernalEditor(EditorAreaDropAdapter.java:135)
at
org.eclipse.ui.internal.ide.EditorAreaDropAdapter.asyncDrop( EditorAreaDropAdapter.java:109)
at
org.eclipse.ui.internal.ide.EditorAreaDropAdapter.access$0(E ditorAreaDropAdapter.java:78)
at
org.eclipse.ui.internal.ide.EditorAreaDropAdapter$1.run(Edit orAreaDropAdapter.java:72)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:106)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:2555)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2260)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1562)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1536)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:257)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:139)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:90)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:277)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:239)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:267)
at org.eclipse.core.launcher.Main.run(Main.java:692)
at org.eclipse.core.launcher.Main.main(Main.java:676)

Pratik Shah schrieb:

> Got a stack trace?
>
> "Philipp Schill" <dev@philippschill.de> wrote in message
> news:c8cklt$l9e$1@eclipse.org...
>
>>Hi!
>>I implemented a model with EMF.
>>No I want to paint the model with gef.
>>
>>There are Actions which have as children one or more Forwards.
>>You can navigate from the Actions to the Forwards an vice-versa.
>>I implemented for each "node" an AbstractGraphicalEditPart and a
>>AbstractGraphicalConnection.
>>
>>In the ActionEditPart I implemented the method:
>>protected List getModelSourceConnections() {
>> return getAction().getForwards();
>>}
>>
>>and in the ForwardEditPart the method:
>>
>>protected List getModelTargetConnections() {
>> List l=new LinkedList();
>> l.add(getForward().getAction());
>> return l;
>>}
>>
>>as described in the ibm redbook...
>>
>>Now i get each time a ClassCastException when the second method is called.
>>
>>Where is the problem
>>
>>phil
>>
>>
>
>
>
Previous Topic:How to change labelText in Logic ??
Next Topic:Rare bug under eclipse 2.1
Goto Forum:
  


Current Time: Sat Jul 12 07:43:20 EDT 2025

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

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

Back to the top