Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Tripolar connection
Tripolar connection [message #132923] Wed, 19 May 2004 08:27 Go to next message
Eclipse UserFriend
Originally posted by: grandan.tiscali.it

Hi,
I need some informations about GEF connections.

Is it possibile to create a tripolar connection? I mean a connection
between 3 different graphic figures. In other way, can I create an anchor
on a connection (for example, in a manner similar to bendpoints)?

Thank you very much!
Bye bye

Daniele
Re: Tripolar connection [message #132936 is a reply to message #132923] Wed, 19 May 2004 09:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Hi Daniele,

"Daniele" <grandan@tiscali.it> wrote in message
news:c8f5p6$nkv$1@eclipse.org...
> Hi,
> I need some informations about GEF connections.
>
> Is it possibile to create a tripolar connection? I mean a connection
> between 3 different graphic figures. In other way, can I create an anchor
> on a connection (for example, in a manner similar to bendpoints)?

What you probably want is to connect a connection to another connection,
instead of any other EditPart. This is possible, install the
GRAPHICAL_NODE_ROLE in your Connections EditPart. This was discussed in a
previous threads as well... check

Branched Connections - possible Contribution 24/09/04
Connecting connections to connections ... 06/11/04

Hope this helps,
Brian.
Re: Tripolar connection [message #133208 is a reply to message #132936] Thu, 20 May 2004 11:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: grandan.tiscali.it

Hi Brian,

thank you for the information, I found it very usefull. Now I have a
question: how can I create a connection anchor on the connection. Can I
put the FixedConnectionAnchor of LogicExample on a connection?
Where can I find an example of this process?

Thank you very much.

Daniele


Brian Fernandes wrote:

> Hi Daniele,

> "Daniele" <grandan@tiscali.it> wrote in message
> news:c8f5p6$nkv$1@eclipse.org...
> > Hi,
> > I need some informations about GEF connections.
> >
> > Is it possibile to create a tripolar connection? I mean a connection
> > between 3 different graphic figures. In other way, can I create an anchor
> > on a connection (for example, in a manner similar to bendpoints)?

> What you probably want is to connect a connection to another connection,
> instead of any other EditPart. This is possible, install the
> GRAPHICAL_NODE_ROLE in your Connections EditPart. This was discussed in a
> previous threads as well... check

> Branched Connections - possible Contribution 24/09/04
> Connecting connections to connections ... 06/11/04

> Hope this helps,
> Brian.
Re: Tripolar connection [message #133236 is a reply to message #133208] Thu, 20 May 2004 12:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Hi Daniele,

I wrote my own Anchor for this purpose.

Basically what I did was - I went through all the points on the connection
(and also the connections that were connected to the connection) and found
the most appropriate point for the anchor. I returned this point in
AbstractConnectionAnchor#getLocation.

This allowed my connections to re-anchor themseleves as the connections they
are connected to moved.

Depending on how you want your sub-connections to connect to the
parent-connection, you will have to decide how advanced to make your anchor.

It can get a little complex, write back if you need more assistance,
All the best,
Brian.

"Daniele" <grandan@tiscali.it> wrote in message
news:c8i5oe$2fm$1@eclipse.org...
> Hi Brian,
>
> thank you for the information, I found it very usefull. Now I have a
> question: how can I create a connection anchor on the connection. Can I
> put the FixedConnectionAnchor of LogicExample on a connection?
> Where can I find an example of this process?
>
> Thank you very much.
>
> Daniele
>
>
> Brian Fernandes wrote:
>
> > Hi Daniele,
>
> > "Daniele" <grandan@tiscali.it> wrote in message
> > news:c8f5p6$nkv$1@eclipse.org...
> > > Hi,
> > > I need some informations about GEF connections.
> > >
> > > Is it possibile to create a tripolar connection? I mean a connection
> > > between 3 different graphic figures. In other way, can I create an
anchor
> > > on a connection (for example, in a manner similar to bendpoints)?
>
> > What you probably want is to connect a connection to another connection,
> > instead of any other EditPart. This is possible, install the
> > GRAPHICAL_NODE_ROLE in your Connections EditPart. This was discussed in
a
> > previous threads as well... check
>
> > Branched Connections - possible Contribution 24/09/04
> > Connecting connections to connections ... 06/11/04
>
> > Hope this helps,
> > Brian.
>
>
Re: Tripolar connection [message #134095 is a reply to message #133236] Tue, 25 May 2004 14:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: grandan.tiscali.it

Hi Brian,
I still need your help.

This is my case: I need a connection A which can anchor itself on a
connection B. So I create a ConnectionFigure for B which extends
PolylineConnection and I add a FixedConnectionAnchor (of the logic
example) on it. I add the anchor in the method
getConnectionCompleteCommand of the EditPart associated with connection B.

My problem is that connection A never anchor itself on the connection B,
but always in the position x=100, y=100.

Can you tell me where I'm wrong?

Can you send me an example (or a set of classes used by it) of an editor
with a connection which can connect itself on another connection?

Thank you very much for the help!
Bye bye

Daniele



Brian Fernandes wrote:

> Hi Daniele,

> I wrote my own Anchor for this purpose.

> Basically what I did was - I went through all the points on the connection
> (and also the connections that were connected to the connection) and found
> the most appropriate point for the anchor. I returned this point in
> AbstractConnectionAnchor#getLocation.

> This allowed my connections to re-anchor themseleves as the connections they
> are connected to moved.

> Depending on how you want your sub-connections to connect to the
> parent-connection, you will have to decide how advanced to make your anchor.

> It can get a little complex, write back if you need more assistance,
> All the best,
> Brian.

> "Daniele" <grandan@tiscali.it> wrote in message
> news:c8i5oe$2fm$1@eclipse.org...
> > Hi Brian,
> >
> > thank you for the information, I found it very usefull. Now I have a
> > question: how can I create a connection anchor on the connection. Can I
> > put the FixedConnectionAnchor of LogicExample on a connection?
> > Where can I find an example of this process?
> >
> > Thank you very much.
> >
> > Daniele
> >
> >
> > Brian Fernandes wrote:
> >
> > > Hi Daniele,
> >
> > > "Daniele" <grandan@tiscali.it> wrote in message
> > > news:c8f5p6$nkv$1@eclipse.org...
> > > > Hi,
> > > > I need some informations about GEF connections.
> > > >
> > > > Is it possibile to create a tripolar connection? I mean a connection
> > > > between 3 different graphic figures. In other way, can I create an
> anchor
> > > > on a connection (for example, in a manner similar to bendpoints)?
> >
> > > What you probably want is to connect a connection to another connection,
> > > instead of any other EditPart. This is possible, install the
> > > GRAPHICAL_NODE_ROLE in your Connections EditPart. This was discussed in
> a
> > > previous threads as well... check
> >
> > > Branched Connections - possible Contribution 24/09/04
> > > Connecting connections to connections ... 06/11/04
> >
> > > Hope this helps,
> > > Brian.
> >
> >
Re: Tripolar connection [message #134105 is a reply to message #134095] Tue, 25 May 2004 16:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Hi Daniele,

I'm afraid my editor and it's anchors are too complex to be of any use to
you.

The FixedConnecitonAnchor won't work the way you want it to.

Implement your own anchor by extending AbstractConnectionAnchor

Override getLocation.

Your "owner" figure is the ConnectionFigure B. Since this is a
PolylineConneciton figure, call getPoints() to get a list of the points that
make up B's polyline.
For now, return the first of these points - later you can use your own logic
to return a point that will lead to the best possible routing.

Finally, use translateToAbsolute on this point to allow for scroll / zoom
etc. Something like getOwner().translateToAbsolute(returnPoint);

You can pretty much copy FixedConnectionAnchor, but change the getLocation
method.

Hope this helps,
Brian.
Re: Tripolar connection [message #134246 is a reply to message #134095] Tue, 25 May 2004 21:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It sounds like your connection editpart is not implementing hte NodeEditPart
interface properly.

"Daniele" <grandan@tiscali.it> wrote in message
news:c8vltn$i7r$1@eclipse.org...
> Hi Brian,
> I still need your help.
>
> This is my case: I need a connection A which can anchor itself on a
> connection B. So I create a ConnectionFigure for B which extends
> PolylineConnection and I add a FixedConnectionAnchor (of the logic
> example) on it. I add the anchor in the method
> getConnectionCompleteCommand of the EditPart associated with connection B.
>
> My problem is that connection A never anchor itself on the connection B,
> but always in the position x=100, y=100.
>
> Can you tell me where I'm wrong?
>
> Can you send me an example (or a set of classes used by it) of an editor
> with a connection which can connect itself on another connection?
>
> Thank you very much for the help!
> Bye bye
>
> Daniele
>
>
>
> Brian Fernandes wrote:
>
> > Hi Daniele,
>
> > I wrote my own Anchor for this purpose.
>
> > Basically what I did was - I went through all the points on the
connection
> > (and also the connections that were connected to the connection) and
found
> > the most appropriate point for the anchor. I returned this point in
> > AbstractConnectionAnchor#getLocation.
>
> > This allowed my connections to re-anchor themseleves as the connections
they
> > are connected to moved.
>
> > Depending on how you want your sub-connections to connect to the
> > parent-connection, you will have to decide how advanced to make your
anchor.
>
> > It can get a little complex, write back if you need more assistance,
> > All the best,
> > Brian.
>
> > "Daniele" <grandan@tiscali.it> wrote in message
> > news:c8i5oe$2fm$1@eclipse.org...
> > > Hi Brian,
> > >
> > > thank you for the information, I found it very usefull. Now I have a
> > > question: how can I create a connection anchor on the connection. Can
I
> > > put the FixedConnectionAnchor of LogicExample on a connection?
> > > Where can I find an example of this process?
> > >
> > > Thank you very much.
> > >
> > > Daniele
> > >
> > >
> > > Brian Fernandes wrote:
> > >
> > > > Hi Daniele,
> > >
> > > > "Daniele" <grandan@tiscali.it> wrote in message
> > > > news:c8f5p6$nkv$1@eclipse.org...
> > > > > Hi,
> > > > > I need some informations about GEF connections.
> > > > >
> > > > > Is it possibile to create a tripolar connection? I mean a
connection
> > > > > between 3 different graphic figures. In other way, can I create an
> > anchor
> > > > > on a connection (for example, in a manner similar to bendpoints)?
> > >
> > > > What you probably want is to connect a connection to another
connection,
> > > > instead of any other EditPart. This is possible, install the
> > > > GRAPHICAL_NODE_ROLE in your Connections EditPart. This was
discussed in
> > a
> > > > previous threads as well... check
> > >
> > > > Branched Connections - possible Contribution 24/09/04
> > > > Connecting connections to connections ... 06/11/04
> > >
> > > > Hope this helps,
> > > > Brian.
> > >
> > >
>
>
Re: Tripolar connection [message #134432 is a reply to message #134246] Wed, 26 May 2004 14:55 Go to previous message
Eclipse UserFriend
Originally posted by: grandan.tiscali.it

Hi,

I created a new anchor for my connection implementing the method
getLocation on your (Brian) indications. My connection edit part also
implements the NodeEditPart.
When I drag the secondary connection onto the primary connection, the
secondary anchors itself at the right position. But when I click to fix
the connection always the target anchor becomes the point x=100, y=100.

I think the problem is not on the anchor.. but in the edit part (or in the
edit policy or in the connection model).

What about the connection model and edit policy? What do I miss?

Thank you very much for the help.
Your indications are very usefull for me.

bye bye,
Daniele




> It sounds like your connection editpart is not implementing hte NodeEditPart
> interface properly.

> "Daniele" <grandan@tiscali.it> wrote in message
> news:c8vltn$i7r$1@eclipse.org...
> > Hi Brian,
> > I still need your help.
> >
> > This is my case: I need a connection A which can anchor itself on a
> > connection B. So I create a ConnectionFigure for B which extends
> > PolylineConnection and I add a FixedConnectionAnchor (of the logic
> > example) on it. I add the anchor in the method
> > getConnectionCompleteCommand of the EditPart associated with connection B.
> >
> > My problem is that connection A never anchor itself on the connection B,
> > but always in the position x=100, y=100.
> >
> > Can you tell me where I'm wrong?
> >
> > Can you send me an example (or a set of classes used by it) of an editor
> > with a connection which can connect itself on another connection?
> >
> > Thank you very much for the help!
> > Bye bye
> >
> > Daniele
> >
> >
> >
> > Brian Fernandes wrote:
> >
> > > Hi Daniele,
> >
> > > I wrote my own Anchor for this purpose.
> >
> > > Basically what I did was - I went through all the points on the
> connection
> > > (and also the connections that were connected to the connection) and
> found
> > > the most appropriate point for the anchor. I returned this point in
> > > AbstractConnectionAnchor#getLocation.
> >
> > > This allowed my connections to re-anchor themseleves as the connections
> they
> > > are connected to moved.
> >
> > > Depending on how you want your sub-connections to connect to the
> > > parent-connection, you will have to decide how advanced to make your
> anchor.
> >
> > > It can get a little complex, write back if you need more assistance,
> > > All the best,
> > > Brian.
> >
> > > "Daniele" <grandan@tiscali.it> wrote in message
> > > news:c8i5oe$2fm$1@eclipse.org...
> > > > Hi Brian,
> > > >
> > > > thank you for the information, I found it very usefull. Now I have a
> > > > question: how can I create a connection anchor on the connection. Can
> I
> > > > put the FixedConnectionAnchor of LogicExample on a connection?
> > > > Where can I find an example of this process?
> > > >
> > > > Thank you very much.
> > > >
> > > > Daniele
> > > >
> > > >
> > > > Brian Fernandes wrote:
> > > >
> > > > > Hi Daniele,
> > > >
> > > > > "Daniele" <grandan@tiscali.it> wrote in message
> > > > > news:c8f5p6$nkv$1@eclipse.org...
> > > > > > Hi,
> > > > > > I need some informations about GEF connections.
> > > > > >
> > > > > > Is it possibile to create a tripolar connection? I mean a
> connection
> > > > > > between 3 different graphic figures. In other way, can I create an
> > > anchor
> > > > > > on a connection (for example, in a manner similar to bendpoints)?
> > > >
> > > > > What you probably want is to connect a connection to another
> connection,
> > > > > instead of any other EditPart. This is possible, install the
> > > > > GRAPHICAL_NODE_ROLE in your Connections EditPart. This was
> discussed in
> > > a
> > > > > previous threads as well... check
> > > >
> > > > > Branched Connections - possible Contribution 24/09/04
> > > > > Connecting connections to connections ... 06/11/04
> > > >
> > > > > Hope this helps,
> > > > > Brian.
> > > >
> > > >
> >
> >
Previous Topic:native drag and drop
Next Topic:Label + DirectEdit
Goto Forum:
  


Current Time: Fri Apr 26 00:29:57 GMT 2024

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

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

Back to the top