Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 55918 Details for
Bug 168582
Support extending of ViewportAutoexposeHelper to allow scrolling outside the viewport
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Suggested fix.
168582AutoexposePatch.txt (text/plain), 4.47 KB, created by
Cherie Revells
on 2006-12-19 13:52:11 EST
(
hide
)
Description:
Suggested fix.
Filename:
MIME Type:
Creator:
Cherie Revells
Created:
2006-12-19 13:52:11 EST
Size:
4.47 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gef >Index: src/org/eclipse/gef/tools/TargetingTool.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/src/org/eclipse/gef/tools/TargetingTool.java,v >retrieving revision 1.20 >diff -u -r1.20 TargetingTool.java >--- src/org/eclipse/gef/tools/TargetingTool.java 9 Feb 2006 22:11:07 -0000 1.20 >+++ src/org/eclipse/gef/tools/TargetingTool.java 19 Dec 2006 18:51:28 -0000 >@@ -88,9 +88,9 @@ > * than the time required to perform the step(). > */ > protected void doAutoexpose() { >- if (exposeHelper == null) >+ if (getAutoexposeHelper() == null) > return; >- if (exposeHelper.step(getLocation())) { >+ if (getAutoexposeHelper().step(getLocation())) { > handleAutoexpose(); > Display.getCurrent().asyncExec(new QueuedAutoexpose()); > } else >@@ -289,7 +289,7 @@ > > class QueuedAutoexpose implements Runnable { > public void run() { >- if (exposeHelper != null) >+ if (getAutoexposeHelper() != null) > doAutoexpose(); > } > } >@@ -309,6 +309,15 @@ > } > > /** >+ * Gets the autoexpose helper. >+ * @return the autoexpose helper >+ * @since 3.3 >+ */ >+protected AutoexposeHelper getAutoexposeHelper() { >+ return exposeHelper; >+} >+ >+/** > * Sets the target editpart. If the target editpart is changing, this method will call > * {@link #handleExitingEditPart()} for the previous target if not <code>null</code>, and > * {@link #handleEnteredEditPart()} for the new target, if not <code>null</code>. >@@ -358,7 +367,7 @@ > * mouse location and calls {@link #setAutoexposeHelper(AutoexposeHelper)}. > */ > protected void updateAutoexposeHelper() { >- if (exposeHelper != null) >+ if (getAutoexposeHelper() != null) > return; > AutoexposeHelper.Search search; > search = new AutoexposeHelper.Search(getLocation()); >Index: src/org/eclipse/gef/editparts/ViewportAutoexposeHelper.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/src/org/eclipse/gef/editparts/ViewportAutoexposeHelper.java,v >retrieving revision 1.13 >diff -u -r1.13 ViewportAutoexposeHelper.java >--- src/org/eclipse/gef/editparts/ViewportAutoexposeHelper.java 30 Mar 2005 21:27:02 -0000 1.13 >+++ src/org/eclipse/gef/editparts/ViewportAutoexposeHelper.java 19 Dec 2006 18:51:28 -0000 >@@ -80,14 +80,16 @@ > port.getClientArea(rect); > port.translateToParent(rect); > port.translateToAbsolute(rect); >- return rect.contains(where) && !rect.crop(threshold).contains(where); >+ return shouldScroll(rect, where); > } > > /** >- * Returns <code>true</code> if the given point is outside the viewport or near its edge. >- * Scrolls the viewport by a calculated (time based) amount in the current direction. >+ * Returns <code>true</code> if the given point is near the viewport's edge. >+ * Scrolls the viewport by a calculated (time based) amount in the current >+ * direction. > * >- * todo: investigate if we should allow auto expose when the pointer is outside the viewport >+ * todo: investigate if we should allow auto expose when the pointer is outside >+ * the viewport -- this is commented on in bugzilla 44288 > * > * @see org.eclipse.gef.AutoexposeHelper#step(org.eclipse.draw2d.geometry.Point) > */ >@@ -98,9 +100,9 @@ > port.getClientArea(rect); > port.translateToParent(rect); > port.translateToAbsolute(rect); >- if (!rect.contains(where) >- || rect.crop(threshold).contains(where)) >- return false; >+ if (!shouldScroll(rect, where)) { >+ return false; >+ } > > // set scroll offset (speed factor) > int scrollOffset = 0; >@@ -145,4 +147,31 @@ > return "ViewportAutoexposeHelper for: " + owner; //$NON-NLS-1$ > } > >+/** >+ * Returns true if the point is inside the area where auto-scrolling should >+ * occur; false otherwise. >+ * >+ * @param rect >+ * the viewport's client area, translated to absolute coordinates >+ * @param where >+ * the point in question >+ * @return true if the point is inside the area where auto-scrolling should >+ * occur; false otherwise. >+ * @since 3.3 >+ */ >+protected boolean shouldScroll(Rectangle rect, Point where) { >+ return rect.contains(where) && !rect.crop(threshold).contains(where); >+} >+ >+/** >+ * Gets the threshold which is the insets that define where the auto-scrolling >+ * behavior should kick in. >+ * >+ * @return Returns the threshold. >+ * @since 3.3 >+ */ >+protected Insets getThreshold() { >+ return threshold; >+} >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 168582
:
55918
|
56293
|
56331