public void mouseWheelMoved(MouseWheelEvent e) { double f = e.getWheelRotation() * 0.2; zoom(f, e.getPoint()); }
public void handleWheel(final MouseWheelEvent event) { if (parent == null || !canvasBounds.contains(event.getPoint())) { return; } event.consume(); clientThread.invoke(() -> { if (isHidden()) { return; } scrollTab(event.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; }
@Override public void mouseWheelMoved(MouseWheelEvent e) { zoom(Math.pow(1.5,-1 * e.getWheelRotation()), e.getPoint()); } });
public void mouseWheelMoved(MouseWheelEvent e) { lastMousePressPoint = e.getPoint(); zoomToMousePosition((byte) -e.getWheelRotation()); }
@Override public void mouseWheelMoved(final MouseWheelEvent e) { scaleWithStableMouse(-WHEEL_ZOOM_STEP * e.getWheelRotation(), e.getPoint()); Component lc = findComponentAt(eventsTarget, e.getPoint()); if (lc != null) { Point lpt = convertPoint(e.getPoint(), lc); MouseWheelListener[] mlisteners = lc.getMouseWheelListeners(); if (mlisteners != null) { for (int i = 0; i < mlisteners.length; i++) { mlisteners[i].mouseWheelMoved(cloneMouseWheelEvent(e, lc, lpt)); } } configureCursor(lc); } }
@Override public void mouseWheelMoved(MouseWheelEvent e) { if (e.isConsumed()) { return; } Point2D.Double mouseLoc = new Point2D.Double(e.getPoint().x, e.getPoint().y); // ensure the point is within the window RectangularShape bounds = component.getBounds(); mouseLoc.x = Math.max(mouseLoc.x, bounds.getMinX()); mouseLoc.x = Math.min(mouseLoc.x, bounds.getMaxX()); mouseLoc.y = Math.max(mouseLoc.y, bounds.getMinY()); mouseLoc.y = Math.min(mouseLoc.y, bounds.getMaxY()); zoomPoint(component, component.toGraphicCoordinate(mouseLoc), (e.getWheelRotation() > 0) ? 1.05 : 0.95); }
public void mouseWheelMoved(MouseWheelEvent e) { double notches = e.getPreciseWheelRotation(); double zoomFactor = Math.abs(notches) * 2; if (notches > 0 && zoomFactor > 0) zoomFactor = 1.0 / zoomFactor; panel().zoom(toModel(e.getPoint()), zoomFactor); }
public void mouseWheelMoved(MouseWheelEvent e) { if (onlyShift(e) && treeTable.columnAtPoint(e.getPoint()) == 0) { scroll(scrollBar, e); } else { listener.mouseWheelMoved(e); } treeTable.mouseWheelMoved(e); } });
/** * @see java.awt.event.MouseWheelListener#mouseWheelMoved(java.awt.event.MouseWheelEvent) */ public void mouseWheelMoved(MouseWheelEvent e) { Display display = (Display)e.getComponent(); if(atPointer) m_point = e.getPoint(); else { m_point.x = display.getWidth()/2; m_point.y = display.getHeight()/2; } if(inverted) zoom(display, m_point, 1 - 0.1f * e.getWheelRotation(), false); else zoom(display, m_point, 1 + 0.1f * e.getWheelRotation(), false); }
protected void translateMouseWheelEvent(MouseWheelEvent e) { publishMouseWheelEvent(e.getID(), e.getWhen(), e.getModifiers(), e.getWheelRotation(), e.getPoint()); } }
@Override public void mouseWheelMoved(MouseWheelEvent e) { if (mouseWheelScrolling) { // Only scroll if actually on tabs area int index = tabs.indexAtLocation(e.getX(), e.getY()); if (mouseWheelScrollingAnywhere || index != -1 || isNearLastTab(e.getPoint())) { if (e.getWheelRotation() < 0) { setSelectedPrevious(); } else if (e.getWheelRotation() > 0) { setSelectedNext(); } } } } });
@Override public void mouseWheelMoved(MouseWheelEvent e) { if (mySettingsProvider.enableMouseReporting() && isRemoteMouseAction(e)) { mySelection = null; Point p = panelToCharCoords(e.getPoint()); listener.mouseWheelMoved(p.x, p.y, e); } } });
/** * {@inheritDoc} */ @Override public void mouseWheelMoved( final MouseWheelEvent aEvent ) { // Convert to the component under the mouse-cursor... Component view = this.controller.getViewComponent(); Point newPoint = SwingUtilities.convertPoint( aEvent.getComponent(), aEvent.getPoint(), view ); // Dispatch the actual zooming to the zoom controller... this.zoomController.zoom( aEvent.getWheelRotation(), newPoint ); aEvent.consume(); } }
public void mouseWheelMoved(MouseWheelEvent e) { if (onlyShift(e)) { int c = table.columnAtPoint(e.getPoint()); int _c = c == -1 ? -1 : table.convertColumnIndexToModel(c); if (_c != -1 && table.isScrollableColumn(_c)) { JScrollBar scroller = getScroller(_c); if (scroller != null) scroll(scroller, e); return; } } listener.mouseWheelMoved(e); } });
public static void addFontResizeOnScroll(Component scrollPane) { scrollPane.addMouseWheelListener(event -> { if (event.isMetaDown()) { final int unitsToScroll = -event.getUnitsToScroll(); changeFontSize(getDeepestComponent(scrollPane, event.getPoint()), unitsToScroll); } }); }
@Override public void mouseWheelMoved(MouseWheelEvent e) { Point componentPoint = SwingUtilities.convertPoint( scrollPane, e.getPoint(), parentPanel); parentPanel.dispatchEvent(new MouseWheelEvent(parentPanel, e.getID(), e.getWhen(), e.getModifiers(), componentPoint.x, componentPoint.y, e.getClickCount(), e.isPopupTrigger(), e.getScrollType(), e.getScrollAmount(), e.getWheelRotation())); }
public void mouseWheelMoved(MouseWheelEvent e) { if (isDragging) { Component target = documentViewController.getViewPort().getView(); Point p = SwingUtilities.convertPoint(e.getComponent(), e.getPoint(), target); MouseEvent m = new MouseEvent(target, 0, e.getWhen(), e.getModifiers(), p.x, p.y, e.getClickCount(), e.isPopupTrigger(), e.getButton()); mouseDragged(m); } }