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

/*
 * Mosaik.java
 *
 * Created on 28.06.2012, 20:28:30
 */
package gui;

import dataBase.DataBase;
import dataBase.TimedAction;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.filechooser.FileFilter;
import mosaik.MosaikFunctions;
import org.jdesktop.application.Action;
import util.simpleIO.Out;

/**
 *
 * @author Niklas
 */
public class Mosaik_new extends javax.swing.JFrame {

    /** Creates new form Mosaik */
    public Mosaik_new() {
        initComponents();
        disableAllComponents(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() {

        jScrollPaneMain = new javax.swing.JScrollPane();
        jPanelMain = new javax.swing.JPanel();
        jPanelRightMenue = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel14 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jLabel21 = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jProgressBar1 = new javax.swing.JProgressBar();
        jTabbedPane = new javax.swing.JTabbedPane();
        jScrollPaneForLoadedPic = new javax.swing.JScrollPane();
        jLabelForOriginalPic = new javax.swing.JLabel();
        jScrollPaneForGeneratedPic = new javax.swing.JScrollPane();
        jLabelForMosaik = new javax.swing.JLabel();
        jScrollPaneForCompareMosaikAndLoadedPic = new javax.swing.JScrollPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabelOfRisizedComparePic = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        jLabeljLabelOfRisizedCompareMosaik = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        openMenuItem = new javax.swing.JMenuItem();
        saveMenuItem = new javax.swing.JMenuItem();
        saveAsMenuItem = new javax.swing.JMenuItem();
        exitMenuItem = new javax.swing.JMenuItem();
        editMenu = new javax.swing.JMenu();
        jMenuItemConfiguration = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        contentsMenuItem = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Mosaik");
        setIconImages(null);
        getContentPane().setLayout(new java.awt.GridLayout(1, 0));

        jScrollPaneMain.setName("jScrollPaneMain"); // NOI18N

        jPanelMain.setName("jPanelMain"); // NOI18N
        jPanelMain.setPreferredSize(new java.awt.Dimension(1000, 768));

        jPanelRightMenue.setName("jPanelRightMenue"); // NOI18N
        jPanelRightMenue.setPreferredSize(new java.awt.Dimension(303, 1040));

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel14.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel14.setText("3. Schritt:");
        jLabel14.setName("jLabel14"); // NOI18N

        jLabel13.setText("Anzahl der Mosaikteile für die");
        jLabel13.setName("jLabel13"); // NOI18N

        jLabel17.setText("Spalten (X):");
        jLabel17.setName("jLabel17"); // NOI18N

        jLabel18.setText("Reihen (Y):");
        jLabel18.setName("jLabel18"); // NOI18N

        jTextField1.setText("50");
        jTextField1.setName("jTextField1"); // NOI18N

        jTextField2.setText("50");
        jTextField2.setName("jTextField2"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(jLabel14)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel18)
                            .addComponent(jLabel17))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField2, javax.swing.GroupLayout.Alignment.LEADING))))
                .addContainerGap(122, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel14)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel3.setName("jPanel3"); // NOI18N

        jLabel19.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel19.setText("4. Schritt (optional)");
        jLabel19.setName("jLabel19"); // NOI18N

        jLabel20.setText("Prozent:");
        jLabel20.setName("jLabel20"); // NOI18N

        jTextField3.setText("100");
        jTextField3.setToolTipText("Hier können Sie die Auflösung des fertigen Mosaik beeinflussen.\nzB.: 100 % = Bildauflösung des Originalbildes wird verwendet\n       200 % = Bildauflösung wird verdoppelt"); // NOI18N
        jTextField3.setName("jTextField3"); // NOI18N

        jLabel22.setText("Bildauflösung");
        jLabel22.setName("jLabel22"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel19)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel22))
                .addContainerGap(139, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel19)
                .addGap(9, 9, 9)
                .addComponent(jLabel22)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel4.setName("jPanel4"); // NOI18N

        jLabel2.setText("Bitte wählen Sie das Bild aus,");
        jLabel2.setIconTextGap(1);
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel1.setText("1. Schritt:");
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel3.setText("das als Ausgangsmaterial");
        jLabel3.setIconTextGap(1);
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setText("für das Mosaik dient");
        jLabel4.setIconTextGap(1);
        jLabel4.setName("jLabel4"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance().getContext().getActionMap(Mosaik_new.class, this);
        jButton1.setAction(actionMap.get("openPictureDialog")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel8.setText("2. Schritt:");
        jLabel8.setName("jLabel8"); // NOI18N

        jLabel7.setText("Bestehende Datenbank wählen");
        jLabel7.setName("jLabel7"); // NOI18N

        jButton2.setAction(actionMap.get("chooseDatabase")); // NOI18N
        jButton2.setName("jButton2"); // NOI18N

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel5.setText("oder:");
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel12.setText("Sofern Sie noch keine Datenbank haben,");
        jLabel12.setAlignmentY(0.0F);
        jLabel12.setName("jLabel12"); // NOI18N

        jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel11.setText("können Sie hier eine neue Datenbank aus");
        jLabel11.setAlignmentY(0.0F);
        jLabel11.setName("jLabel11"); // NOI18N

        jButton3.setAction(actionMap.get("chooseDirectoryOfPictures")); // NOI18N
        jButton3.setName("jButton3"); // NOI18N

        jButton6.setAction(actionMap.get("creatNewDatabase_BasedOnDirectory")); // NOI18N
        jButton6.setText("Speicherort wählen");
        jButton6.setName("jButton6"); // NOI18N

        jLabel6.setText("...");
        jLabel6.setName("jLabel6"); // NOI18N

        jLabel9.setText("...");
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel15.setText("einem beliebiges Verzeichnis erstellen lassen.");
        jLabel15.setAlignmentY(0.0F);
        jLabel15.setName("jLabel15"); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel2)
                                    .addComponent(jButton1)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel7)
                                    .addComponent(jButton2)
                                    .addComponent(jLabel5)
                                    .addComponent(jLabel12)
                                    .addComponent(jLabel11)
                                    .addComponent(jLabel15))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addComponent(jButton3)
                            .addComponent(jButton6))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE)
                            .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE))
                        .addContainerGap())))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addGap(1, 1, 1)
                .addComponent(jLabel3)
                .addGap(2, 2, 2)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel12)
                .addGap(1, 1, 1)
                .addComponent(jLabel11)
                .addGap(1, 1, 1)
                .addComponent(jLabel15)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel6)
                .addGap(7, 7, 7))
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel7.setName("jPanel7"); // NOI18N

        jLabel21.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel21.setText("5. Schritt");
        jLabel21.setName("jLabel21"); // NOI18N

        jButton4.setAction(actionMap.get("createMosaik")); // NOI18N
        jButton4.setName("jButton4"); // NOI18N

        jButton5.setAction(actionMap.get("exportMosaik")); // NOI18N
        jButton5.setName("jButton5"); // NOI18N

        jProgressBar1.setName("jProgressBar1"); // NOI18N
        jProgressBar1.setStringPainted(true);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel21)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                                .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jButton5)
                        .addContainerGap(139, Short.MAX_VALUE))))
        );

        jPanel7Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButton4, jButton5});

        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel21)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton4)
                    .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29)
                .addComponent(jButton5)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanelRightMenueLayout = new javax.swing.GroupLayout(jPanelRightMenue);
        jPanelRightMenue.setLayout(jPanelRightMenueLayout);
        jPanelRightMenueLayout.setHorizontalGroup(
            jPanelRightMenueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRightMenueLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelRightMenueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelRightMenueLayout.createSequentialGroup()
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelRightMenueLayout.createSequentialGroup()
                        .addGroup(jPanelRightMenueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap())))
        );
        jPanelRightMenueLayout.setVerticalGroup(
            jPanelRightMenueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRightMenueLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane.setName("jTabbedPane"); // NOI18N

        jScrollPaneForLoadedPic.setName("jScrollPaneForLoadedPic"); // NOI18N

        jLabelForOriginalPic.setName("jLabelForOriginalPic"); // NOI18N
        jScrollPaneForLoadedPic.setViewportView(jLabelForOriginalPic);

        jTabbedPane.addTab("Originalbild", jScrollPaneForLoadedPic);

        jScrollPaneForGeneratedPic.setName("jScrollPaneForGeneratedPic"); // NOI18N

        jLabelForMosaik.setName("jLabelForMosaik"); // NOI18N
        jScrollPaneForGeneratedPic.setViewportView(jLabelForMosaik);

        jTabbedPane.addTab("Mosaik", jScrollPaneForGeneratedPic);

        jScrollPaneForCompareMosaikAndLoadedPic.setName("jScrollPaneForCompareMosaikAndLoadedPic"); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setPreferredSize(new java.awt.Dimension(605, 704));

        jPanel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel5.setName("jPanel5"); // NOI18N
        jPanel5.setPreferredSize(new java.awt.Dimension(259, 298));

        jLabelOfRisizedComparePic.setAlignmentY(0.0F);
        jLabelOfRisizedComparePic.setIconTextGap(0);
        jLabelOfRisizedComparePic.setName("jLabelOfRisizedComparePic"); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabelOfRisizedComparePic)
                .addContainerGap(257, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabelOfRisizedComparePic)
                .addContainerGap(296, Short.MAX_VALUE))
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel6.setName("jPanel6"); // NOI18N

        jLabeljLabelOfRisizedCompareMosaik.setAlignmentY(0.0F);
        jLabeljLabelOfRisizedCompareMosaik.setName("jLabeljLabelOfRisizedCompareMosaik"); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(jLabeljLabelOfRisizedCompareMosaik)
                .addContainerGap(257, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(jLabeljLabelOfRisizedCompareMosaik)
                .addContainerGap(296, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(9366, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(421, Short.MAX_VALUE))
        );

        jScrollPaneForCompareMosaikAndLoadedPic.setViewportView(jPanel1);

        jTabbedPane.addTab("Vergleich", jScrollPaneForCompareMosaikAndLoadedPic);

        javax.swing.GroupLayout jPanelMainLayout = new javax.swing.GroupLayout(jPanelMain);
        jPanelMain.setLayout(jPanelMainLayout);
        jPanelMainLayout.setHorizontalGroup(
            jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMainLayout.createSequentialGroup()
                .addComponent(jPanelRightMenue, javax.swing.GroupLayout.PREFERRED_SIZE, 296, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 9919, Short.MAX_VALUE))
        );
        jPanelMainLayout.setVerticalGroup(
            jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelMainLayout.createSequentialGroup()
                .addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanelRightMenue, javax.swing.GroupLayout.DEFAULT_SIZE, 760, Short.MAX_VALUE)
                    .addComponent(jTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 760, Short.MAX_VALUE))
                .addContainerGap())
        );

        jScrollPaneMain.setViewportView(jPanelMain);

        getContentPane().add(jScrollPaneMain);

        fileMenu.setMnemonic('f');
        fileMenu.setText("Datei");

        openMenuItem.setMnemonic('o');
        openMenuItem.setText("Bild laden");
        fileMenu.add(openMenuItem);

        saveMenuItem.setMnemonic('s');
        saveMenuItem.setText("Bild exportieren");
        fileMenu.add(saveMenuItem);

        saveAsMenuItem.setMnemonic('a');
        saveAsMenuItem.setText("Aktuelle Datenbank exportieren");
        fileMenu.add(saveAsMenuItem);

        exitMenuItem.setMnemonic('x');
        exitMenuItem.setText("Beenden");
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        editMenu.setMnemonic('e');
        editMenu.setText("Einstellungen");

        jMenuItemConfiguration.setAction(actionMap.get("configuration")); // NOI18N
        jMenuItemConfiguration.setText("Einstellungen");
        jMenuItemConfiguration.setName("jMenuItemConfiguration"); // NOI18N
        editMenu.add(jMenuItemConfiguration);

        menuBar.add(editMenu);

        helpMenu.setMnemonic('h');
        helpMenu.setText("Hilfe");

        contentsMenuItem.setMnemonic('c');
        contentsMenuItem.setText("Contents");
        helpMenu.add(contentsMenuItem);

        aboutMenuItem.setMnemonic('a');
        aboutMenuItem.setText("About");
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

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

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */

        try {
            javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            e.printStackTrace();
        }

        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Mosaik_new().setVisible(true);
            }
        });
    }

    //   --------------------------------------------------------------------------
    public static void resetProgressbar() {
    	if(jProgressBar1!=null){
    		jProgressBar1.setValue(0);
    	}
    }

    @Action
    public static void setProgressvalue() {

    	if(jProgressBar1 != null){
    		
            jProgressBar1.setValue(progress);
            jProgressBar1.validate();
            jProgressBar1.repaint();
            progress++;
    	}
    }

    public void disableAllComponents(boolean b) {

        jButton2.setEnabled(b);
        jButton3.setEnabled(b);
        jButton4.setEnabled(b);
        jButton5.setEnabled(b);
        jButton6.setEnabled(b);
        jTextField1.setEnabled(b);
        jTextField2.setEnabled(b);
        jTextField3.setEnabled(b);
        jTabbedPane.setEnabled(b);


    }

    public void enableComponents1(boolean b) {

        jButton3.setEnabled(b);
        jButton2.setEnabled(b);
        jButton6.setEnabled(b);
       
        jTabbedPane.setEnabled(b);

    }

    public void enableComponents2(boolean b) {
        
        
        jTextField1.setEnabled(b);
        jTextField2.setEnabled(b);
        jTextField3.setEnabled(b);
        jButton4.setEnabled(b);
        
        jTabbedPane.setEnabled(b);
    }

    @Action
    public void openPictureDialog() {

        choosePicDialog = new ChoosePic(this, true);
        choosePicDialog.setLocationRelativeTo(this);
        choosePicDialog.pack();
        choosePicDialog.setVisible(true);

    }

    @Action
    public void chooseDirectoryOfPictures() throws IOException {

        JFileChooser jfc = new JFileChooser();
        jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        if (jfc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
            picturesDirectoryOnly = new File(jfc.getSelectedFile().getAbsolutePath());
            jLabel9.setText(picturesDirectoryOnly.getAbsolutePath());
            enableComponents2(true); 
            System.out.print(picturesDirectoryOnly);
        }
       
    }

    @Action
    public void chooseDatabase() {

        chooseDatabaseDialog = new ChooseDatabase(this, true, "chooseDatabase");
        chooseDatabaseDialog.setLocationRelativeTo(this);
        chooseDatabaseDialog.pack();
        chooseDatabaseDialog.setVisible(true);

    }

    @Action
    public void exportMosaik() throws IOException {

        JFileChooser jfc = new JFileChooser();
        jfc.removeChoosableFileFilter(jfc.getFileFilter());
        jfc.addChoosableFileFilter(new FileFilter() {

            @Override
            public boolean accept(File f) {
                if (f.isDirectory()) {
                    return true;
                }
                String name = f.getName();
                int i = name.lastIndexOf('.');

                if (i > 0 && i < name.length() - 1) {
                    String type = name.substring(i + 1).toLowerCase();		// shorter ;)


                    if (type.equals("jpg")) {
                        return true;
                    }
                }
                return false;
            }

            @Override
            public String getDescription() {
                return ".jpg";
            }
        });

        jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

        if (jfc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
            savePathofExportedFile = new File(jfc.getSelectedFile().getAbsolutePath());
            String name = savePathofExportedFile.getName();
            int i = name.lastIndexOf('.');

            if (i > 0 && i < name.length() - 1) {
                String type = name.substring(i + 1).toLowerCase();

                if (type.equals("jpg")) {
                    ImageIO.write(mosaikImage, "jpg", savePathofExportedFile);
                    System.out.print(savePathofExportedFile);
                }


            } else {
                ImageIO.write(mosaikImage, "jpg", new File(savePathofExportedFile + ".jpg"));
                System.out.print(savePathofExportedFile);
            }
        }




    }

    @Action
    public void configuration() {

        configuration = new Configuration(this, true);
        configuration.setLocationRelativeTo(this);
        configuration.pack();
        configuration.setVisible(true);

    }

    @Action
    public void resizePicture() {
        int faktor = Integer.parseInt(jTextField1.getText());
        int h = originalPicture.getIconHeight();
        int w = originalPicture.getIconWidth();

        int newH = h / 100 * faktor;
        int newW = w / 100 * faktor;
        Image tmp = originalPicture.getImage().getScaledInstance(newW, newH, Image.SCALE_SMOOTH);
        originalPicture = new ImageIcon(tmp);
        this.jLabelForOriginalPic.setIcon(originalPicture);
        this.jLabelForOriginalPic.validate();

    }

    public void setPictureofJLabelPic() throws IOException {
        originalPicture = new ImageIcon(ImageIO.read(picturePathofTheOrinignalFile));
        this.jLabelForOriginalPic.setIcon(originalPicture);

        setPicture(jLabelOfRisizedComparePic, ImageIO.read(picturePathofTheOrinignalFile), jPanel5);
        this.jLabelOfRisizedComparePic.validate();
    }

    @Action
    public void createMosaik() throws FileNotFoundException, IOException, ClassNotFoundException {
        final int xparts = Integer.parseInt(jTextField1.getText());
        final int yparts = Integer.parseInt(jTextField2.getText());
        final float faktor = Integer.parseInt(jTextField3.getText()) / 100.0f;	// durch float dividieren, sonst nur Integer als ergebnis!
        jProgressBar1.setMaximum(Integer.parseInt(jTextField1.getText()));

        new TimedAction(0) {
    @Override
    public void action() throws Exception {
 mosaikImage = MosaikFunctions.makeMosaik(picturePathofTheOrinignalFile, databaseDirectory, xparts, yparts, faktor);
}
        };
        //   mosaikImage = MosaikFunctions.makeMosaik(picturePathofTheOrinignalFile, currentdatabase, xparts, yparts, faktor);

        ImageIcon tmp = new ImageIcon(mosaikImage);
        this.jLabelForMosaik.setIcon(tmp);
        this.jLabelForMosaik.validate();
        jTabbedPane.setSelectedIndex(2);
        setPicture(jLabeljLabelOfRisizedCompareMosaik, mosaikImage, jPanel5);

        jButton5.setEnabled(true);
    }

    public void setPicture(JLabel jLabelLoadedImage1, BufferedImage image, JPanel panel) throws IOException {

        int w = image.getWidth();
        int h = image.getHeight();
        double proW = w / panel.getWidth();
        double proH = h / panel.getHeight();
        ImageIcon newpic;
        if (proW > proH) {
            h = (int) (h / proW);
            newpic = new ImageIcon(image.getScaledInstance(panel.getWidth(), h, Image.SCALE_FAST));

        } else {
            w = (int) (w / proH);
            newpic = new ImageIcon(image.getScaledInstance(w, panel.getHeight(), Image.SCALE_FAST));
        }

        jLabelLoadedImage1.setIcon(newpic);
        jLabelLoadedImage1.validate();

    }

    @Action
    public void saveCurrentDatabase() throws IOException {
        UIManager.put("FileChooser.lookInLabelText", "Speichern in:");
        UIManager.put("FileChooser.upFolderToolTipText", "Einen Ordner aufwärts in der Hierarchie");
        UIManager.put("FileChooser.newFolderToolTipText", "Neuen Ordner anlegen");
        UIManager.put("FileChooser.fileNameLabelText", "Dateiname:");
        UIManager.put("FileChooser.filesOfTypeLabelText", "Dateityp:");
        UIManager.put("FileChooser.cancelButtonText", "Abbrechen");
        UIManager.put("FileChooser.cancelButtonToolTipText ", "Aktion abbrechen");

        jFileChooser1 = new JFileChooser();
        jFileChooser1.removeChoosableFileFilter(jFileChooser1.getFileFilter());
        jFileChooser1.addChoosableFileFilter(new FileFilter() {

            @Override
            public boolean accept(File f) {
                if (f.isDirectory()) {
                    return true;
                }
                String name = f.getName();
                int i = name.lastIndexOf('.');

                if (i > 0 && i < name.length() - 1) {
                    String type = name.substring(i + 1).toLowerCase();		// shorter ;)


                    if (type.equals("db")) {
                        return true;
                    }
                }
                return false;
            }

            @Override
            public String getDescription() {
                return ".db";
            }
        });

        jFileChooser1.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        if (jFileChooser1.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
            File dbDirectory = jFileChooser1.getSelectedFile();
            String name = dbDirectory.getName();
            int i = name.lastIndexOf('.');
            if (i > 0 && i < name.length() - 1) {
                String type = name.substring(i + 1).toLowerCase();

                if (type.equals("db")) {
                    MosaikFunctions.storeDatabase(currentdatabase, dbDirectory);
                    databaseDirectory = dbDirectory;
                   
                } else {
                    JOptionPane.showMessageDialog(this,
                            "Keine gültige Endung eingeben.",
                            "Tipp: Lassen Sie die Endung weg, oder schreiben sie .db hinter den Dateinamen.",
                            JOptionPane.WARNING_MESSAGE);
                }

            } else {
                dbDirectory = new File(dbDirectory + ".db");
                MosaikFunctions.storeDatabase(currentdatabase, dbDirectory);
                databaseDirectory = dbDirectory;
                
            }

            MosaikFunctions.storeDatabase(currentdatabase, dbDirectory);
            databaseDirectory = dbDirectory;
        }
    }
    
    
    @Action
        public void creatNewDatabase_BasedOnDirectory() throws IOException {
        UIManager.put("FileChooser.lookInLabelText", "Speichern in:");
        UIManager.put("FileChooser.upFolderToolTipText", "Einen Ordner aufwärts in der Hierarchie");
        UIManager.put("FileChooser.newFolderToolTipText", "Neuen Ordner anlegen");
        UIManager.put("FileChooser.fileNameLabelText", "Dateiname:");
        UIManager.put("FileChooser.filesOfTypeLabelText", "Dateityp:");
        UIManager.put("FileChooser.cancelButtonText", "Abbrechen");
        UIManager.put("FileChooser.cancelButtonToolTipText ", "Aktion abbrechen");

        jFileChooser1 = new JFileChooser();
        jFileChooser1.removeChoosableFileFilter(jFileChooser1.getFileFilter());
        jFileChooser1.addChoosableFileFilter(new FileFilter() {

            @Override
            public boolean accept(File f) {
                if (f.isDirectory()) {
                    return true;
                }
                String name = f.getName();
                int i = name.lastIndexOf('.');

                if (i > 0 && i < name.length() - 1) {
                    String type = name.substring(i + 1).toLowerCase();		// shorter ;)


                    if (type.equals("db")) {
                        return true;
                    }
                }
                return false;
            }

            @Override
            public String getDescription() {
                return ".db";
            }
        });

        jFileChooser1.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        if (jFileChooser1.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
            File dbDirectory = jFileChooser1.getSelectedFile();
            String name = dbDirectory.getName();
            int i = name.lastIndexOf('.');
            if (i > 0 && i < name.length() - 1) {
                String type = name.substring(i + 1).toLowerCase();

                if (type.equals("db")) {
                    DataBase db = MosaikFunctions.makeDatabase(picturesDirectoryOnly);
                    
                    MosaikFunctions.storeDatabase(db, dbDirectory);
                    currentdatabase = db;
                    databaseDirectory = dbDirectory;
                    jLabel6.setText(dbDirectory.getAbsolutePath());
                     enableComponents2(true);
                   
                } else {
                    JOptionPane.showMessageDialog(this,
                            "Keine gültige Endung eingeben.",
                            "Tipp: Lassen Sie die Endung weg, oder schreiben sie .db hinter den Dateinamen.",
                            JOptionPane.WARNING_MESSAGE);
                }

            } else {
                dbDirectory = new File(dbDirectory + ".db");
                DataBase db = MosaikFunctions.makeDatabase(picturesDirectoryOnly);
                    
                    MosaikFunctions.storeDatabase(db, dbDirectory);
                    currentdatabase = db;
                    databaseDirectory = dbDirectory;
                    jLabel6.setText(dbDirectory.getAbsolutePath());
                    enableComponents2(true);
              }

            
        }
       
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JMenuItem contentsMenuItem;
    private javax.swing.JMenu editMenu;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    protected javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    protected javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    protected javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelForMosaik;
    private javax.swing.JLabel jLabelForOriginalPic;
    private javax.swing.JLabel jLabelOfRisizedComparePic;
    private javax.swing.JLabel jLabeljLabelOfRisizedCompareMosaik;
    private javax.swing.JMenuItem jMenuItemConfiguration;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanelMain;
    private javax.swing.JPanel jPanelRightMenue;
    private static javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JScrollPane jScrollPaneForCompareMosaikAndLoadedPic;
    private javax.swing.JScrollPane jScrollPaneForGeneratedPic;
    private javax.swing.JScrollPane jScrollPaneForLoadedPic;
    private javax.swing.JScrollPane jScrollPaneMain;
    private javax.swing.JTabbedPane jTabbedPane;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem openMenuItem;
    private javax.swing.JMenuItem saveAsMenuItem;
    private javax.swing.JMenuItem saveMenuItem;
    // End of variables declaration//GEN-END:variables
    JDialog choosePicDialog;
    JDialog exportMosaikDialog;
    JDialog chooseDatabaseDialog;
    JDialog chooseDirectory;
    JDialog configuration;
    JDialog storeDatabase;
    File picturesDirectoryOnly;
    File databaseDirectory;
    File picturePathofTheOrinignalFile;
    File savePathofExportedFile;
    ImageIcon originalPicture;
    BufferedImage mosaikImage;
    File newDatabaseDirectory;
    DataBase currentdatabase;
    JTabbedPane test;
    static int progress = 1;
    JFileChooser jFileChooser1;
}
