Shape with a label and show connections with drag & drop [message #213571] |
Fri, 07 April 2006 13:51 |
Nicolas Rousseau Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm new to GEF, even if i did many things with all the examples, but there's
still things that i don't know at all how to do.
I got a shape, and i'd like to have a label attached. I mean a shape and
next to it a label that i can move around it and edit.
I tried to make this from an example i've seen with a label attached to a
connection. But the problem is that it works really well for a connection,
but i can't do it with a shape.
The label i use is added as the children of the shape, same as a label for a
connection.
But the problem is that:
1) I can only see the text when it is inside the shape (wich is the
"parent")
2) If i don't call "setBounds" in the refreshVisual of the label, i
can't see anything
I tried many things, but i still don't know why i can attach a label to a
connection "quite easily" and i can't with something else.
Or maybe i missed something...
And i've seen in the newsgroup several people asking how to show the
connections when u drag a component, but no answer...
Is it possible ? How ?
Thanks,
Nicolas
|
|
|
Re: Shape with a label and show connections with drag & drop [message #213650 is a reply to message #213571] |
Fri, 07 April 2006 20:43 |
Steven R. Shaw Messages: 128 Registered: July 2009 |
Senior Member |
|
|
The general constraint of draw2d is that the children of a figure must be
contained with-in the bounds of the parent. This is necessary in order to
facilitate efficient clipping during the paint routine.
You should be able to work around this by creating a parent figure that
encompasses your Node and the label and it's children. (not trivial).
Another general hint is to take a look at the GMF project (build on top of
GEF) which has a Border item infrastructure that can be used to accommodate
floating node labels. The tooling generator can accommodate floating node
labels in recent integration builds. There is an example in cvs in
org.eclipse.gmf.examples.taipan.gmf.editor plug-in. (www.eclipse.org/gmf)
-Steve
"Nicolas Rousseau" <nicolasrousseau@hotmail.com> wrote in message
news:e15q9k$db7$1@utils.eclipse.org...
> Hi,
>
> I'm new to GEF, even if i did many things with all the examples, but
there's
> still things that i don't know at all how to do.
>
> I got a shape, and i'd like to have a label attached. I mean a shape and
> next to it a label that i can move around it and edit.
>
> I tried to make this from an example i've seen with a label attached to a
> connection. But the problem is that it works really well for a connection,
> but i can't do it with a shape.
>
> The label i use is added as the children of the shape, same as a label for
a
> connection.
> But the problem is that:
> 1) I can only see the text when it is inside the shape (wich is the
> "parent")
> 2) If i don't call "setBounds" in the refreshVisual of the label, i
> can't see anything
>
> I tried many things, but i still don't know why i can attach a label to a
> connection "quite easily" and i can't with something else.
> Or maybe i missed something...
>
>
> And i've seen in the newsgroup several people asking how to show the
> connections when u drag a component, but no answer...
> Is it possible ? How ?
>
>
> Thanks,
> Nicolas
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03006 seconds