visad
Class SocketSlaveDisplay

java.lang.Object
  extended by visad.SocketSlaveDisplay
All Implemented Interfaces:
Remote, RemoteSlaveDisplay

public class SocketSlaveDisplay
extends Object
implements RemoteSlaveDisplay

A SocketSlaveDisplay server wraps around a VisAD display, providing support for stand-alone remote displays (i.e., not dependent on the VisAD packages) that communicate with the server using sockets. For an example, see examples/Test68.java together with the stand-alone VisAD applet visad.browser.VisADApplet, usable from within a web browser.


Constructor Summary
SocketSlaveDisplay(DisplayImpl d)
          construct a SocketSlaveDisplay for the given VisAD display
SocketSlaveDisplay(DisplayImpl d, int port)
          construct a SocketSlaveDisplay for the given VisAD display, and communicate with clients using the given port
 
Method Summary
 int getPort()
          get the socket port used by this SocketSlaveDisplay
 void killServer()
          destroy this server and kills all associated threads
 void sendImage(int[] pixels, int width, int height, int type)
          display automatically calls sendImage when its content changes
 void sendMessage(String message)
          send the given message to this slave display
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketSlaveDisplay

public SocketSlaveDisplay(DisplayImpl d)
                   throws IOException
construct a SocketSlaveDisplay for the given VisAD display

Throws:
IOException

SocketSlaveDisplay

public SocketSlaveDisplay(DisplayImpl d,
                          int port)
                   throws IOException
construct a SocketSlaveDisplay for the given VisAD display, and communicate with clients using the given port

Throws:
IOException
Method Detail

getPort

public int getPort()
get the socket port used by this SocketSlaveDisplay


sendImage

public void sendImage(int[] pixels,
                      int width,
                      int height,
                      int type)
               throws RemoteException
display automatically calls sendImage when its content changes

Specified by:
sendImage in interface RemoteSlaveDisplay
Throws:
RemoteException

sendMessage

public void sendMessage(String message)
                 throws RemoteException
send the given message to this slave display

Specified by:
sendMessage in interface RemoteSlaveDisplay
Throws:
RemoteException

killServer

public void killServer()
destroy this server and kills all associated threads