|
|
|
|
|
|
|
|
|
Re: How to add two or more connections between two editpart? [message #165625 is a reply to message #165501] |
Wed, 26 January 2005 01:19  |
Eclipse User |
|
|
|
Originally posted by: zhlmmc.hotmail.com
I've got it,thank you :)
Pratik Shah wrote:
> You should be setting the connection router on the connection layer (and
> only once), not on the connection itself. Like I said, look at ediagram
> example's DiagramEditPart if you need more details.
> "zhlmmc" <zhlmmc@hotmail.com> wrote in message
> news:ct5cea$hf2$1@www.eclipse.org...
>> I did what you said but it doesn't work.
>> protected IFigure createFigure() {
>> PolylineConnection connection = new PolylineConnection();
>> Label label = new Label();
>> label.setText("line");
>> FanRouter frouter = new FanRouter();
>> frouter.setSeparation(50);
>> frouter.setNextRouter(new BendpointConnectionRouter());
>> connection.setConnectionRouter(frouter);
>> connection.add(label,new
>> ConnectionLocator(connection,ConnectionLocator.MIDDLE));
>>
>> return connection;
>> }
>> The connections are still displayed overlapped.
>> What's wrong?Is there any constraint with my EditPart?
>>
>> Pratik Shah wrote:
>>
>> > Use the FanRouter. It will fan out overlapping connections. You can
> invoke
>> > setSeparation() to specify the distance by which you want the
> connections to
>> > be spread out. Whatever router you're using currently, should be set as
> the
>> > next router on the FanRouter. Then, when you set the FanRouter as the
>> > router for your layer, it will use "the next router" for laying out the
>> > connections, and will fan out ones that are over-lapping.
>>
>> > Look at EDiagram example's DiagramEditPart#refreshVisuals().
>>
>> > "zhlmmc" <zhlmmc@hotmail.com> wrote in message
>> > news:ct2132$m3j$1@www.eclipse.org...
>> >> I mean the connections are displayed separatedly.
>> >> Both the ChorpboxAnchor and the EllipseAnchor will display the
> connections
>> >> overlaped.Should I write a new Anchor by myslfe?
>> >>
>> >> Thanks.
>> >>
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04569 seconds