| How can i draw a connection with lables? [message #100740] |
Mon, 20 October 2003 02:23  |
Eclipse User |
|
|
|
Originally posted by: eeoo_lee.hotmail.com
I want to use some lables to descirbe the realtionship between the source
and target model.I intend to place the labels on the connetion which can
move together with the connection. How can I do that?
Thanks!
|
|
|
|
|
|
| Re: How can i draw a connection with lables? [message #101193 is a reply to message #101180] |
Mon, 20 October 2003 23:31  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Even if there is no model, you can still create an editpart for the label.
This has been discussed before, but one solution is to use a spurious model
object. Perhaps a tuple consising of the connection model object and some
string.
Once you have an editpart, everything else is easier.
"lianglee" <eeoo_lee@hotmail.com> wrote in message
news:bn28mq$jvg$1@eclipse.org...
> Jan Ploski wrote:
>
> > lianglee wrote:
>
> > > I want to use some lables to descirbe the realtionship between the
source
> > > and target model.I intend to place the labels on the connetion which
can
> > > move together with the connection. How can I do that?
>
> > This is how I did it:
>
> > 1. My own class LabeledPolylineConnection extends PolylineConnection.
> > 2. In the constructor, it creates a Label.
> > 3. Because PolylineConnection uses DelegatingLayout, I add the label
> > as a child with a Locator constraint: add(label, new LabelLocator());
> > 3. The LabelLocator class implements Locator; it computes and sets
> > the label's bounds based on the connection's start and end points.
>
> > -JPL
>
>
> Thanks for your reply ,but I still have a question. The label I want to
> creat e is an editable one. I don't know the label on the connection in
> your case is a figure or a model? If it's a figure,can it be edited on
> the connection?
>
|
|
|
Powered by
FUDForum. Page generated in 0.05854 seconds