/*
 * PainelFerramentas.java
 *
 * Created on 13 de Dezembro de 2008, 00:29
  */

package ambienteGrafico.componentes;

import java.awt.Cursor;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import org.jdesktop.swingx.JXGlassBox;
import org.jdesktop.swingx.JXPanel;
import org.jvnet.substance.skin.SubstanceAutumnLookAndFeel;

/**
 *
 * @author  Marília
 */
public class PainelFerramentas extends MeuPainel {

    PainelFerramentaAgentes painelFerramentaAgentes = null;
    PainelFerramentaSimulacao painelFerramentaSimulacao = null;
    PainelFerramentaAmbiente painelFerramentaAmbiente = null;
    PainelFerramentaAlvos painelFerramentaAlvos = null;
    PainelFerramentaObstaculos painelFerramentaObstaculos = null;
    
    /** Creates new form PainelFerramentas */
    public PainelFerramentas(Canvas canvas) {
        mudarLookAndFeel();
        initComponents();
        this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        
        painelFerramentaAgentes = new PainelFerramentaAgentes(canvas);
        painelFerramentaSimulacao = new PainelFerramentaSimulacao(canvas);
        painelFerramentaAmbiente = new PainelFerramentaAmbiente(canvas);
        painelFerramentaAlvos = new PainelFerramentaAlvos(canvas);
        painelFerramentaObstaculos = new PainelFerramentaObstaculos(canvas);

        painelConteiner.add(painelFerramentaAgentes, "card1");
        painelConteiner.add(painelFerramentaSimulacao, "card2");
        painelConteiner.add(painelFerramentaAmbiente, "card3");
        painelConteiner.add(painelFerramentaAlvos, "card4");
        painelConteiner.add(painelFerramentaObstaculos, "card5");
        /*
        this.setVisible(true);
        painelFerramentaAgentes.setVisible(true);
        painelFerramentaSimulacao.setVisible(false);
        painelFerramentaAmbiente.setVisible(false);
        painelFerramentaAlvos.setVisible(false);
        */
    }
    public void mudarLookAndFeel(){
      try {
          UIManager.setLookAndFeel(new SubstanceAutumnLookAndFeel());
        }
        catch (UnsupportedLookAndFeelException e) {
            e.printStackTrace();
        } 
    }
    public void mostrarFerramentaAgente(){
        painelFerramentaAgentes.setVisible(true);
        painelFerramentaSimulacao.setVisible(false);
        painelFerramentaAmbiente.setVisible(false);
        painelFerramentaAlvos.setVisible(false);
        painelFerramentaObstaculos.setVisible(false);
        this.setVisible(true);
    }
    
    public void mostrarFerramentaAmbiente(){
        painelFerramentaAgentes.setVisible(false);
        painelFerramentaSimulacao.setVisible(false);
        painelFerramentaAmbiente.setVisible(true);
        painelFerramentaAlvos.setVisible(false);
        painelFerramentaObstaculos.setVisible(false);
        this.setVisible(true);
    }
    public void mostrarFerramentaSimulacao(){
        painelFerramentaAgentes.setVisible(false);
        painelFerramentaSimulacao.setVisible(true);
        painelFerramentaAmbiente.setVisible(false);
         painelFerramentaAlvos.setVisible(false);
         painelFerramentaObstaculos.setVisible(false);
        this.setVisible(true);
    }
    public void mostrarFerramentaAlvos(){
        painelFerramentaAgentes.setVisible(false);
        painelFerramentaSimulacao.setVisible(false);
        painelFerramentaAmbiente.setVisible(false);
        painelFerramentaAlvos.setVisible(true);
        painelFerramentaObstaculos.setVisible(false);
        this.setVisible(true);
    }
    public void mostrarFerramentaObstaculos(){
        painelFerramentaAgentes.setVisible(false);
        painelFerramentaSimulacao.setVisible(false);
        painelFerramentaAmbiente.setVisible(false);
        painelFerramentaAlvos.setVisible(false);
        painelFerramentaObstaculos.setVisible(true);
        this.setVisible(true);
    }
    public void ocutarPainelFerramentas(){
        this.setVisible(false);
        painelFerramentaAgentes.setVisible(false);
        painelFerramentaSimulacao.setVisible(false);
        painelFerramentaAmbiente.setVisible(false);
        painelFerramentaAlvos.setVisible(false);
        painelFerramentaObstaculos.setVisible(false);
    }

    /** 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.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bt_Fechar = new javax.swing.JButton();
        painelConteiner = new MeuPainel();

        setPreferredSize(new java.awt.Dimension(200, 300));
        setLayout(new java.awt.BorderLayout());

        bt_Fechar.setForeground(new java.awt.Color(0, 0, 1));
        bt_Fechar.setText("Fechar Painel");
        bt_Fechar.setIconTextGap(0);
        bt_Fechar.setMargin(new java.awt.Insets(1, 1, 1, 1));
        bt_Fechar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_FecharActionPerformed(evt);
            }
        });
        add(bt_Fechar, java.awt.BorderLayout.NORTH);

        painelConteiner.setPreferredSize(new java.awt.Dimension(146, 0));
        painelConteiner.setLayout(new java.awt.CardLayout());
        add(painelConteiner, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

private void bt_FecharActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_FecharActionPerformed
        ocutarPainelFerramentas();
}//GEN-LAST:event_bt_FecharActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bt_Fechar;
    private javax.swing.JPanel painelConteiner;
    // End of variables declaration//GEN-END:variables

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                JFrame frame =  new JFrame();
                frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
                PainelFerramentas panel = new PainelFerramentas(null);
                panel.setVisible(true);
                frame.setContentPane(panel);
                frame.setVisible(true);
                frame.pack();
            }
        });
    }
    //----------Gettters and Setters------------------//
    public PainelFerramentaAgentes getPainelFerramentaAgentes() {
        return painelFerramentaAgentes;
    }

    public void setPainelFerramentaAgentes(PainelFerramentaAgentes painelFerramentaAgentes) {
        this.painelFerramentaAgentes =  painelFerramentaAgentes;
    }

    public PainelFerramentaAmbiente getPainelFerramentaAmbiente() {
        return painelFerramentaAmbiente;
    }

    public void setPainelFerramentaAmbiente(PainelFerramentaAmbiente painelFerramentaAmbiente) {
        this.painelFerramentaAmbiente =  painelFerramentaAmbiente;
    }

    public PainelFerramentaSimulacao getPainelFerramentaSimulacao() {
        return painelFerramentaSimulacao;
    }

    public void setPainelFerramentaSimulacao(PainelFerramentaSimulacao painelFerramentaSimulacao) {
        this.painelFerramentaSimulacao =  painelFerramentaSimulacao;
    }

    public PainelFerramentaAlvos getPainelFerramentaAlvos() {
        return painelFerramentaAlvos;
    }

    public void setPainelFerramentaAlvos(PainelFerramentaAlvos painelFerramentaAlvos) {
        this.painelFerramentaAlvos = painelFerramentaAlvos;
    }

    public PainelFerramentaObstaculos getPainelFerramentaObstaculos() {
        return painelFerramentaObstaculos;
    }

    public void setPainelFerramentaObstaculos(PainelFerramentaObstaculos painelFerramentaObstaculos) {
        this.painelFerramentaObstaculos = painelFerramentaObstaculos;
    }
    
}
