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.
<class package="org.netbeans.api.visual.widget" name="Widget"/>
<issue number="216581"/>
</change>
<change>
<api name="general"/>
<summary>Pan action allows change of invoking mouse button</summary>
<version major="2" minor="40"/>
<date day="24" month="7" year="2013"/>
<author login="mantlik"/>
<compatibility addition="yes"/>
<description>
Built-in pan action is using modifiers from <code>Scene.getInputBindings().getZoomActionModifiers()</code> method.
Default value remains <code>MouseEvent.BUTTON2</code>, i.e. mouse wheel, which is compatible with the previous
implementation.
</description>
<class package="org.netbeans.api.visual.laf" name="InputBindings" link="yes"/>
<class package="org.netbeans.modules.visual.action" name="PanAction" link="yes"/>
<issue number="233296"/>
</changes>
<htmlcontents>
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.api.visual
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visual/resources/Bundle.properties
OpenIDE-Module-Specification-Version: 2.39
OpenIDE-Module-Specification-Version: 2.40
AutoUpdate-Essential-Module: true
package org.netbeans.api.visual.laf;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
/**
* This represents input bindings e.g. manages modifiers of actions.
*
* @author David Kaspar
* @since 2.4
* @since 2.5
*/
public final class InputBindings {
private int zoomActionModifiers = KeyEvent.CTRL_MASK;
private int panActionButton = MouseEvent.BUTTON2;
private InputBindings () {
}
* Returns mouse button for pan action.
* @return the MouseEvent button code
public int getPanActionButton () {
return panActionButton;
* Sets mouse button for pan action.
* @param panActionButton MouseEvent button code
public void setPanActionButton (int panActionButton) {
this.panActionButton = panActionButton;
* Creates a new input bindings. This is usually used by the Scene class only.
* @return the input bindings
public State mousePressed (Widget widget, WidgetMouseEvent event) {
if (isLocked ())
return State.createLocked (widget, this);
if (event.getButton () == MouseEvent.BUTTON2) {
scene = widget.getScene ();
if (event.getButton () == scene.getInputBindings().getPanActionButton()) {
scrollPane = findScrollPane (scene.getView ());
if (scrollPane != null) {
lastLocation = scene.convertSceneToView (widget.convertLocalToScene (event.getPoint ()));