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

/*
 * LicensePanel.java
 *
 * Created on 21.10.2010, 22:58:39
 */
package com.jme3.gde.assetpack.project.properties;

import com.jme3.gde.assetpack.project.AssetPackProject;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *
 * @author normenhansen
 */
public class LicensePanel extends javax.swing.JPanel implements ActionListener{

    private AssetPackProject project;

    /** Creates new form LicensePanel */
    public LicensePanel(AssetPackProject project) {
        this.project = project;
        initComponents();
        setName("License");
        jTextArea1.setText(project.getLicense());
    }

    public void actionPerformed(ActionEvent e) {
        project.setLicense(jTextArea1.getText());
    }


    /** 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() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jLabel1 = new javax.swing.JLabel();

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jTextArea1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                updateLicense(evt);
            }
        });
        jScrollPane1.setViewportView(jTextArea1);

        jLabel1.setText(org.openide.util.NbBundle.getMessage(LicensePanel.class, "LicensePanel.jLabel1.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void updateLicense(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_updateLicense
    }//GEN-LAST:event_updateLicense

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    // End of variables declaration//GEN-END:variables
}
