uk.ac.kcl.cch.jb.pliny.pdfAnnot.model
Class PdfResource

java.lang.Object
  extended byuk.ac.kcl.cch.rdb2java.dynData.PropertyChangeObject
      extended byuk.ac.kcl.cch.rdb2java.dynData.BaseObject
          extended byuk.ac.kcl.cch.jb.pliny.model.Resource
              extended byuk.ac.kcl.cch.jb.pliny.pdfAnnot.model.PdfResource
All Implemented Interfaces:
IAuthorityListItem, IHasAttributeProperties, ILoadableFromResultSet, INamedObject, IPropertyChangeObject

public class PdfResource
extends Resource
implements IHasAttributeProperties

an extension on the Pliny Resource that contains special data for PDF files. Most of the extra image data is stored in the Resource's attributes field, packed in via the AttributedResourceHandler.

The Page number is not stored in the Resource, and is therefore not persistent from here. This is because, of course, any particular page number is not really a part of the resource. It is provided here as a convenient way for the various classes that need to know the current page number being displayed can get at it.

Author:
John Bradley

Nested Class Summary
 
Nested classes inherited from class uk.ac.kcl.cch.rdb2java.dynData.BaseObject
BaseObject.ListItemData
 
Field Summary
static String CURRENTPAGE_EVENT
           
static String SCALECHANGE_EVENT
           
 
Fields inherited from class uk.ac.kcl.cch.jb.pliny.model.Resource
ATTRIBUTES_PROP, FAVOURITES_PROP, FULLNAME_PROP, IDENTIFIER_PROP, IDSTART_PROP, INITCHAR_PROP, myCache, MYDISPLAYEDITEMS_PROP, MYSOURCEROLES_PROP, MYSURROGATES_PROP, MYTARGETROLES_PROP, NAME_PROP, OBJECTTYPEKEY_PROP, resourceKey
 
Constructor Summary
PdfResource()
           
PdfResource(boolean empty)
           
 
Method Summary
 int getCacheNumber()
          gets the image cache ID for this image.
 int getCurrentPage()
           
 String getMyCachedPdfFilename()
          returns the full path filename for the cached PDF file that is associated with this resource.
 FKReferenceList getMyPagedDisplayedItems()
          returns the set of LinkableObjects that should be displayed on the current page as reference objects.
 org.jpedal.PdfDecoder getMyPdfDecoder()
          returns the PdfDecoder which currently is working with this PDF file.
 org.eclipse.jface.resource.ImageDescriptor getMyThumbnailDescriptor()
          returns an JFace ImageDescriptor for the thumbnail image that is is associated with the PDF file associated with this resource.
 org.eclipse.swt.graphics.Image getPageImage()
          returns a SWT Image of the current page of this PDF file.
 float getScale()
          gets the current scale setting for the PDF page images.
 String getUrl()
          gets the URL (as a character string) for the original version of the image referenced by this Resource.
 void setCacheNumber(int numb)
          sets the image cache ID for this image.
 void setCurrentPage(int currentPage)
           
 void setScale(float scale)
          sets the current scale setting for the PDF page images.
 void setSwtImageFromPdf(SwtImageFromPdf maker)
           
 void setUrl(String url)
          sets the URL that points to the original version of the image referenced by this Resource.
 
Methods inherited from class uk.ac.kcl.cch.jb.pliny.model.Resource
assignMyReferencesTo, assignMyReferencesTo, closeMyEditor, deleteMe, doInsert, EditorInput2idString, find, find, getALID, getALItem, getAttributes, getFavourites, getFullName, getIdentifier, getIdStart, getInitChar, getInitChar, getItem, getKeyName, getMyConnection, getMyDisplayedItems, getMySourceRoles, getMySurrogates, getMyTargetRoles, getName, getObjectType, getObjectTypeKey, getResourceKey, getSelectEntities, getSQLFrom, getTableJoins, getTableName, idString2EditorInput, isDeletable, isFavourite, loadFromResultSet, openEditor, openEditor, reIntroduceMe, returnMyConnection, setAttributes, setEmpty, setFullName, setIdentifier, setIdentifiers, setIdentifiers, setIdStart, setInitChar, setName, setObjectType, signalChangeFavourites, signalChangeMyDisplayedItems, signalChangeMySourceRoles, signalChangeMySurrogates, signalChangeMyTargetRoles, toString, updateDBName
 
Methods inherited from class uk.ac.kcl.cch.rdb2java.dynData.BaseObject
doSQL, getSavedID, makeWhere, updateDBboolean, updateDBboolean, updateDBint, updateDBint, updateDBString, updateDBString, updateDBTimestamp, updateDBTimestamp
 
Methods inherited from class uk.ac.kcl.cch.rdb2java.dynData.PropertyChangeObject
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CURRENTPAGE_EVENT

public static final String CURRENTPAGE_EVENT
See Also:
Constant Field Values

SCALECHANGE_EVENT

public static final String SCALECHANGE_EVENT
See Also:
Constant Field Values
Constructor Detail

PdfResource

public PdfResource()

PdfResource

public PdfResource(boolean empty)
Method Detail

getCurrentPage

public int getCurrentPage()
Overrides:
getCurrentPage in class Resource

setCurrentPage

public void setCurrentPage(int currentPage)
Overrides:
setCurrentPage in class Resource

getMyPagedDisplayedItems

public FKReferenceList getMyPagedDisplayedItems()
returns the set of LinkableObjects that should be displayed on the current page as reference objects.

Overrides:
getMyPagedDisplayedItems in class Resource

getUrl

public String getUrl()
gets the URL (as a character string) for the original version of the image referenced by this Resource.

Overrides:
getUrl in class Resource

setUrl

public void setUrl(String url)
sets the URL that points to the original version of the image referenced by this Resource.


getCacheNumber

public int getCacheNumber()
gets the image cache ID for this image.


setCacheNumber

public void setCacheNumber(int numb)
sets the image cache ID for this image.


getScale

public float getScale()
gets the current scale setting for the PDF page images.

Returns:
float the current scale setting

setScale

public void setScale(float scale)
sets the current scale setting for the PDF page images.

Parameters:
scale - float the current scale setting

getMyCachedPdfFilename

public String getMyCachedPdfFilename()
returns the full path filename for the cached PDF file that is associated with this resource.

Returns:
String the full path filename to the cached file

getMyThumbnailDescriptor

public org.eclipse.jface.resource.ImageDescriptor getMyThumbnailDescriptor()
returns an JFace ImageDescriptor for the thumbnail image that is is associated with the PDF file associated with this resource.

Returns:
the ImageDescriptor for the associated thumbnail

setSwtImageFromPdf

public void setSwtImageFromPdf(SwtImageFromPdf maker)

getPageImage

public org.eclipse.swt.graphics.Image getPageImage()
returns a SWT Image of the current page of this PDF file.

Returns:
Image of this current page.

getMyPdfDecoder

public org.jpedal.PdfDecoder getMyPdfDecoder()
returns the PdfDecoder which currently is working with this PDF file.

Returns:
Image of this current page.