org.pdfsam.guiclient.business.thumbnails.creators
Class JPodThumbnailCreator
java.lang.Object
org.pdfsam.guiclient.business.thumbnails.creators.AbstractThumbnailCreator
org.pdfsam.guiclient.business.thumbnails.creators.JPodThumbnailCreator
- All Implemented Interfaces:
- ThumbnailsCreator
public class JPodThumbnailCreator
- extends AbstractThumbnailCreator
Thumbnail creator using JPod
- Author:
- Andrea Vacondio
| Methods inherited from class org.pdfsam.guiclient.business.thumbnails.creators.AbstractThumbnailCreator |
clean, getCurrentId, getInputFile, getPageImage, getPageImage, getPageImage, getPanel, getProvidedPassword, getScaledImage, getThumbnail, initThumbnailsPanel, initThumbnailsPanel, setProvidedPassword |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JPOD_RESOLUTION
public static final int JPOD_RESOLUTION
- See Also:
- Constant Field Values
JPodThumbnailCreator
public JPodThumbnailCreator()
getPageImage
public java.awt.image.BufferedImage getPageImage(java.io.File inputFile,
java.lang.String password,
int page,
int rotation)
throws ThumbnailCreationException
rotation - page rotation in degrees
- Returns:
- the image
- Throws:
ThumbnailCreationException
getThumbnail
public java.awt.image.BufferedImage getThumbnail(java.io.File inputFile,
java.lang.String password,
int page,
float resizePercentage)
throws ThumbnailCreationException
- Parameters:
inputFile - pdf documentpassword - document password or null if no password is neededpage - page nmberresizePercentage - resize level
- Returns:
- a thumbnail of the given page
- Throws:
ThumbnailCreationException
getResolution
public int getResolution()
- Returns:
- resolution of the created thumbnails
getCreatorName
public java.lang.String getCreatorName()
- Returns:
- the Name of the creator
getCreatorIdentifier
public java.lang.String getCreatorIdentifier()
- Returns:
- a unique identifier for the creator.
finalizeThumbnailsCreation
protected void finalizeThumbnailsCreation()
throws ThumbnailCreationException
- Description copied from class:
AbstractThumbnailCreator
- generic finalization. It shouldn't clean resources used by the Thumbnails Generation Tasks (Callable).
- Specified by:
finalizeThumbnailsCreation in class AbstractThumbnailCreator
- Throws:
ThumbnailCreationException
getCloserTask
protected java.util.concurrent.Callable<java.lang.Boolean> getCloserTask()
throws ThumbnailCreationException
- Specified by:
getCloserTask in class AbstractThumbnailCreator
- Returns:
- The Collable that is submitted when all the thumbnails generation tasks are terminated. Used to close the document or other clean operations.
- Throws:
ThumbnailCreationException
getDocumentInfo
protected DocumentInfo getDocumentInfo()
throws ThumbnailCreationException
- Specified by:
getDocumentInfo in class AbstractThumbnailCreator
- Returns:
- the DocumentiInfo to set on the thumbnails panel
- Throws:
ThumbnailCreationException
getDocumentModel
protected java.util.Vector<VisualPageListItem> getDocumentModel(java.util.List<DocumentPage> template)
throws ThumbnailCreationException
- Description copied from class:
AbstractThumbnailCreator
- The model to set on thumbnails list before the thumbnails generation starts. This is used to show hourglasses images as thumbnails.
- Specified by:
getDocumentModel in class AbstractThumbnailCreator
- Parameters:
template - Pages template. Used when loading an environment to set rotation and other informations
- Returns:
- a Vector of VisualPageListItem
- Throws:
ThumbnailCreationException
getGenerationTasks
protected java.util.Collection<? extends java.util.concurrent.Callable<java.lang.Boolean>> getGenerationTasks(java.util.Vector<VisualPageListItem> modelList)
throws ThumbnailCreationException
- Specified by:
getGenerationTasks in class AbstractThumbnailCreator
- Parameters:
modelList - the model list set on the Visual List Component
- Returns:
- a Collection of tasks that will run the thumbnails generation
- Throws:
ThumbnailCreationException
initThumbnailsCreation
protected void initThumbnailsCreation()
throws ThumbnailCreationException
- Description copied from class:
AbstractThumbnailCreator
- initialization of the thumbnail creation process
- Specified by:
initThumbnailsCreation in class AbstractThumbnailCreator
- Throws:
ThumbnailCreationException
openInputDocument
protected boolean openInputDocument()
throws ThumbnailCreationException
- Description copied from class:
AbstractThumbnailCreator
- Opens the input document
- Specified by:
openInputDocument in class AbstractThumbnailCreator
- Returns:
- true if opened correctly
- Throws:
ThumbnailCreationException