package com.uvigo.mhp.mediaPlayer;

import com.uvigo.mhp.*;
//import com.uvigo.mhp.ui.NOUSADODelayedTimeEditor;
import com.uvigo.mhp.ui.DelayedTimeModeEditor;
import java.awt.*;
import java.beans.*;

public class MediaPlayerBeanInfo extends SimpleBeanInfo
{
    public MediaPlayerBeanInfo()
    {
    }
    
    public BeanDescriptor getBeanDescriptor()
    {
        BeanDescriptor bd = new BeanDescriptor(MediaPlayer.class);
        bd.setDisplayName("MediaPlayer");
        return bd;
    }
    
    public PropertyDescriptor[] getPropertyDescriptors()
    {
        try
        {
            PropertyDescriptor pd1= new PropertyDescriptor("contextManager", MediaPlayer.class);
            PropertyDescriptor pd2= new PropertyDescriptor("context", MediaPlayer.class);
            PropertyDescriptor pd3= new PropertyDescriptor("fixedAspectRatio", MediaPlayer.class);
            PropertyDescriptor pd4= new PropertyDescriptor("playbackLoop", MediaPlayer.class);
            PropertyDescriptor pd5= new PropertyDescriptor("volume", MediaPlayer.class);
            PropertyDescriptor pd6= new PropertyDescriptor("zoom", MediaPlayer.class);
            PropertyDescriptor pd7= new PropertyDescriptor("configurationFile", MediaPlayer.class);
            PropertyDescriptor pd8= new PropertyDescriptor("startOnContextChange", MediaPlayer.class);
            PropertyDescriptor pd9= new PropertyDescriptor("name", MediaPlayer.class);
            PropertyDescriptor pd10= new PropertyDescriptor("delayedTimeMode", MediaPlayer.class);
            PropertyDescriptor pd11= new PropertyDescriptor("delayedTime", MediaPlayer.class);
            
            pd1.setBound(true);
            pd2.setBound(true);
            pd3.setBound(true);
            pd4.setBound(true);
            pd5.setBound(true);
            pd6.setBound(true);
            pd7.setBound(true);
            pd8.setBound(true);
            pd9.setBound(true);
            pd10.setBound(true);
            pd10.setPropertyEditorClass(DelayedTimeModeEditor.class);
             pd11.setBound(true);
            PropertyDescriptor rv[] =
            {pd1, pd2, pd3, pd4, pd5, pd6, pd7, pd8, pd9, pd10, pd11};
            return rv;
        }
        catch(IntrospectionException e)
        {
            throw new Error(e.toString());
        }
    }
    
    public EventSetDescriptor[] getEventSetDescriptors()
    {
        try
        {
            EventSetDescriptor ed1 = new EventSetDescriptor(
            MediaPlayer.class, "context", ContextListener.class,
            new String[]
            {"contextChanged", "subcontextEntered"}, "addContextListener", "removeContextListener");
            
            return new EventSetDescriptor[]
            {ed1};
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
            return null;
        }
    }
    
    public Image getIcon(int ic)
    {
        switch(ic)
        {
            case 1:
                return loadImage("IconColor16.gif");
                
            case 2:
                return loadImage("IconColor32.gif");
                
            case 3:
                return loadImage("IconMono16.gif");
                
            case 4:
                return loadImage("IconMono32.gif");
        }
        return null;
    }
}