Package java.awt

Examples of java.awt.PointerInfo


                    devices[1].getDefaultConfiguration().getBounds().x;
                if (x1 > x2) {
                    xOffset = -x1;
                }
            }
            final PointerInfo pi = MouseInfo.getPointerInfo();
            if (pi != null) {
                final Point2D p = pi.getLocation();
                robot.mouseMove((int) p.getX() + xOffset - 1,
                                (int) p.getY());
                robot.mouseMove((int) p.getX() + xOffset + 1,
                                (int) p.getY());
                robot.mouseMove((int) p.getX() + xOffset, (int) p.getY());
View Full Code Here


   
   
    private abstract class MouseLocationBasedAction extends AbstractAction {
       
        protected final Point getCurrentLocation() {
            PointerInfo info = MouseInfo.getPointerInfo();
            Point pt = info.getLocation();
            SwingUtilities.convertPointFromScreen(pt, canvas);
            if (pt.x > 0 && pt.y > 0) {
                return adjustPointForZoom(pt);
            }
            return null;
View Full Code Here

        }
    }

    private boolean isMouseInsideSelectorWindow() {
        if (editorSelectorWindow != null) {
            PointerInfo info = MouseInfo.getPointerInfo();
            Point location = info.getLocation();
            return editorSelectorWindow.containsPoint(location);
        }
        return false;
    }
View Full Code Here

    this.captureX = captureX;
    this.captureY = captureY;
  }
 
  private Point getMouseLocation() {
    PointerInfo pInfo;
    Point pointerLocation = new Point(0,0);
   
    try {
      pInfo = MouseInfo.getPointerInfo();
    } catch (HeadlessException e) {
      pInfo = null;
    } catch (SecurityException e) {
      pInfo = null;
    }
   
    if (pInfo == null) return pointerLocation;
   
    return pInfo.getLocation();   
  }
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

            }

            @Override
            public void mouseReleased(MouseEvent e) {
                Graph graph = controller.getSelectedGraph();
                PointerInfo pointerInfo = MouseInfo.getPointerInfo();
                Point location = graph.getLocationOnScreen();
                int pointerX = (int)pointerInfo.getLocation().getX();
                int pointerY = (int)pointerInfo.getLocation().getY();
                int graphX = (int)graph.getParent().getLocationOnScreen().getX();
                int x = (int)pointerX - (int)location.getX();
                int y = (int)pointerY -  (int)location.getY();
                if (pressed && x > 0 && pointerX > graphX) {
                    if (graph.isEditable()) {
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.