Package java.awt

Examples of java.awt.Robot


    ScreenShareRTMPT.instance.virtualScreen.addMouseListener(vListener);
    ScreenShareRTMPT.instance.virtualScreen.addMouseMotionListener(vListener);
    ScreenShareRTMPT.instance.t.add(ScreenShareRTMPT.instance.virtualScreen);

    Rectangle screenRectangle = new Rectangle(screenSize);
    Robot robot = new Robot();
    BufferedImage imageScreen = robot.createScreenCapture(screenRectangle);

    Image img = imageScreen.getScaledInstance(width, height ,Image.SCALE_SMOOTH);
    //imageScreen.
    logger.debug("img"+img);
    ImageIcon image = new ImageIcon(img);
View Full Code Here


   
    // prepare CaptureLocation
    captureDimension = new Rectangle(Double.valueOf(screenDimension.getWidth()).intValue(), Double.valueOf(screenDimension.getHeight()).intValue());
    captureDimension.setLocation(x, y);
   
    rt = new Robot();
  }
View Full Code Here

            validate();
            setVisible(true);
            requestFocus();
            try
            {
                Robot robot = new Robot();
                robot.mouseMove(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth() + 48, -48);
            }
            catch(AWTException ex)
            {}
        }
    }
View Full Code Here

            projector.getRectifyingHomography(camera, tempH);
            JavaCV.fractalTriangleWave(tempFloat, tempH);
            cvConvertScale(tempFloat, imageToProject, 255, 0);
        } else if (virtualSettings.desktopScreenNumber >= 0) {
            desktopScreen = CanvasFrame.getScreenDevice(virtualSettings.desktopScreenNumber);
            robot = new Robot(desktopScreen);
            int w = virtualSettings.desktopScreenWidth,
                h = virtualSettings.desktopScreenHeight;
            if (w <= 0 || h <= 0) {
                DisplayMode dm = desktopScreen.getDisplayMode();
                w = dm.getWidth();
View Full Code Here

      
        tEnv.addObjRelation("EventProducer",
                            new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
            public void fireEvent() {
                try {                            
                    Robot rob = new Robot();
                    rob.mouseMove(point.X + 2, point.Y + 7);
                    rob.mousePress(InputEvent.BUTTON1_MASK);                   
                    rob.mouseMove(point.X + 400, point.Y);
                    rob.mouseRelease (InputEvent.BUTTON1_MASK);                                       
                } catch (java.awt.AWTException e) {
                    System.out.println("desired child doesn't exist");
                }
            }
        });
View Full Code Here

        try
        {
            int button =
                rightClick ? InputEvent.BUTTON3_MASK : InputEvent.BUTTON1_MASK;
           
            Robot robot = new Robot();
            robot.mouseMove(p.x, p.y);
            while (display.readAndDispatch());
            try { Thread.sleep(20); } catch (InterruptedException _) { }
            robot.mousePress(button);
            while (display.readAndDispatch());
            try { Thread.sleep(20); } catch (InterruptedException _) { }
            robot.mouseRelease(button);
            while (display.readAndDispatch());
            try { Thread.sleep(20); } catch (InterruptedException _) { }
        }
        catch (AWTException e) { throw new RuntimeException(e); }
    }
View Full Code Here

    public BufferedImage getVideoSurfaceContents() {
        Logger.debug("getVideoSurfaceContents()");
        try {
            Rectangle bounds = videoSurface.canvas().getBounds();
            bounds.setLocation(videoSurface.canvas().getLocationOnScreen());
            return new Robot().createScreenCapture(bounds);
        }
        catch(Exception e) {
            throw new RuntimeException("Failed to get video surface contents", e);
        }
    }
View Full Code Here

    robotFactory = new RobotFactory();
  }

  @Test
  public void shouldCreateNewRobot() throws AWTException {
    Robot last = null;
    for (int i = 0; i < 6; i++) {
      Robot current = robotFactory.newRobotInPrimaryScreen();
      assertThat(current).isNotNull().isNotSameAs(last);
      last = current;
    }
  }
View Full Code Here

   * @throws AWTException if the platform configuration does not allow low-level input control. This exception is always
   *           thrown when {@code GraphicsEnvironment.isHeadless()} returns {@code true}.
   * @throws SecurityException if {@code createRobot} permission is not granted.
   */
  public @Nonnull Robot newRobotInPrimaryScreen() throws AWTException {
    return new Robot();
  }
View Full Code Here

    this(windows, new RobotFactory());
  }

  WindowStatus(@Nonnull Windows windows, @Nonnull RobotFactory robotFactory) {
    this.windows = windows;
    Robot r = null;
    try {
      r = robotFactory.newRobotInPrimaryScreen();
    } catch (AWTException ignored) {
      logger.log(WARNING, "Error ocurred when creating a new Robot", ignored);
    }
View Full Code Here

TOP

Related Classes of java.awt.Robot

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.