|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jomic.tools.AbstractTask
net.sf.jomic.comic.AbstractCreateComicTask
public abstract class AbstractCreateComicTask
Task to create comic from a set of image files.
| Constructor Summary | |
|---|---|
AbstractCreateComicTask(java.io.File newSourceBaseDir,
java.lang.String[] newSourceFileNames,
java.util.Map newImageInfoMap,
java.io.File newTargetComicFile,
Conversion newConversion)
Create a new task to create a comic. |
|
| Method Summary | |
|---|---|
protected abstract void |
addImageFile(java.lang.String outImageName,
java.io.File sourceImageFile)
Add an image file to the target comic stream/document/file/whatever. |
protected abstract void |
cleanUpComic()
Release all resources need allocated by setUpComic() to create the target comic
stream/document/file/whatever. |
protected void |
enableAddedAtLeastOneImage()
Must be called by addImageFile when an image actually was added. |
protected Conversion |
getConversion()
|
protected ImageInfo |
getImageInfo(java.io.File imageFile)
Obtain the imageInfo for imageFile, preferably from the newImageInfoMap
passed to the constructor. |
protected java.io.File |
getSourceBaseDir()
|
protected java.io.File |
getTargetComicFile()
|
protected boolean |
hasAddedAtLeastOneImage()
|
protected abstract void |
setUpComic()
Allocate all resources needed to create the target comic file. |
void |
start()
Start the task, which will cause the progress to iterate from 0 to getMaximum. |
| Methods inherited from class net.sf.jomic.tools.AbstractTask |
|---|
addProgressChangeListener, getMaxProgress, getProgress, getProgressMessage, isInterrupted, removeProgressChangeListener, setMaxProgress, setProgress, setProgressMessage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractCreateComicTask(java.io.File newSourceBaseDir,
java.lang.String[] newSourceFileNames,
java.util.Map newImageInfoMap,
java.io.File newTargetComicFile,
Conversion newConversion)
newSourceBaseDir - the base directory where the source files are locatednewSourceFileNames - the names of the files relative to newSourceBaseDir
that should be included in the archivenewImageInfoMap - a map of ImageInfos used to decide if images can be
added. If this is null, the ImageInfo is filled during start()
.newTargetComicFile - the comic file to createnewConversion - a conversion specifying the format and image manipulations of the
new comic; if null, the default will be a conversion creating a CBZ including all the
images specified.ImageInfo| Method Detail |
|---|
protected abstract void setUpComic()
throws java.lang.Exception
cleanUpComic() either when done or an error occurs.
java.lang.ExceptioncleanUpComic()protected final Conversion getConversion()
protected final java.io.File getSourceBaseDir()
protected final java.io.File getTargetComicFile()
protected ImageInfo getImageInfo(java.io.File imageFile)
imageInfo for imageFile, preferably from the newImageInfoMap
passed to the constructor. If the image can not be found in the map, obtain a new ImageInfo
for it and put it in the map for later reuse.
public void start()
throws java.lang.Exception
TaskgetMaximum.
start in interface Taskstart in class AbstractTaskjava.lang.Exception
protected abstract void addImageFile(java.lang.String outImageName,
java.io.File sourceImageFile)
throws java.lang.Exception
outImageName - the name under which the image should be stored (if applicable for
the output format)sourceImageFile - the source image file to be added
java.lang.Exception
protected abstract void cleanUpComic()
throws java.lang.Exception
setUpComic() to create the target comic
stream/document/file/whatever. This will be called in any case even if something went
wrong during setUpComic() so this routine must be able to handle null
values without resulting in NullPointerExceptions.
java.lang.ExceptionsetUpComic()protected void enableAddedAtLeastOneImage()
addImageFile when an image actually was added.
addImageFile(String, File)protected boolean hasAddedAtLeastOneImage()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||