Robot is used for simulating user interaction such as
typing keys on the keyboard and using the mouse as well as capturing
graphical information without requiring a javafx.scene.Scene
instance. Robot objects must be constructed and used on the JavaFX
Application Thread.
| Modifier and Type | Field and Description |
|---|---|
| private final GlassRobot |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Point2D | Returns: the current mouse (x,y) screen coordinatesReturns the current mouse (x,y) screen coordinates as a |
| public double | Returns: the current mousex positionReturns the current mouse |
| public double | Returns: the current mousey positionReturns the current mouse |
| public Color | Returns: the pixel color at the specified screen coordinatesthe x coordinate to get the pixel color from x, double the y coordinate to get the pixel color from y)Returns the |
| public Color | Returns: the pixel color at the specified screen coordinatesthe (x,y) coordinates to get the pixel color from location)Returns the |
| public WritableImage | getScreenCapture(WritableImage
either null or a image, double WritableImage that will
be used to place the screen capture inthe starting x-position of the rectangular area to capture x, double the starting y-position of the rectangular area to capture y, double the width of the rectangular area to capture width, double the height of the rectangular area to capture height, boolean If true, the returned scaleToFit)Image will be
scaled to fit the request dimensions (if necessary). Otherwise, the size
of the returned image will depend on the output scale (DPI) of the primary
screen.Returns a |
| public WritableImage | getScreenCapture(WritableImage
either null or a image, double WritableImage that will
be used to place the screen capture inthe starting x-position of the rectangular area to capture x, double the starting y-position of the rectangular area to capture y, double the width of the rectangular area to capture width, double the height of the rectangular area to capture height)Returns a |
| public WritableImage | getScreenCapture(WritableImage
either null or a image, Rectangle2D WritableImage that will
be used to place the screen capture inthe rectangular area of the screen to capture region)Returns a |
| public WritableImage | getScreenCapture(WritableImage
either null or a image, Rectangle2D WritableImage that will
be used to place the screen capture inthe rectangular area of the screen to capture region, boolean if true, the returned scaleToFit)Image will be
scaled to fit the request dimensions (if necessary). Otherwise, the size
of the returned image will depend on the output scale (DPI) of the primary
screen.Returns a |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | mouseMove(double
screen coordinate x to move the mouse to x, double screen coordinate y to move the mouse to y)Moves the mouse to the specified (x,y) screen coordinates relative to the primary screen. |
| public final void | |
| public void | |
| public void | mouseRelease(MouseButton...
the mouse buttons to release buttons)Releases the specified |
| public void | mouseWheel(int
the (signed) amount of clicks to scroll the wheel wheelAmt)Scrolls the mouse wheel by the specified amount of wheel clicks. |
| peer | back to summary |
|---|---|
| private final GlassRobot peer | |
| Robot | back to summary |
|---|---|
| public Robot() Constructs a new
| |
| getMousePosition | back to summary |
|---|---|
| public Point2D getMousePosition() Returns the current mouse (x,y) screen coordinates as a
| |
| getMouseX | back to summary |
|---|---|
| public double getMouseX() Returns the current mouse
| |
| getMouseY | back to summary |
|---|---|
| public double getMouseY() Returns the current mouse
| |
| getPixelColor | back to summary |
|---|---|
| public Color getPixelColor(double x, double y) Returns the
| |
| getPixelColor | back to summary |
|---|---|
| public Color getPixelColor(Point2D location) Returns the
| |
| getScreenCapture | back to summary |
|---|---|
| public WritableImage getScreenCapture(WritableImage image, double x, double y, double width, double height, boolean scaleToFit) Returns a
If the
If
| |
| getScreenCapture | back to summary |
|---|---|
| public WritableImage getScreenCapture(WritableImage image, double x, double y, double width, double height) Returns a Implementation Specification This method is equivalent to calling
| |
| getScreenCapture | back to summary |
|---|---|
| public WritableImage getScreenCapture(WritableImage image, Rectangle2D region) Returns a Implementation Specification This method is equivalent to calling
| |
| getScreenCapture | back to summary |
|---|---|
| public WritableImage getScreenCapture(WritableImage image, Rectangle2D region, boolean scaleToFit) Returns a
If the
If
| |
| keyPress | back to summary |
|---|---|
| public void keyPress(KeyCode keyCode) Presses the specified
| |
| keyRelease | back to summary |
|---|---|
| public void keyRelease(KeyCode keyCode) Releases the specified
| |
| keyType | back to summary |
|---|---|
| public void keyType(KeyCode keyCode) Types the specified Implementation Specification This is a convenience method that is equivalent to calling
| |
| mouseClick | back to summary |
|---|---|
| public void mouseClick(MouseButton... buttons) Clicks the specified Implementation Specification This is a convenience method that is equivalent to calling
| |
| mouseMove | back to summary |
|---|---|
| public void mouseMove(double x, double y) Moves the mouse to the specified (x,y) screen coordinates relative to the primary screen.
| |
| mouseMove | back to summary |
|---|---|
| public final void mouseMove(Point2D location) Moves the mouse to the (x,y) screen coordinates, relative to the primary
screen, specified by the given
| |
| mousePress | back to summary |
|---|---|
| public void mousePress(MouseButton... buttons) Presses the specified
| |
| mouseRelease | back to summary |
|---|---|
| public void mouseRelease(MouseButton... buttons) Releases the specified
| |
| mouseWheel | back to summary |
|---|---|
| public void mouseWheel(int wheelAmt) Scrolls the mouse wheel by the specified amount of wheel clicks. A positive
| |