Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Using images for nodes
Using images for nodes [message #213574] Mon, 15 December 2008 12:55 Go to next message
Anna is currently offline AnnaFriend
Messages: 34
Registered: July 2009
Member
Is it possible to use for example a gif-image for a node in GMF? We want
to create the initial and final state for a statechart and thought it
would be much easier to use image-files rather than creating them in the
gmfgraph. Also, is it possible to "load" the image into the .gmfgraph or
do we have to manipulate any code to make it work? The first option would
of course be the best...

And, we want our nodes to have a fixed size. Even though we set both max,
min and preferred size, it doesn't seem to matter, the node can be created
in any size in the diagram anyways. We have tried to use the
DefaultSizeFacet-option too, but that didn't seem to make any
difference...perhaps we used it in the wrong way?

/Linda & Anna
Re: Using images for nodes [message #213598 is a reply to message #213574] Mon, 15 December 2008 13:40 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Linda,

> Is it possible to use for example a gif-image for a node in GMF? We
You can do it now only by using CustomFigures and writing java code (use
ScalableImageFigure as a super-class)

> And, we want our nodes to have a fixed size. Even though we set both
Try using Node.setResizeConstraint(Direction.NONE)

-----------------
Alex Shatalin
Re: Using images for nodes [message #213649 is a reply to message #213598] Tue, 16 December 2008 08:12 Go to previous messageGo to next message
Anna is currently offline AnnaFriend
Messages: 34
Registered: July 2009
Member
Alex Shatalin wrote:

> Try using Node.setResizeConstraint(Direction.NONE)

OK, we will, but doesn't that only make it impossible to resize the node
after you have drawn it? We want to be sure that the node has the same
size every time such a node is drawn (for example, an initial state should
automatically become an ellipse with dx = 15 and dy = 15 every time it is
drawn).
But maybe this will work. In that case, where/in what file should this be
used?

/Linda & Anna
Re: Using images for nodes [message #213735 is a reply to message #213649] Tue, 16 December 2008 13:26 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Anna,

I've used these settings to create nodes with fixed size all (representing
some picture from the image), so i think this is exactly what you are looking
for.

> But maybe this will work. In that case, where/in what file should this
> be used?
In .gmfgraph file.

-----------------
Alex Shatalin
Previous Topic:Compartment Size
Next Topic:Figure not drawing
Goto Forum:
  


Current Time: Thu Apr 25 03:50:20 GMT 2024

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

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

Back to the top