|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.vnc.VNCViewer
public class VNCViewer
Abstracts out the details of a VNC client. Once constructed it connects to the given server and maintains a VNC connection. It spawns its own thread to handle the details of updating and protocol details. Key events can be sent. Mouse movements and clicks can be sent. Clipboard can be get/set. A screenshot of the remote frame buffer can be retrieved.
Constructor Summary | |
---|---|
VNCViewer(java.lang.String host,
int display,
java.lang.String p)
Creates a new VNCViewer which connects and authenticates. |
|
VNCViewer(java.lang.String s,
java.lang.String p)
Creates a new VNCViewer which connects and authenticates. |
Method Summary | |
---|---|
java.lang.String |
getClipboard()
|
int |
getDepth()
|
int |
getHeight()
|
int[] |
getImage()
|
java.lang.String |
getName()
|
PixelFormat |
getPixelFormat()
|
float |
getProtocol()
|
java.lang.String |
getServerHost()
|
int |
getWidth()
|
static void |
main(java.lang.String[] args)
Tests out the VNC viewer with some default settings. |
void |
refresh(boolean incremental,
int x,
int y,
int w,
int h)
Requests a refresh of an area of the screen. |
void |
run()
|
void |
sendKey(int key,
boolean down)
Sends a KeyEvent to the server. |
void |
sendMouse(int x,
int y,
byte buttons)
Sends a mouse pointer event to the server. |
void |
setClipboard(java.lang.String clipboard)
|
void |
stop()
Stops the client thread gracefully. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VNCViewer(java.lang.String s, java.lang.String p) throws java.lang.Exception
s
- The host, host:display, or host::port to connect to.p
- The password to send.
java.lang.Exception
public VNCViewer(java.lang.String host, int display, java.lang.String p) throws java.lang.Exception
host
- -
The host name to connect to.display
- -
The display number.
java.lang.Exception
- If unable to connect or comminicate or authenticate.Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
public void stop()
public static void main(java.lang.String[] args)
args
- public java.lang.String getClipboard()
public void setClipboard(java.lang.String clipboard)
clipboard
- The clipboard string to set on the remote host.public java.lang.String getName()
public java.lang.String getServerHost()
public int getWidth()
public int getHeight()
public int getDepth()
public PixelFormat getPixelFormat()
public int[] getImage()
public void sendKey(int key, boolean down)
key
- Which keydown
- Whether or not the key is down (pressed) or up (released).public void sendMouse(int x, int y, byte buttons)
x
- The x-coordinate of the event.y
- The y-coordinate of the event.buttons
- A bitmask of which buttons are pressed.public void refresh(boolean incremental, int x, int y, int w, int h)
incremental
- Whether or not this is an incremental request.x
- The x-coordinate.y
- The y-coordinate.w
- The width.h
- The height.public float getProtocol()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |