Skip to main content



      Home
Home » Eclipse Projects » GEF » Creating connections
Creating connections [message #87433] Tue, 15 July 2003 18:06 Go to next message
Eclipse UserFriend
Originally posted by: rahul.dhar.intel.com

I think I have everything working in my application except for connection
creation. I'm using the Logic diagram example as start code. For some
reason, I always get a diagonal line from the upper right corner of my
drawing window, regardless of where I click for the source anchor. I
think that my anchors aren't being recognized, so the connection line just
grabs some default values for its start and end points. Is there any way
to check this? If they aren't being recognized, how do I register my
anchors? Is there a simple method for creating connections?

Thanks,
-Rahul
Re: Creating connections [message #87583 is a reply to message #87433] Wed, 16 July 2003 09:05 Go to previous messageGo to next message
Eclipse UserFriend
Try putting a breakpoint in
AbstractConnectionEditPart.getSourceConnectionAnchor() (or getTarget...). This
is where the connection edit part tries to get an anchor from its source or
target node edit part. If either of those are null, you'll get one of the
default anchors, which are roughly in the upper left corner. Your edit parts
also need to implement the NodeEditPart interface.

Eric


Rahul Dhar wrote:

> I think I have everything working in my application except for connection
> creation. I'm using the Logic diagram example as start code. For some
> reason, I always get a diagonal line from the upper right corner of my
> drawing window, regardless of where I click for the source anchor. I
> think that my anchors aren't being recognized, so the connection line just
> grabs some default values for its start and end points. Is there any way
> to check this? If they aren't being recognized, how do I register my
> anchors? Is there a simple method for creating connections?
>
> Thanks,
> -Rahul
>
Re: Creating connections [message #87668 is a reply to message #87583] Wed, 16 July 2003 18:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rahul.dhar.intel.com

Eric Bordeau wrote:

> Try putting a breakpoint in
> AbstractConnectionEditPart.getSourceConnectionAnchor() (or getTarget...).
This
> is where the connection edit part tries to get an anchor from its source or
> target node edit part. If either of those are null, you'll get one of the
> default anchors, which are roughly in the upper left corner. Your edit
parts
> also need to implement the NodeEditPart interface.

Default at (10,10) in fact :) Thanks a lot.

My next question is can I have multiple connections from the same anchor?
I would like to be able to do something like (aplogies if the ascii art
doesn't come out nicely) this. The anchors are the '#'. I'd like to
avoid having to create multiple anchors, since that would things very
messy, at least from a usability standpoint.

#---------#---------#
+--|--+ +--|--+ +--|--+
| | | | | |
+-----+ +-----+ +-----+


Thanks,
-Rahul
Re: Creating connections [message #87698 is a reply to message #87668] Wed, 16 July 2003 20:31 Go to previous message
Eclipse UserFriend
> My next question is can I have multiple connections from the same anchor?
> I would like to be able to do something like (aplogies if the ascii art
> doesn't come out nicely) this. The anchors are the '#'. I'd like to
> avoid having to create multiple anchors, since that would things very
> messy, at least from a usability standpoint.
>
> #---------#---------#
> +--|--+ +--|--+ +--|--+
> | | | | | |
> +-----+ +-----+ +-----+

Yes, you can do this. The logic example allows you to have multiple outputs
using the same anchor. Inputs are restricted to one per anchor only because it
doesn't make sense to have multiple inputs to one terminal.
Previous Topic:BiDi and GEF
Next Topic:ScrollableGraphicalViewer and key accelerations
Goto Forum:
  


Current Time: Sun Jun 15 19:48:33 EDT 2025

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

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

Back to the top