| Summary: | Faulty behavior when using the ConnectionDragCreationTool to create connections | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Michael Moser <mmo> |
| Component: | GEF-Legacy GEF (MVC) | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.2 | ||
| Target Milestone: | 3.2.0 (Callisto) M4 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
The tool is not calling handleFinished() on mouseUp. Note that this would be inappropriate if the tool were functioning as a tracker. Fix is to check if the tool is the active tool, and if it is, call finished. What do you want to happen on mouseup, if the NOT sign is being displayed? Should the tool remain active, or unload itself? Released to HEAD On mouse-up, the tool always finishes. This means it is unloaded unless it is "sticky". BTW, being different just for the sake of it is not good for the user. GEF applications should behave consistently unless there are strong conventions for a specific domain that suggest deviating. Most GEF clients use this form of the connection creation in conjunction with a handle that indicates it can be dragged to connect. re. comment 1 (Should the tool remain active, or unload itself?) this should depend on the PROPERTY_UNLOAD_WHEN_FINISHED setting, i.e. if that's set, it should unload, if not then it should remain active and allow the user to create the next connection. re. comment 3 (... being different just for the sake of it is not good for the user...): Without intending to start a major debate here, but this is exactly the reason, why I wanted to change this behavior in the first place. At least for a windows users like myself it feels quite "unnatural" to have to click twice to create a connection. In all programs I have used so far (with the exception of Visio) the "normal" way to draw a connection is to select the line/connection/connector tool, then click onto the first object, keep the button pressed while moving to the second (during which time a line is normaly shown starting at the first object and following the mouse cursor) and release the mouse button over the second object (after which the connection is created and made permanent). I don't think it is a very good idea, if GEF-based applications try to set or impose a different "standard" how to draw connections (esp. if that differs from the platform's de-facto standard), but since not everybody might agree, in my app I wanted to make this user-choosable anyway via a preference setting. Therefore IMHO it should be as easy as possible for a programmer to provide both variants and let the user decide. Just having to select a different Connection...CreationTool class would be exactly such a way and so I had hoped, that just setting the toolclass to ConnectionDragCreationTool would be all that is required. > re. comment 1 (Should the tool remain active, or unload itself?) > this should depend on the PROPERTY_UNLOAD_WHEN_FINISHED setting, i.e. if that's > set, it should unload, if not then it should remain active and allow the user So, it should unload even if no connection was created. I think it will do this now. > re. comment 3 (... being different just for the sake of it is not good for the > user...): > Without intending to start a major debate here, but this is exactly the reason, > why I wanted to change this behavior in the first place. At least for a windows > users like myself it feels quite "unnatural" to have to click twice to create a > connection. In all programs I have used so far (with the exception of Visio) > the "normal" way to draw a connection is to select the > line/connection/connector tool, then click onto the first object, keep the > button pressed while moving to the second (during which time a line is normaly > shown starting at the first object and following the mouse cursor) and release > the mouse button over the second object (after which the connection is created > and made permanent). My guess is these other program are just drawing lines, like powerpoint or word. Consider the following scenarios: 1) The target and source are not both visible in the editor. The user must scroll, expand, or click, on some UI to get to the target for the connection. 2) When clicking on the source or target, a popup menu is displayed showing possible sources (such as different events) or targets (such as methods/ports), for the user to select as part of defining the connection. 3) The connection creation is initiated from the context menu. For example, right click on a node and say "connect to". The button can not be held down when selecting from the menu. It's just a mouse click. Anyway, GEF aims to please and we have given you the rope you need :-). > My guess is these other program are just drawing lines, like powerpoint or word. Yes, these too, but I also worked with misc. generations of Rational products, TogetherSoft's UML tool, etc. In all those the type of connections is determined BEFORE drawing the connection by selecting the appropriate tool. Others I recall would pop up a dialog AFTER completing the connection asking for additionally required info (such as port numbers, etc.). > ... we have given you the rope you need ... YES! and I will now go and hang myself. :-) But I very much appreciate your support in providing all required tools! |
When using the ConnectionDragCreationTool to create connections the behavior is buggy: After creating a connection (i.e. after releasing the mouse button) the "plug"-cursor remains or rather: it is changed into a plug plus a no-entry sign. That plug-plus-no-entry remains regardless of whether the "unload when finished" property is specified or not. When leaving and re-entering the canvas the normal pointer/arrow cursor is shown. But with that pointer one can NOT select anything, rather the connection tool is still shown as active, but one can not create a new connection, either. One first has to click into the palette to either select the Select or the Connection tool before things are back to normal. So, something's definitely buggy here... Besides my own application 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_FINISHED, Boolean.TRUE); toolGroup.add(tool); ... -----------%<-----------%<----------- This is on eclipse 3.2M2 and with both, GEF 3.1.1 and 3.2M3. This is under Windows XP and I tried also both, JDK 1.4.2 and 1.5.0. Michael