Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Disable connection feedback
Disable connection feedback [message #793135] Tue, 07 February 2012 20:19 Go to next message
Russ Loucks is currently offline Russ Loucks
Messages: 11
Registered: December 2011
Junior Member
I have a GEF/Draw2D-based editor that allows users to build a data flow
diagram. Figures include both input data 'channel' anchors and output
data 'channel' anchors. I've extended AbstractConnectionAnchor to suit
my needs and this mostly works well.

One problem. When I select an output 'channel' anchor on an figure
using the connection tool, a feedback connection line appears between
the channel I've just selected and the closest input 'channel' anchor on
the same element. I would prefer nothing appear in this case; the model
doesn't support nodes to be connected to themselves.

In the edit part for the nodes, I've implemented the
GRAPHICAL_NODE_ROLE edit policy
(getConnectionCreateCommand(CreateConnectionRequest),
getConnectionCompleteCommand(CreateConnectionRequest), etc.) and tried
to return NULL in the 'getConnectionCompleteCommand()' method if the
source and target nodes are the same.

No luck.... Any other ideas?
Re: Disable connection feedback [message #793137 is a reply to message #793135] Tue, 07 February 2012 20:25 Go to previous messageGo to next message
Alexander Nyßen is currently offline Alexander Nyßen
Messages: 49
Registered: July 2009
Location: Lünen
Member
Don't return null (which means the edit policy ignores the command) but an UnexecutableCommand instance. That should to the trick...
Re: Disable connection feedback [message #794581 is a reply to message #793137] Thu, 09 February 2012 13:15 Go to previous messageGo to next message
Mauro P. is currently offline Mauro P.
Messages: 24
Registered: April 2011
Junior Member
in the target EdtiPart override the method
public ConnectionAnchor getSourceConnectionAnchor(Request request)
public ConnectionAnchor getTargetConnectionAnchor(Request request)

and make them return the correct anchor point for the creationConnection request.
This anchor will be used only during the creation of the connection.

hop this help you
Re: Disable connection feedback [message #794784 is a reply to message #793137] Thu, 09 February 2012 17:51 Go to previous messageGo to next message
Russ Loucks is currently offline Russ Loucks
Messages: 11
Registered: December 2011
Junior Member
On 02/07/2012 02:25 PM, Alexander Nyssen wrote:
> Don't return null (which means the edit policy ignores the command) but
> an UnexecutableCommand instance. That should to the trick...

This didn't work (the connection feedback line was still there). The
fix that worked was to return a 'null' ConnectionAnchor in my public
ConnectionAnchor EditPart.getTargetConnectionAnchor(Request request) {}
method.

I check to see if the source n target parts exist and return null if
their models' are the same.

Thanks! R
Re: Disable connection feedback [message #794785 is a reply to message #794581] Thu, 09 February 2012 17:51 Go to previous message
Russ Loucks is currently offline Russ Loucks
Messages: 11
Registered: December 2011
Junior Member
On 02/09/2012 07:15 AM, Missing name Mising name wrote:
> in the target EdtiPart override the method
>
> public ConnectionAnchor getSourceConnectionAnchor(Request request)
> public ConnectionAnchor getTargetConnectionAnchor(Request request)
>
> and make them return the correct anchor point for the creationConnection
> request.
> This anchor will be used only during the creation of the connection.
>
> hop this help you

Thanks. The fix that worked was to return a 'null' ConnectionAnchor in
my public ConnectionAnchor EditPart.getTargetConnectionAnchor(Request
request) {} method.

I check to see if the source n target parts exist and return null if
their models' are the same.

Thanks! R
Previous Topic: GEF based project
Next Topic:GEF Displaying rulers
Goto Forum:
  


Current Time: Thu Oct 23 14:36:15 GMT 2014

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

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