Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » is it possible to create or modify an image at runtime
is it possible to create or modify an image at runtime [message #179586] Fri, 28 March 2008 11:06 Go to next message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hi .
I have some elements and attributes to be configured. Currently for any
element i chose it is displayed in the form of an image(or icon) on the
graphical editor that i have. This image is just loaded from an exisitng
set of images that i already have.


Now i want 1 or 2 of the attribute values of that element to also be
displayed. That is i configure the attributes for the element at runtime.
So when the image for the element is being displayed i want this attibute
values to be reflected as part of that image.


Is there any way in which i can create an image or window with the text
value of the attribute obtained at runtime such that new attribute image
has a transparent background and only the text is visible. This new image
should be superimposed on the existing image of the element such that only
the text appears on the image. the result should be that i still have my
original element image displayed but with the attribute values also appear
as part of the same image.
Re: is it possible to create or modify an image at runtime [message #179640 is a reply to message #179586] Fri, 28 March 2008 13:38 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello sowmya,

It should be possible to create a composite figure with image on the background
and label (editable and associated with domain model attribute) in front
of this image. We have used this composite figure in EclispeCon 2008 tutorial:
http://www.eclipsecon.org/2008/?page=sub/&id=337.

-----------------
Alex Shatalin
Re: is it possible to create or modify an image at runtime [message #181044 is a reply to message #179640] Sat, 05 April 2008 14:25 Go to previous messageGo to next message
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hello Alex,
Thanks for the reply. But the link you have given only takes
me to the presentation. I was not able to get the procedure to generate
composite images. The tutorial could not be opened.

Meanwhile i tried to use GC( in org.eclipse.swt.graphics.GC)
for getting the composite image. The drawString() method under GC draws
the text on the existing Image.

This again is causing a problem when i try to call gc after
fetching the Image from the stored images and call gc on it. It throws an
"IllegalArgumentException" . [ Whereas it works fine when I use 'new' for
Image as - "Image img = new Image();"

The code snippet i have as below :
Image image = imageDescriptor.createImage();
GC imageGC = new GC(img);// throws
IllegalArgumentException
imageGC.drawString("abc", 0, 0);
primaryShape = new Label(image);
imageGC.dispose();
Is there any way this can be solved.
Re: is it possible to create or modify an image at runtime [message #181133 is a reply to message #181044] Mon, 07 April 2008 09:43 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello sowmya,

> me to the presentation. I was not able to get the procedure to
> generate
> composite images. The tutorial could not be opened.
You can download all the sample projects used in this tutorial from here:
https://eclipsecon.greenmeetingsystems.com/submissions/view/ 337

-----------------
Alex Shatalin
Previous Topic:Problems saving a diagram created from a domain model
Next Topic:Re-order children in compartment
Goto Forum:
  


Current Time: Thu Apr 25 05:53:36 GMT 2024

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

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

Back to the top