jj2000.disp
Class TitleUpdater

java.lang.Object
  |
  +--jj2000.disp.TitleUpdater
All Implemented Interfaces:
java.lang.Runnable

public class TitleUpdater
extends java.lang.Object
implements java.lang.Runnable

This class should run as an independent thread to update tha main display window title with current image scroll position and zoom.


Field Summary
(package private)  java.lang.String btitle
          The base of the title
 boolean done
          The thread exits when this is true
(package private)  ImgScrollPane isp
          The ImgScrollPane where the image is displayed
(package private) static int UPDATE_T
          The update perion, in milliseconds: 100
(package private)  java.awt.Frame win
          The frame which title to update
 
Constructor Summary
TitleUpdater(ImgScrollPane isp, java.awt.Frame win, java.lang.String btitle)
          Instantiates the title updater.
 
Method Summary
 void run()
          The method that executes this thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_T

static final int UPDATE_T
The update perion, in milliseconds: 100

See Also:
Constant Field Values

isp

ImgScrollPane isp
The ImgScrollPane where the image is displayed


win

java.awt.Frame win
The frame which title to update


btitle

java.lang.String btitle
The base of the title


done

public volatile boolean done
The thread exits when this is true

Constructor Detail

TitleUpdater

public TitleUpdater(ImgScrollPane isp,
                    java.awt.Frame win,
                    java.lang.String btitle)
Instantiates the title updater. The title of 'win' will be regularly updated with the current zoom and scroll point. The current zoom and scroll point are added to the basic title given by 'btitle'.

Parameters:
isp - Where the image is displayed
win - The window which title to update
btitle - The base of the title.
Method Detail

run

public void run()
The method that executes this thread. The method periodically updates the title, if necessary, and puts to sleep the thread for 100 msec. This method never returns. If the sleep of the thread is interrupted, the title will be updated earlier and the cycle will continue.

Specified by:
run in interface java.lang.Runnable