package demo;

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

public class page1_1 extends Page
 {
     public page1_1()
 {
     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();
        mediaPlayer1 = new com.uvigo.mhp.mediaPlayer.MediaPlayer();
        hTextLook21 = new com.uvigo.mhp.looks.HTextLook2();
        hRangeLook21 = new com.uvigo.mhp.looks.HRangeLook2();
        hPanel1 = new com.uvigo.mhp.ui.HPanel();
        hMenu1 = new com.uvigo.mhp.ui.HMenu();
        hScrollPane1 = new com.uvigo.mhp.ui.HScrollPane();
        textPanel1 = new com.uvigo.mhp.textPanel.TextPanel();
        hScrollBar1 = new com.uvigo.mhp.ui.HScrollBar();
        hMultiPanel1 = new com.uvigo.mhp.ui.HMultiPanel();
        panel1 = new java.awt.Panel();
        hLabel1 = new com.uvigo.mhp.ui.HLabel();
        panel2 = new java.awt.Panel();
        hLabel2 = new com.uvigo.mhp.ui.HLabel();
        panel3 = new java.awt.Panel();
        panel4 = new java.awt.Panel();
        hButton1 = new com.uvigo.mhp.ui.HButton();
        hButton2 = new com.uvigo.mhp.ui.HButton();
        hButton3 = new com.uvigo.mhp.ui.HButton();
        hImage1 = new com.uvigo.mhp.ui.HImage();

        mediaPlayer1.setConfigurationFile("file:/c:/teleco/demo/italia/turandot.xml");
        mediaPlayer1.setPlaybackLoop(false);
        mediaPlayer1.setVolume(1.0F);
        hTextLook21.setDelay(250);
        hTextLook21.setSeparator(" * * * ");

        setLayout(null);

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

        hMenu1.setBackground(new java.awt.Color(153, 255, 153));
        hMenu1.setBackgroundMode(org.havi.ui.HVisible.BACKGROUND_FILL);
        hMenu1.setConfigurationFile("file:/c:/teleco/demo/italia/menu.xml");
        hMenu1.setContextManager(mainContextManager);
        hMenu1.setCyclic(true);
        hMenu1.setFireEventOnChange(true);
        hMenu1.setLayoutOrientation(javax.swing.JList.HORIZONTAL_WRAP);
        hPanel1.add(hMenu1);

        add(hPanel1);
        hPanel1.setBounds(10, 430, 420, 40);

        hScrollPane1.setVerticalScrollControl(hScrollBar1);
        textPanel1.setBackground(new java.awt.Color(0, 0, 204));
        textPanel1.setConfigurationFile("file:/c:/teleco/demo/italia/texto.xml");
        textPanel1.setContextManager(mainContextManager);
        hScrollPane1.setViewportView(textPanel1);

        add(hScrollPane1);
        hScrollPane1.setBounds(10, 10, 420, 410);

        hScrollBar1.setBackground(new java.awt.Color(204, 255, 204));
        hScrollBar1.setBackgroundMode(org.havi.ui.HVisible.BACKGROUND_FILL);
        hScrollBar1.setForeground(new java.awt.Color(102, 0, 102));
        try {
            hScrollBar1.setLook(hRangeLook21);
        } catch (org.havi.ui.HInvalidLookException e1) {
            e1.printStackTrace();
        }
        hScrollBar1.setValue(0);
        add(hScrollBar1);
        hScrollBar1.setBounds(440, 360, 210, 110);

        hMultiPanel1.setBackground(new java.awt.Color(153, 255, 153));
        hMultiPanel1.setConfigurationFile("file:/c:/teleco/demo/italia/multi.xml");
        hMultiPanel1.setContextManager(mainContextManager);
        hMultiPanel1.setOpaque(true);
        panel1.setLayout(new java.awt.GridLayout(1, 0));

        hLabel1.setLabel("No se me ocurre\nqu\u00e9 poner aqu\u00ed");
        panel1.add(hLabel1);

        hMultiPanel1.add(panel1, "card2");

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

        hLabel2.setLabel("Aqu\u00ed no hay nada que poner");
        try {
            hLabel2.setLook(hTextLook21);
        } catch (org.havi.ui.HInvalidLookException e1) {
            e1.printStackTrace();
        }
        panel2.add(hLabel2);

        hMultiPanel1.add(panel2, "card3");

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

        panel4.setBackground(new java.awt.Color(0, 204, 204));
        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);
            }
        });

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

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

        panel4.add(hButton3);

        panel3.add(panel4, java.awt.BorderLayout.SOUTH);

        hImage1.setBackground(new java.awt.Color(0, 204, 204));
        hImage1.setBackgroundMode(org.havi.ui.HVisible.BACKGROUND_FILL);
        hImage1.setImageURL("file:/c:/teleco/demo/italia/turandot.gif");
        panel3.add(hImage1, java.awt.BorderLayout.CENTER);

        hMultiPanel1.add(panel3, "card4");

        add(hMultiPanel1);
        hMultiPanel1.setBounds(440, 10, 210, 340);

    }//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.CourseDelegate courseDelegate;
    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.HLabel hLabel1;
    private com.uvigo.mhp.ui.HLabel hLabel2;
    private com.uvigo.mhp.ui.HMenu hMenu1;
    private com.uvigo.mhp.ui.HMultiPanel hMultiPanel1;
    private com.uvigo.mhp.ui.HPanel hPanel1;
    private com.uvigo.mhp.looks.HRangeLook2 hRangeLook21;
    private com.uvigo.mhp.ui.HScrollBar hScrollBar1;
    private com.uvigo.mhp.ui.HScrollPane hScrollPane1;
    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;
    private java.awt.Panel panel2;
    private java.awt.Panel panel3;
    private java.awt.Panel panel4;
    private com.uvigo.mhp.textPanel.TextPanel textPanel1;
    // 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_1());
     
     scene.addWindowListener(new WindowAdapter()
 {
     public void windowClosing(WindowEvent e)
 {
     System.exit(0);
     }
     }
     );
     scene.setVisible(true);
     scene.validate();
     }
}
