Interface AlbumObject

All Superinterfaces:
Comparable<AlbumObject>, Transferable
All Known Implementing Classes:
AlbumObjectImpl, FileAlbumObject, VirtualFolder

public interface AlbumObject extends Transferable, Comparable<AlbumObject>
  • Field Details

    • albumObjectFlavor

      static final DataFlavor 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

      void setLastModified(long lastModified) throws IOException
      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

      void setWhenAdded(long whenAdded) throws IOException
      Throws:
      IOException
      Since:
      12.6.5
    • loadImage

      Image loadImage(boolean useFastLoading, Dimension imageDim) throws 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:
      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

      Image loadImage() throws IOException
      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

      boolean setName(String newName)
      Set the name of this AlbumObject
    • getComment

      String getComment()
    • setComment

      void setComment(String newComment) throws IOException
      Throws:
      IOException
    • getTitle

      String getTitle()
      Since:
      9.6
    • setTitle

      boolean setTitle(String newTitle) throws IOException
      Throws:
      IOException
      Since:
      9.6
    • getRating

      int getRating()
      Since:
      9.6
    • setRating

      void setRating(int rating) throws IOException
      Throws:
      IOException
      Since:
      9.6
    • getFlag

      Flag getFlag()
      Since:
      10.0
    • setFlag

      void setFlag(Flag flag) throws IOException
      Throws:
      IOException
      Since:
      10.0
    • getKeywords

      String getKeywords()
      Since:
      11.6
    • getKeywordSet

      Set<String> getKeywordSet()
      Returns:
      Since:
      14.2
    • setKeywords

      void setKeywords(String keywords) throws IOException
      Throws:
      IOException
      Since:
      11.6
    • setKeywords

      default void setKeywords(Set<String> keywords) throws IOException
      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

      void rotateLeft() throws IOException
      Throws:
      IOException
    • rotateRight

      void rotateRight() throws IOException
      Throws:
      IOException
    • getOrientation

      Orientation getOrientation()
    • setOrientation

      void setOrientation(Orientation o) throws IOException
      Throws:
      IOException
    • isIncludeOriginal

      boolean isIncludeOriginal()
      Since:
      11.2
    • setIncludeOriginal

      void setIncludeOriginal(boolean includeOriginal) throws IOException
      Throws:
      IOException
      Since:
      11.2
    • isUseOriginal

      boolean isUseOriginal()
      Since:
      13.10
    • setUseOriginal

      void setUseOriginal(boolean useOriginal) throws IOException
      Throws:
      IOException
      Since:
      13.10
    • delete

      void delete() throws IOException, PermissionException
      Throws:
      IOException
      PermissionException
    • createFolder

      AlbumObject createFolder(String suggestedName) throws 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:
      IOException
    • createFolder

      AlbumObject createFolder(int index, String suggestedName) throws IOException
      Create a folder (with some relevant backing) and make folder a child of this AlbumObject
      Parameters:
      index - Location to insert to
      suggestedName - String
      Returns:
      AlbumObject for newly created folder
      Throws:
      IOException
    • createPage

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

      AlbumObject createPage(int index, String suggestedName, File template) throws 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:
      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 IOException
      Throws:
      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 IOException
      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

      default 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 List<AlbumObject> getChildren(Category ofCategory)
      Parameters:
      ofCategory - Category to filter on
      Returns:
      Unmodifiable list of children of certain category
      Since:
      24
    • getChildren

      default List<AlbumObject> getChildren(Predicate<AlbumObject> filter)
      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

      TreeCollection 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(String childPath)
      Since:
      8.1
    • setChildren

      void setChildren(List<AlbumObject> children) throws IOException
      Set List of children AlbumObjects if this is a directory/folder
      Throws:
      IOException
    • containsName

      boolean containsName(String name)
    • moveTo

      void moveTo(AlbumObject newParent) throws IOException
      Throws:
      IOException
    • moveTo

      void moveTo(AlbumObject newParent, int position) throws IOException
      Throws:
      IOException
    • moveTo

      void moveTo(AlbumObject newParent, String newName) throws IOException
      Throws:
      IOException
      Since:
      13
    • moveTo

      void moveTo(AlbumObject newParent, String newName, int position) throws IOException
      Throws:
      IOException
      Since:
      13
    • getUniqueName

      String getUniqueName(String suggestedName)
      Parameters:
      suggestedName -
      Returns:
      suggestedName or unique name based on suggested name if suggestedName already exists
      Since:
      13
    • repairLink

      boolean repairLink(File newTarget) throws IOException
      Throws:
      IOException
    • add

      void add(List<File> files) throws IOException
      Throws:
      IOException
    • add

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

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

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

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

      AlbumObject.Ordering getOrdering()
    • setOrdering

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

      AlbumObject.Ordering getFolderOrdering()
    • setFolderOrdering

      void setFolderOrdering(AlbumObject.Ordering folderOrdering) throws IOException
      Throws:
      IOException
    • isFoldersFirst

      boolean isFoldersFirst()
    • setFoldersFirst

      void setFoldersFirst(boolean foldersFirst) throws IOException
      Throws:
      IOException
    • isReverseOrdering

      boolean isReverseOrdering()
    • setReverseOrdering

      void setReverseOrdering(boolean reverseOrdering) throws IOException
      Throws:
      IOException
    • isReverseFolderOrdering

      boolean isReverseFolderOrdering()
    • setReverseFolderOrdering

      void setReverseFolderOrdering(boolean reverseFolderOrdering) throws IOException
      Throws:
      IOException
    • setRepresentingIcon

      void setRepresentingIcon(BufferedImage thumbnail, boolean changed) throws IOException
      Throws:
      IOException
    • getRepresentingAlbumObject

      AlbumObject getRepresentingAlbumObject()
    • getRenderer

      ImageRenderer getRenderer() throws IOException
      Throws:
      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

      ImageIcon getRepresentingIcon(Dimension bounds, boolean enlarge) throws IOException
      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

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

      Dimension getSize(boolean filteredSize) throws IOException
      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

      void addPropertyChangeListener(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

      String getPathFromRoot()
      Get the path to this AlbumObject in the form folder/subfolder/albumObject
      Since:
      8.0
    • getPathFrom

      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(PropertyChangeListener listener)
      Unregisters listeners. Does not neccesarily need to be called as we use weak references
      Parameters:
      listener -
    • addPropertyChangeListener

      void addPropertyChangeListener(String propertyName, 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