package demo;

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

public class page1_2 extends Page
 {
     public page1_2()
 {
     try
 {
     initComponents();
     courseDelegate.setPage(this);
     }
     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
        mainContextManager = new com.uvigo.mhp.ContextManager();
        courseDelegate = new com.uvigo.mhp.CourseDelegate();
        hTextLook21 = new com.uvigo.mhp.looks.HTextLook2();
        hPanel1 = new com.uvigo.mhp.ui.HPanel();
        mediaPlayer1 = new com.uvigo.mhp.mediaPlayer.MediaPlayer();
        hLabel1 = new com.uvigo.mhp.ui.HLabel();
        hButton1 = new com.uvigo.mhp.ui.HButton();
        hButton2 = new com.uvigo.mhp.ui.HButton();
        hButton3 = new com.uvigo.mhp.ui.HButton();
        hLabel2 = new com.uvigo.mhp.ui.HLabel();
        hMultiPanel1 = new com.uvigo.mhp.ui.HMultiPanel();
        hImage3 = new com.uvigo.mhp.ui.HImage();
        hImage4 = new com.uvigo.mhp.ui.HImage();
        hAnimated1 = new com.uvigo.mhp.ui.HAnimated();
        panel1 = new java.awt.Panel();
        hImage1 = new com.uvigo.mhp.ui.HImage();
        hLabel3 = new com.uvigo.mhp.ui.HLabel();
        hImage2 = new com.uvigo.mhp.ui.HImage();
        hImage5 = new com.uvigo.mhp.ui.HImage();

        courseDelegate.setPage(this);
        hTextLook21.setSeparator("   ");

        setLayout(null);

        setBackground(java.awt.Color.orange);
        setBackgroundImageURL("file:/c:/teleco/mhp/fondo3.jpg");
        setOpaque(true);
        hPanel1.setLayout(new java.awt.GridLayout(1, 1));

        hPanel1.setBackgroundImageMode(com.uvigo.mhp.ui.HPanel.IMAGE_DONT_SHOW);
        hPanel1.setOpaque(true);
        mediaPlayer1.setConfigurationFile("file:/c:/teleco/demo/video/muro.xml");
        mediaPlayer1.setContextManager(mainContextManager);
        mediaPlayer1.setPlaybackLoop(false);
        mediaPlayer1.setVolume(1.0F);
        mediaPlayer1.addContextListener(new com.uvigo.mhp.ContextListener() {
            public void contextChanged(com.uvigo.mhp.ContextEvent param0) {
            }
            public void subcontextEntered(com.uvigo.mhp.ContextEvent param0) {
                mediaPlayer1SubcontextEntered(param0);
            }
        });

        hPanel1.add(mediaPlayer1);

        add(hPanel1);
        hPanel1.setBounds(8, 68, 430, 350);

        hLabel1.setBackground(java.awt.Color.black);
        hLabel1.setBackgroundMode(org.havi.ui.HVisible.BACKGROUND_FILL);
        hLabel1.setFont(new java.awt.Font("Bremen Bd BT", 0, 36));
        hLabel1.setForeground(java.awt.Color.orange);
        hLabel1.setLabel("El muro de Berl\u00edn");
        add(hLabel1);
        hLabel1.setBounds(10, 10, 640, 50);

        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);
            }
        });

        add(hButton1);
        hButton1.setBounds(450, 310, 60, 52);

        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);
            }
        });

        add(hButton2);
        hButton2.setBounds(520, 310, 60, 52);

        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);
            }
        });

        add(hButton3);
        hButton3.setBounds(590, 310, 60, 52);

        hLabel2.setBackground(java.awt.Color.magenta);
        hLabel2.setBackgroundMode(org.havi.ui.HVisible.BACKGROUND_FILL);
        hLabel2.setFont(new java.awt.Font("Dialog", 0, 24));
        hLabel2.setLabel("El muro de Berl\u00edn");
        add(hLabel2);
        hLabel2.setBounds(10, 430, 640, 40);

        hMultiPanel1.setBackground(java.awt.Color.black);
        hMultiPanel1.setConfigurationFile("file:/c:/teleco/demo/video/multi.xml");
        hMultiPanel1.setContextManager(mainContextManager);
        hMultiPanel1.setForeground(java.awt.Color.orange);
        hMultiPanel1.setOpaque(true);
        hImage3.setImageURL("file:/c:/teleco/demo/video/alemania.gif");
        hMultiPanel1.add(hImage3, "3");

        hImage4.setImageURL("file:/c:/teleco/demo/video/muro.jpg");
        hMultiPanel1.add(hImage4, "4");

        hAnimated1.setContentFile("file:/c:/teleco/demo/video/obras.xml");
        hAnimated1.setDelay(2);
        hMultiPanel1.add(hAnimated1, "card7");

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

        hImage1.setImageURL("file:/c:/teleco/demo/video/kennedy.gif");
        panel1.add(hImage1, java.awt.BorderLayout.CENTER);

        hLabel3.setLabel("John Fitzgerald Kennedy - Antiguo presidente de los USA");
        try {
            hLabel3.setLook(hTextLook21);
        } catch (org.havi.ui.HInvalidLookException e1) {
            e1.printStackTrace();
        }
        panel1.add(hLabel3, java.awt.BorderLayout.SOUTH);

        hMultiPanel1.add(panel1, "card8");

        hImage2.setImageURL("file:/c:/teleco/demo/video/gorbachov.jpg");
        hMultiPanel1.add(hImage2, "2");

        hImage5.setImageURL("file:/c:/teleco/demo/video/union.jpg");
        hMultiPanel1.add(hImage5, "5");

        add(hMultiPanel1);
        hMultiPanel1.setBounds(450, 70, 200, 230);

    }//GEN-END:initComponents

    private void mediaPlayer1SubcontextEntered(com.uvigo.mhp.ContextEvent param0) {//GEN-FIRST:event_mediaPlayer1SubcontextEntered
        hLabel2.setLabel(mediaPlayer1.getSubcontext());
    }//GEN-LAST:event_mediaPlayer1SubcontextEntered

    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.CourseDelegate courseDelegate;
    private com.uvigo.mhp.ui.HAnimated hAnimated1;
    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.HImage hImage1;
    private com.uvigo.mhp.ui.HImage hImage2;
    private com.uvigo.mhp.ui.HImage hImage3;
    private com.uvigo.mhp.ui.HImage hImage4;
    private com.uvigo.mhp.ui.HImage hImage5;
    private com.uvigo.mhp.ui.HLabel hLabel1;
    private com.uvigo.mhp.ui.HLabel hLabel2;
    private com.uvigo.mhp.ui.HLabel hLabel3;
    private com.uvigo.mhp.ui.HMultiPanel hMultiPanel1;
    private com.uvigo.mhp.ui.HPanel hPanel1;
    private com.uvigo.mhp.looks.HTextLook2 hTextLook21;
    private com.uvigo.mhp.ContextManager mainContextManager;
    private com.uvigo.mhp.mediaPlayer.MediaPlayer mediaPlayer1;
    private java.awt.Panel panel1;
    // End of variables declaration//GEN-END:variables
     
     
     public static void main(String[] args)
 {
     HSceneFactory hsFactory = HSceneFactory.getInstance();
     HScene scene = hsFactory.getBestScene(new HSceneTemplate());
     scene.setLayout(new BorderLayout());
     
     scene.add(new page1_2());
     
     scene.addWindowListener(new WindowAdapter()
 {
     public void windowClosing(WindowEvent e)
 {
     System.exit(0);
     }
     }
     );
     scene.setVisible(true);
     scene.validate();
     }
}
