google-code-export / gwt-links

Automatically exported from code.google.com/p/gwt-links
2 stars 0 forks source link

error with controller.drawStraightArrowConnection() (GWT2.2) #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
What is the expected output? What do you see instead?
I'm trying to do the demo code and I obtain an error with the line onnection c1 
= controller.drawStraightArrowConnection(helloLabel, worldLabel);

What version of the product are you using? On what operating system?
I use Eclipse Helios and GWT 2.2.0 and I work with windows XP.

Please provide any additional information below.

My code :
DiagramController controller = new DiagramController(400,400);
        controller.showGrid(true); // Display a background grid
        HorizontalPanel myPanel = new HorizontalPanel();

        Label helloLabel = new Label("Hello");
        controller.addWidget(helloLabel,25,115);

        Label worldLabel = new Label("World");
        controller.addWidget(worldLabel,200,115);

        Connection c1 = controller.drawStraightArrowConnection(helloLabel, worldLabel);

        Widget w = controller.getView();
        myPanel.add(w);
        RootPanel.get().add(myPanel);

Error :
11:54:11.802 [ERROR] [webprotege] Uncaught exception escaped
com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, 
see full set in UmbrellaException#getCauses
    at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:214)
    at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:103)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:151)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1310)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1266)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.orange.links.client.exception.DiagramViewNotDisplayedException: 
Add the view in your application. Try : 
RootPanel.get().add(controller.getView());You can also add the view in a Panel 
for example : myPanel.add(controller.getView());
    at com.orange.links.client.utils.SegmentPath.straightPath(SegmentPath.java:86)
    at com.orange.links.client.utils.SegmentPath.<init>(SegmentPath.java:19)
    at com.orange.links.client.connection.AbstractConnection.<init>(AbstractConnection.java:57)
    at com.orange.links.client.connection.StraightArrowConnection.<init>(StraightArrowConnection.java:19)
    at com.orange.links.client.connection.ConnectionFactory.create(ConnectionFactory.java:25)
    at com.orange.links.client.DiagramController.drawConnection(DiagramController.java:239)
    at com.orange.links.client.DiagramController.drawConnection(DiagramController.java:234)
    at com.orange.links.client.DiagramController.drawStraightArrowConnection(DiagramController.java:228)
    at edu.stanford.bmir.protege.web.client.WebProtege.loadWelcomeView(WebProtege.java:125)
    at edu.stanford.bmir.protege.web.client.WebProtege.access$0(WebProtege.java:110)
    at edu.stanford.bmir.protege.web.client.WebProtege$1.onClick(WebProtege.java:83)
    at com.google.gwt.user.client.ui.ListenerWrapper$WrappedClickListener.onClick(ListenerWrapper.java:245)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:204)
    at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:103)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:151)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1310)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1266)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:662)

Original issue reported on code.google.com by lea.jo...@gmail.com on 20 Sep 2011 at 10:09

GoogleCodeExporter commented 9 years ago
Hi
 I faced the same issue. Probably when i worked around, it was happening cause the controller was not yet added in the root panel, yet we were trying to draw connections.

Try 
                Widget w = controller.getView();
        myPanel.add(w);
        RootPanel.get().add(myPanel);
 Connection c1 = controller.drawStraightArrowConnection(helloLabel, worldLabel); 

This ideally drew the exact connection

Original comment by rubiniku...@gmail.com on 5 Nov 2012 at 11:11