Can't unwrap interface: interface a.f.ec on Graph API

I adapted a layouter example (from http://www.yworks.com/products/yfiles/doc/demo/layout/DiagonalLayouter.java.html) and created a class named DiagramLayouter. Now, when I try to use it I enconter the error below.

Any tips?

Thanks!

DiagramLayouter layouter = new DiagramLayouter();
if (graph.getNodeArray().length > 0 && layouter.canLayout(graph)) {
GraphManager graphManager = GraphManager.getGraphManager();
graphManager.createBufferedLayouter(layouter).doLayout(graph);
graph.updateViews();
}


java.lang.AssertionError: Can't unwrap interface: interface a.f.ec
at com.intellij.openapi.graph.impl.GraphBase.b(GraphBase.java:58)
at com.intellij.openapi.graph.impl.GraphBase.a(GraphBase.java:82)
at com.intellij.openapi.graph.impl.GraphBase.b(GraphBase.java:1)
at com.intellij.openapi.graph.impl.GraphBase.unwrap(GraphBase.java:80)
at com.intellij.openapi.graph.impl.GraphManagerImpl.createBufferedLayouter(GraphManagerImpl.java:344)
at org.codecompany.plugins.intelliprof.diagram.DiagramGraphDataModel.doLayout(DiagramGraphDataModel.java:115)
at org.codecompany.plugins.intelliprof.diagram.DiagramViewer.createDiagram(DiagramViewer.java:72)
at com.tivo.jipviewer.ProfilerResultViewer.initComponents(ProfilerResultViewer.java:185)
at com.tivo.jipviewer.ProfilerResultViewer.]]>(ProfilerResultViewer.java:117)
at org.codecompany.plugins.intelliprof.component.IntelliPROFProjectComponent.projectOpened(IntelliPROFProjectComponent.java:46)
at com.intellij.openapi.project.impl.ProjectImpl.c(ProjectImpl.java:67)
at com.intellij.openapi.project.impl.ProjectImpl.access$300(ProjectImpl.java:41)
at com.intellij.openapi.project.impl.ProjectImpl$MyProjectManagerListener.projectOpened(ProjectImpl.java:8)
at com.intellij.openapi.project.impl.ProjectManagerImpl$1.projectOpened(ProjectManagerImpl.java:4)
at com.intellij.openapi.project.impl.ProjectManagerImpl.d(ProjectManagerImpl.java:283)
at com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(ProjectManagerImpl.java:60)
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(ProjectManagerImpl.java:157)
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(ProjectManagerImpl.java:180)
at com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:92)

5 comments

Andre,

Does "layouter.doLayout(graph)" work properly?
if no then send me DiagramLayouter file for debug, please.

Serega.


DiagramLayouter layouter = new DiagramLayouter();

if (graph.getNodeArray().length > 0 && layouter.canLayout(graph)) {
GraphManager graphManager = GraphManager.getGraphManager();
layouter.doLayout(graph);

graph.updateViews();
}


0

Hi Sergey,

I replaced the code but still not wroking. The files is attached.

Thanks,

Andre



Attachment(s):
stacktrace.txt
DiagramViewer.java
DiagramLayouter.java
DiagramGraphDataModel.java
DiagramPresentationModel.java
0

Hi Sergey,

I solved the problem just removing this method from my class:

for(EdgeCursor ec = graph.edges(); ec.ok(); ec.next())
{
EdgeLayout el = graph.getLayout(ec.edge());
el.clearPoints();
el.addPoint(0,0);
}

Thanks,

André

0

Andre,

Out of curiosity, have you implemented sequence diagram yet?
Could you post example screenshot.

thanks,

Serega.

Hi Sergey,

I solved the problem just removing this method from my class:

for(EdgeCursor ec = graph.edges(); ec.ok(); ec.next())
{
EdgeLayout el = graph.getLayout(ec.edge());
el.clearPoints();
el.addPoint(0,0);
}
Thanks,

André



0

Hi Sergey,

I'm working on it. Probably this week... :)

Andre

0

Please sign in to leave a comment.