se.datadosen.jalbum
Interface AlbumObject

All Superinterfaces:
java.awt.datatransfer.Transferable
All Known Implementing Classes:
AlbumObjectImpl

public interface AlbumObject
extends java.awt.datatransfer.Transferable


Field Summary
static java.awt.datatransfer.DataFlavor albumObjectFlavor
           
static java.lang.String FOLDER_ORDERING_KEY
           
static java.lang.String FOLDERS_FIRST_KEY
           
static java.lang.String ORDER_BY_CAMERA_DATE
           
static java.lang.String ORDER_BY_DATE
           
static java.lang.String ORDER_BY_NAME
           
static java.lang.String ORDER_BY_RATING
           
static java.lang.String ORDER_CUSTOM
           
static java.lang.String ORDER_JALBUM
           
static java.lang.String ORDERING_KEY
           
static java.lang.String REVERSE_FOLDER_ORDERING_KEY
           
static java.lang.String REVERSE_ORDERING_KEY
           
 
Method Summary
 void add(java.util.List<java.io.File> files)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a property change listener to album object.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 boolean containsName(java.lang.String name)
           
 AlbumObject createFolder(java.lang.String suggestedName)
          Create a folder (with some relevant backing) and make folder a child of this AlbumObject
 void delete()
           
 AlbumObject getChild(java.lang.String childPath)
           
 java.util.List<AlbumObject> getChildren()
           
 java.lang.String getComment()
           
 AlbumObjectFactory getFactory()
           
 java.io.File getFile()
           
 java.lang.String getFolderOrdering()
           
 long getLastModified()
           
 AlbumObjectMetadata getMetadata()
           
 java.lang.String getName()
           
 java.lang.String getOrdering()
           
 AlbumObject getParent()
           
 java.lang.String getPathFromRoot()
          Get the path to this AlbumObject in the form folder/subfolder/albumObject
 AlbumObjectProperties getProperties()
          Get properties bound to this object.
 AlbumObject getRepresentingAlbumObject()
           
 AlbumObject getRepresentingAlbumObject(boolean force)
           
 javax.swing.ImageIcon getRepresentingIcon(java.awt.Dimension bounds, boolean enlarge)
           
 javax.swing.ImageIcon getRepresentingIcon(java.awt.Dimension bounds, boolean cropToBounds, boolean enlarge)
           
 java.io.File getRepresentingIconFile()
           
 java.lang.String getThumbnailPath()
           
 void invalidate()
          Call if underlaying (file) structure has changed Will force synchronization with underlaying structure when getChildren is called
 boolean isDisplayableImage()
           
 boolean isFolder()
           
 boolean isFoldersFirst()
           
 boolean isIncluded()
           
 boolean isLink()
           
 boolean isReverseFolderOrdering()
           
 boolean isReverseOrdering()
           
 java.awt.Image loadImage()
           
 java.awt.Image loadImage(boolean useFastLoading, java.awt.Dimension imageDim)
           
 void moveTo(AlbumObject newParent)
           
 void moveTo(AlbumObject newParent, int position)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Unregisters listeners.
 boolean repairLink(java.io.File newTarget)
           
 void rotateLeft()
           
 void rotateRight()
           
 void setChildren(java.util.List<AlbumObject> children)
          Set List of children AlbumObjects if this is a directory/folder
 void setComment(java.lang.String newComment)
           
 void setFolderOrdering(java.lang.String folderOrdering)
           
 void setFoldersFirst(boolean foldersFirst)
           
 void setIncluded(boolean included)
           
 boolean setName(java.lang.String newName)
          Set the name of this AlbumObject
 void setOrdering(java.lang.String ordering)
           
 void setRepresentingAlbumObject(AlbumObject rep)
           
 void setRepresentingIcon(java.awt.image.BufferedImage thumbnail, boolean changed)
           
 void setReverseFolderOrdering(boolean reverseFolderOrdering)
           
 void setReverseOrdering(boolean reverseOrdering)
           
 void updateRepresentingIcon()
           
 
Methods inherited from interface java.awt.datatransfer.Transferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported
 

Field Detail

ORDERING_KEY

static final java.lang.String ORDERING_KEY
See Also:
Constant Field Values

REVERSE_ORDERING_KEY

static final java.lang.String REVERSE_ORDERING_KEY
See Also:
Constant Field Values

FOLDERS_FIRST_KEY

static final java.lang.String FOLDERS_FIRST_KEY
See Also:
Constant Field Values

FOLDER_ORDERING_KEY

static final java.lang.String FOLDER_ORDERING_KEY
See Also:
Constant Field Values

REVERSE_FOLDER_ORDERING_KEY

static final java.lang.String REVERSE_FOLDER_ORDERING_KEY
See Also:
Constant Field Values

ORDER_JALBUM

static final java.lang.String ORDER_JALBUM
See Also:
Constant Field Values

ORDER_CUSTOM

static final java.lang.String ORDER_CUSTOM
See Also:
Constant Field Values

ORDER_BY_DATE

static final java.lang.String ORDER_BY_DATE
See Also:
Constant Field Values

ORDER_BY_CAMERA_DATE

static final java.lang.String ORDER_BY_CAMERA_DATE
See Also:
Constant Field Values

ORDER_BY_RATING

static final java.lang.String ORDER_BY_RATING
See Also:
Constant Field Values

ORDER_BY_NAME

static final java.lang.String ORDER_BY_NAME
See Also:
Constant Field Values

albumObjectFlavor

static final java.awt.datatransfer.DataFlavor albumObjectFlavor
Method Detail

getParent

AlbumObject getParent()
Returns:
parent AlbumObject or null if no parent

getFile

java.io.File getFile()
Returns:
backing File or null if no backing file Caller should always be prepared to receive a null value

getLastModified

long getLastModified()
Returns:
last modified date of file or applied filters, whatever is latest

loadImage

java.awt.Image loadImage(boolean useFastLoading,
                         java.awt.Dimension imageDim)
                         throws java.io.IOException
Parameters:
useFastLoading - enable fast loading.
imageDim - Dimension used to calculate scale for fast loading.
Returns:
backing Image or null if not displayable. Use isDisplayable() to check
Throws:
java.io.IOException

loadImage

java.awt.Image loadImage()
                         throws java.io.IOException
Returns:
backing Image or null if not displayable. Use isDisplayable() to check
Throws:
java.io.IOException

getFactory

AlbumObjectFactory getFactory()

getName

java.lang.String getName()
Returns:
String name of AlbumObject

setName

boolean setName(java.lang.String newName)
Set the name of this AlbumObject


getComment

java.lang.String getComment()

setComment

void setComment(java.lang.String newComment)
                throws java.io.IOException
Throws:
java.io.IOException

getMetadata

AlbumObjectMetadata getMetadata()

getProperties

AlbumObjectProperties getProperties()
Get properties bound to this object. AlbumObjectProperties are not just plain strings.

Returns:
AlbumObjectProperties
Since:
8.0
See Also:
AlbumObjectProperties

rotateLeft

void rotateLeft()
                throws java.io.IOException
Throws:
java.io.IOException

rotateRight

void rotateRight()
                 throws java.io.IOException
Throws:
java.io.IOException

delete

void delete()
            throws java.io.IOException,
                   PermissionException
Throws:
java.io.IOException
PermissionException

createFolder

AlbumObject createFolder(java.lang.String suggestedName)
                         throws java.io.IOException
Create a folder (with some relevant backing) and make folder a child of this AlbumObject

Parameters:
suggestedName - String
Returns:
AlbumObject for newly created folder
Throws:
java.io.IOException

isDisplayableImage

boolean isDisplayableImage()
Returns:
boolean true if this album object is displayable in an album

isLink

boolean isLink()
Returns:
boolean true if this AlbumObject represents a folder/directory that is physically linked

isFolder

boolean isFolder()
Returns:
boolean true if this AlbumObject represents a folder/directory

isIncluded

boolean isIncluded()

setIncluded

void setIncluded(boolean included)

getChildren

java.util.List<AlbumObject> getChildren()
Returns:
List of children AlbumObjects of this AlbumObject or null if this is not a directory/folder. Will return an empty list if this is an empty directory/folder

getChild

AlbumObject getChild(java.lang.String childPath)
Since:
8.1

setChildren

void setChildren(java.util.List<AlbumObject> children)
                 throws java.io.IOException
Set List of children AlbumObjects if this is a directory/folder

Throws:
java.io.IOException

containsName

boolean containsName(java.lang.String name)

moveTo

void moveTo(AlbumObject newParent)
            throws java.io.IOException
Throws:
java.io.IOException

moveTo

void moveTo(AlbumObject newParent,
            int position)
            throws java.io.IOException
Throws:
java.io.IOException

repairLink

boolean repairLink(java.io.File newTarget)
                   throws java.io.IOException
Throws:
java.io.IOException

add

void add(java.util.List<java.io.File> files)
         throws java.io.IOException
Throws:
java.io.IOException

getOrdering

java.lang.String getOrdering()

setOrdering

void setOrdering(java.lang.String ordering)
                 throws java.io.IOException
Throws:
java.io.IOException

getFolderOrdering

java.lang.String getFolderOrdering()

setFolderOrdering

void setFolderOrdering(java.lang.String folderOrdering)
                       throws java.io.IOException
Throws:
java.io.IOException

isFoldersFirst

boolean isFoldersFirst()

setFoldersFirst

void setFoldersFirst(boolean foldersFirst)
                     throws java.io.IOException
Throws:
java.io.IOException

isReverseOrdering

boolean isReverseOrdering()

setReverseOrdering

void setReverseOrdering(boolean reverseOrdering)
                        throws java.io.IOException
Throws:
java.io.IOException

isReverseFolderOrdering

boolean isReverseFolderOrdering()

setReverseFolderOrdering

void setReverseFolderOrdering(boolean reverseFolderOrdering)
                              throws java.io.IOException
Throws:
java.io.IOException

setRepresentingIcon

void setRepresentingIcon(java.awt.image.BufferedImage thumbnail,
                         boolean changed)
                         throws java.io.IOException
Throws:
java.io.IOException

getRepresentingAlbumObject

AlbumObject getRepresentingAlbumObject()

getRepresentingAlbumObject

AlbumObject getRepresentingAlbumObject(boolean force)

setRepresentingAlbumObject

void setRepresentingAlbumObject(AlbumObject rep)

updateRepresentingIcon

void updateRepresentingIcon()
                            throws java.io.IOException
Throws:
java.io.IOException

invalidate

void invalidate()
Call if underlaying (file) structure has changed Will force synchronization with underlaying structure when getChildren is called


getRepresentingIcon

javax.swing.ImageIcon getRepresentingIcon(java.awt.Dimension bounds,
                                          boolean enlarge)
                                          throws java.io.IOException
Parameters:
bounds -
enlarge -
Returns:
small Icon representing this AlbumObject (be it a thumbnail or icon)
Throws:
java.io.IOException

getRepresentingIcon

javax.swing.ImageIcon getRepresentingIcon(java.awt.Dimension bounds,
                                          boolean cropToBounds,
                                          boolean enlarge)
                                          throws java.io.IOException
Throws:
java.io.IOException

getRepresentingIconFile

java.io.File getRepresentingIconFile()
Returns:
File reference to image representing this AlbumObject or null if it is not an icon

getThumbnailPath

java.lang.String getThumbnailPath()

addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener to album object. To get alerted on comment changes for now Uses weak references so will not prevent listeners from being garbage collected

Parameters:
listener -

getPathFromRoot

java.lang.String getPathFromRoot()
Get the path to this AlbumObject in the form folder/subfolder/albumObject

Since:
8.0

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregisters listeners. Does not neccesarily need to be called as we use weak references

Parameters:
listener -

addPropertyChangeListener

void addPropertyChangeListener(java.lang.String propertyName,
                               java.beans.PropertyChangeListener listener)