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 06:31 Go to next message
Alejandro Salas is currently offline Alejandro Salas
Messages: 1
Registered: February 2014
Junior Member
Hello,

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) i.next();
                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 14:41 Go to previous message
Yonglin Lei is currently offline Yonglin Lei
Messages: 1
Registered: June 2014
Junior Member
Hi,

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$9.run() line: 1113
Realm.runWithDefault(Realm, Runnable) line: 332
PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 997
E4Workbench.createAndRunUI(MApplicationElement) line: 140
Workbench$5.run() 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:

DomainEventDispatcher.dispatchMouseDoubleClicked(MouseEvent)-->
SWTEventDispatcher.dispatchMouseDoubleClicked(MouseEvent)-->
mouseTarget.handleMouseDoubleClicked(currentEvent)


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: Wed Aug 20 18:38:57 EDT 2014

Powered by FUDForum. Page generated in 0.03140 seconds