|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Robot
jview.GestureRobot
public class GestureRobot
This class implements the InputEventLinking interface and
uses an AWT Robot to generate events on the local application. It thus act
like a server, allowing remote control of an application. The right way to
use this class can be described as follows:
GestureRobot#setParent(),
using the main GUI frame as its argument. Do this
only after the GUI has been drawn on the screen.getDefaultToolkit().addAWTEventListener).GestureLink.linkTo(java.lang.String)
method, using the Naming path to the gui server.setClientDimension(java.awt.Dimension) with the actual client size.
Again, take special care of identical layouts.
| Field Summary | |
|---|---|
private String |
binding
If we are successfully bound, this is our name. |
private float |
compress
Defaults to 1, but on jpeg also supports lower values. |
static int |
EXPORTPORT
The default export port. |
private Point |
screen
The host component location on screen. |
private Dimension |
size
The host component size. |
private Dimension |
transfersize
If null, size of screen dump is preserved during transfer. |
private int |
transfertype
If zero, no image conversion is done for transfer. |
private String |
type
Defaults to png, but supports also jpeg and a few others. |
static List<String> |
WRITEFORMATS
All known writer formats. |
private double |
xzoom
If scaling is necessary. |
private double |
yzoom
If scaling is necessary. |
| Constructor Summary | |
|---|---|
GestureRobot()
Default constructor. |
|
GestureRobot(Component c)
Constructs a robot using the indicated component as the main component, whose on-screen location and size will determine the mouse movement linking. |
|
GestureRobot(GraphicsDevice gd)
Default constructor with graphics device. |
|
GestureRobot(GraphicsDevice gd,
Component c)
Constructs a robot using the indicated component as the main component, whose on-screen location and size will determine the mouse movement linking. |
|
| Method Summary | |
|---|---|
void |
bind(String bindname)
Binds this gesture robot to the provided name using the Naming mecahnism. |
void |
exit()
On exit, we unlink ourself from the registry, if we have been bound sucessfully. |
void |
export()
Exports the robot to the registry, but does not bind it there. |
void |
follow(InputEvent ie)
We try to mimick mouse movements and key presses from the remote client into our component. |
static void |
main(String[] arg)
In the standalone version, we export the entire screen to the RMI using the provided bind name. |
void |
setClientDimension(Dimension d)
If this method is called, the server might be able to correctly translate mouse-movements if the display sizes differ. |
int |
setColorDepth(int bits)
Use one of the 'lower' color model buffered image types. |
boolean |
setCompressedSize(Dimension small)
Use a smaller than full screen dump size to allow further compression. |
float |
setCompressionQuality(float between01)
Sets the quality of the screen capture. |
String |
setCompressionType(String jpeg)
Sets the type of the screen shot returned to this type if it is one of the allowed types. |
void |
setParent(Component c)
We set the parent component onto which the gestures are delivered. |
SerializableBufferedImage |
shareScreen()
Transfers the entire screen. |
SerializableBufferedImage |
shareScreen(Rectangle box)
Transfers an excerpt of the entire screen. |
void |
signalForQuit()
If we receive a signal here, we unbind and exit the VM. |
| Methods inherited from class java.awt.Robot |
|---|
createScreenCapture, delay, getAutoDelay, getPixelColor, isAutoWaitForIdle, keyPress, keyRelease, mouseMove, mousePress, mouseRelease, mouseWheel, setAutoDelay, setAutoWaitForIdle, toString, waitForIdle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int EXPORTPORT
public static final List<String> WRITEFORMATS
private String binding
private Point screen
private Dimension size
private double xzoom
private double yzoom
private String type
private float compress
private int transfertype
private Dimension transfersize
| Constructor Detail |
|---|
public GestureRobot()
throws RemoteException,
AWTException
RemoteException
AWTException
public GestureRobot(GraphicsDevice gd)
throws RemoteException,
AWTException
RemoteException
AWTException
public GestureRobot(Component c)
throws RemoteException,
AWTException
RemoteException
AWTException
public GestureRobot(GraphicsDevice gd,
Component c)
throws RemoteException,
AWTException
RemoteException
AWTException| Method Detail |
|---|
public void export()
throws RemoteException
RemoteException
public void bind(String bindname)
throws RemoteException,
AlreadyBoundException,
MalformedURLException
RemoteException
AlreadyBoundException
MalformedURLExceptionpublic void exit()
exit in interface ExitCleaning
public void signalForQuit()
throws RemoteException
RemoteExceptionpublic void setParent(Component c)
public void setClientDimension(Dimension d)
throws RemoteException
InputEventLinking
setClientDimension in interface InputEventLinkingRemoteException
public SerializableBufferedImage shareScreen()
throws RemoteException
shareScreen in interface ScreenLinkingRemoteException
public SerializableBufferedImage shareScreen(Rectangle box)
throws RemoteException
shareScreen in interface ScreenLinkingRemoteException
public String setCompressionType(String jpeg)
throws RemoteException
setCompressionType in interface CompressedScreenLinkingRemoteException
public float setCompressionQuality(float between01)
throws RemoteException
setCompressionQuality in interface CompressedScreenLinkingRemoteException
public int setColorDepth(int bits)
throws RemoteException
setColorDepth in interface CompressedScreenLinkingRemoteExceptionBufferedImage
public boolean setCompressedSize(Dimension small)
throws RemoteException
setCompressedSize in interface CompressedScreenLinkingRemoteException
public void follow(InputEvent ie)
throws RemoteException
follow in interface InputEventLinkingRemoteException
public static void main(String[] arg)
throws RemoteException,
AWTException,
AlreadyBoundException,
MalformedURLException
RemoteException
AWTException
AlreadyBoundException
MalformedURLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||