List of usage examples for java.awt.event MouseWheelEvent isMetaDown
public boolean isMetaDown()
From source file:savant.view.swing.GraphPane.java
/** * {@inheritDoc}/*from w ww.j av a 2 s . c om*/ */ @Override public void mouseWheelMoved(MouseWheelEvent e) { int notches = e.getWheelRotation(); LocationController lc = LocationController.getInstance(); if (MiscUtils.MAC && e.isMetaDown() || e.isControlDown()) { if (notches < 0) { lc.shiftRangeLeft(); } else { lc.shiftRangeRight(); } } else { if (InterfaceSettings.doesWheelZoom()) { if (notches < 0) { lc.zoomInOnMouse(); } else { lc.zoomOutFromMouse(); } } else { JScrollBar sb = getVerticalScrollBar(); if (sb.isVisible()) { sb.setValue(sb.getValue() + notches * 15); } } } }