Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » back to default 'Select' tool after creating a connection
back to default 'Select' tool after creating a connection [message #204012] Tue, 29 November 2005 18:04 Go to next message
Eclipse UserFriend
Originally posted by: pbeagan.yahoo_dontspamme_.com

Hi, In my editor, a user can create a connection between to objects. When
the second node of the connection is clicked, the connection is created.
At this point GEF still has the Connection tool selected for the user to
create another connection. What do I need to do to make it so the user has
the 'Select' tool after a connection is created? Thanks.
Re: back to default 'Select' tool after creating a connection [message #204292 is a reply to message #204012] Thu, 01 December 2005 19:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

toolEntry.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_ FINISHED,
BOOLEAN.TRUE);

"Patrick" <pbeagan@yahoo_dontspamme_.com> wrote in message
news:dmi4iu$k58$1@news.eclipse.org...
> Hi, In my editor, a user can create a connection between to objects.
> When
> the second node of the connection is clicked, the connection is created.
> At this point GEF still has the Connection tool selected for the user to
> create another connection. What do I need to do to make it so the user
> has
> the 'Select' tool after a connection is created? Thanks.
Re: back to default 'Select' tool after creating a connection [message #204755 is a reply to message #204292] Tue, 06 December 2005 14:19 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Thanks - I just wanted to post the same question!

And I have a related question:

I dislike the behaviour, that I have to first click (and release) on the
first object and then click again on the second one.
In most other drawing applications I have used so far, one creates a
connection by pressing the mouse over the first object and then - while
keeping the mouse-button pressed - moves the mouse over to the second
object and releases the button there, i.e. press mouse button over obj1
=> move (or drag) to obj2 => release mouse button over obj2.

Can that behavior be achieved with a similarly simple modification or
would that require some major code changes?

Michael



"Randy Hudson" <none@us.ibm.com> wrote in message
news:dmnjbk$9mg$1@news.eclipse.org...
> toolEntry.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_ FINISHED,
> BOOLEAN.TRUE);
>
> "Patrick" <pbeagan@yahoo_dontspamme_.com> wrote in message
> news:dmi4iu$k58$1@news.eclipse.org...
>> Hi, In my editor, a user can create a connection between to objects.
>> When
>> the second node of the connection is clicked, the connection is
>> created.
>> At this point GEF still has the Connection tool selected for the user
>> to
>> create another connection. What do I need to do to make it so the
>> user has
>> the 'Select' tool after a connection is created? Thanks.
>
>
Re: back to default 'Select' tool after creating a connection [message #204761 is a reply to message #204755] Tue, 06 December 2005 19:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You bet. Use the ConnectionDragCreationTool as your tool. Call
ToolEntry#setToolClass with that class.

"Michael Moser" <mmo@zurich.ibm.com> wrote in message
news:dn46kn$93r$1@news.eclipse.org...
> Thanks - I just wanted to post the same question!
>
> And I have a related question:
>
> I dislike the behaviour, that I have to first click (and release) on the
> first object and then click again on the second one.
> In most other drawing applications I have used so far, one creates a
> connection by pressing the mouse over the first object and then - while
> keeping the mouse-button pressed - moves the mouse over to the second
> object and releases the button there, i.e. press mouse button over obj1 =>
> move (or drag) to obj2 => release mouse button over obj2.
>
> Can that behavior be achieved with a similarly simple modification or
> would that require some major code changes?
>
> Michael
>
>
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:dmnjbk$9mg$1@news.eclipse.org...
>> toolEntry.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_ FINISHED,
>> BOOLEAN.TRUE);
>>
>> "Patrick" <pbeagan@yahoo_dontspamme_.com> wrote in message
>> news:dmi4iu$k58$1@news.eclipse.org...
>>> Hi, In my editor, a user can create a connection between to objects.
>>> When
>>> the second node of the connection is clicked, the connection is created.
>>> At this point GEF still has the Connection tool selected for the user to
>>> create another connection. What do I need to do to make it so the user
>>> has
>>> the 'Select' tool after a connection is created? Thanks.
>>
>>
>
Re: back to default 'Select' tool after creating a connection [message #204769 is a reply to message #204761] Tue, 06 December 2005 21:16 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
"Randy Hudson" <none@us.ibm.com> wrote in message
news:dn4q7m$a8g$1@news.eclipse.org...
> You bet. Use the ConnectionDragCreationTool as your tool. Call
> ToolEntry#setToolClass with that class.

Wow, that was easy!

I added the line marked <<< to the existing code:
...
// Add (solid-line) connection tool
toolEntry =
new ConnectionCreationToolEntry("Solid connection", ...);
toolEntry.setToolClass(ConnectionDragCreationTool.class); // <<<
added this line
toolGroup.add(toolEntry);

...

But now I get a somewhat odd behaviour, that I can't explain:

When I now draw a connection it at first behaves as desired, i.e. it
draws the connection after releasing the mouse over the second object.
But after that, the mouse-icon for connections (the "plug") remains but
it's now combined with a no-entry sign no matter where I move it on the
canvas. That mouse-cursor only goes away, when the mouse leaves the
drawing canvas (and does not come back - when one re-enters it). So -
apparently, after having temporarily left the canvas the tool is
deselected - at least one can NOT create another connection with it -
but on the palette it's still marked as selected.

Isthis working as designed or is this a bug or did I miss something
here???

Michael
Re: back to default 'Select' tool after creating a connection [message #204832 is a reply to message #204769] Thu, 08 December 2005 03:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> But now I get a somewhat odd behaviour, that I can't explain:
>
> When I now draw a connection it at first behaves as desired, i.e. it draws
> the connection after releasing the mouse over the second object.
> But after that, the mouse-icon for connections (the "plug") remains but
> it's now combined with a no-entry sign no matter where I move it on the
> canvas. That mouse-cursor only goes away, when the mouse leaves the
> drawing canvas (and does not come back - when one re-enters it). So -
> apparently, after having temporarily left the canvas the tool is
> deselected - at least one can NOT create another connection with it - but
> on the palette it's still marked as selected.

Perhaps the tool is staying active? Can you create a second connection? Try
setting the property "unload when finished" to true using similar technique.
Otherwise, it could be a bug like a lingering mouse cursor or something.

> Isthis working as designed or is this a bug or did I miss something
> here???
>
> Michael
>
Re: back to default 'Select' tool after creating a connection [message #204848 is a reply to message #204832] Thu, 08 December 2005 09:14 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Hi again!

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dn89ta$btf$1@news.eclipse.org...
>> But now I get a somewhat odd behaviour, that I can't explain:
>> ...
>
> Perhaps the tool is staying active? Can you create a second
> connection? Try setting the property "unload when finished" to true
> using similar technique. Otherwise, it could be a bug like a lingering
> mouse cursor or something.

It's a strange combination:
The tool is NOT staying active - regardless of whether I add the "unload
when finished" property or not.
But the "plug"-cursor always stays, also regardless of whether "unload
when finished" is there or not. Until one leaves the drawing area by
when the cursor disappears.

I also tested/verified this by adding the line
-----------%<-----------%<-----------
tool.setToolClass(ConnectionDragCreationTool.class);
-----------%<-----------%<-----------

to the GEF example "Shapes" (class: ShapesEditorPaletteFactory, method:
createToolsGroup):
-----------%<-----------%<-----------
...
// Add (solid-line) connection tool
tool = new ConnectionCreationToolEntry("Solid connection",
"Create a solid-line
connection",
new CreationFactory()
{
public Object getNewObject() {
return null;
}

// see
// ShapeEditPart#createEditPolicies()
// this is abused to
// transmit the desired line
// style
public Object getObjectType() {
return Connection.SOLID_CONNECTION;
}
},
ImageDescriptor.createFromFile(ShapesPlugin.class,
"icons/connection_s16.gif"),
ImageDescriptor.createFromFile(ShapesPlugin.class,
"icons/connection_s24.gif"));

// added by MMO:
tool.setToolClass(ConnectionDragCreationTool.class); // <<<<<
// the odd behaviour stays with and without this:
// tool.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINIS HED,
Boolean.TRUE);
toolGroup.add(tool);
...
-----------%<-----------%<-----------

Summarizing: I'ld say this is a bug! Can you reproduce this? If so I'll
enter it in bugzilla...

Michael
Re: back to default 'Select' tool after creating a connection [message #204944 is a reply to message #204848] Thu, 08 December 2005 22:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Go ahead and open it so you'll be CC'ed on the bugzilla.
>
> It's a strange combination:
> The tool is NOT staying active - regardless of whether I add the "unload
> when finished" property or not.
> But the "plug"-cursor always stays, also regardless of whether "unload
> when finished" is there or not. Until one leaves the drawing area by when
> the cursor disappears.
>
> I also tested/verified this by adding the line
> -----------%<-----------%<-----------
> tool.setToolClass(ConnectionDragCreationTool.class);
> -----------%<-----------%<-----------
>
> to the GEF example "Shapes" (class: ShapesEditorPaletteFactory, method:
> createToolsGroup):
> -----------%<-----------%<-----------
> ...
> // Add (solid-line) connection tool
> tool = new ConnectionCreationToolEntry("Solid connection",
> "Create a solid-line connection",
> new CreationFactory()
> {
> public Object getNewObject() {
> return null;
> }
>
> // see
> // ShapeEditPart#createEditPolicies()
> // this is abused to
> // transmit the desired line
> // style
> public Object getObjectType() {
> return Connection.SOLID_CONNECTION;
> }
> },
> ImageDescriptor.createFromFile(ShapesPlugin.class,
> "icons/connection_s16.gif"),
> ImageDescriptor.createFromFile(ShapesPlugin.class,
> "icons/connection_s24.gif"));
>
> // added by MMO:
> tool.setToolClass(ConnectionDragCreationTool.class); // <<<<<
> // the odd behaviour stays with and without this:
> // tool.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINIS HED,
> Boolean.TRUE);
> toolGroup.add(tool);
> ...
> -----------%<-----------%<-----------
>
> Summarizing: I'ld say this is a bug! Can you reproduce this? If so I'll
> enter it in bugzilla...
>
> Michael
>
Re: back to default 'Select' tool after creating a connection [message #204969 is a reply to message #204944] Fri, 09 December 2005 09:16 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=120077

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dnaago$7r8$1@news.eclipse.org...
> Go ahead and open it so you'll be CC'ed on the bugzilla.
Previous Topic:SWTGraphics no longer draws on SWT Canvas in 3.1
Next Topic:EMF and GEF: an interesting but strange result...
Goto Forum:
  


Current Time: Wed Feb 05 13:51:22 GMT 2025

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

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

Back to the top