Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Shape with a label and show connections with drag & drop
Shape with a label and show connections with drag & drop [message #213571] Fri, 07 April 2006 13:51 Go to next message
Nicolas Rousseau is currently offline Nicolas RousseauFriend
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 Go to previous message
Steven R. Shaw is currently offline Steven R. ShawFriend
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
>
>
Previous Topic:New GEF Wiki available...
Next Topic:attaching textviewer to graphical viewer
Goto Forum:
  


Current Time: Fri Apr 26 19:01:49 GMT 2024

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

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

Back to the top