|
|||||||||
| 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(File newSourceBaseDir,
String[] newSourceFileNames,
Map newImageInfoMap,
File newTargetComicFile,
Conversion newConversion)
Create a new task to create a comic. |
|
| Method Summary | |
|---|---|
protected abstract void |
addImageFile(String outImageName,
File sourceImageFile)
Add an image file to the target comic stream/document/file/whatever. |
protected abstract void |
cleanUpComic()
Release all resources need allocted 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(File imageFile)
Obtain the imageInfo for imageFile, preferably from the newImageInfoMap
passed to the constructor. |
protected File |
getSourceBaseDir()
|
protected 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(File newSourceBaseDir,
String[] newSourceFileNames,
Map newImageInfoMap,
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 Exception
cleanUpComic() either when done or an error occurs.
ExceptioncleanUpComic()protected final Conversion getConversion()
protected final File getSourceBaseDir()
protected final File getTargetComicFile()
protected ImageInfo getImageInfo(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 Exception
TaskgetMaximum.
start in interface Taskstart in class AbstractTaskException
protected abstract void addImageFile(String outImageName,
File sourceImageFile)
throws 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
Exception
protected abstract void cleanUpComic()
throws 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 rourtine must be able to handle null
values without resulting in NullPointerExceptions.
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 | ||||||||