Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Inserting image in a node(problem resolved)
Inserting image in a node [message #681999] Fri, 10 June 2011 07:53 Go to next message
fenrir  is currently offline fenrir
Messages: 15
Registered: April 2011
Location: France
Junior Member
Hi

I want to insert an image in a diagram node. I tried the method I found which consists to put this code in XXXEditPart, modifying the XXXFigure constructor
but it doesn't works ='(

/**
* @generated NOT
*/
public XXXFigure() {
// Get the picture
Image img = new Image(null,"c:\\toto.png");
ImageFigure imgF = new ImageFigure();
imgF.setImage(img);

// Add it to the figure
this.add(imgF);
// Set figure size as picture size
this.setMaximumSize(imgF.getSize());
this.setMinimumSize(imgF.getSize());


createContents();
}


Can anybody help me please? (It's an urgent problem)

Thanks




[Updated on: Fri, 10 June 2011 09:10]

Report message to a moderator

Re: Inserting image in a node [message #682028 is a reply to message #681999] Fri, 10 June 2011 09:09 Go to previous message
fenrir  is currently offline fenrir
Messages: 15
Registered: April 2011
Location: France
Junior Member
Ok, my problem is resolved : I just forgot that I put a BorderLayout.

Just changed

this.add(imgF);

to

this.add(imgF, BorderLayout.CENTER);

and it works =)

Previous Topic:How to place a compartment node in the center of a container node
Next Topic:Extend / Inherit Diagrams
Goto Forum:
  


Current Time: Sat Oct 25 11:26:42 GMT 2014

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

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