Package se.datadosen.jalbum
Interface AlbumObject
- All Superinterfaces:
Comparable<AlbumObject>
,Transferable
- All Known Implementing Classes:
AlbumObjectImpl
,FileAlbumObject
,VirtualFolder
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int index, Set<AlbumObject> objects) Add list of AlbumObjcts to (before) given index, replacing existing objects with the added onesvoid
add
(int index, AlbumObject object) Add AlbumObjct to (before) given index, replacing existing object with the added onesvoid
void
add
(Set<AlbumObject> objects) Add list of AlbumObjcts to children, replacing existing objects with the added onesvoid
add
(AlbumObject object) Add AlbumObjct to children, replacing existing object with the added onesvoid
Adds a property change listener to album object.void
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) boolean
containsName
(String name) createFolder
(int index, String suggestedName) Create a folder (with some relevant backing) and make folder a child of this AlbumObjectcreateFolder
(String suggestedName) Create a folder (with some relevant backing) and make folder a child of this AlbumObjectcreatePage
(int index, String suggestedName) Create an empty web page (with some relevant backing) and make this a child of this AlbumObjectcreatePage
(int index, String suggestedName, File template) Create a web page (with some relevant backing) and make this a child of this AlbumObjectvoid
delete()
void
Fire a "modelChanged" property event, causing UI to update Used by undo/redo mechanismlong
default List<AlbumObject>
getChildren
(boolean ordered) default List<AlbumObject>
getChildren
(Predicate<AlbumObject> filter) default List<AlbumObject>
getChildren
(Category ofCategory) Return an unmodifiable collection of all included, visible children and descendants of this AlbumObject.getDescendants
(IncludeOption opt, IncludeOption... opts) Return an unmodifiable collection of all included, visible children and descendants of this AlbumObject.getFile()
getFlag()
long
getName()
getPathFrom
(AlbumObject folder) Get the path from "folder" to this AlbumObject in the form folder/subfolder/albumObjectGet the path to this AlbumObject in the form folder/subfolder/albumObjectGet properties bound to this object.int
getRepresentingAlbumObject
(boolean force) getRepresentingIcon
(Dimension bounds, boolean enlarge) getRepresentingIcon
(Dimension bounds, boolean cropToBounds, boolean enlarge) For ordinary images, this method will simply return the image file reference itself.getSize()
getSize
(boolean filteredSize) getTitle()
getUniqueName
(String suggestedName) getVars()
jAlbum 9.4long
Get xmp properties bound to this objectboolean
void
Call if underlying (file) structure has changed Will force synchronization with underlying structure when getChildren is calledboolean
boolean
isFolder()
boolean
boolean
isHidden()
boolean
boolean
boolean
isLink()
boolean
boolean
boolean
boolean
isWithin
(AlbumObject parent) void
moveTo
(AlbumObject newParent) void
moveTo
(AlbumObject newParent, int position) void
moveTo
(AlbumObject newParent, String newName) void
moveTo
(AlbumObject newParent, String newName, int position) void
Unregisters listeners.boolean
repairLink
(File newTarget) void
void
void
setCameraDate
(long cameraDate) void
setChildren
(List<AlbumObject> children) Set List of children AlbumObjects if this is a directory/foldervoid
setComment
(String newComment) void
void
setFolderOrdering
(AlbumObject.Ordering folderOrdering) void
setFoldersFirst
(boolean foldersFirst) void
setHidden
(boolean hidden) void
setIncluded
(boolean included) void
setIncludeOriginal
(boolean includeOriginal) void
setKeywords
(String keywords) default void
setKeywords
(Set<String> keywords) void
setLastModified
(long lastModified) boolean
Set the name of this AlbumObjectvoid
setOrdering
(AlbumObject.Ordering ordering) void
void
setRating
(int rating) void
void
setRepresentingIcon
(BufferedImage thumbnail, boolean changed) void
setReverseFolderOrdering
(boolean reverseFolderOrdering) void
setReverseOrdering
(boolean reverseOrdering) boolean
void
setUseOriginal
(boolean useOriginal) void
void
setWhenAdded
(long whenAdded) void
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface java.awt.datatransfer.Transferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported
-
Field Details
-
albumObjectFlavor
-
-
Method Details
-
getParent
AlbumObject getParent()- Returns:
- parent AlbumObject or null if no parent
-
getFile
File getFile()- Returns:
- backing File or null if no backing file Caller should always be prepared to receive a null value
-
getFactory
AlbumObjectFactory getFactory() -
getEngine
AlbumBean getEngine()- Returns:
- Current AlbumBean engine
- Since:
- 20.1
-
getLastModified
long getLastModified()- Returns:
- last modified date of file or applied filters, whatever is latest
-
setLastModified
- Throws:
IOException
- Since:
- 20.1
-
getWhenAdded
long getWhenAdded()- Returns:
- Date this album object was added to the album
-
getCameraDate
long getCameraDate()- Returns:
- Camera date for this object
- Since:
- 29.4
-
setCameraDate
void setCameraDate(long cameraDate) -
setWhenAdded
- Throws:
IOException
- Since:
- 12.6.5
-
loadImage
- 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:
IOException
-
loadImage
Image loadImage(boolean useFastLoading, Dimension imageDim, boolean applyFilters) throws IOException - Parameters:
useFastLoading
- enable fast loading.imageDim
- Dimension used to calculate scale for fast loading.applyFilters
- whether to apply image specific filters or not- Returns:
- backing Image or null if not displayable. Use isDisplayable() to check
- Throws:
IOException
- Since:
- 32
-
loadImage
- Returns:
- backing Image or null if not displayable. Use isDisplayable() to check
- Throws:
IOException
-
getName
String getName()- Returns:
- String name of AlbumObject
-
getWebName
String getWebName()- Returns:
- String name of AlbumObject in the final web album (not URL-encoded)
-
setName
Set the name of this AlbumObject -
getComment
String getComment() -
setComment
- Throws:
IOException
-
getTitle
String getTitle()- Since:
- 9.6
-
setTitle
- Throws:
IOException
- Since:
- 9.6
-
getRating
int getRating()- Since:
- 9.6
-
setRating
- Throws:
IOException
- Since:
- 9.6
-
getFlag
Flag getFlag()- Since:
- 10.0
-
setFlag
- Throws:
IOException
- Since:
- 10.0
-
getKeywords
String getKeywords()- Since:
- 11.6
-
getKeywordSet
- Returns:
- Since:
- 14.2
-
setKeywords
- Throws:
IOException
- Since:
- 11.6
-
setKeywords
- Throws:
IOException
- Since:
- 24
-
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:
-
getXmpManager
XmpManager getXmpManager()Get xmp properties bound to this object- Returns:
- the xmpManager or null if this object doesn't support xmp
- Since:
- 10.0
-
rotateLeft
- Throws:
IOException
-
rotateRight
- Throws:
IOException
-
getOrientation
Orientation getOrientation() -
setOrientation
- Throws:
IOException
-
isIncludeOriginal
boolean isIncludeOriginal()- Since:
- 11.2
-
setIncludeOriginal
- Throws:
IOException
- Since:
- 11.2
-
isUseOriginal
boolean isUseOriginal()- Since:
- 13.10
-
setUseOriginal
- Throws:
IOException
- Since:
- 13.10
-
delete
- Throws:
IOException
PermissionException
-
createFolder
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:
IOException
-
createFolder
Create a folder (with some relevant backing) and make folder a child of this AlbumObject- Parameters:
index
- Location to insert tosuggestedName
- String- Returns:
- AlbumObject for newly created folder
- Throws:
IOException
-
createPage
Create an empty web page (with some relevant backing) and make this a child of this AlbumObject- Parameters:
suggestedName
- String- Returns:
- AlbumObject for newly created page
- Throws:
IOException
-
createPage
Create a web page (with some relevant backing) and make this a child of this AlbumObject- Parameters:
suggestedName
- Stringtemplate
- , file to use as source for this page creation- Returns:
- AlbumObject for newly created page
- Throws:
IOException
-
isDisplayableImage
boolean isDisplayableImage()- Returns:
- boolean true if this album object is displayable in an album
-
hasDisplayableImage
boolean hasDisplayableImage()- Returns:
- boolean true if this album object is displayable in an album (images and movies)
-
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
-
getCategory
Category getCategory() -
isIncluded
boolean isIncluded() -
setIncluded
- Throws:
IOException
-
isHidden
boolean isHidden() -
isWithin
- Returns:
- true if current object is a descendant (child, grandchild etc) of "parent" or is the parent
- Since:
- 10.4
-
setHidden
- Throws:
IOException
-
getChildren
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
- See Also:
-
getChildren
- Parameters:
ordered
- Pass false and ordering will not be guaranteed (performance option)- 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
- Since:
- 24
-
getChildren
- Parameters:
ofCategory
- Category to filter on- Returns:
- Unmodifiable list of children of certain category
- Since:
- 24
-
getChildren
- Parameters:
filter
- boolean lambda expression- Returns:
- Unmodifiable list of children matching specified condition
- Since:
- 24
-
getDescendants
TreeCollection getDescendants()Return an unmodifiable collection of all included, visible children and descendants of this AlbumObject. The containing album objects are iterated lazily for performance- Returns:
- Since:
- 14.2
- See Also:
-
getDescendants
Return an unmodifiable collection of all included, visible children and descendants of this AlbumObject. The containing album objects are iterated lazily for performance- Parameters:
opt
- Flag to also include excluded or hidden objectsopts
- More flags to also include excluded and/or hidden objects- Returns:
- Since:
- 14.2
-
getChild
- Since:
- 8.1
-
setChildren
Set List of children AlbumObjects if this is a directory/folder- Throws:
IOException
-
containsName
-
moveTo
- Throws:
IOException
-
moveTo
- Throws:
IOException
-
moveTo
- Throws:
IOException
- Since:
- 13
-
moveTo
- Throws:
IOException
- Since:
- 13
-
getUniqueName
- Parameters:
suggestedName
-- Returns:
- suggestedName or unique name based on suggested name if suggestedName already exists
- Since:
- 13
-
repairLink
- Throws:
IOException
-
add
- Throws:
IOException
-
add
Add list of AlbumObjcts to (before) given index, replacing existing objects with the added ones- Parameters:
index
-objects
-- Throws:
IOException
- Since:
- 9.6
-
add
Add AlbumObjct to (before) given index, replacing existing object with the added ones- Parameters:
index
-object
-- Throws:
IOException
- Since:
- 21
-
add
Add list of AlbumObjcts to children, replacing existing objects with the added ones- Parameters:
objects
-- Throws:
IOException
- Since:
- 10.10.5
-
add
Add AlbumObjct to children, replacing existing object with the added ones- Parameters:
object
-- Throws:
IOException
- Since:
- 21
-
getOrdering
AlbumObject.Ordering getOrdering() -
setOrdering
- Throws:
IOException
-
getFolderOrdering
AlbumObject.Ordering getFolderOrdering() -
setFolderOrdering
- Throws:
IOException
-
isFoldersFirst
boolean isFoldersFirst() -
setFoldersFirst
- Throws:
IOException
-
isReverseOrdering
boolean isReverseOrdering() -
setReverseOrdering
- Throws:
IOException
-
isReverseFolderOrdering
boolean isReverseFolderOrdering() -
setReverseFolderOrdering
- Throws:
IOException
-
setRepresentingIcon
- Throws:
IOException
-
getRepresentingAlbumObject
AlbumObject getRepresentingAlbumObject() -
getRenderer
- Throws:
IOException
-
getRepresentingAlbumObject
-
setRepresentingAlbumObject
-
updateRepresentingIcon
void updateRepresentingIcon() -
invalidate
void invalidate()Call if underlying (file) structure has changed Will force synchronization with underlying structure when getChildren is called -
getRepresentingIcon
- Parameters:
bounds
-enlarge
-- Returns:
- small Icon representing this AlbumObject (be it a thumbnail or icon)
- Throws:
IOException
-
getRepresentingIcon
ImageIcon getRepresentingIcon(Dimension bounds, boolean cropToBounds, boolean enlarge) throws IOException - Throws:
IOException
-
getImageInfo
- Returns:
- Raw image information (unrotated size)
- Throws:
IOException
-
getSize
- Returns:
- An orientation adjusted original image size. Non-images return null
- Throws:
IOException
- Since:
- 16.3
-
getSize
- Parameters:
filteredSize
- whether to calculate filtered size or not- Returns:
- An orientation adjusted original image size. Non-images return null
- Throws:
IOException
- Since:
- 32
-
getRepresentingImageFile
File getRepresentingImageFile()For ordinary images, this method will simply return the image file reference itself. For movies or other file types having a .thm file, it will return the .thm file. For movies that have had a representing image extracted by jAlbum, it will return a reference to that image (stored under .jalbum/cache these days). For other file types, it returns null. To then get hold of a proper icon image, use FileFilters.getIconFor(File) -
getThumbnailPath
String getThumbnailPath() -
addPropertyChangeListener
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
String getPathFromRoot()Get the path to this AlbumObject in the form folder/subfolder/albumObject- Since:
- 8.0
-
getPathFrom
Get the path from "folder" to this AlbumObject in the form folder/subfolder/albumObject- Parameters:
folder
- to calculate path from. Needs to be an ancestor of this AlbumObject- Since:
- 15
-
removePropertyChangeListener
Unregisters listeners. Does not neccesarily need to be called as we use weak references- Parameters:
listener
-
-
addPropertyChangeListener
-
getVars
Scope getVars()jAlbum 9.4 -
setVars
-
fireModelChanged
void fireModelChanged()Fire a "modelChanged" property event, causing UI to update Used by undo/redo mechanism
-