/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JPortalInternalFrame.java
 *
 * Created on 10.02.2010, 23:54:00
 */

package csa.gui.components;

/**
 *
 * @author Malban
 */
public class CSAInternalFrame extends javax.swing.JInternalFrame {

    CSAView mParent =null;
    /** Creates new form CSAInternalFrame */
    public CSAInternalFrame() {
        initComponents();
        
        // Theme t = Configuration.getConfiguration().getCurrentTheme();
        // setFrameIcon(new javax.swing.ImageIcon(t.getImage("BlueIconSmall.png")));
    }

    public void setParent(CSAView p)
    {
        mParent=p;
    }
    /** 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() {

        setClosable(true);
        setResizable(true);
        setPreferredSize(new java.awt.Dimension(800, 600));
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameClosed(evt);
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
            }
        });

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formInternalFrameClosed(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameClosed
        if (mParent != null)
            mParent.removeInternalFrame(this);
    }//GEN-LAST:event_formInternalFrameClosed
    javax.swing.JPanel mPanel;
    public void addPanel(javax.swing.JPanel panel)
    {
        mPanel = panel;
        add(panel, java.awt.BorderLayout.CENTER);
    }

    public javax.swing.JPanel getPanel()
    {
        return mPanel;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
