Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Highlighting parts of a diagram(Searching for a few tipps on how to write a pluglin that will highlight a node and adjazent edges on mouseover / click.)
Highlighting parts of a diagram [message #730050] Tue, 27 September 2011 14:39 Go to next message
Mathias Poths is currently offline Mathias Poths
Messages: 2
Registered: September 2011
Junior Member
Hi everybody,

I was searching for a while now and hope you have a few good tipps for me for starting the following:

I want to write a plugin that will allow Rational Software Modeler (RSM) which is based on GMF to support highlighting of relevant parts of an Activity Diagram. We have pretty comprehensive diagrams and sometimes can't see what is connected to what.

I want to be able to select a node and have all connected edges and maybe connected nodes highlighted. I ask my self the following questions:

* Can I modify how a node is displayed in a diagram to highlight it without changing the view model, so that I do not persist the highlight, when I save the model? (maybe I can only modify how it is rendered)

* Can I register myself to some "mouseover"-event for the nodes in a diagram?

Or maybe someone has done something similar already.

Any help is kindly appreciated.

Thanks in advance,
Mathias
Re: Highlighting parts of a diagram [message #730398 is a reply to message #730050] Wed, 28 September 2011 10:03 Go to previous messageGo to next message
Andreas Muelder is currently offline Andreas Muelder
Messages: 71
Registered: July 2011
Member
Hi Mathias,

I did something similar for the YAKINDU Statechart Tools version 2.0.
It is a Statechart Tool where you can execute the statechart model, the active states are highlighted in the diagram editor then.
(see http://muelder.blogspot.com/2011/09/new-features-in-sct-2-milestone-5.html) for a screenshot.

Technically, all the highlighting stuff is encapsulated in a single class called HighlightingSupportAdapter. Maybe you want to have a look in the code, it is open source. It is a generic HighlightingAdapter, that can be applied to every GMF based editor. A semantic element is passed to the adapter as well as the higlighting color and the highlighting time. Maybe this is a good start for your use case!

Andreas



icon12.gif  Re: Highlighting parts of a diagram [message #734758 is a reply to message #730398] Sun, 09 October 2011 19:56 Go to previous messageGo to next message
Mathias Poths is currently offline Mathias Poths
Messages: 2
Registered: September 2011
Junior Member
Hi Andreas,

thanks a lot for the link. Last week I was able to take a closer look at the class mentioned by you. I was not able to immediately use it for our RSM modeling but it showed me how to use the different models in GMF and I was able to write something myself.

Thanks a lot again. This was exactly the hints that I needed.

Mathias
Re: Highlighting parts of a diagram [message #1031818 is a reply to message #730050] Tue, 02 April 2013 08:26 Go to previous messageGo to next message
Simon Zutterman is currently offline Simon Zutterman
Messages: 28
Registered: October 2012
Junior Member
Hi,

I would like to adjust my graphical editor so it highlights al the adjacent nodes of the selected node.
I found the three highlighting classes in the svn repository of yakindu, but i don't really have an idea how to adjust/implement this in my project since i am just beginning to use Eclipse.

Any way you could help me with this?
Re: Highlighting parts of a diagram [message #1032650 is a reply to message #1031818] Wed, 03 April 2013 09:00 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

you can use the selection service of Eclipse to get the selected model element http://www.eclipse.org/articles/Article-WorkbenchSelections/article.html. This is a GraphicalEditPart. You can access the figure of it and manipulate the rendering in the way you want. You can also call methods to get all outgoing/incoming edges etc. If you like to get to the semantic/domain model element you can call resolveSemanticElement of IGraphicalEditPart.

Ralph
Previous Topic:GMF live validation
Next Topic:Multiple label in one node
Goto Forum:
  


Current Time: Wed Sep 03 07:11:06 GMT 2014

Powered by FUDForum. Page generated in 0.01859 seconds