|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.AbstractDBEntry
com.antelmann.db.PropertyEntryImpl
com.antelmann.image.ImageURLEntry
public class ImageURLEntry
ImageEntry serves as a basic wrapper for image information stored in a database.
This implementation relies on a weak reference to access the actual image data,
which e.g. may be read from a file when calling getImage() which would
trigger the method retrieveImage() to retrieve the image.
ImageURLEntrySQLStore,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
ImageURLEntry.Thumbnail<T extends ImageURLEntry>
|
| Nested classes/interfaces inherited from interface com.antelmann.db.Taggable |
|---|
Taggable.Adapter<T extends Tag> |
| Nested classes/interfaces inherited from interface com.antelmann.util.Localizable |
|---|
Localizable.Adapter |
| Field Summary |
|---|
| Fields inherited from class com.antelmann.db.PropertyEntryImpl |
|---|
propertyChangeSupport, props, um, vcs |
| Fields inherited from interface com.antelmann.db.DBEntry |
|---|
ENTRY_FLAVOR, ENTRY_LIST_FLAVOR |
| Constructor Summary | |
|---|---|
ImageURLEntry()
uses a random id |
|
ImageURLEntry(Object id)
time is automatically set to current system time |
|
ImageURLEntry(Object id,
ImageURLEntry ie)
creates a new ImageHolder based on the given one - with a different ID |
|
| Method Summary | |
|---|---|
boolean |
add(Keyword word)
makes this instance member of the given group |
boolean |
addKeyword(String keyword)
|
boolean |
addRegionTag(SimpleRegionTag tag)
|
void |
clear()
resets all fields |
Date |
getBeginTime()
returns getDate() |
InputStream |
getContent()
accesses the raw content of this document |
Date |
getDate()
simply returns the embedded time as a new Date instance |
String |
getDescription()
provides a detailed description of this document |
Image |
getDisplayIcon()
returns an image that is suitable for use as an icon for this instance. |
Image |
getDisplayImage()
returns an image that represents a visual representation of this instance. |
Date |
getEndTime()
always returns null |
GeoPoint |
getGeoPoint()
|
Image |
getImage()
|
Locale |
getLocale()
allows access to the Locale that this instance currently uses to localize its messages, |
String |
getNotes()
always returns null |
URL |
getOriginalLocation()
returns getURL() |
SimpleRegionTag[] |
getRegionTags()
|
Collection<Keyword> |
getTags()
lists all groups that this instance is currently a member of (the data is essentially derived from a set) |
Image |
getThumbnail()
|
long |
getTime()
|
String |
getTitle()
returns the title of this document |
URL |
getURL()
|
boolean |
hasKeyword(String keyword)
|
boolean |
isTagged(Keyword word)
allows to determine the membership of the given tag or group |
boolean |
remove(Keyword word)
terminates the membership of this instance to the given group |
boolean |
removeKeyword(String keyword)
|
boolean |
removeRegionTag(SimpleRegionTag tag)
|
protected Image |
retrieveImage()
this method is responsible for loading the original image from its original location; this method is called by getImage()
if the image is not cached anymore by the weak reference holding the data. |
void |
setDescription(String description)
|
void |
setGeoPoint(GeoPoint gp)
|
protected void |
setImageReference(Image image)
this method merely sets the soft reference to the given image. |
void |
setLocale(Locale locale,
Object context)
sets the Locale for this object so that all subsequent return values of method calls to this instance can be localized accordingly until a different Locale is set. |
void |
setThumbnail(Image image)
|
void |
setTime(Date date)
|
void |
setTime(long timeInMillis)
|
void |
setTitle(String title)
|
void |
setURL(URL url)
|
String |
toDetailedString()
provides full details of this instance in a String. |
String |
toString()
|
void |
updateThumbnail(int maxWidthHeight)
updates the thumbnail based on the return value of getImage(). |
| Methods inherited from class com.antelmann.db.AbstractDBEntry |
|---|
equals, getID, hashCode, hashEntry, sameEntry |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.antelmann.db.PropertyEntry |
|---|
getProperties, getProperty, removeProperty, setProperty |
| Methods inherited from interface com.antelmann.db.DBEntry |
|---|
getID |
| Constructor Detail |
|---|
public ImageURLEntry()
public ImageURLEntry(Object id)
public ImageURLEntry(Object id,
ImageURLEntry ie)
throws IOException
IOException| Method Detail |
|---|
public Locale getLocale()
Localizable
getLocale in interface LocalizableLocalizable.setLocale(Locale, Object)
public void setLocale(Locale locale,
Object context)
Localizable
setLocale in interface Localizablelocale - the Locale that is to be used to determine return values for all methods
of this instance; if set to null, the default locale is to be used.context - a context that may be required for this instance to load the resources for the given locale;
this context may be null for objects that do not require an external context.
Examples of a context may be a database, a resource file, some map or no context at all.Localizable.getLocale()
protected Image retrieveImage()
throws IOException
getImage()
if the image is not cached anymore by the weak reference holding the data.
This implementation retrieves the image from the URL.
IOExceptiongetURL()
public Image getImage()
throws IOException
IOException
protected void setImageReference(Image image)
throws IOException
getImage(),
a subclass must provide a method to also ensure that retrieveImage()
returns this image (while that method should also call this method!).
IOExceptionpublic void clear()
public String toString()
toString in class AbstractDBEntrypublic String toDetailedString()
DetailedString
toDetailedString in interface DetailedStringtoDetailedString in class PropertyEntryImpl
public Image getDisplayImage()
throws IOException
Imageable
getDisplayImage in interface ImageableIOException
public Image getDisplayIcon()
throws IOException
Imageable
getDisplayIcon in interface ImageableIOExceptionpublic String getTitle()
DocumentEntry
getTitle in interface DocumentEntrypublic void setTitle(String title)
public URL getURL()
public void setURL(URL url)
public Date getDate()
public long getTime()
public void setTime(long timeInMillis)
public void setTime(Date date)
public String getDescription()
DocumentEntry
getDescription in interface DocumentEntrypublic void setDescription(String description)
public GeoPoint getGeoPoint()
getGeoPoint in interface GeoEncodedpublic void setGeoPoint(GeoPoint gp)
public void updateThumbnail(int maxWidthHeight)
throws IOException
getImage().
The image is scaled so that it will fit into a square with the given boundary;
the thumbnail maintains the original ratio.
IOException
public void setThumbnail(Image image)
throws IOException
IOException
public Image getThumbnail()
throws IOException
IOExceptionpublic boolean addKeyword(String keyword)
public boolean add(Keyword word)
Taggable
add in interface Taggable<Keyword>word - the Group object that this instance is to become a member of
public Collection<Keyword> getTags()
Taggable
getTags in interface Taggable<Keyword>public boolean hasKeyword(String keyword)
public boolean isTagged(Keyword word)
Taggable
isTagged in interface Taggable<Keyword>public boolean removeKeyword(String keyword)
public boolean remove(Keyword word)
Taggable
remove in interface Taggable<Keyword>word - the Group that this instance is to be removed from as a member
public SimpleRegionTag[] getRegionTags()
public boolean removeRegionTag(SimpleRegionTag tag)
public boolean addRegionTag(SimpleRegionTag tag)
public Date getBeginTime()
getDate()
getBeginTime in interface LifeCycleObjectpublic Date getEndTime()
getEndTime in interface LifeCycleObject
public InputStream getContent()
throws IOException
DocumentEntry
getContent in interface DocumentEntryIOExceptionpublic String getNotes()
getNotes in interface DocumentEntrypublic URL getOriginalLocation()
getURL()
getOriginalLocation in interface DocumentEntry
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||