Package java.awt

Examples of java.awt.PointerInfo


  }
 
  synchronized public void sendCursorStatus() {
    try {
     
      PointerInfo a = MouseInfo.getPointerInfo();
      Point mouseP = a.getLocation();
     
      //Integer x = Long.valueOf(Math.round(mouseP.getX())).intValue();
      //Integer y = Long.valueOf(Math.round(mouseP.getY())).intValue();
     
      //Real size: Real mouse position = Resize : X
View Full Code Here


   * is called. This is for multi-monitor support.
   *
   * @return GraphicsEnvironment of the current screen
   */
  private static GraphicsConfiguration detectScreen() {
    PointerInfo pointer = MouseInfo.getPointerInfo();
    if (pointer != null) {
      return pointer.getDevice().getDefaultConfiguration();
    }
    return null;
  }
View Full Code Here

                @Override
                public void run() {
                    while (true) {

                        final PointerInfo pointerInfo = MouseInfo.getPointerInfo();

                        // Obtain information from the mouse
                        final Point point = pointerInfo.getLocation();

                        final EyeTrackingEvent event = createEvent(point);

                        MouseTrackingDevice.this.listenerLock.lock();
                        // And dispatch it to the listener
View Full Code Here

        final Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    final SessionRecorder sr = BrowserPluginImpl.this.sessionRecorder;
                    final PointerInfo pointerInfo = MouseInfo.getPointerInfo();
                    final Point point = pointerInfo.getLocation();

                    if (sr != null) sr.updateMousePosition(point.x, point.y);

                    try {
                        Thread.sleep(25);
View Full Code Here

            public void run() {

                SessionRecorderImpl.this.usingOwnMouseListener = true;

                while (true) {
                    final PointerInfo pointerInfo = MouseInfo.getPointerInfo();

                    // Obtain information from the mouse
                    final Point point = pointerInfo.getLocation();

                    updateMousePosition(point.x, point.y);

                    // Sleep some time ...
                    try {
View Full Code Here

        });

    }
   
    public static Point getRelativeMouseLocation(Component component) {
        PointerInfo pointerInfo = MouseInfo.getPointerInfo();
        if (pointerInfo == null) {
            return new Point();
        } else {
            Point mouseLocation = pointerInfo.getLocation();
            return getRelativeLocation(mouseLocation, component);
        }
    }
View Full Code Here

    if (!this.button.isShowing()) {
      // shouldn't happen. Is some lurking Swing bug
      return;
    }
    try {
      PointerInfo pi = MouseInfo.getPointerInfo();
      int px = pi.getLocation().x - this.button.getLocationOnScreen().x;
      int py = pi.getLocation().y - this.button.getLocationOnScreen().y;
      this.button.getModel().setRollover(this.button.contains(px, py));
    } catch (AccessControlException ace) {
      // sandbox - give up
    }
    this.stateTransitionModel.onModelStateChanged();
View Full Code Here

    }
  }

  synchronized public void sendCursorStatus() {
    try {
      PointerInfo a = MouseInfo.getPointerInfo();
      Point mouseP = a.getLocation();

      float scaleFactor = (1.0f * ScreenDimensions.resizeX) / ScreenDimensions.spinnerWidth;

      // Real size: Real mouse position = Resize : X
      int x = (int)(Ampl_factor * (mouseP.getX() - ScreenDimensions.spinnerX) * scaleFactor);
 
View Full Code Here

  private void smoothMove(final int x, final int y) {

    Robot.log.info("Mouse move to (" + x + ", " + y + ")");

    final PointerInfo pInfo = MouseInfo.getPointerInfo();

    final Point origin = pInfo.getLocation();

    Robot.log.debug("Current pointer position (" + origin.getX() + ", " + origin.getY() + ")");

    int differenceX = (int) (x - origin.getX());
    int differenceY = (int) (y - origin.getY());
View Full Code Here

      if (!this.button.isShowing()) {
        // shouldn't happen. Is some lurking Swing bug
        return;
      }
      try {
        PointerInfo pi = MouseInfo.getPointerInfo();
        int px = pi.getLocation().x
            - this.button.getLocationOnScreen().x;
        int py = pi.getLocation().y
            - this.button.getLocationOnScreen().y;
        this.button.getModel()
            .setRollover(this.button.contains(px, py));
      } catch (AccessControlException ace) {
        // sandbox - give up
View Full Code Here

TOP

Related Classes of java.awt.PointerInfo

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.