Home » Modeling » Graphiti » Drag & drop of (text)elements?(Drag and drop, but not a connection)
Drag & drop of (text)elements? [message #1087306] |
Thu, 15 August 2013 12:50 |
Albert Hofkamp Messages: 41 Registered: August 2009 |
Member |
|
|
Hello,
I am looking for a way to add events to my edges (see the image)
At the right are locations, with edges between them. At the left are events known to this automaton. The user must attach one or more events to the edges.
My idea is to use drag and drop for this (pick up an event from the left, and drag it to the edge at the right). I have looked at the Graphiti features, but the only form of drag & drop seems to be to add a connection from a context-button (as done with an edge between locations). However, I don't want to display a connection, the name of the event should just be added to a decorator of the edge.
(Ideally, "pick up" an event name from the left, move it to the edge, and let it "fall" on the edge.)
The question is, can this be done, and how?
It seems to me that I need to make create and add features for events attached to edges (that is, create and add event-references). I have not done that yet, but it seems easy to do. What I am stuck at however, is how to make this drag & drop behavior.
Is this possible, or should I do something else, eg a popup of some sort??
|
|
|
Re: Drag & drop of (text)elements? [message #1090762 is a reply to message #1087306] |
Tue, 20 August 2013 15:57 |
Eclipse User |
|
|
|
Hi Albert,
Just an idea: maybe the Move feature can be overridden to achieve this
effect? It is used with drag-and-drop.
Kind regards,
Koen
On 15/08/13 14:50, Albert Hofkamp wrote:
> Hello,
>
> I am looking for a way to add events to my edges (see the image)
>
> At the right are locations, with edges between them. At the left are events known to this automaton. The user must attach one or more events to the edges.
>
> My idea is to use drag and drop for this (pick up an event from the left, and drag it to the edge at the right). I have looked at the Graphiti features, but the only form of drag & drop seems to be to add a connection from a context-button (as done with an edge between locations). However, I don't want to display a connection, the name of the event should just be added to a decorator of the edge.
>
> (Ideally, "pick up" an event name from the left, move it to the edge, and let it "fall" on the edge.)
>
> The question is, can this be done, and how?
>
> It seems to me that I need to make create and add features for events attached to edges (that is, create and add event-references). I have not done that yet, but it seems easy to do. What I am stuck at however, is how to make this drag & drop behavior.
>
> Is this possible, or should I do something else, eg a popup of some sort??
>
>
|
|
| |
Re: Drag & drop of (text)elements? [message #1092247 is a reply to message #1091288] |
Thu, 22 August 2013 14:07 |
Eclipse User |
|
|
|
Hi Albert,
While I agree it may sound a bit hack-ish at first, I don't immediately
see how the framework could distinguish a move operation from the
copy/link operation that you're looking for (except if the user would
need to press the control/shift/alt key while dragging, for example).
The user actually interacts as if he/she moves the event to the link,
with the exception that the list of events still contains the event
afterwards. In that sense, I think it truly is a special case of moving,
and extending the move feature for that is not really far-fetched.
Otherwise, you would need a custom feature, but I don't think you can
easily combine that with drag and drop.
Koen
On 21/08/13 11:50, Albert Hofkamp wrote:
> I pondered about that too. Looking at the code, it might even work.
>
> In the Graphiti framework however, I don't really expect to have to do
> this. They have all these clean separate features for semantically
> different operations where you can extend some basic functionality to
> get your behavior.
> Then for a copy/link operation you suddenly have to use a move operation
> where you have to disable the location move part of the graphical elements?
>
> So I agree with you that your suggestion may provide the visual behavior
> that I want.
> I am however having a lot of doubts, jumping to such a somewhat hack-ish
> solution for such a quite common Gui operation doesn't feel like the
> right solution.
> The question thus boils down to whether I am missing some alternative
> way of solving this thing, or is my feeling all wrong.
>
> For now I opted for adding a dialog window to set the events that you
> want, which will be useful anyway for the cases where you need to add a
> lot of events.
>
|
|
| | | |
Goto Forum:
Current Time: Thu Sep 26 03:39:39 GMT 2024
Powered by FUDForum. Page generated in 0.03945 seconds
|