Class ImageScaleWorker

java.lang.Object
  extended byjava.lang.Thread
      extended byImageScaleWorker
All Implemented Interfaces:
java.lang.Runnable

public class ImageScaleWorker
extends java.lang.Thread

Worker class. Longlived thread implementation that read images from AlbumCreator until no more files are to be scaled, after which it self terminates gracefully


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ImageScaleWorker(int workerId, AlbumCreator album, int maxSizeLarge, int maxSizeThumb)
          Generates the ImageScaleWorker object
 
Method Summary
 void run()
          Keeps running while a) busy, and b) there are more images to fetch from AlbumCreator parent
 void scaleImage(java.io.File[] files)
          Creates one thumbnail and one large sized copy of the source image.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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

ImageScaleWorker

public ImageScaleWorker(int workerId,
                        AlbumCreator album,
                        int maxSizeLarge,
                        int maxSizeThumb)
Generates the ImageScaleWorker object

Parameters:
workerId - Unique identifier for the worker used for printing funny messages to console log
album - Pointer to AlbumCreator that spawned the thread
maxSizeLarge - Maximum image size (in either X or Y, whichever is larger)
maxSizeThumb - Maximum thumb size (in either X or Y, whichever is larger)
Method Detail

run

public void run()
Keeps running while a) busy, and b) there are more images to fetch from AlbumCreator parent


scaleImage

public void scaleImage(java.io.File[] files)
Creates one thumbnail and one large sized copy of the source image.

Parameters:
files - File objects containg where to read source image, and where to write target