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 98272 Details for
Bug 229726
Improvements to auto-scrolling behavior in GEF
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Add feedback to auto-scrolling in DragEditPartsTracker.
DragEditPartsTrackerPatch.txt (text/plain), 3.10 KB, created by
Cherie Revells
on 2008-04-30 17:24:11 EDT
(
hide
)
Description:
Add feedback to auto-scrolling in DragEditPartsTracker.
Filename:
MIME Type:
Creator:
Cherie Revells
Created:
2008-04-30 17:24:11 EDT
Size:
3.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gef >Index: src/org/eclipse/gef/tools/DragEditPartsTracker.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.gef/src/org/eclipse/gef/tools/DragEditPartsTracker.java,v >retrieving revision 1.54 >diff -u -r1.54 DragEditPartsTracker.java >--- src/org/eclipse/gef/tools/DragEditPartsTracker.java 21 Dec 2007 19:28:47 -0000 1.54 >+++ src/org/eclipse/gef/tools/DragEditPartsTracker.java 30 Apr 2008 21:20:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -18,13 +18,17 @@ > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.KeyEvent; > import org.eclipse.swt.graphics.Cursor; >+import org.eclipse.swt.widgets.Control; > >+import org.eclipse.draw2d.FigureCanvas; > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.PositionConstants; >+import org.eclipse.draw2d.Viewport; > import org.eclipse.draw2d.geometry.Dimension; > import org.eclipse.draw2d.geometry.Point; > import org.eclipse.draw2d.geometry.PrecisionPoint; > import org.eclipse.draw2d.geometry.PrecisionRectangle; >+import org.eclipse.draw2d.geometry.Rectangle; > > import org.eclipse.gef.AutoexposeHelper; > import org.eclipse.gef.EditPart; >@@ -349,10 +353,43 @@ > showTargetFeedback(); > showSourceFeedback(); > setCurrentCommand(getCommand()); >+ >+ // Expose the diagram as the user scrolls in the area handled by the >+ // autoexpose helper. >+ updateAutoexposeHelper(); > } > return true; > } > >+protected Cursor calculateCursor() { >+ if (isInState(STATE_DRAG_IN_PROGRESS) >+ || isInState(STATE_ACCESSIBLE_DRAG_IN_PROGRESS)) { >+ >+ // Give some feedback so the user knows the area where autoscrolling >+ // will occur. >+ if (getAutoexposeHelper() != null) { >+ return SharedCursors.HAND; >+ } else { >+ >+ // Give some feedback so the user knows that they can't drag >+ // outside the viewport. >+ Control control = getCurrentViewer().getControl(); >+ if (control instanceof FigureCanvas) { >+ Viewport viewport = ((FigureCanvas) control).getViewport(); >+ Rectangle rect = Rectangle.SINGLETON; >+ viewport.getClientArea(rect); >+ viewport.translateToParent(rect); >+ viewport.translateToAbsolute(rect); >+ >+ if (!rect.contains(getLocation())) { >+ return getDisabledCursor(); >+ } >+ } >+ } >+ } >+ return super.calculateCursor(); >+} >+ > /** > * Calls {@link TargetingTool#updateAutoexposeHelper()} if a drag is in progress. > * @see org.eclipse.gef.tools.TargetingTool#handleHover()
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 229726
:
98271
| 98272