Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » attach a movable label to a connection link
attach a movable label to a connection link [message #216027] Fri, 12 May 2006 13:27 Go to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
Hi,

Someone now how to create a movable label attached to a link?
I have created a LinkEditPart (figure : polyline) and a nameLinkEditPart
(figure Label).
when I execute the program, these edit part are well built but I can see
the label?

In the code of nameLinkEditPart I have these code:

protected void refreshVisuals() {
StringFigure f = (StringFigure)createFigure();
Dimension size = getGraphNode().getSize();
Point p = getGraphNode().getPosition();
Rectangle r = new Rectangle(p ,size);
f.setName(name);}
LayoutManager
layout=((GraphicalEditPart)getParent()).getContentPane().get LayoutManager();
layout.setConstraint(
f,
r);
thx
Re: attach a movable label to a connection link [message #216231 is a reply to message #216027] Tue, 16 May 2006 14:39 Go to previous message
Steven R. Shaw is currently offline Steven R. ShawFriend
Messages: 128
Registered: July 2009
Senior Member
Take a look at the following article:
http://www.eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2 d.html

-Steve

"Patrick" <Patrick.Tessier@cea.fr> wrote in message
news:10b52449eca46f5d4524ec4824768741$1@www.eclipse.org...
> Hi,
>
> Someone now how to create a movable label attached to a link?
> I have created a LinkEditPart (figure : polyline) and a nameLinkEditPart
> (figure Label).
> when I execute the program, these edit part are well built but I can see
> the label?
>
> In the code of nameLinkEditPart I have these code:
>
> protected void refreshVisuals() {
> StringFigure f = (StringFigure)createFigure();
> Dimension size = getGraphNode().getSize();
> Point p = getGraphNode().getPosition();
> Rectangle r = new Rectangle(p ,size);
> f.setName(name);}
> LayoutManager
>
layout=((GraphicalEditPart)getParent()).getContentPane().get LayoutManager();
> layout.setConstraint(
> f,
> r);
> thx
>
Previous Topic:i do i include ActiveX control in GEF??
Next Topic:How to create a DirectEditManager using ComboBoxCellEditor in GEF (workaround)
Goto Forum:
  


Current Time: Sat Apr 20 02:01:08 GMT 2024

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

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

Back to the top