Text to Graph editor [message #75357] |
Tue, 07 November 2006 10:34  |
Eclipse User |
|
|
|
Originally posted by: Laph95.gmail.com
Hi all !
My problem is a bit complex I assume because I don't find anything on the
Internet (or anywhere else) to help me.
I'm currently realizing a project which is actually an RCP application. My
application is an editor for a language developed in my company.
This language have to be edited in a textual way but also in a graphical
way.
In a first time I want to convert my "textual" file in a "graphical" file.
This way, I want to use GMF. So I designed an EMF model, then all the
steps to GMF generated code. My editor is actually operational (i.e. I can
draw my forms, etc.) but is independant from the text file.
What I want to do now is to "link" the text to the graphic.
More precisely I want to parse a text source code file, and then
automatically generate a graph file which represents the source code in a
graphical style (with colors, lines, Rectangles, etc :). I don't have
example of existing application of that kind... So :
I have an ANTLR parser for my own language.
I have my EMF model.
I have GMF code generated.
I have much motivation :)
But I still don't know how to begin to draw automatically my graphical
view from my textual view.
If someone even know how I can do that (if it is possible) or just a link
to a website which could help me...
Thanks a lot (and all apologies for my approximative english) !!
|
|
|
Re: Text to Graph editor [message #75408 is a reply to message #75357] |
Tue, 07 November 2006 10:57   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Laph,
Part of what you'll need is a resource implementation that can read and
write your text file to and from an instance of your Ecore model. To
accomplish this, you should probably derive directly from ResourceImpl
and implement the doLoad and doSave methods to parse your text file and
to print to your text file. Once you've implemented this, then the rest
of GMF should just fit in nicely since the diagram can be a separate
resource that acts as a view of a model stored separately in your text
file and hence your text file will effectively act as an alternative
serialization format for the XMI/XML serialization EMF typically produces.
Laph wrote:
> Hi all !
>
> My problem is a bit complex I assume because I don't find anything on
> the Internet (or anywhere else) to help me.
>
> I'm currently realizing a project which is actually an RCP
> application. My application is an editor for a language developed in
> my company.
> This language have to be edited in a textual way but also in a
> graphical way.
>
> In a first time I want to convert my "textual" file in a "graphical"
> file.
> This way, I want to use GMF. So I designed an EMF model, then all the
> steps to GMF generated code. My editor is actually operational (i.e. I
> can draw my forms, etc.) but is independant from the text file.
> What I want to do now is to "link" the text to the graphic.
> More precisely I want to parse a text source code file, and then
> automatically generate a graph file which represents the source code
> in a graphical style (with colors, lines, Rectangles, etc :). I don't
> have example of existing application of that kind... So :
>
> I have an ANTLR parser for my own language.
> I have my EMF model.
> I have GMF code generated.
> I have much motivation :)
>
> But I still don't know how to begin to draw automatically my graphical
> view from my textual view.
> If someone even know how I can do that (if it is possible) or just a
> link to a website which could help me...
>
> Thanks a lot (and all apologies for my approximative english) !!
>
|
|
|
|
|
|
Re: Text to Graph editor [message #75710 is a reply to message #75659] |
Wed, 08 November 2006 05:59   |
Eclipse User |
|
|
|
Originally posted by: Laph95.gmail.com
Thanks for your precise answer, it's clearer for me now...
Nevertheless the only thing which is always actually blur in my mind is
the B to C arrow.
You explain this is a kind of "free" arrow but in my case, I think it's a
problem for me.
Effectively, my eCore model is really simple : only one class and some
attributes because in our language, everything IS this class. I.d. a
state's kind is that class, transitions' kind is that class, etc.
Only attributes allow me to get the differences between the states (for
example INIT state, FINAL state, SIMPLE state, COMPOSITE state, etc.).
So I'm wondering how I can get a good graphical view (with good forms
drawn on it) with attributes for only basement ?
Thanks to GMF, I have a mapping which explain relationship between the
elements in the view but I don't know how to be sure I'll get the good
element drawn in the view if I have one and only one class in my
metamodel...
Is there a solution to get a element in the view corresponding to an
attribute of my unique class ?
So what I actually want is to open a GMF graphic view with an instance of
my eCore model for only argument (it's the same procedure than a text
editor's opening with the file's name as argument).
I wish what I mean is clear because it's a big project and it isn't easy
to explain such things quickly and clearly.
Thanks a lot for your help !!
|
|
|
|
|
|
|
|
|
|
|
Re: Text to Graph editor [message #80801 is a reply to message #80698] |
Fri, 24 November 2006 17:16  |
Eclipse User |
|
|
|
Hello Laph,
No special support for it. Standard layout should be called at the end of
diagram creation, so if it is not called (layouting your diagram manually
will produce different results) - submitt a request. If something is not
layouted correctly - submitt a request for layout subsystem. ;-)
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.05190 seconds