Skip to main content



      Home
Home » Eclipse Projects » GEF » Simulate ConnectionCreationTool from within EditPart
Simulate ConnectionCreationTool from within EditPart [message #85215] Wed, 25 June 2003 10:29 Go to next message
Eclipse UserFriend
Originally posted by: g.wagenknecht.intershop.de

Hi!

When I click on the connection anchor of an EditPart I can return my own
DragTracker in EditPart#getDragTracker. This works fine with the
ConnectionDragCreationTool. But know I want to use the
ConnectionCreationTool but it doesn't work the way it works from within the
palette (click on source -> move mouse and see connection -> click on
target -> connection is created).

Any hints?

Thanks,
Gunnar
Re: Simulate ConnectionCreationTool from within EditPart [message #85262 is a reply to message #85215] Wed, 25 June 2003 11:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I don't really understand what you are showing/want to show the user.
You want them to be able to click somewhere, and the connection creation
tool is immediately activated and is now waiting for the second click? Do
you have some kind of button that is pressed to enter connection creation
mode? You'll probably have to subclass AbstractConnectionCrationTool, and
load your custom tool on mouseUp on that button. Your custom tool would
already know the button which invoked it, so it could query the source
editpart for the first part of the connection creation if necessary.

"Gunnar Wagenknecht" <g.wagenknecht@intershop.de> wrote in message
news:bdcbk6$63l$1@rogue.oti.com...
> Hi!
>
> When I click on the connection anchor of an EditPart I can return my own
> DragTracker in EditPart#getDragTracker. This works fine with the
> ConnectionDragCreationTool. But know I want to use the
> ConnectionCreationTool but it doesn't work the way it works from within
the
> palette (click on source -> move mouse and see connection -> click on
> target -> connection is created).
>
> Any hints?
>
> Thanks,
> Gunnar
>
>
Re: Simulate ConnectionCreationTool from within EditPart [message #85435 is a reply to message #85262] Thu, 26 June 2003 02:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: g.wagenknecht.intershop.de

Randy Hudson wrote:

> I don't really understand what you are showing/want to show the user.

Sorry, I just want that the user doesn't need to activate the
ConnectionCreationTool in the palette separately. Instead he should easily
start creating a connection bei clicking on the connection anchor figure and
then draw the connection and click again over the target connection anchor.

Another way is the ConnectionDragCreationTool but I'd like to have a unique
usabillity. I prefer "click -> move -> click" than "press -> drag ->
release".

> You want them to be able to click somewhere, and the connection
> creation tool is immediately activated and is now waiting for the
> second click?

Exactly.

> Do you have some kind of button that is pressed to
> enter connection creation mode?

Not really, I only check if the SelectionRequest was done over the
connection anchor figure.

> You'll probably have to subclass AbstractConnectionCrationTool,
> and load your custom tool on mouseUp on that button.

I thought I could directly use ConnectionCreationTool...

Cu, Gunnar
Re: Simulate ConnectionCreationTool from within EditPart [message #85965 is a reply to message #85435] Sun, 29 June 2003 08:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi
You can create a class that extends ConnectionCreationTool and implements
DragTracker. Once the getDragTracker method is called in your editpart, you
can return the class you created if the user pressed the mouse over the
connection anchor.
"Gunnar Wagenknecht" <g.wagenknecht@intershop.de> wrote in message
news:bde495$kvr$1@rogue.oti.com...
> Randy Hudson wrote:
>
> > I don't really understand what you are showing/want to show the user.
>
> Sorry, I just want that the user doesn't need to activate the
> ConnectionCreationTool in the palette separately. Instead he should easily
> start creating a connection bei clicking on the connection anchor figure
and
> then draw the connection and click again over the target connection
anchor.
>
> Another way is the ConnectionDragCreationTool but I'd like to have a
unique
> usabillity. I prefer "click -> move -> click" than "press -> drag ->
> release".
>
> > You want them to be able to click somewhere, and the connection
> > creation tool is immediately activated and is now waiting for the
> > second click?
>
> Exactly.
>
> > Do you have some kind of button that is pressed to
> > enter connection creation mode?
>
> Not really, I only check if the SelectionRequest was done over the
> connection anchor figure.
>
> > You'll probably have to subclass AbstractConnectionCrationTool,
> > and load your custom tool on mouseUp on that button.
>
> I thought I could directly use ConnectionCreationTool...
>
> Cu, Gunnar
>
>
Re: Simulate ConnectionCreationTool from within EditPart [message #86054 is a reply to message #85965] Mon, 30 June 2003 01:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: g.wagenknecht.intershop.de

Yoav Rubin wrote:

> You can create a class that extends ConnectionCreationTool and
> implements DragTracker. Once the getDragTracker method is called in
> your editpart, you can return the class you created if the user
> pressed the mouse over the connection anchor.

Yes I know but this didn't give the result I wanted.

Cu, Gunnar
Re: Simulate ConnectionCreationTool from within EditPart [message #86082 is a reply to message #86054] Mon, 30 June 2003 03:11 Go to previous message
Eclipse UserFriend
I did in my app the same thing with connections and it took me some time to
make it work correctly, but this is the only way i found to make this behave
the way i wanted. i needed also to override the handleButtonDown method, to
either start or finish the connection creation, also the method getCommand,
because there were cases that the super implementation for it didn't behave
all the time properly. Moreover, after the connection creation was finished,
i needed to reset the selection and the active tool in the edit domain.

"Gunnar Wagenknecht" <g.wagenknecht@intershop.de> wrote in message
news:bdoisc$uen$1@rogue.oti.com...
> Yoav Rubin wrote:
>
> > You can create a class that extends ConnectionCreationTool and
> > implements DragTracker. Once the getDragTracker method is called in
> > your editpart, you can return the class you created if the user
> > pressed the mouse over the connection anchor.
>
> Yes I know but this didn't give the result I wanted.
>
> Cu, Gunnar
>
>
Previous Topic:Rendering HTML with draw2d.text
Next Topic:Urgent help needed!! Removing component
Goto Forum:
  


Current Time: Sat May 03 07:10:35 EDT 2025

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

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

Back to the top