Package org.boco.seamwebappgen.gui

Source Code of org.boco.seamwebappgen.gui.WebAppGenGUI

/***************************************************************************
*  Copyright (c) 2004 - 2008  Fabrizio Boco fabboco@users.sourceforge.net *
*                                                                         *
*                                                                         *
*   This is free software; you can redistribute it and/or                 *
*   modify it under the terms of the GNU Library General Public           *
*   License (version 2.1) as published by the Free Software Foundation    *
*                                                                         *
*   This library  is distributed in the hope that it will be useful,      *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU Library General Public License for more details.                  *
*                                                                         *
*   You should have received a copy of the GNU Library General Public     *
*   License along with this library; see the file COPYING.LIB. If not,    *
*   write to the Free Software Foundation, Inc., 59 Temple Place,         *
*   Suite 330, Boston, MA  02111-1307, USA                                *
*                                                                         *
***************************************************************************/
/**
- $Header: /usr/local/cvslocalrepository/SeamWebAppGenerator/src/org/boco/seamwebappgen/gui/Attic/WebAppGenGUI.java,v 1.1.2.2 2008/04/22 05:37:57 fab Exp $
- $Author: fab $
- $Revision: 1.1.2.2 $
- $Date: 2008/04/22 05:37:57 $
- $Log: WebAppGenGUI.java,v $
- Revision 1.1.2.2  2008/04/22 05:37:57  fab
- Aggiornamento indirizzo di posta
-
- Revision 1.1.2.1  2008/04/19 13:12:49  fab
- Modifiche varie per rafactoring
-
- Revision 1.1.2.1  2008/04/19 11:18:31  fab
- Refactoring
-
- Revision 1.4.4.3  2008/04/19 10:07:02  fab
- Aggiornamento riferimenti licenza
-
-
**/
package org.boco.seamwebappgen.gui;

import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
import javax.swing.BorderFactory;

import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import org.boco.seamwebappgen.SeamBasedGenerator;
import org.boco.seamwebappgen.projectGeneration.ProjectGenerator;

/**
*
*
* @author Fabrizio Boco
*
*
*/
public class WebAppGenGUI extends JFrame implements ActionListener
{

  private static final long  serialVersionUID  = 1L;

  private JPanel          jPanel        = null;
  private JPanel          jPanelTitoli    = null;
  private JPanel          jPanelDirectory  = null;
  private JPanel          jPanelPulsanti    = null;
  private JPanel          jPanelWarning    = null;
  private JLabel          jLabel1        = null;
  private JLabel          jLabel2        = null;
  private JLabel          jLabel3        = null;
  private JLabel          jLabel4        = null;
  private JPanel          jPanel1        = null;
  private JPanel          jPanel2        = null;
  private JLabel          jLSourceDir      = null;
  private JLabel          sourceDirLabel    = null;
  private JLabel          targetDirLabel    = null;
  private JPanel          jPanel3        = null;
  private JLabel          jLTargetDir      = null;
  private JPanel          jPanel4        = null;
  private JButton        bOk          = null;
  private JButton        bEsci          = null;
  private JButton        bFileSource      = null;
  private JButton        bFileTarget      = null;
  private JTextArea        messagesArea    = null;

  private String          runningInfoFile  = "./runningInfoFile.properties"; //$NON-NLS-1$
  private Properties      runningInfo      = new Properties();
  private JFileChooser      sourceDirChooser;
  private JFileChooser      targetDirChooser;

  private JProgressBar      jProgressBar    = null;

  private JButton        bCreateProject    = null;

  private JLabel          jLPackageName    = null;
  private JButton        bHelp;
  private LogoCanvas      canvas1;
  private JTextField      jTextVersion;
  private JLabel          jLabelVersion;
  private JPanel          jPanelVersionInformation;

  private JPanel          jPanel5        = null;
  private JTextField      jTPackageName    = null;
  private Boolean        creatingProject;
  private JLabel          jLApplicationName  = null;
  private JPanel          jPanel6        = null;
  private JTextField      jTApplicationName  = null;

  public WebAppGenGUI()
  {
    // super();

    initialize();

    addWindowListener(new WindowAdapter()
    {

      public void windowClosing(WindowEvent e)
      {
        System.exit(0);
      }
    });

    String sourceDir = ""; //$NON-NLS-1$
    String targetDir = ""; //$NON-NLS-1$

    try
    {
      this.jTextVersion.setText(Messages.getString("WebAppGen.applicationVersion")); //$NON-NLS-1$

      runningInfo.load(new FileInputStream(new File(runningInfoFile)));
      sourceDir = runningInfo.getProperty("sourceDir"); //$NON-NLS-1$
      targetDir = runningInfo.getProperty("targetDir"); //$NON-NLS-1$
    }
    catch (FileNotFoundException e1)
    {
      sourceDir = null;
      targetDir = null;
      e1.printStackTrace();
    }
    catch (IOException e1)
    {
      sourceDir = null;
      targetDir = null;
      e1.printStackTrace();
    }

    if (sourceDir == null)
    {
      sourceDirChooser = new JFileChooser();
      sourceDirLabel.setText("?"); //$NON-NLS-1$
    }
    else
    {
      sourceDirChooser = new JFileChooser(new File(sourceDir));
      sourceDirLabel.setText(sourceDir);
    }

    sourceDirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

    if (targetDir == null)
    {
      targetDirChooser = new JFileChooser();
      targetDirLabel.setText("?"); //$NON-NLS-1$
    }
    else
    {
      targetDirChooser = new JFileChooser(new File(targetDir));
      targetDirLabel.setText(targetDir);
    }

    targetDirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

    messagesArea.setText(""); //$NON-NLS-1$

    //getGenerationTypeGroup();

    creatingProject = false;

    jLPackageName.setVisible(false);
    jTPackageName.setVisible(false);

    jLApplicationName.setVisible(false);
    jTApplicationName.setVisible(false);

    pack();
    setVisible(true);
  }

  private void initialize()
  {
    this.setPreferredSize(new Dimension(950, 443));
    this.setSize(new java.awt.Dimension(950, 443));
    this.setContentPane(getJPanel());
    this.setTitle(Messages.getString("WebAppGen.applicationName")); //$NON-NLS-1$
    this.bOk.addActionListener(this);
    this.bEsci.addActionListener(this);
    this.bFileSource.addActionListener(this);
    this.bFileTarget.addActionListener(this);
    this.bCreateProject.addActionListener(this);
    this.bHelp.addActionListener(this);
  }

  public void actionPerformed(ActionEvent event)
  {
    if (event.getSource().equals(bEsci))
    {
      System.exit(0);
    }

    if (event.getSource().equals(bOk) && !creatingProject)
    {
      try
      {
        FileOutputStream os = new FileOutputStream(new File(runningInfoFile));
        runningInfo.store(os, ""); //$NON-NLS-1$
        os.close();

        SeamBasedGenerator generator = new SeamBasedGenerator(sourceDirLabel.getText() + File.separator + "bin", targetDirLabel.getText(), jProgressBar, messagesArea); //$NON-NLS-1$

        new Thread(generator).start();
      }
      catch (NullPointerException e)
      {
        e.printStackTrace();
        messagesArea.setText("java.lang.NullPointerException"); //$NON-NLS-1$
      }
      catch (Exception e)
      {
        e.printStackTrace();
        messagesArea.setText(e.getMessage());
      }

    }

    if (event.getSource().equals(bOk) && creatingProject)
    {
      if (jTApplicationName.getText().equals("")) //$NON-NLS-1$
      {
        messagesArea.setText(Messages.getString("WebAppGen.applicationNameLabel")); //$NON-NLS-1$
        return;
      }

      if (jTPackageName.getText().equals("")) //$NON-NLS-1$
      {
        messagesArea.setText(Messages.getString("WebAppGen.applicationPackageLabel")); //$NON-NLS-1$
        return;
      }

      /**
       * Creazione del progetto
       */
      try
      {
        FileOutputStream os = new FileOutputStream(new File(runningInfoFile));

        runningInfo.put("applicationName", jTApplicationName.getText()); //$NON-NLS-1$
        runningInfo.put("packageName", jTPackageName.getText()); //$NON-NLS-1$

        runningInfo.store(os, ""); //$NON-NLS-1$
        os.close();

        ProjectGenerator generator = new ProjectGenerator(jTApplicationName.getText(), sourceDirLabel.getText(), jTPackageName.getText(), jProgressBar, messagesArea);

        new Thread(generator).start();
      }
      catch (Exception e)
      {
        e.printStackTrace();
        messagesArea.setText(e.getMessage());
      }
    }

    if (event.getSource().equals(bFileSource))
    {
      int ret = sourceDirChooser.showOpenDialog(null);

      if (ret == JFileChooser.CANCEL_OPTION)
        return;

      File file = sourceDirChooser.getSelectedFile();

      sourceDirLabel.setText(file.getAbsolutePath());
      targetDirLabel.setText(file.getAbsolutePath());

      runningInfo.put("sourceDir", file.getAbsolutePath()); //$NON-NLS-1$
      runningInfo.put("targetDir", file.getAbsolutePath()); //$NON-NLS-1$
    }

    if (event.getSource().equals(bFileTarget))
    {
      int ret = targetDirChooser.showOpenDialog(null);

      if (ret == JFileChooser.CANCEL_OPTION)
        return;

      File file = targetDirChooser.getSelectedFile();

      targetDirLabel.setText(file.getAbsolutePath());

      runningInfo.put("targetDir", file.getAbsolutePath()); //$NON-NLS-1$
    }

    if (event.getSource().equals(this.bCreateProject))
    {
      // Attivazione dell'acquisizione delle informazioni per la creazione del progetto
      bCreateProject.setVisible(false);

      bFileSource.setVisible(false);

      jLTargetDir.setVisible(false);
      targetDirLabel.setVisible(false);
      bFileTarget.setVisible(false);

      jLPackageName.setVisible(true);
      jTPackageName.setVisible(true);

      jLApplicationName.setVisible(true);
      jTApplicationName.setVisible(true);

      if (runningInfo.get("applicationName") != null) //$NON-NLS-1$
        jTApplicationName.setText(runningInfo.get("applicationName").toString()); //$NON-NLS-1$

      if (runningInfo.get("packageName") != null) //$NON-NLS-1$
        jTPackageName.setText(runningInfo.get("packageName").toString()); //$NON-NLS-1$

      creatingProject = true;

      this.pack();
      this.repaint();
    }

    if (event.getSource().equals(this.bHelp))
    {
      DocumentationViewer documentationViewer = new DocumentationViewer(this);
      documentationViewer.pack();
      documentationViewer.setVisible(true);
      documentationViewer.repaint();
    }
  }

  /**
   * This method initializes jPanel 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel()
  {
    if (jPanel == null)
    {
      GridLayout gridLayout = new GridLayout(4, 1);
      gridLayout.setColumns(3);
      gridLayout.setRows(4);
      jPanel = new JPanel();
      jPanel.setBackground(new java.awt.Color(230, 230, 230));
      jPanel.setLayout(gridLayout);
      jPanel.add(getJPanelTitoli(), null);
      jPanel.add(getJPanelDirectory(), null);
      jPanel.add(getJPanelPulsanti(), null);
      jPanel.add(getJPanelWarning(), null);
    }
    return jPanel;
  }

  /**
   * This method initializes jPanel1 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanelTitoli()
  {
    if (jPanelTitoli == null)
    {
      GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
      gridBagConstraints3.gridx = 0;
      gridBagConstraints3.fill = GridBagConstraints.NONE;
      gridBagConstraints3.anchor = GridBagConstraints.CENTER;
      gridBagConstraints3.gridy = 3;
      jLabel4 = new JLabel();
      jLabel4.setText(Messages.getString("WebAppGen.copyrightLabel1")); //$NON-NLS-1$
      jLabel4.setForeground(java.awt.Color.red);
      GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
      gridBagConstraints2.gridx = 0;
      gridBagConstraints2.fill = GridBagConstraints.NONE;
      gridBagConstraints2.gridy = 2;
      jLabel3 = new JLabel();
      jLabel3.setText(Messages.getString("WebAppGen.copyrightLabel2")); //$NON-NLS-1$
      jLabel3.setForeground(java.awt.Color.red);
      GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.gridy = 1;
      jLabel2 = new JLabel();
      jLabel2.setText(Messages.getString("WebAppGen.applicationOwner")); //$NON-NLS-1$
      jLabel2.setForeground(java.awt.Color.blue);
      GridBagConstraints gridBagConstraints = new GridBagConstraints();
      gridBagConstraints.gridx = 0;
      gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints.gridy = 0;
      jLabel1 = new JLabel();
      jLabel1.setText(Messages.getString("WebAppGen.applicationDescription")); //$NON-NLS-1$
      jLabel1.setForeground(java.awt.Color.blue);
      jLabel1.setBackground(new java.awt.Color(230, 230, 230));
      jPanelTitoli = new JPanel();
      jPanelTitoli.setBackground(new java.awt.Color(230, 230, 230));
      GridBagLayout layout = new GridBagLayout();
      layout.columnWeights = new double[] {0.1, 0.1, 0.1};
      layout.columnWidths = new int[] {7, 7, 7};
      layout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1};
      layout.rowHeights = new int[] {7, 7, 7, 7};
      jPanelTitoli.setLayout(layout);
      jPanelTitoli.add(jLabel1, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
      jPanelTitoli.add(jLabel2, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
      jPanelTitoli.add(jLabel3, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
      jPanelTitoli.add(jLabel4, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
      jPanelTitoli.add(getJPanelVersionInformation(), new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
      jPanelTitoli.add(getCanvas1(), new GridBagConstraints(0, 0, 1, 5, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
      jPanelTitoli.repaint();
    }
    return jPanelTitoli;
  }

  /**
   * This method initializes jPanel2 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanelDirectory()
  {
    if (jPanelDirectory == null)
    {
      GridBagConstraints gridBagConstraints30 = new GridBagConstraints();
      gridBagConstraints30.gridx = 1;
      gridBagConstraints30.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints30.gridy = 2;
      GridBagConstraints gridBagConstraints29 = new GridBagConstraints();
      gridBagConstraints29.gridx = 0;
      gridBagConstraints29.gridy = 2;
      jLApplicationName = new JLabel();
      jLApplicationName.setText(Messages.getString("WebAppGen.applicationNameLabel")); //$NON-NLS-1$
      GridBagConstraints gridBagConstraints28 = new GridBagConstraints();
      gridBagConstraints28.gridx = 1;
      gridBagConstraints28.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints28.gridy = 3;
      GridBagConstraints gridBagConstraints27 = new GridBagConstraints();
      gridBagConstraints27.gridx = 1;
      gridBagConstraints27.gridy = 2;
      GridBagConstraints gridBagConstraints26 = new GridBagConstraints();
      gridBagConstraints26.gridx = 0;
      gridBagConstraints26.gridy = 3;
      jLPackageName = new JLabel();
      jLPackageName.setText(Messages.getString("WebAppGen.applicationPackageLabel")); //$NON-NLS-1$
      GridBagConstraints gridBagConstraints25 = new GridBagConstraints();
      gridBagConstraints25.gridx = 0;
      gridBagConstraints25.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints25.gridwidth = 3;
      gridBagConstraints25.gridy = 3;
      GridBagConstraints gridBagConstraints24 = new GridBagConstraints();
      gridBagConstraints24.gridx = 0;
      gridBagConstraints24.gridy = 2;
      GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
      gridBagConstraints11.gridx = 0;
      gridBagConstraints11.gridy = 2;
      GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
      gridBagConstraints10.gridx = 2;
      gridBagConstraints10.gridy = 1;
      GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
      gridBagConstraints9.gridx = 2;
      gridBagConstraints9.gridy = 0;
      GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
      gridBagConstraints8.gridx = 1;
      gridBagConstraints8.fill = java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints8.gridy = 1;
      GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
      gridBagConstraints7.gridx = 0;
      gridBagConstraints7.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints7.gridy = 1;
      GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
      gridBagConstraints6.gridx = 1;
      gridBagConstraints6.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints6.ipadx = 350;
      gridBagConstraints6.gridy = 0;
      GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
      gridBagConstraints4.gridx = 0;
      gridBagConstraints4.fill = java.awt.GridBagConstraints.NONE;
      gridBagConstraints4.ipadx = 51;
      gridBagConstraints4.anchor = java.awt.GridBagConstraints.WEST;
      gridBagConstraints4.gridy = 0;
      GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
      gridBagConstraints5.gridx = 1;
      gridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints5.anchor = java.awt.GridBagConstraints.EAST;
      gridBagConstraints5.gridy = 0;
      jPanelDirectory = new JPanel();
      jPanelDirectory.setLayout(new GridBagLayout());
      jPanelDirectory.setBackground(new java.awt.Color(230, 230, 230));
      jPanelDirectory.add(getJPanel1(), gridBagConstraints4);
      jPanelDirectory.add(getJPanel2(), gridBagConstraints6);
      jPanelDirectory.add(getJPanel3(), gridBagConstraints7);
      jPanelDirectory.add(getJPanel4(), gridBagConstraints8);
      jPanelDirectory.add(getBFileSource(), gridBagConstraints9);
      jPanelDirectory.add(getJButton(), gridBagConstraints10);

      jPanelDirectory.add(jLPackageName, gridBagConstraints26);
      jPanelDirectory.add(getJPanel5(), gridBagConstraints28);
      jPanelDirectory.add(jLApplicationName, gridBagConstraints29);
      jPanelDirectory.add(getJPanel6(), gridBagConstraints30);
    }
    return jPanelDirectory;
  }

  /**
   * This method initializes jPanel3 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanelPulsanti()
  {
    if (jPanelPulsanti == null)
    {
      GridBagConstraints gridBagConstraints23 = new GridBagConstraints();
      gridBagConstraints23.gridx = 4;
      gridBagConstraints23.gridwidth = 2;
      gridBagConstraints23.ipadx = 0;
      gridBagConstraints23.insets = new java.awt.Insets(0, 13, 0, 0);
      gridBagConstraints23.fill = java.awt.GridBagConstraints.VERTICAL;
      gridBagConstraints23.gridy = 1;
      GridBagConstraints gridBagConstraints22 = new GridBagConstraints();
      gridBagConstraints22.gridx = 2;
      gridBagConstraints22.gridy = 0;
      GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
      gridBagConstraints21.gridx = 2;
      gridBagConstraints21.gridy = 1;
      GridBagConstraints gridBagConstraints20 = new GridBagConstraints();
      gridBagConstraints20.gridx = 0;
      gridBagConstraints20.gridy = 1;
      GridBagConstraints gridBagConstraints19 = new GridBagConstraints();
      gridBagConstraints19.gridx = 0;
      gridBagConstraints19.gridy = 1;
      GridBagConstraints gridBagConstraints18 = new GridBagConstraints();
      gridBagConstraints18.gridx = 0;
      gridBagConstraints18.gridy = 0;
      GridBagConstraints gridBagConstraints17 = new GridBagConstraints();
      gridBagConstraints17.gridx = 1;
      gridBagConstraints17.gridy = 1;
      GridBagConstraints gridBagConstraints16 = new GridBagConstraints();
      gridBagConstraints16.gridx = 1;
      gridBagConstraints16.gridy = 0;
      GridBagConstraints gridBagConstraints15 = new GridBagConstraints();
      gridBagConstraints15.gridx = 1;
      gridBagConstraints15.gridy = 1;
      GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
      gridBagConstraints14.gridx = 0;
      gridBagConstraints14.gridy = 1;
      GridBagConstraints gridBagConstraints13 = new GridBagConstraints();
      gridBagConstraints13.gridx = 1;
      gridBagConstraints13.gridy = 0;
      GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
      gridBagConstraints12.gridx = 0;
      gridBagConstraints12.gridy = 0;
      jPanelPulsanti = new JPanel();
      jPanelPulsanti.setLayout(new GridBagLayout());
      jPanelPulsanti.setBackground(new java.awt.Color(230, 230, 230));

      jPanelPulsanti.add(getBOk(), gridBagConstraints17);

      jPanelPulsanti.add(getBEsci(), gridBagConstraints21);

      jPanelPulsanti.add(getJButton2(), gridBagConstraints23);
      jPanelPulsanti.add(getBHelp(), new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
      //      jPanelPulsanti.add(getJrbSeam(), gridBagConstraints17);
      //      jPanelPulsanti.add(getJrbSeam(), gridBagConstraints22);

    }
    return jPanelPulsanti;
  }

  /**
   * This method initializes jPanel4 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanelWarning()
  {
    if (jPanelWarning == null)
    {

      jPanelWarning = new JPanel();
      jPanelWarning.setLayout(new BorderLayout());
      jPanelWarning.setBackground(java.awt.Color.lightGray);
      jPanelWarning.add(getJProgressBar(), BorderLayout.NORTH);
      jPanelWarning.add(getMessagesArea(), getMessagesArea().getName());
    }
    return jPanelWarning;
  }

  /**
   * This method initializes jPanel1 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel1()
  {
    if (jPanel1 == null)
    {
      jLSourceDir = new JLabel();
      jLSourceDir.setText(Messages.getString("WebAppGen.sourceDirLabel")); //$NON-NLS-1$
      jPanel1 = new JPanel();
      jPanel1.setPreferredSize(new java.awt.Dimension(320, 30));
      jPanel1.setBackground(new java.awt.Color(230, 230, 230));
      jPanel1.add(jLSourceDir, null);
    }
    return jPanel1;
  }

  /**
   * This method initializes jPanel2 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel2()
  {
    if (jPanel2 == null)
    {
      sourceDirLabel = new JLabel();
      sourceDirLabel.setText(Messages.getString("WebAppGenGUI.21")); //$NON-NLS-1$
      jPanel2 = new JPanel();
      jPanel2.setPreferredSize(new java.awt.Dimension(320, 30));
      jPanel2.setBackground(new java.awt.Color(230, 230, 230));
      jPanel2.add(sourceDirLabel, null);
    }
    return jPanel2;
  }

  /**
   * This method initializes jPanel3 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel3()
  {
    if (jPanel3 == null)
    {
      jLTargetDir = new JLabel();
      jLTargetDir.setText(Messages.getString("WebAppGen.targetDirLabel")); //$NON-NLS-1$
      jPanel3 = new JPanel();
      jPanel3.setBackground(new java.awt.Color(230, 230, 230));
      jPanel3.add(jLTargetDir, null);
    }
    return jPanel3;
  }

  /**
   * This method initializes jPanel4 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel4()
  {
    if (jPanel4 == null)
    {
      targetDirLabel = new JLabel();
      targetDirLabel.setText(Messages.getString("WebAppGenGUI.22")); //$NON-NLS-1$
      jPanel4 = new JPanel();
      jPanel4.setBackground(new java.awt.Color(230, 230, 230));
      jPanel4.add(targetDirLabel, null);
    }
    return jPanel4;
  }

  /**
   * This method initializes jButton 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getBOk()
  {
    if (bOk == null)
    {
      bOk = new JButton();
      bOk.setText(Messages.getString("WebAppGen.buttonOk")); //$NON-NLS-1$
    }
    return bOk;
  }

  /**
   * This method initializes jButton1 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getBEsci()
  {
    if (bEsci == null)
    {
      bEsci = new JButton();
      bEsci.setText(Messages.getString("WebAppGen.buttonExit")); //$NON-NLS-1$
    }
    return bEsci;
  }

  /**
   * This method initializes jButton 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getBFileSource()
  {
    if (bFileSource == null)
    {
      bFileSource = new JButton();
      bFileSource.setText(Messages.getString("WebAppGen.buttonSelect")); //$NON-NLS-1$
    }
    return bFileSource;
  }

  /**
   * This method initializes jButton 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButton()
  {
    if (bFileTarget == null)
    {
      bFileTarget = new JButton();
      bFileTarget.setText(Messages.getString("WebAppGen.buttonSelect")); //$NON-NLS-1$
    }
    return bFileTarget;
  }

  /**
   * This method initializes jTextArea 
   *  
   * @return javax.swing.JTextArea 
   */
  private JTextArea getMessagesArea()
  {
    if (messagesArea == null)
    {
      messagesArea = new JTextArea();
      messagesArea.setText(""); //$NON-NLS-1$
      messagesArea.setColumns(70);
      messagesArea.setRows(5);
      messagesArea.setBackground(new java.awt.Color(230, 230, 230));
    }
    return messagesArea;
  }

  /**
   * This method initializes jProgressBar 
   *  
   * @return javax.swing.JProgressBar 
   */
  private JProgressBar getJProgressBar()
  {
    if (jProgressBar == null)
    {
      jProgressBar = new JProgressBar();
    }
    return jProgressBar;
  }

  /**
   * This method initializes jButton 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButton2()
  {
    if (bCreateProject == null)
    {
      bCreateProject = new JButton();
      bCreateProject.setText(Messages.getString("WebAppGen.buttonCreateProject")); //$NON-NLS-1$
    }
    return bCreateProject;
  }

  /**
   * This method initializes jPanel5 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel5()
  {
    if (jPanel5 == null)
    {
      jPanel5 = new JPanel();
      jPanel5.setBackground(new java.awt.Color(230, 230, 230));
      jPanel5.add(getJTextField(), null);
    }
    return jPanel5;
  }

  /**
   * This method initializes jTextField 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextField()
  {
    if (jTPackageName == null)
    {
      jTPackageName = new JTextField();
      jTPackageName.setPreferredSize(new Dimension(250, 18));
    }
    return jTPackageName;
  }

  /**
   * This method initializes jPanel6 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel6()
  {
    if (jPanel6 == null)
    {
      jPanel6 = new JPanel();
      jPanel6.setBackground(new java.awt.Color(230, 230, 230));
      jPanel6.add(getJTextField2(), null);
    }
    return jPanel6;
  }

  /**
   * This method initializes jTextField 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextField2()
  {
    if (jTApplicationName == null)
    {
      jTApplicationName = new JTextField();
      jTApplicationName.setPreferredSize(new Dimension(250, 18));
    }
    return jTApplicationName;
  }

  public JPanel getJPanelVersionInformation()
  {
    if (jPanelVersionInformation == null)
    {
      jPanelVersionInformation = new JPanel();
      FlowLayout jPanelVersionInformationLayout = new FlowLayout();
      jPanelVersionInformation.setLayout(jPanelVersionInformationLayout);
      jPanelVersionInformation.setBackground(new java.awt.Color(230, 230, 230));
      jPanelVersionInformation.add(getJLabelVersion());
      jPanelVersionInformation.add(getJTextVersion());
    }
    return jPanelVersionInformation;
  }

  private JLabel getJLabelVersion()
  {
    if (jLabelVersion == null)
    {
      jLabelVersion = new JLabel();
      jLabelVersion.setForeground(java.awt.Color.blue);
      jLabelVersion.setText(Messages.getString("WebAppGen.applicationVersionLabel")); //$NON-NLS-1$
      jLabelVersion.setFont(new java.awt.Font("Dialog", 1, 12)); //$NON-NLS-1$
    }
    return jLabelVersion;
  }

  public JTextField getJTextVersion()
  {
    if (jTextVersion == null)
    {
      jTextVersion = new JTextField();
      jTextVersion.setPreferredSize(new java.awt.Dimension(30, 22));
      jTextVersion.setEditable(false);
      jTextVersion.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
      jTextVersion.setBackground(new java.awt.Color(230, 230, 230));
      jTextVersion.setForeground(java.awt.Color.red);
      jTextVersion.setFont(new java.awt.Font("Dialog", 1, 12)); //$NON-NLS-1$

    }
    return jTextVersion;
  }

  private Canvas getCanvas1()
  {
    if (canvas1 == null)
    {
      canvas1 = new LogoCanvas();
      canvas1.setPreferredSize(new java.awt.Dimension(48, 48));
      canvas1.setSize(48, 48);
    }
    return canvas1;
  }

  private JButton getBHelp()
  {
    if (bHelp == null)
    {
      bHelp = new JButton();
      bHelp.setText("Help"); //$NON-NLS-1$
    }
    return bHelp;
  }

} //  @jve:decl-index=0:visual-constraint="29,15"
TOP

Related Classes of org.boco.seamwebappgen.gui.WebAppGenGUI

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.