@Override public void mouseWheelMoved (MouseWheelEvent e) { synchronized (this) { TouchEvent event = usedTouchEvents.obtain(); event.pointer = 0; event.type = TouchEvent.TOUCH_SCROLLED; event.scrollAmount = e.getWheelRotation(); event.timeStamp = System.nanoTime(); touchEvents.add(event); lwjglAwtCanvas.graphics.requestRendering(); } }
@Override public void mouseWheelMoved (MouseWheelEvent e) { synchronized (this) { TouchEvent event = usedTouchEvents.obtain(); event.pointer = 0; event.type = TouchEvent.TOUCH_SCROLLED; event.scrollAmount = e.getWheelRotation(); event.timeStamp = System.nanoTime(); touchEvents.add(event); lwjglAwtCanvas.graphics.requestRendering(); } }
@Override public void mouseWheelMoved(MouseWheelEvent e) { setRenderYDelta(e.getWheelRotation()); }
public void mouseWheelMoved(MouseWheelEvent e) { double f = e.getWheelRotation() * 0.2; zoom(f, e.getPoint()); }
TabbedPane(MainWindow window) { this.mainWindow = window; setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); addMouseWheelListener(e -> { int direction = e.getWheelRotation(); int index = getSelectedIndex(); int maxIndex = getTabCount() - 1; if ((index == 0 && direction < 0) || (index == maxIndex && direction > 0)) { index = maxIndex - index; } else { index += direction; } setSelectedIndex(index); }); }
public void handleWheel(final MouseWheelEvent event) { if (parent == null || !canvasBounds.contains(event.getPoint())) { return; } event.consume(); clientThread.invoke(() -> { if (isHidden()) { return; } scrollTab(event.getWheelRotation()); }); }
private MouseWheelEvent translateEvent(MouseWheelEvent e) { Dimension stretchedDimensions = client.getStretchedDimensions(); Dimension realDimensions = client.getRealDimensions(); int newX = (int) (e.getX() / (stretchedDimensions.width / realDimensions.getWidth())); int newY = (int) (e.getY() / (stretchedDimensions.height / realDimensions.getHeight())); return new MouseWheelEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers(), newX, newY, e.getClickCount(), e.isPopupTrigger(), e.getScrollType(), e.getScrollAmount(), e.getWheelRotation()); } }
@Override public MouseWheelEvent mouseWheelMoved(MouseWheelEvent event) { if (!overlay.isMapShown() || isNotWithinOverlay(event.getPoint())) { return event; } int direction = event.getWheelRotation(); if (direction > 0) { plugin.ascendMap(); } else { plugin.descendMap(); } event.consume(); return event; }
int amount = (event.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) ? event.getUnitsToScroll() * scrollBar.getUnitIncrement() : (event.getWheelRotation() < 0 ? -1 : 1) * scrollBar.getBlockIncrement();
@Override public void mouseWheelMoved(MouseWheelEvent e) { if (getActiveSide() != ALL) { if (e.getWheelRotation() < 0) { actionZoomIn(); } else { actionZoomOut(); } } } });
public void mouseWheelMoved(MouseWheelEvent e) { int notches = e.getWheelRotation(); // System.out.println("outx:"+notches); // if (currentDialog != null && currentDialog.equals(MTGDialogs.ChooseCommonDialog)) { // System.out.println("out:"+1); // } }
@Override public void mouseWheelMoved(MouseWheelEvent e) { if (e.getWheelRotation() == 0) { Font font = textArea.getFont(); int size = font.getSize(); if (e.getWheelRotation() > 0) { textArea.setFont(new Font(font.getName(), font.getStyle(), --size >= 8 ? --size : 8)); } else { if (scrollPane.isWheelScrollingEnabled() && e.getWheelRotation() != 0) { JScrollBar toScroll = scrollPane.getVerticalScrollBar(); int direction = e.getWheelRotation() < 0 ? -1 : 1; int orientation = SwingConstants.VERTICAL; if (toScroll == null || !toScroll.isVisible()) { boolean limitScroll = Math.abs(e.getWheelRotation()) == 1; Object fastWheelScroll = toScroll.getClientProperty("JScrollBar.fastWheelScrolling"); if (Boolean.TRUE == fastWheelScroll && comp instanceof Scrollable) {
@Override public void mouseWheelMoved(MouseWheelEvent e) { int notches = e.getWheelRotation(); int index = rows.getSelectedIndex(); if (notches < 0) { if (index > 0) { rows.setSelectedIndex(index - 1); rows.repaint(); } } else if (index < choices.size() - 1) { rows.setSelectedIndex(index + 1); rows.repaint(); } }
@Override public void mouseWheelMoved(MouseWheelEvent e) { if ((e.getWheelRotation() > 0) && (stepX > 1)) { stepX /= 2; if (selection) { selectionIn *= 2; selectionOut *= 2; } } else { stepX *= 2; if (selection) { selectionIn /= 2; selectionOut /= 2; } } updateCurrentTrack(); } });
@Override public void mouseWheelMoved(MouseWheelEvent e) { JTabbedPane tabPane = (JTabbedPane) e.getSource(); int dir = -e.getWheelRotation(); int selIndex = tabPane.getSelectedIndex(); int maxIndex = tabPane.getTabCount() - 1; if ((selIndex == 0 && dir < 0) || (selIndex == maxIndex && dir > 0)) { selIndex = maxIndex - selIndex; } else { selIndex += dir; } if (0 <= selIndex && selIndex < tabPane.getTabCount()) { // Fix #54575: NullPointerException on setSelectedIndex() try { tabPane.setSelectedIndex(selIndex); } catch (NullPointerException err) { LOGGER.error(err, err); } } }
public void mouseWheelMoved(MouseWheelEvent e) { int notches = e.getWheelRotation(); TestbedTest currTest = model.getCurrTest(); if (currTest == null) { return; } ZoomType zoom = notches < 0 ? ZoomType.ZOOM_IN : ZoomType.ZOOM_OUT; currTest.getCamera().zoomToPoint(mouse, zoom); } });
@Override public void mouseWheelMoved(MouseWheelEvent e) { this.mapView.onZoomEvent(); byte zoomLevelDiff = (byte) -e.getWheelRotation(); this.mapView.getModel().mapViewPosition.zoom(zoomLevelDiff); } }
@Override public void mouseWheelMoved(MouseWheelEvent e) { double scaleDelta = 1.0 - (e.getWheelRotation() / 10.0); zoom(scaleDelta, e.getX(), e.getY()); } }
@Override public void mouseWheelMoved(MouseWheelEvent e) { int delta = e.getWheelRotation(); if (delta == 0) return; if (delta > 0) { if (this.invertZoom) zoomOut(delta); else zoomIn(delta); } else if (delta < 0) { if (this.invertZoom) zoomIn(delta * -1); else zoomOut(delta * -1); } }
/** * Creates a new event instance for a mouse wheel event. * * @param pane the source map pane * @param event the source mouse wheel event */ public MapMouseEvent(MapPane pane, MouseWheelEvent event) { super( (Component) pane, event.getID(), event.getWhen(), event.getModifiers(), event.getX(), event.getY(), event.getClickCount(), event.isPopupTrigger()); worldCoords = calculateWorldPos(pane, event); isWheelEvent = true; wheelAmount = event.getWheelRotation(); }