Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Diagram with timed events on horizontal lines(Would like hints or pointers to similar examples)
Diagram with timed events on horizontal lines [message #497124] Thu, 12 November 2009 14:40 Go to next message
Chris Lott is currently offline Chris LottFriend
Messages: 1
Registered: November 2009
Junior Member
Hi, I am writing to ask for hints and pointers for getting started with a new editor. I'm not new to GEF, but I am new to GMF. I'm trying to avoid all the dogwork of creating a GEF editor by sitting on top of GMF.

I would like to create a graphical editor to show and manipulate timed events. Think about controlling a strand of lights (it's close to Christmas :-). I have in mind a picture vaguely like Apple's garage band, in which multiple tracks are shown on horizontal lines. I am thinking one horizontal line for each light strand, with time t-zero at the left and increasing to the right. I would like to put the on-off events on top of each line. So if I have 3 lights to control the editor would show something like this:


1 -----[|||||]-------[||||||]------------------
2 ----------[|||||]-----[|||||]----------------
3 ----------------------------------------------
0....1.....2.....3.....4.....5.....6.....7.....8 (scale that is not editable)

This diagram represents the following data: strand 1 lights up and goes off, strand 2 lights up and goes off, etc; strand 3 never lights up at all. I want the editor to support adding/removing a light, adding/removing events to a light, and dragging the events left/right. A light might have a label. Each event has properties like brightness, start time, end time; maybe a label. That's about it.

Unlike so many examples I have seen, I don't want a canvas that allows the user to add a light just anywhere; all lines should remain equidistant and parallel. Events should only be added to existing horizontal lines, not dropped anywhere on the canvas. I also have no use for links between diagram elements, which I know ignores much GMF/GEF power. I suspect I need some sort of snap-to layout, because events should sit right on the line.

I built an EMF model starting with annotated Java interfaces, basically I have a collection of lights, and each light has a collection of events. So far so good. Now I'm working thru the GMF tutorial and have reached the tooling definition.

I suspect that I mostly need help with layout code/models, but since I'm so new to GMF I am not sure I'm asking the right questions yet. I welcome any hints, tips, and pointers. Thanks in advance!!

Re: Diagram with timed events on horizontal lines [message #498485 is a reply to message #497124] Tue, 17 November 2009 08:35 Go to previous message
Alex Shatalin is currently offline Alex ShatalinFriend
Messages: 141
Registered: July 2009
Senior Member
Hello Chris,

In this task GMF can help you to generate EditParts structure/requests dealing
with EMF model.
The rest should be done by you manually. You can try using .gmfgraph for
figure definitions, but since you need some custom controls (AFAIU - buttons
to switch on/off - change state of this diagram) I think it's better to use
custom figures instead of primitive draw2d figures in .gmfgraph.
In addition everything about layouting/reordering requests/feedbacks should
be done manually too.

So, to my understanding there is a lot of space for diagram customization,
but you can get some simple sceleton working by generating code with GMF.

-----------------
Alex Shatalin
Previous Topic:Putting Image in compartment
Next Topic:Getting write transactions to work in GMF
Goto Forum:
  


Current Time: Thu Apr 25 21:35:57 GMT 2024

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

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

Back to the top