Package java.awt.event

Examples of java.awt.event.MouseWheelEvent


      if (action.equals(".") || action.equals(",")) {
        Point mouse = nc.getMousePosition();
        if (mouse == null)
          mouse = new Point((int) nc.getBounds().getCenterX(),
              (int) nc.getBounds().getCenterY());
        MouseWheelEvent we = new MouseWheelEvent(nc, e.getID(), e
            .getWhen(), e.getModifiers(), mouse.x, mouse.y, 0,
            false, MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, action
                .equals(",") ? -1 : 1);
        mouseWheelMoved(we);
      } else {
View Full Code Here


            if (amount == -1) {
                type = MouseWheelEvent.WHEEL_BLOCK_SCROLL;
                amount = 1;
            }
        }
        return new MouseWheelEvent(src, event.getEventId(),
                event.getTime(), event.getInputModifiers(),
                where.x, where.y, 0, false, type, amount,
                event.getWheelRotation());
    }
View Full Code Here

                eventProcessed = true;
            }

        });

        scrollPane.processEvent(new MouseWheelEvent(scrollPane,
                                              MouseEvent.MOUSE_WHEEL,
                                              0l, 0, 100, 200, 0, false,
                                              MouseWheelEvent.WHEEL_BLOCK_SCROLL,
                                              10, 10));
        assertTrue(eventProcessed);
View Full Code Here

        robot.mouseWheel(scroll);
        robot.delay(1000);
        assertNotNull(mouseEvent);
        assertTrue(mouseEvent instanceof MouseWheelEvent);
        assertEquals(MouseEvent.MOUSE_WHEEL, mouseEvent.getID());
        MouseWheelEvent mwe = (MouseWheelEvent) mouseEvent;
        assertEquals(sgn(scroll), sgn(mwe.getWheelRotation()));
    }
View Full Code Here

            if (amount == -1) {
                type = MouseWheelEvent.WHEEL_BLOCK_SCROLL;
                amount = 1;
            }
        }
        return new MouseWheelEvent(src, event.getEventId(),
                event.getTime(), event.getInputModifiers(),
                where.x, where.y, 0, false, type, amount,
                event.getWheelRotation());
    }
View Full Code Here

                eventProcessed = true;
            }

        });

        scrollPane.processEvent(new MouseWheelEvent(scrollPane,
                                              MouseEvent.MOUSE_WHEEL,
                                              0l, 0, 100, 200, 0, false,
                                              MouseWheelEvent.WHEEL_BLOCK_SCROLL,
                                              10, 10));
        assertTrue(eventProcessed);
View Full Code Here

            // Zoom change
            if ( !someDragged && mouseEventType.equals ( MouseEventType.mouseWheelMoved ) &&
                    ( SwingUtils.isCtrl ( e ) || SwingUtils.isAlt ( e ) ) )
            {
                final MouseWheelEvent mwe = ( MouseWheelEvent ) e;
                setZoom ( getZoom () - mwe.getWheelRotation () );
                setCursor ( Cursor.getDefaultCursor () );
                return repaintRequired;
            }

            // Visible area drag
View Full Code Here

        // Retarget event.
        MouseEvent retargeted;
        if (id == MouseEvent.MOUSE_WHEEL)
          {
            MouseWheelEvent mwe = (MouseWheelEvent) ev;
            retargeted = new MouseWheelEvent(target, id, ev.getWhen(),
                                             ev.getModifiers()
                                             | ev.getModifiersEx(), x, y,
                                             ev.getClickCount(),
                                             ev.isPopupTrigger(),
                                             mwe.getScrollType(),
                                             mwe.getScrollAmount(),
                                             mwe.getWheelRotation());
          }
        else
          {
            retargeted = new MouseEvent(target, id, ev.getWhen(),
                                       ev.getModifiers() | ev.getModifiersEx(),
View Full Code Here

    }


    public void wheelMouse(ComponentOperator oper, int x, int y, int scrollAmount) {
        dispatchEvent(oper.getSource(), new MouseWheelEvent(
                oper.getSource(),
                MouseWheelEvent.MOUSE_WHEEL,
                System.currentTimeMillis(),
                0,
                x,
View Full Code Here

    public boolean handlesWheelScrolling() {return true;}

    public void handleEvent(AWTEvent e) {
        if (e.getID() == MouseEvent.MOUSE_WHEEL) {
            MouseWheelEvent mwe = (MouseWheelEvent)e;
            nativeHandleMouseWheel(mwe.getScrollType(),
                                   mwe.getScrollAmount(),
                                   mwe.getWheelRotation());
        }
        else {
            super.handleEvent(e);
        }
    }
View Full Code Here

TOP

Related Classes of java.awt.event.MouseWheelEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.