Interface AlbumObject

All Superinterfaces:
java.lang.Comparable<AlbumObject>, java.awt.datatransfer.Transferable
All Known Implementing Classes:
AlbumObjectImpl, FileAlbumObject, VirtualFolder

public interface AlbumObject
extends java.awt.datatransfer.Transferable, java.lang.Comparable<AlbumObject>
  • Field Details

    • albumObjectFlavor

      static final java.awt.datatransfer.DataFlavor albumObjectFlavor
  • Method Details

    • 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
    • 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

      void setLastModified​(long lastModified) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      20.1
    • getWhenAdded

      long getWhenAdded()
      Returns:
      Date this album object was added to the album
    • setWhenAdded

      void setWhenAdded​(long whenAdded) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      12.6.5
    • 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
    • getName

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

      java.lang.String getWebName()
      Returns:
      String name of AlbumObject in the final web album (not URL-encoded)
    • 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
    • getTitle

      java.lang.String getTitle()
      Since:
      9.6
    • setTitle

      boolean setTitle​(java.lang.String newTitle) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      9.6
    • getRating

      int getRating()
      Since:
      9.6
    • setRating

      void setRating​(int rating) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      9.6
    • getFlag

      Flag getFlag()
      Since:
      10.0
    • setFlag

      void setFlag​(Flag flag) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      10.0
    • getKeywords

      java.lang.String getKeywords()
      Since:
      11.6
    • getKeywordSet

      java.util.Set<java.lang.String> getKeywordSet()
      Returns:
      Since:
      14.2
    • setKeywords

      void setKeywords​(java.lang.String keywords) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      11.6
    • setKeywords

      default void setKeywords​(java.util.Set<java.lang.String> keywords) throws java.io.IOException
      Throws:
      java.io.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:
      AlbumObjectProperties
    • 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

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

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

      Orientation getOrientation()
    • setOrientation

      void setOrientation​(Orientation o) throws java.io.IOException
      Throws:
      java.io.IOException
    • isIncludeOriginal

      boolean isIncludeOriginal()
      Since:
      11.2
    • setIncludeOriginal

      void setIncludeOriginal​(boolean includeOriginal) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      11.2
    • isUseOriginal

      boolean isUseOriginal()
      Since:
      13.10
    • setUseOriginal

      void setUseOriginal​(boolean useOriginal) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      13.10
    • 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
    • createFolder

      AlbumObject createFolder​(int index, 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
      index - Location to insert to
      Returns:
      AlbumObject for newly created folder
      Throws:
      java.io.IOException
    • createPage

      AlbumObject createPage​(int index, java.lang.String suggestedName) throws java.io.IOException
      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:
      java.io.IOException
    • createPage

      AlbumObject createPage​(int index, java.lang.String suggestedName, java.io.File template) throws java.io.IOException
      Create a web page (with some relevant backing) and make this a child of this AlbumObject
      Parameters:
      suggestedName - String
      template - , file to use as source for this page creation
      Returns:
      AlbumObject for newly created page
      Throws:
      java.io.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

      void setIncluded​(boolean included) throws java.io.IOException
      Throws:
      java.io.IOException
    • isHidden

      boolean isHidden()
    • isWithin

      boolean isWithin​(AlbumObject parent)
      Returns:
      true if current object is a descendant (child, grandchild etc) of "parent" or is the parent
      Since:
      10.4
    • setHidden

      void setHidden​(boolean hidden) throws java.io.IOException
      Throws:
      java.io.IOException
    • 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
      See Also:
      getDescendants()
    • getChildren

      default java.util.List<AlbumObject> getChildren​(boolean ordered)
      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

      default java.util.List<AlbumObject> getChildren​(Category ofCategory)
      Parameters:
      ofCategory - Category to filter on
      Returns:
      Unmodifiable list of children of certain category
      Since:
      24
    • getChildren

      default java.util.List<AlbumObject> getChildren​(java.util.function.Predicate<AlbumObject> filter)
      Parameters:
      filter - boolean lambda expression
      Returns:
      Unmodifiable list of children matching specified condition
      Since:
      24
    • getDescendants

      java.util.Collection<AlbumObject> 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:
      to also include excluded or hidden objects.
    • getDescendants

      java.util.Collection<AlbumObject> getDescendants​(IncludeOption opt, IncludeOption... opts)
      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 objects
      opts - More flags to also include excluded and/or hidden objects
      Returns:
      Since:
      14.2
    • 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
    • moveTo

      void moveTo​(AlbumObject newParent, java.lang.String newName) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      13
    • moveTo

      void moveTo​(AlbumObject newParent, java.lang.String newName, int position) throws java.io.IOException
      Throws:
      java.io.IOException
      Since:
      13
    • getUniqueName

      java.lang.String getUniqueName​(java.lang.String suggestedName)
      Parameters:
      suggestedName -
      Returns:
      suggestedName or unique name based on suggested name if suggestedName already exists
      Since:
      13
    • 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
    • add

      void add​(int index, java.util.Set<AlbumObject> objects) throws java.io.IOException
      Add list of AlbumObjcts to (before) given index, replacing existing objects with the added ones
      Parameters:
      index -
      objects -
      Throws:
      java.io.IOException
      Since:
      9.6
    • add

      void add​(int index, AlbumObject object) throws java.io.IOException
      Add AlbumObjct to (before) given index, replacing existing object with the added ones
      Parameters:
      index -
      object -
      Throws:
      java.io.IOException
      Since:
      21
    • add

      void add​(java.util.Set<AlbumObject> objects) throws java.io.IOException
      Add list of AlbumObjcts to children, replacing existing objects with the added ones
      Parameters:
      objects -
      Throws:
      java.io.IOException
      Since:
      10.10.5
    • add

      void add​(AlbumObject object) throws java.io.IOException
      Add AlbumObjct to children, replacing existing object with the added ones
      Parameters:
      object -
      Throws:
      java.io.IOException
      Since:
      21
    • getOrdering

      AlbumObject.Ordering getOrdering()
    • setOrdering

      void setOrdering​(AlbumObject.Ordering ordering) throws java.io.IOException
      Throws:
      java.io.IOException
    • getFolderOrdering

      AlbumObject.Ordering getFolderOrdering()
    • setFolderOrdering

      void setFolderOrdering​(AlbumObject.Ordering 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()
    • getRenderer

      ImageRenderer getRenderer() throws java.io.IOException
      Throws:
      java.io.IOException
    • getRepresentingAlbumObject

      AlbumObject getRepresentingAlbumObject​(boolean force)
    • setRepresentingAlbumObject

      void setRepresentingAlbumObject​(AlbumObject rep)
    • updateRepresentingIcon

      void updateRepresentingIcon()
    • invalidate

      void invalidate()
      Call if underlying (file) structure has changed Will force synchronization with underlying 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
    • getImageInfo

      FileFilters.BasicImageInfo getImageInfo() throws java.io.IOException
      Returns:
      Raw image information (unrotated size)
      Throws:
      java.io.IOException
    • getSize

      java.awt.Dimension getSize() throws java.io.IOException
      Returns:
      An orientation adjusted original image size. Non-images return null
      Throws:
      java.io.IOException
      Since:
      16.3
    • getRepresentingImageFile

      java.io.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

      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
    • getPathFrom

      java.lang.String getPathFrom​(AlbumObject folder)
      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

      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)
    • getVars

      Scope getVars()
      jAlbum 9.4
    • setVars

      void setVars​(Scope vars)
    • fireModelChanged

      void fireModelChanged()
      Fire a "modelChanged" property event, causing UI to update Used by undo/redo mechanism