Home » Modeling » GMF (Graphical Modeling Framework) » Labeled arrow pointing to (and touching) node
Labeled arrow pointing to (and touching) node [message #8318] |
Mon, 07 August 2006 11:40  |
Eclipse User |
|
|
|
Hi,
I'm trying to model the following situation: A node can have an arrow
pointing at that node (and touching it with its head). The arrow does
not have anything on its other side. Heres some ASCII art to demonstrate:
--------
| Node |
| |<--label--
| |
--------
Is there an easy way I've overseen to achieve this with GMF?
Thanks in advance,
Chris
|
|
| | | |
Re: Labeled arrow pointing to (and touching) node [message #8583 is a reply to message #8566] |
Tue, 08 August 2006 01:56   |
Eclipse User |
|
|
|
Hi,
hm, I should really habe been more precise - sorry for that :-)
The problem is not how to draw an arrow (the GMF tutorial explains e.g.
how to draw a "use case actor"). The problem is how to "dock" that arrow
to the node.
I would like to be able to add an arrow to a node, and that arrow
appears as shown below (i.e., its head touching the node, and its body
preferably being upright to the node).
Thanks anyway,
Chris
Khai M Nguyen schrieb:
> If the arrow/label is static you can just create a custom figure for it
> can't you?
>
> -- Khai --
>
>
> chris wrote:
>> Hi Dmitry,
>>
>> thanks for your fast answer... but I don't understand it totally. I'm
>> aware of Decorators for Connections, but the arrow I have in mind is not
>> a Connection, since it only has an element on the target side. It's just
>> an arrow pointing at an element. I can't utilize a Connection for this
>> Use case, can I?
>>
>> Thanks,
>> Chris
>>
>>
>> Dmitry Stadnik schrieb:
>>> Hello!
>>>
>>> Specify appropriate DecorationFigure (PolylineDecoration?) for your
>>> connection figure in gmfgraph.
>>>
>>> chris wrote:
>>>> Hi,
>>>>
>>>> I'm trying to model the following situation: A node can have an arrow
>>>> pointing at that node (and touching it with its head). The arrow does
>>>> not have anything on its other side. Heres some ASCII art to
>>>> demonstrate:
>>>>
>>>> --------
>>>> | Node |
>>>> | |<--label--
>>>> | |
>>>> --------
>>>>
>>>> Is there an easy way I've overseen to achieve this with GMF?
>>>>
>>>> Thanks in advance,
>>>> Chris
|
|
|
Re: Labeled arrow pointing to (and touching) node [message #9739 is a reply to message #8583] |
Tue, 08 August 2006 03:57   |
Eclipse User |
|
|
|
Originally posted by: 5d5.mail.ru
Hello!
Please check gmfgraph model of ecore diagram editor; it should contain
such an arrow. In draw2d you may have a look at PolylineConnection and
PolylineDecoration figures and how they got composed. Basically you
should add PolylineDecoration to PolylineConnection in your gmfgraph model.
chris wrote:
> Hi,
>
> hm, I should really habe been more precise - sorry for that :-)
>
> The problem is not how to draw an arrow (the GMF tutorial explains e.g.
> how to draw a "use case actor"). The problem is how to "dock" that arrow
> to the node.
>
> I would like to be able to add an arrow to a node, and that arrow
> appears as shown below (i.e., its head touching the node, and its body
> preferably being upright to the node).
>
> Thanks anyway,
> Chris
>
>
> Khai M Nguyen schrieb:
>> If the arrow/label is static you can just create a custom figure for it
>> can't you?
>>
>> -- Khai --
>>
>>
>> chris wrote:
>>> Hi Dmitry,
>>>
>>> thanks for your fast answer... but I don't understand it totally. I'm
>>> aware of Decorators for Connections, but the arrow I have in mind is not
>>> a Connection, since it only has an element on the target side. It's just
>>> an arrow pointing at an element. I can't utilize a Connection for this
>>> Use case, can I?
>>>
>>> Thanks,
>>> Chris
>>>
>>>
>>> Dmitry Stadnik schrieb:
>>>> Hello!
>>>>
>>>> Specify appropriate DecorationFigure (PolylineDecoration?) for your
>>>> connection figure in gmfgraph.
>>>>
>>>> chris wrote:
>>>>> Hi,
>>>>>
>>>>> I'm trying to model the following situation: A node can have an arrow
>>>>> pointing at that node (and touching it with its head). The arrow does
>>>>> not have anything on its other side. Heres some ASCII art to
>>>>> demonstrate:
>>>>>
>>>>> --------
>>>>> | Node |
>>>>> | |<--label--
>>>>> | |
>>>>> --------
>>>>>
>>>>> Is there an easy way I've overseen to achieve this with GMF?
>>>>>
>>>>> Thanks in advance,
>>>>> Chris
|
|
|
Re: Labeled arrow pointing to (and touching) node [message #9808 is a reply to message #8583] |
Tue, 08 August 2006 04:45   |
Eclipse User |
|
|
|
Originally posted by: khai.n.situvista.com
I'm still not clear on what you really want to do.
Is the arrow/label an actual Node on your canvas that looks like an
arrow with a label? And you want this to always be 'docked' to another
node?
or
Is the arrow/label purely visual... meaning you want to make your node
look like it has an arrow pointing to it?
-- Khai --
chris wrote:
> Hi,
>
> hm, I should really habe been more precise - sorry for that :-)
>
> The problem is not how to draw an arrow (the GMF tutorial explains e.g.
> how to draw a "use case actor"). The problem is how to "dock" that arrow
> to the node.
>
> I would like to be able to add an arrow to a node, and that arrow
> appears as shown below (i.e., its head touching the node, and its body
> preferably being upright to the node).
>
> Thanks anyway,
> Chris
>
>
> Khai M Nguyen schrieb:
>> If the arrow/label is static you can just create a custom figure for it
>> can't you?
>>
>> -- Khai --
>>
>>
>> chris wrote:
>>> Hi Dmitry,
>>>
>>> thanks for your fast answer... but I don't understand it totally. I'm
>>> aware of Decorators for Connections, but the arrow I have in mind is not
>>> a Connection, since it only has an element on the target side. It's just
>>> an arrow pointing at an element. I can't utilize a Connection for this
>>> Use case, can I?
>>>
>>> Thanks,
>>> Chris
>>>
>>>
>>> Dmitry Stadnik schrieb:
>>>> Hello!
>>>>
>>>> Specify appropriate DecorationFigure (PolylineDecoration?) for your
>>>> connection figure in gmfgraph.
>>>>
>>>> chris wrote:
>>>>> Hi,
>>>>>
>>>>> I'm trying to model the following situation: A node can have an arrow
>>>>> pointing at that node (and touching it with its head). The arrow does
>>>>> not have anything on its other side. Heres some ASCII art to
>>>>> demonstrate:
>>>>>
>>>>> --------
>>>>> | Node |
>>>>> | |<--label--
>>>>> | |
>>>>> --------
>>>>>
>>>>> Is there an easy way I've overseen to achieve this with GMF?
>>>>>
>>>>> Thanks in advance,
>>>>> Chris
|
|
|
Re: Labeled arrow pointing to (and touching) node [message #13215 is a reply to message #9808] |
Wed, 09 August 2006 13:08   |
Eclipse User |
|
|
|
Hi,
Thanks for trying to help!
Khai M Nguyen schrieb:
> Is the arrow/label an actual Node on your canvas that looks like an
> arrow with a label? And you want this to always be 'docked' to another
> node?
>
> or
>
> Is the arrow/label purely visual... meaning you want to make your node
> look like it has an arrow pointing to it?
The arrow represents an element of my model. I have an Ecore model
containing a class Node and a class Arrow. The Arrow class has a 1:1
reference to the Node class. The Node is represented as a Rectangle
figure, and I want the Arrow to be visualized as shown below. That said,
I think the first of your suggestions seems to be more appropriate.
I've thought about using a Connection for this, but as far as I can see,
a Connection needs a source and a target element, and my Arrow only has
a target element. I have thought about using some invisible Element on
the source side of a Connection, but I'm not sure if this is possible.
I've also thought about creating a Custom arrow figure (I actually did),
but I don't know how to "dock" that figure to the target Node. I also
would like to be able to dock the arrow at an arbitrary side of the
Node, which would probably be difficult, since I'd need to transform the
figure, depending on the side it is docked to.
I hope I've provided enough information now :-)
Bye,
Chris
>>>>>> --------
>>>>>> | Node |
>>>>>> | |<--label--
>>>>>> | |
>>>>>> --------
|
|
| |
Re: Labeled arrow pointing to (and touching) node [message #14915 is a reply to message #13215] |
Fri, 11 August 2006 00:43  |
Eclipse User |
|
|
|
Originally posted by: khai.n.situvista.com
First off there is a thread about a similar requirement to yours that
you might want to follow; it's in this same newsgroup and titled
"Figure around other (externally) , borders, layout .."
Second (implement as a Connection), in your 1:1 model you can also look
at your Arrow as the source and your Node as the target which will allow
you to implement a connection between them. More specifically, the
'label' of your Arrow should be the source and the 'arrow' figure is the
connection. Since you have no model element for this 'connection' you
can follow the thread in the old newsgroup on how to do this titled
"Creating Connections with no semantic element".
A connection and its decoration have a lot of flexibility to control how
it looks. You can create a custom shape of a big arrow if you want.
Another benefit of this is that the the arrow figure will be
automagically rotated as you move the Arrow node around the central Node.
Third (implement as 'docked' nodes by containment), you can implement an
'invisible' container node that will contain 1 Node and 1 Arrow. This
container will not have a label and will not have a border, and should
have a layout that allows the Arrow to be placed in any of the 4
positions in regards to the Node(Top, Bottom, Right, Left).
Your Arrow node will be a custom figure that has 2 parts: the arrow
figure and the label. Similar to the container node above; the Arrow
node should have a layout that allows the label to be on top, at bottom,
etc... in relation to the arrow figure. Additionally you must have 4
separate figures for your arrow to represent the 4 orientations:
pointing up, pointing down, pointing left, and pointing right.
If you make the invisible container node slightly larger than your Node
the user can drag and drop the Arrow node slightly to the right, left,
top, bottom of your Node to place it. To have the arrow point in the
right direction you will need to override the generated code for your
Arrow node to return the correct figure (and label placement) for your
Arrow based on its position in relation to your Node.
This will do just about what you want but it also requires the most
work. I hope this at least points you in the right direction. Once you
get going on whichever approach you decide you can ask more questions
when you run into issues.
-- Khai --
chris wrote:
> Hi,
>
> Thanks for trying to help!
>
> Khai M Nguyen schrieb:
>> Is the arrow/label an actual Node on your canvas that looks like an
>> arrow with a label? And you want this to always be 'docked' to another
>> node?
>>
>> or
>>
>> Is the arrow/label purely visual... meaning you want to make your node
>> look like it has an arrow pointing to it?
>
> The arrow represents an element of my model. I have an Ecore model
> containing a class Node and a class Arrow. The Arrow class has a 1:1
> reference to the Node class. The Node is represented as a Rectangle
> figure, and I want the Arrow to be visualized as shown below. That said,
> I think the first of your suggestions seems to be more appropriate.
>
> I've thought about using a Connection for this, but as far as I can see,
> a Connection needs a source and a target element, and my Arrow only has
> a target element. I have thought about using some invisible Element on
> the source side of a Connection, but I'm not sure if this is possible.
>
> I've also thought about creating a Custom arrow figure (I actually did),
> but I don't know how to "dock" that figure to the target Node. I also
> would like to be able to dock the arrow at an arbitrary side of the
> Node, which would probably be difficult, since I'd need to transform the
> figure, depending on the side it is docked to.
>
> I hope I've provided enough information now :-)
>
> Bye,
> Chris
>
>
>>>>>>> --------
>>>>>>> | Node |
>>>>>>> | |<--label--
>>>>>>> | |
>>>>>>> --------
|
|
|
Goto Forum:
Current Time: Tue Jul 22 01:56:40 EDT 2025
Powered by FUDForum. Page generated in 0.05764 seconds
|