public class Albums
extends java.util.Observable
Modifier and Type | Method and Description |
---|---|
void |
addAlbum(Album v)
Add an album to the list of albums
|
void |
addFolder(java.lang.String f)
Add a local folder to the albums
|
static void |
addThread(java.lang.Thread t)
Add a running thread in the thread manager
|
java.util.HashMap<java.lang.String,Album> |
getAlbums()
Get all albums (useful to check sync status)
|
static Albums
|
getInstance()
Get the working instance of albums, or create a new one
|
java.util.ArrayList<Media> |
getMediaSearched()
List of medias being the result of a search
|
static Albums
|
getNewInstance()
Get a new instance of the singleton (useful for tests)
|
java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.awt.Point[]>>
|
getPersonsBase()
Get the list of persons in all albums
|
Album |
getSelected()
Get the selected album
|
java.lang.String |
getSelectedName()
Get the selected album name
|
java.util.concurrent.Semaphore |
getSemaphore()
|
javax.swing.tree.DefaultMutableTreeNode |
getTree()
Get the tree of albums (useful for JList)
|
boolean |
isConnected()
Get the selected album name
|
void |
loadAlbums()
Load albums from the save file albums.data It contains all albums
serialized
|
void |
loadOnlineAlbums()
Load albums remotely stored on Picasa Web
|
void |
loadSavedPersons(Album album,
Photo photo)
Load the list of persons saved in persons.data file
|
void |
refreshObservers(AlbumsMessage msg)
Shortcut to notify observers
|
void |
removeAlbum(java.lang.String k,
boolean confirm)
Remove an album from the list
|
void |
removeOnlineAlbums()
Remove online albums when the user disconnects
Stop all loading threads
|
void |
renameAlbum(java.lang.String old,
java.lang.String neu)
Rename an album in the list
|
void |
saveAlbums()
Save the list of albums serialized in a file
|
void |
search(java.lang.String txt,
java.lang.String type,
java.lang.String where)
Search a query through all albums
|
void |
setSelected(java.lang.String selected)
Change the selected album
|
int |
size()
Size of all albums
|
static void |
stopThreads()
Stop all running threads from the threads manager
|
void |
syncAlbums()
Synchronize all albums with the disk and Picasa
Not really used....
|
void |
updateTags(java.lang.String photoId,
java.lang.String tags)
Update tags for all medias with the given id
|
public java.util.concurrent.Semaphore getSemaphore()
public static Albums getInstance()
public static Albums getNewInstance()
public java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.awt.Point[]>> getPersonsBase()
public void search(java.lang.String txt, java.lang.String type, java.lang.String where)
txt
- word to searchtype
- type of search (all, tags, desc, title, person)where
- list of albums specifiedpublic java.util.ArrayList<Media> getMediaSearched()
public java.util.HashMap<java.lang.String,Album> getAlbums()
public void addAlbum(Album v)
v
- album to addpublic void removeAlbum(java.lang.String k, boolean confirm)
k
- name of the album to removepublic int size()
public Album getSelected()
public java.lang.String getSelectedName()
public boolean isConnected()
public void setSelected(java.lang.String selected)
selected
- name of the album to set as selectedpublic javax.swing.tree.DefaultMutableTreeNode getTree()
public void refreshObservers(AlbumsMessage msg)
msg
- message to notifypublic void loadAlbums() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void saveAlbums() throws java.io.IOException
java.io.IOException
public void loadOnlineAlbums() throws java.io.IOException, com.google.gdata.util.ServiceException, java.net.URISyntaxException
java.io.IOException
com.google.gdata.util.ServiceException
java.net.URISyntaxException
public void loadSavedPersons(Album album, Photo photo)
album
- album where to search personsphoto
- photo where to search personspublic void addFolder(java.lang.String f)
f
- name of the folderpublic void syncAlbums() throws java.io.IOException, com.google.gdata.util.ServiceException, java.net.URISyntaxException
java.io.IOException
com.google.gdata.util.ServiceException
java.net.URISyntaxException
public void renameAlbum(java.lang.String old, java.lang.String neu)
old
- old name of the albumneu
- new namepublic void updateTags(java.lang.String photoId, java.lang.String tags)
photoId
- id of the photo to updatetags
- tags to addpublic void removeOnlineAlbums()
public static void stopThreads()
public static void addThread(java.lang.Thread t)
t
- thread to add