| attach a movable label to a connection link [message #216027] |
Fri, 12 May 2006 09:27  |
Eclipse User |
|
|
|
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 10:39  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.04221 seconds