Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Double click to open diagram not working
Double click to open diagram not working [message #1239955] Wed, 05 February 2014 11:31 Go to next message
Alejandro Salas is currently offline Alejandro SalasFriend
Messages: 1
Registered: February 2014
Junior Member

I'm building a GMF based diagram that will have other diagrams associated with some nodes inside it. I have set an Open Diagram Behavior on my ChildNode in the super diagram .gmfgen telling it what the Diagram Kind and Editor ID is from the sub diagram .gmfgen.

As this is not working, I have debugged it and method getOpenCommand in OpenDiagramEditPolicy returns null when it tries to get
Style link = view.getStyle(NotationPackage.eINSTANCE.getHintedDiagramLinkStyle())
I have inspected what that function does and I have realized that when it makes the comparison of the styles it's taking a DiagramStyle and a FontStyle so it finally returns null as they are not the same.

This is the code of the method getStyle:
if (eIsSet(NotationPackage.Literals.VIEW__STYLES)) {
            for (Iterator i = getStyles().iterator(); i.hasNext();) {
                Style style = (Style);
                if (style.eClass() == eClass || eClass.isInstance(style))
                    return style;

I don't know what I'm doing wrong as I have followed the guide about Diagram Partitioning.
Thank you in advance!
Re: Double click to open diagram not working [message #1389391 is a reply to message #1239955] Fri, 27 June 2014 18:41 Go to previous message
Yonglin Lei is currently offline Yonglin LeiFriend
Messages: 1
Registered: June 2014
Junior Member

I got a similar problem. After double-click the getOpenCommand of OpenDiagramEditPolicy even did not get invoked. Debugging shows that the execution stack is like this:

TacticalStageNameEditPart(GraphicalEditPart).performRequest(Request) line: 1122
SelectEditPartTracker.performOpen() line: 194
SelectEditPartTracker.handleDoubleClick(int) line: 137
SelectEditPartTracker(AbstractTool).mouseDoubleClick(MouseEvent, EditPartViewer) line: 1069
DelegatingDragEditPartsTracker(SelectionTool).mouseDoubleClick(MouseEvent, EditPartViewer) line: 527
SelectionToolEx(SelectionTool).mouseDoubleClick(MouseEvent, EditPartViewer) line: 527
DiagramEditDomain(EditDomain).mouseDoubleClick(MouseEvent, EditPartViewer) line: 231
DomainEventDispatcher.dispatchMouseDoubleClicked(MouseEvent) line: 291
LightweightSystem$EventHandler.mouseDoubleClick(MouseEvent) line: 518
TypedListener.handleEvent(Event) line: 196
EventTable.sendEvent(Event) line: 84
FigureCanvas(Widget).sendEvent(Event) line: 1057
Display.runDeferredEvents() line: 4170
Display.readAndDispatch() line: 3759
PartRenderingEngine$ line: 1113
Realm.runWithDefault(Realm, Runnable) line: 332, IEclipseContext) line: 997
E4Workbench.createAndRunUI(MApplicationElement) line: 140
Workbench$ line: 611

In the TacticalStageNameEditPart(GraphicalEditPart).performRequest(Request) method, after statement
EditPart targetEditPart = getTargetEditPart(request);
is executed, the return value is null. Therefore the command was not executed.

Maybe the right execution sequence should be like this, from DomainEventDispatcher.dispatchMouseDoubleClicked:


To make this happen, the variable DomainEventDispatcher.editorCaptured within DomainEventDispatcher.dispatchMouseDoubleClicked method has to be false instead of true. Any help is appreciated.
Previous Topic:use of visual effect mapping
Next Topic:Customizing Workbench by Adding Title
Goto Forum:

Current Time: Tue Mar 02 20:49:20 GMT 2021

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

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

Back to the top