Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How do I add an icon to a node?
How do I add an icon to a node? [message #870091] Sun, 06 May 2012 11:00 Go to next message
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 66
Registered: July 2009

I have created a diagram in which I have multiple rectangular nodes with
labels in the center of each node. Now I would like to add an icon to
the node (not the label) in the corner of the node to distinguish the
node types. Currently I'm using colors to distinguish the nodes but this
fails in black and white prints.

Is there somewhere in the gmfgraph I need to add something to the
rectangles or is there a code extension I need to make in the node EditPart?

I'd appreciate any advice or examples.

Best regards,

Re: How do I add an icon to a node? [message #870189 is a reply to message #870091] Mon, 07 May 2012 08:14 Go to previous message
Andreas Muelder is currently offline Andreas MuelderFriend
Messages: 73
Registered: July 2011
Hi Nigel,
you can add icons to a node via the org.eclipse.gmf.runtime.diagram.ui.decoratorProviders extension point.
Take a look at class BookmarkDecorator to get an idea how to implement your own decorator. Don't forget to set isVolatile to false when calling getDecoratorTarget().addShapeDecoration(..). the icon won't be printable otherwise.
Previous Topic:How to create a umlclass file, and create some notations and then save by programming
Next Topic:Search Functionality in GMF Diagrams
Goto Forum:

Current Time: Thu Oct 29 16:50:15 GMT 2020

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

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

Back to the top