Example usage for java.awt.event MouseWheelEvent getButton

List of usage examples for java.awt.event MouseWheelEvent getButton

Introduction

In this page you can find the example usage for java.awt.event MouseWheelEvent getButton.

Prototype

public int getButton() 

Source Link

Document

Returns which, if any, of the mouse buttons has changed state.

Usage

From source file:net.sf.mzmine.chartbasics.gui.swing.ChartGestureMouseAdapter.java

@Override
public void mouseWheelMoved(MouseWheelEvent e) {
    if (gestureHandlers == null || gestureHandlers.isEmpty() || !listensFor(Event.MOUSE_WHEEL))
        return;//  w  w w  . j av a  2 s .c  o  m

    if (e.getComponent() instanceof ChartPanel) {
        ChartPanel chartPanel = (ChartPanel) e.getComponent();
        ChartEntity entity = findChartEntity(chartPanel, e);
        ChartGesture.Entity gestureEntity = ChartGesture.getGestureEntity(entity);
        Button button = Button.getButton(e.getButton());

        // handle event
        handleEvent(new ChartGestureEvent(chartPanel, e, entity,
                new ChartGesture(gestureEntity, Event.MOUSE_WHEEL, button)));
    }
}