jsky.app.jskycat
Class JSkyCatRemoteControl

java.lang.Object
  extended by java.lang.Thread
      extended by jsky.app.jskycat.JSkyCatRemoteControl
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, javax.swing.event.ChangeListener, ImageGraphicsHandler

public class JSkyCatRemoteControl
extends java.lang.Thread
implements ImageGraphicsHandler, javax.swing.event.ChangeListener

Implements a remote control socket interface for JSkyCat.

Version:
$Revision: 1.1 $
Author:
Allan Brighton

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JSkyCatRemoteControl(int portNum, JSkyCat jskycat)
          Listen on the given port for remote commands to the given JSkyCat instance.
 
Method Summary
 void drawImageGraphics(BasicImageDisplay imageDisplay, java.awt.Graphics2D g)
          Called each time the image is repainted.
 void run()
          Start accepting client connections.
 void stateChanged(javax.swing.event.ChangeEvent e)
          Called when the image processor settings are changed.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSkyCatRemoteControl

public JSkyCatRemoteControl(int portNum,
                            JSkyCat jskycat)
                     throws java.io.IOException
Listen on the given port for remote commands to the given JSkyCat instance.

Throws:
java.io.IOException
Method Detail

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Called when the image processor settings are changed. Try to improve performance by not automatically scanning the image to find the best cut levels (tell it that the user set the cut levels and they should not be changed).

Specified by:
stateChanged in interface javax.swing.event.ChangeListener

drawImageGraphics

public void drawImageGraphics(BasicImageDisplay imageDisplay,
                              java.awt.Graphics2D g)
Called each time the image is repainted. This feature is (mis)used to get notification when the image has been displayed, since the graphics handlers are called after the image is painted. This is used to delay the reply for image display commands and avoid overwriting an image while the data is being read. With tiling, this can still happen, but only if the user is scrolling at the time.

Specified by:
drawImageGraphics in interface ImageGraphicsHandler

run

public void run()
Start accepting client connections.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread