Bug 168582 - Support extending of ViewportAutoexposeHelper to allow scrolling outside the viewport
Summary: Support extending of ViewportAutoexposeHelper to allow scrolling outside the ...
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.2 (Callisto SR2)   Edit
Assignee: Cherie Revells CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 168203
  Show dependency tree
 
Reported: 2006-12-19 13:49 EST by Cherie Revells CLA
Modified: 2008-09-18 13:26 EDT (History)
1 user (show)

See Also:


Attachments
Suggested fix. (4.47 KB, patch)
2006-12-19 13:52 EST, Cherie Revells CLA
no flags Details | Diff
Add getAutoexposeHelper() method. (712 bytes, patch)
2007-01-02 13:52 EST, Cherie Revells CLA
no flags Details | Diff
Updated with new comments (730 bytes, patch)
2007-01-03 09:23 EST, Cherie Revells CLA
ahunter.eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cherie Revells CLA 2006-12-19 13:49:26 EST
A GMF client application would like to have autoscrolling support in the tools when dragging the mouse pointer outside the viewport.  We would like to add this support in GMF.  To do this, we need access to the autoexpose helper in the TargetingTool and the ability to change the criteria for when a scroll will occur in the ViewportAutoexposeHelper.

I am attaching patch with the changes.  Alex has already reviewed the code.
Comment 1 Cherie Revells CLA 2006-12-19 13:52:11 EST
Created attachment 55918 [details]
Suggested fix.
Comment 2 Randy Hudson CLA 2006-12-19 14:42:55 EST
FYI-
This request has been made many times. I don't see any real issues with the code changes (patch), but there *is* a problem with the behavior you're trying to acheive:

1) Auto-Scrolling when outside the viewport is not the correct platform behavior. PowerPoint does not do this.  Word doesn't do it.  Window File Explorer doesn't do it. No one does this because of 2):

2) Scrolling outside the viewport is impossible during a DND drop. If the mouse is not over the Canvas, then some other target control is receiving the DND events, therefore the canvas can not be scrolled. This means you're creating two gestures for the user to invoke auto-scrolling.

3) The behavior is not cross-platform. It can not be supported on GTK.

I agree the current behavior is not perfect. But, one way to make it "better", or more like MS Office, File Explorer, not to mention the native SWT widgets during DND (Tree, Table, List, etc.), would be to change the cursor to a NOT sign when outside the canvas.  The user would immediately bring the mouse back inside and find the current trigger area.
Comment 3 Randy Hudson CLA 2006-12-19 14:48:15 EST
There is one other motivation to stick with platform convention.  If bug 106605 is ever fixed in SWT, then GEF will be able to drag from inside a diagram to some other control, like another editor, etc. In that case when the mouse leaves the canvas, it should start looking for external drop targets, rather than.
Comment 4 Cherie Revells CLA 2006-12-20 09:40:57 EST
Yes, there is a chance in the future we may want to support dropping between editors or something like that, so I see how this would limit that.  I have modified the GMF code so that it scrolls when the user is near the border and the cursor changes to the disabled icon when outside the viewport.  However, it is still a bit hard for a user to discover this.  I am going to try to come up with another icon to use as the cursor when near the edge that will show that if you stay near the edge scrolling will occur.
Comment 5 Randy Hudson CLA 2006-12-20 10:01:47 EST
You might have to extend the autoexposehelper API to allow cursor contribution.
Comment 6 Cherie Revells CLA 2007-01-02 13:52:23 EST
Created attachment 56293 [details]
Add getAutoexposeHelper() method.

I would like to implement this in GMF in the way Randy suggests.  When the user drags a shape to the 'critical zone' near the edge of the viewport, the cursor changes to show that something can happen here (i.e. scrolling).  When the user drags a shape outside the viewport, the cursor changes to the disabled icon.

I am implementing this in the DragEditpartTracker in which case I need to be able to know if there is an autoexpose helper that will do the auto-scrolling.  Therefore, I am requesting that a getter for the autoexpose helper be available.
Comment 7 Randy Hudson CLA 2007-01-02 14:12:57 EST
javadoc should read:
 * Returns <code>null</code> or the current autoexpose helper.
+ * @return null or a helper
Comment 8 Cherie Revells CLA 2007-01-03 09:23:41 EST
Created attachment 56331 [details]
Updated with new comments
Comment 9 Cherie Revells CLA 2007-01-03 09:24:25 EST
Anthony, can you commit this when you get a chance?
Comment 10 Anthony Hunter CLA 2007-01-09 14:41:57 EST
Committed patch to HEAD and R32_Maintenance.
Also updated the copyright to indicate change in 2007.