Package java.awt.event

Examples of java.awt.event.MouseWheelEvent


                                                    id,
                                                    x,
                                                    y,
                                                    ((SunDropTargetEvent)e).getDispatcher());
            } else if (id == MouseEvent.MOUSE_WHEEL) {
                retargeted = new MouseWheelEvent(target,
                                      id,
                                       e.getWhen(),
                                       e.getModifiersEx() | e.getModifiers(),
                                       x,
                                       y,
View Full Code Here


                : Math.pow(0.95, ev.getWheelRotation())));
          } else if (getMouseWheelListeners().length == 1) {
            // If this listener is the only one registered on this component
            // redispatch event to its parent (for default scroll bar management)
            getParent().dispatchEvent(
              new MouseWheelEvent(getParent(), ev.getID(), ev.getWhen(),
                  ev.getModifiersEx() | ev.getModifiers(),
                  ev.getX() - getX(), ev.getY() - getY(),
                  ev.getClickCount(), ev.isPopupTrigger(), ev.getScrollType(),
                  ev.getScrollAmount(), ev.getWheelRotation()));
          }
View Full Code Here

            int         modifiers       = mouseEvent.getModifiers();
            int         clickCount      = mouseEvent.getClickCount();
            boolean     isPopupTrigger  = mouseEvent.isPopupTrigger();
            MouseEvent newEvent;
            if(id == MouseEvent.MOUSE_WHEEL) {
                MouseWheelEvent mouseWheelEvent = (MouseWheelEvent) mouseEvent;
                int             scrollType = mouseWheelEvent.getScrollType();
                int             scrollAmount = mouseWheelEvent.getScrollAmount();
                int             wheelRotation = mouseWheelEvent.getWheelRotation();
                newEvent = new MouseWheelEvent(parentComponent, id, when, modifiers, point.x, point.y,
                        clickCount, isPopupTrigger, scrollType, scrollAmount,
                        wheelRotation);
            }
            else {
                newEvent = new MouseEvent(parentComponent, id, when, modifiers, point.x, point.y,
View Full Code Here

        final int ex = x - p.x; // - pwo.x;
        final int ey = y - p.y; // - pwo.y;
        final int modifiers = getModifiers();
        MouseEvent event;
        if (id == MouseEvent.MOUSE_WHEEL) {
            event = new MouseWheelEvent(source, id, time, modifiers, ex, ey,
                1, popupTrigger, MouseWheelEvent.WHEEL_UNIT_SCROLL,
                wheelAmt, //TODO check what to put here
                wheelAmt); //TODO check what to put here
        } else {
            event = new MouseEvent(source, id, time, modifiers, ex, ey,
View Full Code Here

    listener.mouseDragged(e);
  }

  @Override
  public void mouseWheelMoved(MouseWheelEvent e, Point mapPosition) {
    e = new MouseWheelEvent((Component) e.getSource(), e.getID(),
        e.getWhen(), e.getModifiers(), mapPosition.x, mapPosition.y,
        e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), false,
        e.getScrollType(), e.getScrollAmount(), e.getWheelRotation());
    listener.mouseWheelMoved(e);
  }
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

            int         modifiers       = mouseEvent.getModifiers();
            int         clickCount      = mouseEvent.getClickCount();
            boolean     isPopupTrigger  = mouseEvent.isPopupTrigger();
            MouseEvent newEvent;
            if(id == MouseEvent.MOUSE_WHEEL) {
                MouseWheelEvent mouseWheelEvent = (MouseWheelEvent) mouseEvent;
                int             scrollType = mouseWheelEvent.getScrollType();
                int             scrollAmount = mouseWheelEvent.getScrollAmount();
                int             wheelRotation = mouseWheelEvent.getWheelRotation();
                newEvent = new MouseWheelEvent(parentComponent, id, when, modifiers, point.x, point.y,
                        clickCount, isPopupTrigger, scrollType, scrollAmount,
                        wheelRotation);
            }
            else {
                newEvent = new MouseEvent(parentComponent, id, when, modifiers, point.x, point.y,
View Full Code Here

        Component comp = lastComponent != null ? lastComponent : componentAt( x, y, desktop, false );
        if ( comp == null ) {
            comp = desktop;
        }
        final Point pos = convertPoint( desktop, x, y, comp );
        final MouseWheelEvent event = new MouseWheelEvent( comp,
                MouseEvent.MOUSE_WHEEL,
                System.currentTimeMillis(), getCurrentModifiers( -1 ), pos.x, pos.y, 1, false,
                MouseWheelEvent.WHEEL_UNIT_SCROLL,
                Math.abs( wheelDelta ), wheelDelta > 0 ? -1 : 1 );
        dispatchEvent( comp, event );
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

    /**
     * Mouse wheel event processing by vertical scrollbar
     */
    private void processMouseWheel(Point where, long when, int modifiers, int wheelRotation) {
        MouseWheelEvent mwe = new MouseWheelEvent(choice, MouseEvent.MOUSE_WHEEL, when,
                modifiers, where.x, where.y, 0, false, MouseWheelEvent.WHEEL_UNIT_SCROLL, 1,
                wheelRotation);
        scrollController.mouseWheelMoved(mwe);
    }
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.