java/abc-drupal-gui/src/cz/frantovo/abcDrupal/gui/HlavniOkno.java
changeset 2 2f02db6cd698
parent 0 f1a6902957b8
child 3 d40099dbbdd1
     1.1 --- a/java/abc-drupal-gui/src/cz/frantovo/abcDrupal/gui/HlavniOkno.java	Thu Dec 31 18:00:23 2009 +0100
     1.2 +++ b/java/abc-drupal-gui/src/cz/frantovo/abcDrupal/gui/HlavniOkno.java	Thu Dec 31 18:12:03 2009 +0100
     1.3 @@ -6,6 +6,8 @@
     1.4  package cz.frantovo.abcDrupal.gui;
     1.5  
     1.6  import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
     1.7 +import cz.frantovo.abcDrupal.Konvertor;
     1.8 +import cz.frantovo.abcDrupal.PosluchacLogu;
     1.9  import java.util.logging.Level;
    1.10  import java.util.logging.Logger;
    1.11  import javax.swing.UIManager;
    1.12 @@ -15,7 +17,7 @@
    1.13   *
    1.14   * @author fiki
    1.15   */
    1.16 -public class HlavniOkno extends javax.swing.JFrame {
    1.17 +public class HlavniOkno extends javax.swing.JFrame implements PosluchacLogu {
    1.18  
    1.19      private static final Logger log = Logger.getLogger(HlavniOkno.class.getName());
    1.20  
    1.21 @@ -33,32 +35,71 @@
    1.22      // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    1.23      private void initComponents() {
    1.24  
    1.25 +        jLabel1 = new javax.swing.JLabel();
    1.26 +        jLabel2 = new javax.swing.JLabel();
    1.27 +        jdbcZdroj = new javax.swing.JTextField();
    1.28 +        jdbcCil = new javax.swing.JTextField();
    1.29 +        jScrollPane1 = new javax.swing.JScrollPane();
    1.30 +        vystup = new javax.swing.JTextArea();
    1.31          jButton1 = new javax.swing.JButton();
    1.32 -        jTextField1 = new javax.swing.JTextField();
    1.33  
    1.34          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    1.35 +        setTitle("ABC-Drupal");
    1.36  
    1.37 -        jButton1.setText(":-)");
    1.38 +        jLabel1.setText("Zdroj");
    1.39  
    1.40 -        jTextField1.setText("jTextField1");
    1.41 +        jLabel2.setText("Cíl");
    1.42 +
    1.43 +        jdbcZdroj.setText("jdbcZdroj");
    1.44 +
    1.45 +        jdbcCil.setText("jdbcCil");
    1.46 +
    1.47 +        vystup.setColumns(20);
    1.48 +        vystup.setEditable(false);
    1.49 +        vystup.setRows(5);
    1.50 +        vystup.setEnabled(false);
    1.51 +        jScrollPane1.setViewportView(vystup);
    1.52 +
    1.53 +        jButton1.setText("Nahrát data");
    1.54 +        jButton1.addActionListener(new java.awt.event.ActionListener() {
    1.55 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
    1.56 +                jButton1ActionPerformed(evt);
    1.57 +            }
    1.58 +        });
    1.59  
    1.60          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    1.61          getContentPane().setLayout(layout);
    1.62          layout.setHorizontalGroup(
    1.63              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.64 -            .addGroup(layout.createSequentialGroup()
    1.65 +            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    1.66                  .addContainerGap()
    1.67 -                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.68 -                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING)
    1.69 -                    .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE))
    1.70 +                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    1.71 +                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 599, Short.MAX_VALUE)
    1.72 +                    .addGroup(layout.createSequentialGroup()
    1.73 +                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.74 +                            .addComponent(jLabel1)
    1.75 +                            .addComponent(jLabel2))
    1.76 +                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    1.77 +                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.78 +                            .addComponent(jdbcCil, javax.swing.GroupLayout.DEFAULT_SIZE, 560, Short.MAX_VALUE)
    1.79 +                            .addComponent(jdbcZdroj, javax.swing.GroupLayout.DEFAULT_SIZE, 560, Short.MAX_VALUE)))
    1.80 +                    .addComponent(jButton1))
    1.81                  .addContainerGap())
    1.82          );
    1.83          layout.setVerticalGroup(
    1.84              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.85 -            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    1.86 +            .addGroup(layout.createSequentialGroup()
    1.87                  .addContainerGap()
    1.88 -                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    1.89 -                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 234, Short.MAX_VALUE)
    1.90 +                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    1.91 +                    .addComponent(jLabel1)
    1.92 +                    .addComponent(jdbcZdroj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    1.93 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    1.94 +                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    1.95 +                    .addComponent(jdbcCil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    1.96 +                    .addComponent(jLabel2))
    1.97 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    1.98 +                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
    1.99 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
   1.100                  .addComponent(jButton1)
   1.101                  .addContainerGap())
   1.102          );
   1.103 @@ -66,6 +107,11 @@
   1.104          pack();
   1.105      }// </editor-fold>//GEN-END:initComponents
   1.106  
   1.107 +    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
   1.108 +	Konvertor k = new Konvertor(jdbcZdroj.getText(), jdbcCil.getText(), this);
   1.109 +	k.konvertuj();
   1.110 +    }//GEN-LAST:event_jButton1ActionPerformed
   1.111 +
   1.112      /**
   1.113       * @param args the command line arguments
   1.114       */
   1.115 @@ -89,6 +135,15 @@
   1.116      }
   1.117      // Variables declaration - do not modify//GEN-BEGIN:variables
   1.118      private javax.swing.JButton jButton1;
   1.119 -    private javax.swing.JTextField jTextField1;
   1.120 +    private javax.swing.JLabel jLabel1;
   1.121 +    private javax.swing.JLabel jLabel2;
   1.122 +    private javax.swing.JScrollPane jScrollPane1;
   1.123 +    private javax.swing.JTextField jdbcCil;
   1.124 +    private javax.swing.JTextField jdbcZdroj;
   1.125 +    private javax.swing.JTextArea vystup;
   1.126      // End of variables declaration//GEN-END:variables
   1.127 +
   1.128 +    public void vypis(String zprava) {
   1.129 +	vystup.append(zprava + "\n");
   1.130 +    }
   1.131  }