uk.ac.kcl.cch.jb.pliny.imageRes.model
Class ImageResource

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.imageRes.model.ImageResource
All Implemented Interfaces:
IAuthorityListItem, IHasAttributeProperties, ILoadableFromResultSet, INamedObject, IPropertyChangeObject, IZoomableImageResource

public class ImageResource
extends Resource
implements IHasAttributeProperties, IZoomableImageResource

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

Author:
John Bradley

Nested Class Summary
 
Nested classes inherited from class uk.ac.kcl.cch.rdb2java.dynData.BaseObject
BaseObject.ListItemData
 
Field Summary
 
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
ImageResource()
          creates a new instance of the ImageResource and stores it in the backing store DB.
ImageResource(boolean empty)
          creates a new instance of the ImageResource and if the parameter is true does i initially store it in the backing store DB.
 
Method Summary
 int getCacheNumber()
          gets the image cache ID for this image.
 String getExtension()
          gets the filename extension (and by implication, the image type) for the image referenced by this Resource.
 String getIdentifier()
           
 org.eclipse.draw2d.geometry.Rectangle getImagePosition()
          returns the current Image position within the editors annotation area (as a draw2d Rectange).
 org.eclipse.jface.resource.ImageDescriptor getMyImageDescriptor()
          gets an image descriptor handle to the image in the Image cache for this image.
 org.eclipse.jface.resource.ImageDescriptor getMyThumbnailDescriptor()
          gets an image descriptor handle to the thumbnail version of this image (stored in the cache).
 String getUrl()
          gets the URL (as a character string) for the original version of the image referenced by this Resource.
 int getZoomSize()
          gets the current zoomsize for the image referenced by this Resource.
 void setCacheNumber(int numb)
          sets the image cache ID for this image.
 void setExtension(String ext)
          sets the filename extension (and by implication, the image type) for the image referenced by this Resource.
 void setImagePosition(org.eclipse.draw2d.geometry.Rectangle r)
          sets the current Image position within the editors annotation area (as a draw2d Rectange) to the given value.
 void setUrl(String url)
          sets the URL that points to the original version of the image referenced by this Resource.
 void setZoomSize(int zoom)
          sets the current zoomsize for 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, getCurrentPage, getFavourites, getFullName, getIdStart, getInitChar, getInitChar, getItem, getKeyName, getMyConnection, getMyDisplayedItems, getMyPagedDisplayedItems, getMySourceRoles, getMySurrogates, getMyTargetRoles, getName, getObjectType, getObjectTypeKey, getResourceKey, getSelectEntities, getSQLFrom, getTableJoins, getTableName, idString2EditorInput, isDeletable, isFavourite, loadFromResultSet, openEditor, openEditor, reIntroduceMe, returnMyConnection, setAttributes, setCurrentPage, 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
 
Methods inherited from interface uk.ac.kcl.cch.jb.pliny.controls.IZoomableImageResource
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

ImageResource

public ImageResource()
creates a new instance of the ImageResource and stores it in the backing store DB.


ImageResource

public ImageResource(boolean empty)
creates a new instance of the ImageResource and if the parameter is true does i initially store it in the backing store DB.

Method Detail

getIdentifier

public String getIdentifier()
Overrides:
getIdentifier in class Resource

getImagePosition

public org.eclipse.draw2d.geometry.Rectangle getImagePosition()
returns the current Image position within the editors annotation area (as a draw2d Rectange).

Specified by:
getImagePosition in interface IZoomableImageResource
Returns:
Rectangle the resource's current ImagePosition setting.

setImagePosition

public void setImagePosition(org.eclipse.draw2d.geometry.Rectangle r)
sets the current Image position within the editors annotation area (as a draw2d Rectange) to the given value.


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.


getExtension

public String getExtension()
gets the filename extension (and by implication, the image type) for the image referenced by this Resource.


setExtension

public void setExtension(String ext)
sets the filename extension (and by implication, the image type) for the image referenced by this Resource.


getZoomSize

public int getZoomSize()
gets the current zoomsize for the image referenced by this Resource.

Specified by:
getZoomSize in interface IZoomableImageResource
Returns:
int the current zoom size.

setZoomSize

public void setZoomSize(int zoom)
sets the current zoomsize for the image referenced by this Resource.

Specified by:
setZoomSize in interface IZoomableImageResource
Parameters:
zoom - int the new zoom size to save.

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.


getMyImageDescriptor

public org.eclipse.jface.resource.ImageDescriptor getMyImageDescriptor()
gets an image descriptor handle to the image in the Image cache for this image.

Returns:
an ImageDescriptor for this image.

getMyThumbnailDescriptor

public org.eclipse.jface.resource.ImageDescriptor getMyThumbnailDescriptor()
gets an image descriptor handle to the thumbnail version of this image (stored in the cache).

Returns:
an ImageDescriptor for this image.