Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to add labels to connection
How to add labels to connection [message #209371] Tue, 14 February 2006 07:16 Go to next message
Eclipse UserFriend
Originally posted by: rupesh_wakde.yahoo.com

hello

I am starting out with GEF,can anybody tell me how to add labels to the
connection.

thanks in advance
Re: How to add labels to connection [message #209413 is a reply to message #209371] Tue, 14 February 2006 13:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vinusemail.gmail.com

Hi Rupesh
just check this article:
http://www.eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2 d.html

- Regards
Vinu

rupesh wrote:
> hello
>
> I am starting out with GEF,can anybody tell me how to add labels to the
> connection.
>
> thanks in advance
>
Re: How to add labels to connection [message #209463 is a reply to message #209413] Wed, 15 February 2006 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rupesh_wakde.yahoo.com

thanks Vinu
Re: How to add labels to connection [message #209513 is a reply to message #209371] Wed, 15 February 2006 17:32 Go to previous message
Eclipse UserFriend
Originally posted by: dutz.c-ware.de

This is the code I used and it works nicely. Jope it helps

package de.cware.qpe.editors.incidence.view.figure;

import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.MidpointLocator;
import org.eclipse.draw2d.PolygonDecoration;
import org.eclipse.draw2d.PolylineConnection;

public class LabeledConnectionFigure extends PolylineConnection {
protected Label label;

public LabeledConnectionFigure() {
setTargetDecoration(new PolygonDecoration());
MidpointLocator labelLocator = new MidpointLocator(this, 0);
label = new Label("1");
label.setOpaque(true);
add(label, labelLocator);
}

public void setLabelText(String labelText) {
label.setText(labelText);
}

public String getLabelText() {
return label.getText();
}
}


Chris


"rupesh" <rupesh_wakde@yahoo.com> schrieb im Newsbeitrag
news:38682afaabba616098873e78934678e9$1@www.eclipse.org...
> hello
>
> I am starting out with GEF,can anybody tell me how to add labels to the
> connection.
>
> thanks in advance
>
Previous Topic:actionbars, delete, undo, redo
Next Topic:Delete in context menu won't work
Goto Forum:
  


Current Time: Thu Apr 18 00:22:41 GMT 2024

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

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

Back to the top