/* (non-Javadoc)
* @see cs213.photoAlbum.control.ControlInterface#listPhotoInfo(java.lang.String)
*/
@Override
public String[] listPhotoInfo(String filename) {
Photo p = backend.getPhoto(filename);
if (p == null){
return null;
}
int tagsize = 0;
int numalbums = 0;
if (p.listTags() != null){
tagsize = p.listTags().length;
}
if (p.listAlbums() != null){
numalbums = p.listAlbums().length;
}
String[] ret = new String[5];
ret[0] = p.toString();
ret[1] = p.caption;
ret[3] = /*"Date: " +*/p.cal.getTime().toString();
ret[2] = "";//"Album:";
for (int i = 0; i < p.listAlbums().length; i++){
ret[2] = ret[2] + p.listAlbums()[i] + ", ";
}
ret[2] = ret[2].substring(0, ret[2].length() - 2);
ret[4] = "";
if (p.listTags().length != 0){
//ret[4] = "Tags:\n ";
for (int i = 0; i < p.listTags().length; i++){
ret[4] = ret[4] + p.listTags()[i] + ", ";
}
}
if(ret[4].length() != 0)
ret[4] = ret[4].substring(0, ret[4].length()-2);
// int index = 4;