Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Problem with SVG(Problem with SVG)
icon5.gif  Problem with SVG [message #503778] Tue, 15 December 2009 12:30 Go to next message
hayfekh  is currently offline hayfekh Friend
Messages: 14
Registered: December 2009
Junior Member
Hi everybody,
I am beginner in eclipse and I am in the process of creating a graphical editor with GMF. I want to include SVG images in my editor, I followed the steps provided in the tutorial http://wiki.eclipse.org/GMF_Tutorial_BPMN,
Here is my code specific to the createNodeShape() method:

/**
* @generated NOT
*/
protected IFigure createNodeShape() {
java.net.URL url = FileLocator.find(AaaDiagramEditorPlugin.getInstance().getBun dle(), (IPath) new Path("icons/obj16.svg"), null); //$NON-NLS-1$
return new ScalableImageFigure(RenderedImageFactory.getInstance(url), true, true, true);

}


The problem is that it does not accept getInstance (url) and displays the following:
The method getInstance(URL) is undefined for the type RenderedImageFactory.

I need your help.
Thank you in advance.
Re: Problem with SVG [message #503783 is a reply to message #503778] Tue, 15 December 2009 13:11 Go to previous messageGo to next message
hayfekh  is currently offline hayfekh Friend
Messages: 14
Registered: December 2009
Junior Member
Sorry I made an error:
new Path("icons/obj16/compose.svg")
not
new Path("icons/obj16.svg")
Re: Problem with SVG [message #503809 is a reply to message #503778] Tue, 15 December 2009 21:39 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

the tutorial is old.
I advice you to use SVGFigue which are provided by gmf experimental SDK. You can get them directly on your gmfgraph.

Regards,

Aurelien Pupier


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Problem with SVG [message #503818 is a reply to message #503809] Tue, 15 December 2009 16:53 Go to previous messageGo to next message
hayfekh  is currently offline hayfekh Friend
Messages: 14
Registered: December 2009
Junior Member
Thank you for your answer,
sorry to ask you again, SVGFigure requires no modification of the generated code?
Re: Problem with SVG [message #503869 is a reply to message #503818] Wed, 16 December 2009 08:02 Go to previous messageGo to next message
Thomas is currently offline ThomasFriend
Messages: 79
Registered: October 2009
Member
No, I had nothing changed in the code, except to add some dependencies.

Thomas
Re: Problem with SVG [message #503897 is a reply to message #503869] Wed, 16 December 2009 10:06 Go to previous messageGo to next message
hayfekh  is currently offline hayfekh Friend
Messages: 14
Registered: December 2009
Junior Member
Thanks a lot.

I have done as you have said to me but it does not accept org.eclipse.gmf.runtime.lite.svg that I am writing in implementation bundle figure gallery (marked in red in dependencies).
Moreover I don't know if document URI that I write for SVGFigure is correct or not:
platform:/plugin/A.diagram/images/compose.svg
Sorry for the question which may be stupid!
Please tell me where is the problem?
Re: Problem with SVG [message #503915 is a reply to message #503897] Wed, 16 December 2009 11:59 Go to previous message
Thomas is currently offline ThomasFriend
Messages: 79
Registered: October 2009
Member
my svg uri

this.setURI("platform:/plugin/test.svg.custom.diagram/images/some.svg ");

projectname: test.svg.custom.diagram
folder: images
SVGPicture: some.svg

this is the uri;

and i guess you dont have the experimental sdk installed.
Thomas
Re: Problem with SVG [message #503933 is a reply to message #503915] Wed, 16 December 2009 09:38 Go to previous message
hayfekh  is currently offline hayfekh Friend
Messages: 14
Registered: December 2009
Junior Member
Thanks a lot!!
It works now Very Happy
Previous Topic:[SVG ScaleableImage] setClip
Next Topic:Standard command IDs for GMF
Goto Forum:
  


Current Time: Sat Apr 20 01:27:46 GMT 2024

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

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

Back to the top