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 233296
Collapse All | Expand All

(-)api.visual/apichanges.xml (+18 lines)
Lines 772-777 Link Here
772
            <class package="org.netbeans.api.visual.widget" name="Widget"/>
772
            <class package="org.netbeans.api.visual.widget" name="Widget"/>
773
            <issue number="216581"/>
773
            <issue number="216581"/>
774
        </change>
774
        </change>
775
776
        <change>
777
            <api name="general"/>
778
            <summary>Pan action allows change of invoking mouse button</summary>
779
            <version major="2" minor="40"/>
780
            <date day="24" month="7" year="2013"/>
781
            <author login="mantlik"/>
782
            <compatibility addition="yes"/>
783
            <description>
784
                Built-in pan action is using modifiers from <code>Scene.getInputBindings().getZoomActionModifiers()</code> method.
785
		Default value remains <code>MouseEvent.BUTTON2</code>, i.e. mouse wheel, which is compatible with the previous
786
                implementation.
787
            </description>
788
            <class package="org.netbeans.api.visual.laf" name="InputBindings" link="yes"/>
789
            <class package="org.netbeans.modules.visual.action" name="PanAction" link="yes"/>
790
            <issue number="233296"/>
791
        </change>
792
775
    </changes>
793
    </changes>
776
794
777
    <htmlcontents>
795
    <htmlcontents>
(-)api.visual/manifest.mf (-1 / +1 lines)
Lines 1-6 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.39
4
OpenIDE-Module-Specification-Version: 2.40
5
AutoUpdate-Essential-Module: true
5
AutoUpdate-Essential-Module: true
6
6
(-)api.visual/src/org/netbeans/api/visual/laf/InputBindings.java (-1 / +21 lines)
Lines 45-60 Link Here
45
package org.netbeans.api.visual.laf;
45
package org.netbeans.api.visual.laf;
46
46
47
import java.awt.event.KeyEvent;
47
import java.awt.event.KeyEvent;
48
import java.awt.event.MouseEvent;
48
49
49
/**
50
/**
50
 * This represents input bindings e.g. manages modifiers of actions.
51
 * This represents input bindings e.g. manages modifiers of actions.
51
 *
52
 *
52
 * @author David Kaspar
53
 * @author David Kaspar
53
 * @since 2.4
54
 * @since 2.5
54
 */
55
 */
55
public final class InputBindings {
56
public final class InputBindings {
56
57
57
    private int zoomActionModifiers = KeyEvent.CTRL_MASK;
58
    private int zoomActionModifiers = KeyEvent.CTRL_MASK;
59
    private int panActionButton = MouseEvent.BUTTON2;
58
    
60
    
59
    private InputBindings () {
61
    private InputBindings () {
60
    }
62
    }
Lines 78-83 Link Here
78
    }
80
    }
79
81
80
    /**
82
    /**
83
     * Returns mouse button for pan action.
84
     * @return the MouseEvent button code
85
     * @since 2.5
86
     */
87
    public int getPanActionButton () {
88
        return panActionButton;
89
    }
90
91
    /**
92
     * Sets mouse button for pan action.
93
     * @param panActionButton MouseEvent button code
94
     * @since 2.5
95
     */
96
    public void setPanActionButton (int panActionButton) {
97
        this.panActionButton = panActionButton;
98
    }
99
100
    /**
81
     * Creates a new input bindings. This is usually used by the Scene class only.
101
     * Creates a new input bindings. This is usually used by the Scene class only.
82
     * @return the input bindings
102
     * @return the input bindings
83
     * @since 2.4
103
     * @since 2.4
(-)api.visual/src/org/netbeans/modules/visual/action/PanAction.java (-1 / +1 lines)
Lines 67-74 Link Here
67
    public State mousePressed (Widget widget, WidgetMouseEvent event) {
67
    public State mousePressed (Widget widget, WidgetMouseEvent event) {
68
        if (isLocked ())
68
        if (isLocked ())
69
            return State.createLocked (widget, this);
69
            return State.createLocked (widget, this);
70
        if (event.getButton () == MouseEvent.BUTTON2) {
71
            scene = widget.getScene ();
70
            scene = widget.getScene ();
71
        if (event.getButton () == scene.getInputBindings().getPanActionButton()) {
72
            scrollPane = findScrollPane (scene.getView ());
72
            scrollPane = findScrollPane (scene.getView ());
73
            if (scrollPane != null) {
73
            if (scrollPane != null) {
74
                lastLocation = scene.convertSceneToView (widget.convertLocalToScene (event.getPoint ()));
74
                lastLocation = scene.convertSceneToView (widget.convertLocalToScene (event.getPoint ()));

Return to bug 233296