List of usage examples for java.awt.event MouseWheelEvent getComponent
public Component getComponent()
From source file:Main.java
void saySomething(String eventDescription, MouseWheelEvent e) { textArea.append(e.getComponent().getClass().getName() + ": " + eventDescription); textArea.setCaretPosition(textArea.getDocument().getLength()); }
From source file:events.MouseWheelEventDemo.java
void eventOutput(String eventDescription, MouseWheelEvent e) { textArea.append(e.getComponent().getClass().getName() + ": " + eventDescription); textArea.setCaretPosition(textArea.getDocument().getLength()); }
From source file:api3.transform.PlotWave.java
private MouseWheelListener addZoomWheel() { return new MouseWheelListener() { private void zoomChartAxis(ChartPanel chartP, boolean increase) { int width = chartP.getMaximumDrawWidth() - chartP.getMinimumDrawWidth(); int height = chartP.getMaximumDrawHeight() - chartP.getMinimumDrawWidth(); if (increase) { chartP.zoomInDomain(width / 2, height / 2); } else { chartP.zoomOutDomain(width / 2, height / 2); }//from w w w .ja v a2 s . c om lastValue = SLIDER_DEFAULT_VALUE; slider.setValue(lastValue); } public synchronized void decreaseZoom(JComponent chart, boolean saveAction) { ChartPanel ch = (ChartPanel) chart; zoomChartAxis(ch, false); } public synchronized void increaseZoom(JComponent chart, boolean saveAction) { ChartPanel ch = (ChartPanel) chart; zoomChartAxis(ch, true); } @Override public void mouseWheelMoved(MouseWheelEvent e) { if (e.getScrollType() != MouseWheelEvent.WHEEL_UNIT_SCROLL) { return; } if (e.getWheelRotation() < 0) { increaseZoom((ChartPanel) e.getComponent(), true); } else { decreaseZoom((ChartPanel) e.getComponent(), true); } } }; }
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 . com*/ 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))); } }
From source file:processing.app.EditorTab.java
public void mouseWheelMoved(MouseWheelEvent e) { if (e.isControlDown()) { if (e.getWheelRotation() < 0) { editor.base.handleFontSizeChange(1); } else {/* ww w .j a v a 2 s. c om*/ editor.base.handleFontSizeChange(-1); } } else { e.getComponent().getParent().dispatchEvent(e); } }