portaview.model
Class Album

java.lang.Object
  extended byjava.util.Observable
      extended byportaview.model.DomainModel
          extended byportaview.model.NameModel
              extended byportaview.model.Album
All Implemented Interfaces:
XmlRpcType

public class Album
extends NameModel
implements XmlRpcType

Represents the album in PortaView. An album is a folder that contain images on disk. This object is not used in the MVC model but rather serves as a class to retrieve photos on disk.

Version:
$Id: Album.java,v 1.5 2003/12/10 06:18:57 wlee Exp $
Author:
William Lee

Field Summary
static int ICON_H
           
static int ICON_W
           
static java.lang.String XT_ICON
           
static java.lang.String XT_NAME
           
static java.lang.String XT_PHOTOS
           
 
Constructor Summary
Album(java.io.File dir)
          Creates an album from a directory.
 
Method Summary
 java.io.File getDirectory()
           
 Photo getPhoto(int seq)
          Returns the photo with the show name and the sequence id.
 Photo getPhoto(java.lang.String name)
          Returns a photo given the name.
 java.util.List listPhotos()
          Lists out the photos inside this album.
 void setDirectory(java.io.File directory)
          Sets the directory.
 java.lang.Object toXmlRpcType()
          Returns a Hashtable of name = the name of album and icon = byte[] of the album image.
 
Methods inherited from class portaview.model.NameModel
getName, setName
 
Methods inherited from class portaview.model.DomainModel
forceNotifyObservers
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XT_NAME

public static final java.lang.String XT_NAME
See Also:
Constant Field Values

XT_ICON

public static final java.lang.String XT_ICON
See Also:
Constant Field Values

XT_PHOTOS

public static final java.lang.String XT_PHOTOS
See Also:
Constant Field Values

ICON_W

public static final int ICON_W
See Also:
Constant Field Values

ICON_H

public static final int ICON_H
See Also:
Constant Field Values
Constructor Detail

Album

public Album(java.io.File dir)
Creates an album from a directory.

Parameters:
dir - directory for the album.
Method Detail

getDirectory

public java.io.File getDirectory()
Returns:
the directory for this album.

setDirectory

public void setDirectory(java.io.File directory)
Sets the directory.

Parameters:
directory - album directory

listPhotos

public java.util.List listPhotos()
Lists out the photos inside this album.

Returns:
the list of File that represents the photos in this album.

getPhoto

public Photo getPhoto(int seq)
Returns the photo with the show name and the sequence id.

Parameters:
seq - the sequence of photo based on the directory's sorting order.
Returns:
the photo.

getPhoto

public Photo getPhoto(java.lang.String name)
Returns a photo given the name.

Parameters:
name - name of photo.
Returns:
the Photo.

toXmlRpcType

public java.lang.Object toXmlRpcType()
Returns a Hashtable of name = the name of album and icon = byte[] of the album image.

Specified by:
toXmlRpcType in interface XmlRpcType
Returns:
object of XmlRpc type.
See Also:
XmlRpcType.toXmlRpcType()


Copyright © 2003 The PortaView Team. All Rights Reserved.