Interface AlbumObject

    • Field Detail

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

        default 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
      • 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
      • 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
      • 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
      • 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()
      • getDescendants

        java.util.Collection<AlbumObject> getDescendants​(IncludeOption opt,
                                                         IncludeOption... opts)
        Return an unmodifiable collection of all included, visible children and descendants of this AlbumObject.
        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​(java.util.Set<AlbumObject> objects)
          throws java.io.IOException
        Add list of AlbumObjcts to end of children, replacing existing objects with the added ones
        Parameters:
        objects -
        Throws:
        java.io.IOException
        Since:
        10.10.5
      • setOrdering

        void setOrdering​(AlbumObject.Ordering ordering)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • 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()
      • 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