This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 101523
Collapse All | Expand All

(-)graph/lib/apichanges.xml (+13 lines)
Lines 137-142 Link Here
137
            <class package="org.netbeans.api.visual.widget" name="Widget" link="yes"/>
137
            <class package="org.netbeans.api.visual.widget" name="Widget" link="yes"/>
138
            <issue number="98307"/>
138
            <issue number="98307"/>
139
        </change>
139
        </change>
140
141
        <change>
142
            <api name="general"/>
143
            <summary>Mouse dragging event processing improved</summary>
144
            <version major="2" minor="3"/>
145
            <date day="28" month="5" year="2007"/>
146
            <author login="dkaspar"/>
147
            <compatibility addition="yes"/>
148
            <description>
149
                Mouse dragging event processing improved. MoveAction and others are now smoothly scrolling a view.
150
            </description>
151
            <issue number="101523"/>
152
        </change>
140
    </changes>
153
    </changes>
141
154
142
    <htmlcontents>
155
    <htmlcontents>
(-)graph/lib/manifest.mf (-1 / +1 lines)
Lines 1-4 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.api.visual
2
OpenIDE-Module: org.netbeans.api.visual
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visual/resources/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visual/resources/Bundle.properties
4
OpenIDE-Module-Specification-Version: 2.1
4
OpenIDE-Module-Specification-Version: 2.3
(-)graph/lib/src/org/netbeans/api/visual/widget/SceneComponent.java (-3 / +30 lines)
Lines 34-44 Link Here
34
 */
34
 */
35
final class SceneComponent extends JComponent implements MouseListener, MouseMotionListener, KeyListener, MouseWheelListener,FocusListener, DropTargetListener {
35
final class SceneComponent extends JComponent implements MouseListener, MouseMotionListener, KeyListener, MouseWheelListener,FocusListener, DropTargetListener {
36
36
37
    private static final int AUTO_SHIFT = 32;
38
37
    private Scene scene;
39
    private Scene scene;
38
    private Widget lockedWidget;
40
    private Widget lockedWidget;
39
    private WidgetAction lockedAction;
41
    private WidgetAction lockedAction;
40
    private long eventIDcounter = 0;
42
    private long eventIDcounter = 0;
41
    private AccessibleContext accessibleContext;
43
    private AccessibleContext accessibleContext;
44
    private Point shiftedMouseLocation = new Point ();
42
45
43
    public SceneComponent (Scene scene) {
46
    public SceneComponent (Scene scene) {
44
        this.scene = scene;
47
        this.scene = scene;
Lines 208-214 Link Here
208
    }
211
    }
209
212
210
    private WidgetAction.State processLocationOperator (Operator operator, WidgetAction.WidgetLocationEvent event) {
213
    private WidgetAction.State processLocationOperator (Operator operator, WidgetAction.WidgetLocationEvent event) {
211
        event.setPoint (scene.convertViewToScene (event.getPoint ()));
214
        Point viewPoint = event.getPoint ();
215
        Point oldScenePoint = scene.convertViewToScene (viewPoint);
216
        Point scenePoint = new Point (oldScenePoint);
217
        scenePoint.translate (- shiftedMouseLocation.x, - shiftedMouseLocation.y);
218
        event.setPoint (scenePoint);
212
219
213
        WidgetAction.State state;
220
        WidgetAction.State state;
214
        Point location;
221
        Point location;
Lines 244-252 Link Here
244
        lockedAction = state.getLockedAction ();
251
        lockedAction = state.getLockedAction ();
245
        scene.validate ();
252
        scene.validate ();
246
253
247
        if (lockedWidget != null)
254
        if (lockedWidget != null) {
255
            Point previousScreenLocation = getLocationOnScreen ();
248
            scrollRectToVisible (scene.convertSceneToView (lockedWidget.convertLocalToScene (lockedWidget.getBounds ())));
256
            scrollRectToVisible (scene.convertSceneToView (lockedWidget.convertLocalToScene (lockedWidget.getBounds ())));
249
257
            Point newScreenLocation = getLocationOnScreen ();
258
            Point newViewPoint = new Point (viewPoint);
259
            newViewPoint.translate (- (newScreenLocation.x - previousScreenLocation.x), - (newScreenLocation.y - previousScreenLocation.y));
260
            Point newScenePoint = scene.convertViewToScene (newViewPoint);
261
            shiftedMouseLocation.x += newScenePoint.x - oldScenePoint.x;
262
            shiftedMouseLocation.y += newScenePoint.y - oldScenePoint.y;
263
            if (operator == Operator.MOUSE_DRAGGED) {
264
                Rectangle visibleRect = getVisibleRect ();
265
                if (viewPoint.x < visibleRect.x)
266
                    shiftedMouseLocation.x += AUTO_SHIFT;
267
                else if (viewPoint.x >= visibleRect.x + visibleRect.width)
268
                    shiftedMouseLocation.x -= AUTO_SHIFT;
269
                if (viewPoint.y < visibleRect.y)
270
                    shiftedMouseLocation.y += AUTO_SHIFT;
271
                else if (viewPoint.y >= visibleRect.y + visibleRect.width)
272
                    shiftedMouseLocation.y -= AUTO_SHIFT;
273
            }
274
        } else
275
            shiftedMouseLocation.x = shiftedMouseLocation.y = 0;
276
            
250
        return state;
277
        return state;
251
    }
278
    }
252
279

Return to bug 101523