Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Phantom nodes in gmfmap rendering all elements in the model
Phantom nodes in gmfmap rendering all elements in the model [message #237007] Tue, 21 July 2009 06:12
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member

I had a diagram editor which could render diagram nodes, but not permit
them to be created. This was so I could create shortcut elements in the
editor. To achieve this, I had created a nonsense ecore containment
feature as their direct Containment Feature, but simply disabled the
Creation Tool in the gmfmap.

I want to remove the nonsense ecore element to clean up the ecore model;
however, if I set the Containment Feature to null, the creation tool
becomes a phantom node.

If the diagram contains a phantom node,
XXXDiagramUpdater.getXXXSemanticChildren() also uses
getPhantomNodesIterator(Resource), which by default returns the contents
of the entire model (Resource.getAllContents()).

As a result, the initialised diagram editor renders _all_ phantom nodes
from all over the document within the editor, as opposed to not
rendering anything (as it was doing before).

I can easily use Dynamic Templates to replace
XXXDiagramUpdater.getPhantomNodesIterator(Resource) with "return
Collections.EMPTY_LIST.iterator();" (and this is my current approach and
it works fine), but I was curious if there would be a better way to
define nodes in the gmfmap which don't have a creation tool, are not
directly contained, and do not automatically render and initialise _all_
elements in the local model.

Any thoughts?

Previous Topic:Replacing tool palette navigation with a scrollbar
Next Topic:Removing a diagram from the New wizard
Goto Forum:

Current Time: Wed Apr 21 15:29:58 GMT 2021

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

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

Back to the top