/*
 * Created on 17.12.2003
 *
 */

package LumiSoft.UI.Controls;

import java.awt.*;
import java.util.ArrayList;
import java.net.*;;

/**
 * Image list.
 */
public class ImageList 
{
	private ArrayList<Image> m_pImages = null;
//	private int       m_Width   = 0;
//	private int       m_Height  = 0;
	
	/**
	 * Default constructor.
	 * @param width
	 * @param height
	 */
	public ImageList(int width,int height)
	{			
		m_pImages = new ArrayList<Image>();
//		m_Width   = width;
//		m_Height  = height;
	}
	
	
	/**
	 * Adds image to image to list.
	 * @param image
	 */
	public void Add(Image image)
	{
		if(image != null){
			m_pImages.add(image);
		}		
	}	
	/**
	 * Adds image to image to list.
	 * @param imageUrl
	 */
	public void Add(URL imageUrl)
	{
		Image image = Toolkit.getDefaultToolkit().getImage(imageUrl);
		if(image != null){
			m_pImages.add(image);
		}
	}
	
	/**
	 * Gets images.
	 * @return
	 */
	public Image[] getImages()
	{
		return (Image[])m_pImages.toArray();
	}
	
	/**
	 * Gets image from specified index.
	 * @param index
	 * @return
	 */
	public Image get(int index)
	{
		return m_pImages.get(index);
	}
	
	/**
	 * Gets images count in list.
	 * @return
	 */
	public int getCount()
	{
		return m_pImages.size();
	}

}
