Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Icon of Wrapping Label
Icon of Wrapping Label [message #1068100] Fri, 12 July 2013 07:47 Go to next message
Pierre Cressant is currently offline Pierre CressantFriend
Messages: 6
Registered: July 2013
Junior Member
Hello Everybody,

I've got a problem in GMF. I have a node with several labels. In one of them, I want to display a specific icon.

So, I've tried various things. I tried to instantiate my wrappinglabel with an image as parameters
fFigureTaskIconExecutorFigure = new WrappingLabel(this.loadImageExecutor());
public Image loadImageExecutor() {
			Task task = (Task) ((View) TaskEditPart.this.getModel())
					.getElement();

			String stringPath = "icons/custom/" + task.getExecutor().getName()
					+ ".gif";

			System.out.println(stringPath);

			Bundle bundle = Platform.getBundle("KMADeRCP.diagram");
			IPath path = new Path(stringPath);
			URL url = FileLocator.find(bundle, path, null);
			ImageDescriptor desc = ImageDescriptor.createFromURL(url);

			return desc.createImage();


It doesn't work. The icon displayed at the node's creation is the default one.

I've also tried to set the icon after the instantiation of the label :

fFigureTaskIconExecutorFigure.setIcon(this.loadImageExecutor());


Well, it returned me this : !MESSAGE MapModeUtil#getMapMode(IFigure fig) fig parameter must be attached to a parent - using default MapMode

If someone have an idea about it...

Thank you and sorry for my bad english.
Re: Icon of Wrapping Label [message #1807627 is a reply to message #1068100] Wed, 05 June 2019 10:59 Go to previous message
Sonja Riethig is currently offline Sonja RiethigFriend
Messages: 3
Registered: May 2019
Junior Member
Have you figured this out?
Previous Topic:GMF Diagram : Workbench tool bar Font DropDown Disabled
Next Topic:Palette tool is not visible if I change settings
Goto Forum:
  


Current Time: Mon Aug 10 09:27:49 GMT 2020

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

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

Back to the top