|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
AlbumCreator
Master thread responsible for an album creation
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
AlbumCreator(java.io.File sourceDir,
java.io.File targetDir,
int numWorkers,
int maxFullSize,
int maxThumbSize,
int imagesPerRow,
int imagesPerColumn)
Create a new AlbumCreator |
Method Summary | |
void |
appendToConsole(java.lang.String s)
Writes a string to the graphical console log |
java.lang.String |
convertPath(java.lang.String path)
Converts a file's source path to a corresponding path where it's newly scaled version should be |
void |
copyMovieFiles()
Copies all known movie files from their source path to their destination path, untouched |
void |
createErrorDialog(java.lang.String msg,
java.awt.Frame lockMe)
Generates a popup window (JDialog) with the approperiate warning |
void |
createSubdirs()
Creates all directories found in source directory in target directory file structure |
void |
generateIndexHtml(java.io.File dir,
boolean isRootDir)
Called for each directory in the file structure to produce one or more index[2-9]*.html files. |
void |
generateMovieHtmlFile(java.io.File movie)
Generates a suitable HTML file for movie watching |
java.io.File[] |
getData()
Called by workers to fetch their workload. |
void |
parseDirectory(java.lang.String path)
Recursively parses through a file structure, looking for files to include in the album generation |
void |
printHtmlIndexHeader(java.io.FileWriter fw,
int pages,
java.lang.String title,
boolean isRootDir)
Initiates an HTML index file with approperiate HTML code |
void |
run()
Activates the AlbumCreator, causing it to spawn workers and begins creating the album |
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 |
public AlbumCreator(java.io.File sourceDir, java.io.File targetDir, int numWorkers, int maxFullSize, int maxThumbSize, int imagesPerRow, int imagesPerColumn)
sourceDir
- Root directory of album repositorytargetDir
- Root directory of album outputnumWorkers
- The number of ImageScaleWorker threads to be launchedmaxFullSize
- Maximum picture width/height for large imagesmaxThumbSize
- Maximum picture width/height for thumb imagesimagesPerRow
- Images per html page rowimagesPerColumn
- Images per html page columnImageScaleWorker
Method Detail |
public void run()
public void appendToConsole(java.lang.String s)
s
- String to be written to console
public void generateIndexHtml(java.io.File dir, boolean isRootDir)
dir
- Directory to generate index file(s) inisRootDir
- true if this is the root directory. This will prevent creation of a hyperlink to parent directory
public void printHtmlIndexHeader(java.io.FileWriter fw, int pages, java.lang.String title, boolean isRootDir)
fw
- FileWriter to write HTML code ontopages
- Total number of index pages in this directory. Used to create links to index2.html if there are more than the maximum allowed images per page in this directorytitle
- Title of the index.html pageisRootDir
- true if this is the root directory. This will prevent creation of a hyperlink to parent directorypublic java.io.File[] getData()
ImageScaleWorker
public java.lang.String convertPath(java.lang.String path)
path
- Path to file original
public void copyMovieFiles()
public void createErrorDialog(java.lang.String msg, java.awt.Frame lockMe)
msg
- The message you want to flaglockMe
- Frame to lock while error is visible
JDialog
public void generateMovieHtmlFile(java.io.File movie)
movie
- Movie File to generate HTML forpublic void createSubdirs()
public void parseDirectory(java.lang.String path)
path
- Root path where search begins.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |