Top Fields Constructors Methods
com.sun.glass.ui.gtk

pack-priv final Class GtkRobot

extends GlassRobot
Class Inheritance
Imports
com.sun.glass.ui.gtk.screencast.ScreencastHelper, javafx.scene.input.KeyCode, .MouseButton, javafx.scene.paint.Color, com.sun.glass.ui.Application, .GlassRobot, .Screen

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
Inherited from com.sun.glass.ui.GlassRobot:
MOUSE_BACK_BTNMOUSE_FORWARD_BTNMOUSE_LEFT_BTNMOUSE_MIDDLE_BTNMOUSE_RIGHT_BTN

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected native int
protected native int
protected native void
_getScreenCapture(int x, int y, int width, int height, int[] data)

protected native void
_keyPress(int code)

protected native void
_keyRelease(int code)

public native void
_mouseMove(int x, int y)

protected native void
_mousePress(int button)

protected native void
_mouseRelease(int buttons)

protected native void
_mouseWheel(int wheelAmt)

public void
create()

Implements abstract com.sun.glass.ui.GlassRobot.create.

Initializes any state necessary for this Robot.

public void
destroy()

Implements abstract com.sun.glass.ui.GlassRobot.destroy.

Frees any resources allocated by this Robot.

public double
getMouseX()

Implements abstract com.sun.glass.ui.GlassRobot.getMouseX.

Returns the current mouse x-position.

public double
getMouseY()

Implements abstract com.sun.glass.ui.GlassRobot.getMouseY.

Returns the current mouse y-position.

public Color
getPixelColor(double
the x coordinate to get the pixel color from
x
,
double
the y coordinate to get the pixel color from
y
)

Implements abstract com.sun.glass.ui.GlassRobot.getPixelColor.

Returns the Color of the pixel at the screen coordinates relative to the primary screen specified by location.

public void
getScreenCapture(int
the starting x-position of the rectangular area to capture
x
,
int
the starting y-position of the rectangular area to capture
y
,
int
the width of the rectangular area to capture
width
,
int
the height of the rectangular area to capture
height
,
int[]
the array to fill with the raw pixel data corresponding to the captured region
data
,
boolean
If true the returned 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.
scaleToFit
)

Overrides com.sun.glass.ui.GlassRobot.getScreenCapture.

Captures the specified rectangular area of the screen and uses it to fill the given data array with the raw pixel data.

public void
keyPress(KeyCode
the key to press
code
)

Implements abstract com.sun.glass.ui.GlassRobot.keyPress.

Presses the specified KeyCode key.

public void
keyRelease(KeyCode
the key to release
code
)

Implements abstract com.sun.glass.ui.GlassRobot.keyRelease.

Releases the specified KeyCode key.

public void
mouseMove(double
screen coordinate x to move the mouse to
x
,
double
screen coordinate y to move the mouse to
y
)

Implements abstract com.sun.glass.ui.GlassRobot.mouseMove.

Moves the mouse to the specified (x,y) screen coordinates relative to the primary screen.

public void
mousePress(MouseButton...
the mouse buttons to press
buttons
)

Implements abstract com.sun.glass.ui.GlassRobot.mousePress.

Presses the specified MouseButtons.

public void
mouseRelease(MouseButton...
the mouse buttons to release
buttons
)

Implements abstract com.sun.glass.ui.GlassRobot.mouseRelease.

Releases the specified MouseButtons.

public void
mouseWheel(int
the (signed) amount of clicks to scroll the wheel
wheelAmt
)

Implements abstract com.sun.glass.ui.GlassRobot.mouseWheel.

Scrolls the mouse wheel by the specified amount of wheel clicks.

Inherited from com.sun.glass.ui.GlassRobot:
convertFromIntArgbconvertFromPixelsconvertToRobotMouseButtongetScreenCapture

Field Detail

METHOD_GTKback to summary
private static final String METHOD_GTK
METHOD_SCREENCASTback to summary
private static final String METHOD_SCREENCAST
screenshotMethodback to summary
private static final String screenshotMethod

Constructor Detail

GtkRobotback to summary
pack-priv GtkRobot()

Method Detail

_getMouseXback to summary
protected native int _getMouseX()
_getMouseYback to summary
protected native int _getMouseY()
_getScreenCaptureback to summary
protected native void _getScreenCapture(int x, int y, int width, int height, int[] data)
_keyPressback to summary
protected native void _keyPress(int code)
_keyReleaseback to summary
protected native void _keyRelease(int code)
_mouseMoveback to summary
public native void _mouseMove(int x, int y)
_mousePressback to summary
protected native void _mousePress(int button)
_mouseReleaseback to summary
protected native void _mouseRelease(int buttons)
_mouseWheelback to summary
protected native void _mouseWheel(int wheelAmt)
createback to summary
public void create()

Implements abstract com.sun.glass.ui.GlassRobot.create.

Doc from com.sun.glass.ui.GlassRobot.create.

Initializes any state necessary for this Robot. Called by the Robot constructor.

Annotations
@Override
destroyback to summary
public void destroy()

Implements abstract com.sun.glass.ui.GlassRobot.destroy.

Doc from com.sun.glass.ui.GlassRobot.destroy.

Frees any resources allocated by this Robot.

Annotations
@Override
getMouseXback to summary
public double getMouseX()

Implements abstract com.sun.glass.ui.GlassRobot.getMouseX.

Doc from com.sun.glass.ui.GlassRobot.getMouseX.

Returns the current mouse x-position.

Returns:double

the current mouse x-position

Annotations
@Override
getMouseYback to summary
public double getMouseY()

Implements abstract com.sun.glass.ui.GlassRobot.getMouseY.

Doc from com.sun.glass.ui.GlassRobot.getMouseY.

Returns the current mouse y-position.

Returns:double

the current mouse y-position

Annotations
@Override
getPixelColorback to summary
public Color getPixelColor(double x, double y)

Implements abstract com.sun.glass.ui.GlassRobot.getPixelColor.

Doc from com.sun.glass.ui.GlassRobot.getPixelColor.

Returns the Color of the pixel at the screen coordinates relative to the primary screen specified by location. Regardless of the scale of the screen (Screen#getOutputScaleX(), Screen#getOutputScaleY()), this method only samples a single pixel. For example, on a HiDPI screen with output scale 2, the screen unit at the point (x,y) may have 4 pixels. In this case the color returned is the color of the top, left pixel. Color values are not averaged when a screen unit is made up of more than one pixel.

Parameters
x:double

the x coordinate to get the pixel color from

y:double

the y coordinate to get the pixel color from

Returns:Color

the pixel color at the specified screen coordinates

Annotations
@Override
getScreenCaptureback to summary
public void getScreenCapture(int x, int y, int width, int height, int[] data, boolean scaleToFit)

Overrides com.sun.glass.ui.GlassRobot.getScreenCapture.

Doc from com.sun.glass.ui.GlassRobot.getScreenCapture.

Captures the specified rectangular area of the screen and uses it to fill the given data array with the raw pixel data. The data is in RGBA format where each pixel in the image is encoded as 4 bytes - one for each color component of each pixel. If this method is not overridden by subclasses then getScreenCapture(WritableImage, double, double, double, double, boolean) must be overridden to not call this method.

Parameters
x:int

the starting x-position of the rectangular area to capture

y:int

the starting y-position of the rectangular area to capture

width:int

the width of the rectangular area to capture

height:int

the height of the rectangular area to capture

data:int[]

the array to fill with the raw pixel data corresponding to the captured region

scaleToFit:boolean

If true the returned 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.

Annotations
@Override
keyPressback to summary
public void keyPress(KeyCode code)

Implements abstract com.sun.glass.ui.GlassRobot.keyPress.

Doc from com.sun.glass.ui.GlassRobot.keyPress.

Presses the specified KeyCode key.

Parameters
code:KeyCode

the key to press

Annotations
@Override
keyReleaseback to summary
public void keyRelease(KeyCode code)

Implements abstract com.sun.glass.ui.GlassRobot.keyRelease.

Doc from com.sun.glass.ui.GlassRobot.keyRelease.

Releases the specified KeyCode key.

Parameters
code:KeyCode

the key to release

Annotations
@Override
mouseMoveback to summary
public void mouseMove(double x, double y)

Implements abstract com.sun.glass.ui.GlassRobot.mouseMove.

Doc from com.sun.glass.ui.GlassRobot.mouseMove.

Moves the mouse to the specified (x,y) screen coordinates relative to the primary screen.

Parameters
x:double

screen coordinate x to move the mouse to

y:double

screen coordinate y to move the mouse to

Annotations
@Override
mousePressback to summary
public void mousePress(MouseButton... buttons)

Implements abstract com.sun.glass.ui.GlassRobot.mousePress.

Doc from com.sun.glass.ui.GlassRobot.mousePress.

Presses the specified MouseButtons.

Parameters
buttons:MouseButton[]

the mouse buttons to press

Annotations
@Override
mouseReleaseback to summary
public void mouseRelease(MouseButton... buttons)

Implements abstract com.sun.glass.ui.GlassRobot.mouseRelease.

Doc from com.sun.glass.ui.GlassRobot.mouseRelease.

Releases the specified MouseButtons.

Parameters
buttons:MouseButton[]

the mouse buttons to release

Annotations
@Override
mouseWheelback to summary
public void mouseWheel(int wheelAmt)

Implements abstract com.sun.glass.ui.GlassRobot.mouseWheel.

Doc from com.sun.glass.ui.GlassRobot.mouseWheel.

Scrolls the mouse wheel by the specified amount of wheel clicks. A positive wheelAmt scrolls the wheel towards the user (down) whereas negative amounts scrolls the wheel away from the user (up).

Parameters
wheelAmt:int

the (signed) amount of clicks to scroll the wheel

Annotations
@Override