package demo;

import com.uvigo.mhp.*;
import java.awt.*;
import java.awt.event.*;
import org.havi.ui.*;

public class Question_Video extends TestQuestion
{
    public Question_Video()
    {
        try
        {
            initComponents();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        hLabel1 = new com.uvigo.mhp.ui.HLabel();
        hPanel1 = new com.uvigo.mhp.ui.HPanel();
        hPanel3 = new com.uvigo.mhp.ui.HPanel();
        hPanel4 = new com.uvigo.mhp.ui.HPanel();
        hButton1 = new com.uvigo.mhp.ui.HButton();
        hButton2 = new com.uvigo.mhp.ui.HButton();
        hButton3 = new com.uvigo.mhp.ui.HButton();
        mediaPlayer1 = new com.uvigo.mhp.mediaPlayer.MediaPlayer();
        hPanel2 = new com.uvigo.mhp.ui.HPanel();

        setLayout(new java.awt.BorderLayout());

        setOptionsContainer(hPanel2);
        hLabel1.setBackground(java.awt.Color.magenta);
        hLabel1.setBackgroundMode(org.havi.ui.HVisible.BACKGROUND_FILL);
        hLabel1.setFont(new java.awt.Font("Dialog", 0, 18));
        hLabel1.setName("label");
        add(hLabel1, java.awt.BorderLayout.NORTH);

        hPanel1.setLayout(new java.awt.BorderLayout());

        hPanel3.setLayout(new java.awt.BorderLayout());

        hPanel4.setLayout(new java.awt.GridLayout(1, 1));

        hButton1.setContentFile("file:/c:/teleco/demo/botones/play.xml");
        hButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                hButton1ActionPerformed(evt);
            }
        });

        hPanel4.add(hButton1);

        hButton2.setContentFile("file:/c:/teleco/demo/botones/pause.xml");
        hButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                hButton2ActionPerformed(evt);
            }
        });

        hPanel4.add(hButton2);

        hButton3.setContentFile("file:/c:/teleco/demo/botones/stop.xml");
        hButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                hButton3ActionPerformed(evt);
            }
        });

        hPanel4.add(hButton3);

        hPanel3.add(hPanel4, java.awt.BorderLayout.SOUTH);

        mediaPlayer1.setName("player");
        mediaPlayer1.setPlaybackLoop(false);
        mediaPlayer1.setVolume(1.0F);
        hPanel3.add(mediaPlayer1, java.awt.BorderLayout.CENTER);

        hPanel1.add(hPanel3, java.awt.BorderLayout.WEST);

        hPanel2.setLayout(new java.awt.GridLayout(0, 1));

        hPanel1.add(hPanel2, java.awt.BorderLayout.CENTER);

        add(hPanel1, java.awt.BorderLayout.CENTER);

    }//GEN-END:initComponents

    private void hButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hButton3ActionPerformed
        mediaPlayer1.stop();
    }//GEN-LAST:event_hButton3ActionPerformed

    private void hButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hButton2ActionPerformed
        mediaPlayer1.pause();
    }//GEN-LAST:event_hButton2ActionPerformed

    private void hButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hButton1ActionPerformed
        mediaPlayer1.start();
    }//GEN-LAST:event_hButton1ActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private com.uvigo.mhp.ui.HButton hButton1;
    private com.uvigo.mhp.ui.HButton hButton2;
    private com.uvigo.mhp.ui.HButton hButton3;
    private com.uvigo.mhp.ui.HLabel hLabel1;
    private com.uvigo.mhp.ui.HPanel hPanel1;
    private com.uvigo.mhp.ui.HPanel hPanel2;
    private com.uvigo.mhp.ui.HPanel hPanel3;
    private com.uvigo.mhp.ui.HPanel hPanel4;
    private com.uvigo.mhp.mediaPlayer.MediaPlayer mediaPlayer1;
    // End of variables declaration//GEN-END:variables
}
