Example usage for javax.swing JProgressBar JProgressBar

List of usage examples for javax.swing JProgressBar JProgressBar

Introduction

In this page you can find the example usage for javax.swing JProgressBar JProgressBar.

Prototype

public JProgressBar() 

Source Link

Document

Creates a horizontal progress bar that displays a border but no progress string.

Usage

From source file:de.bfs.radon.omsimulation.gui.OMPanelSimulation.java

/**
 * Initialises the interface of the simulation panel.
 *//*ww  w  . jav a2 s . c o m*/
protected void initialize() {
    setLayout(null);

    btnStart = new JButton("Start");
    btnStart.addActionListener(this);
    btnStart.setBounds(616, 326, 124, 23);
    btnStart.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(btnStart);

    progressBarSimulation = new JProgressBar();
    progressBarSimulation.setBounds(10, 475, 730, 23);
    progressBarSimulation.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    progressBarSimulation.setVisible(false);
    add(progressBarSimulation);

    lblSelectOmbfile = new JLabel("Open OMB-File");
    lblSelectOmbfile.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    lblSelectOmbfile.setBounds(10, 36, 132, 14);
    add(lblSelectOmbfile);

    lblOmsFile = new JLabel("Save OMS-File");
    lblOmsFile.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    lblOmsFile.setBounds(174, 272, 120, 14);
    add(lblOmsFile);

    txtOmsFile = new JTextField();
    txtOmsFile.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent arg0) {
            setOmsFile(txtOmsFile.getText());
        }
    });
    txtOmsFile.setBounds(304, 269, 302, 20);
    txtOmsFile.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(txtOmsFile);
    txtOmsFile.setColumns(10);

    btnBrowseOms = new JButton("Browse");
    btnBrowseOms.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            JFileChooser fileDialog = new JFileChooser();
            fileDialog.setFileFilter(new FileNameExtensionFilter("*.oms", "oms"));
            fileDialog.showSaveDialog(getParent());
            final File file = fileDialog.getSelectedFile();
            if (file != null) {
                String oms;
                String[] tmpFileName = file.getAbsolutePath().split("\\.");
                if (tmpFileName[tmpFileName.length - 1].equals("oms")) {
                    oms = "";
                } else {
                    oms = ".oms";
                }
                txtOmsFile.setText(file.getAbsolutePath() + oms);
                setOmsFile(file.getAbsolutePath() + oms);
            }
        }
    });
    btnBrowseOms.setBounds(616, 268, 124, 23);
    btnBrowseOms.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(btnBrowseOms);

    lblWarning = new JLabel("This could take a while, grab a coffee!");
    lblWarning.setBounds(421, 94, 319, 15);
    lblWarning.setForeground(new Color(255, 0, 0, 255));
    lblWarning.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(lblWarning);

    lblSelectProject = new JLabel("Select Project");
    lblSelectProject.setBounds(10, 65, 132, 14);
    lblSelectProject.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(lblSelectProject);

    lblSimulationType = new JLabel("Simulation Type");
    lblSimulationType.setBounds(10, 94, 132, 14);
    lblSimulationType.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(lblSimulationType);

    lblCampaigns = new JLabel("campaigns");
    lblCampaigns.setBounds(421, 122, 185, 14);
    lblCampaigns.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(lblCampaigns);

    lblRatio = new JLabel("Ratio");
    lblRatio.setBounds(174, 152, 44, 14);
    lblRatio.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(lblRatio);

    lblPercent = new JLabel("%");
    lblPercent.setBounds(246, 302, 360, 14);
    lblPercent.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(lblPercent);

    spnrRandomCampaigns = new JSpinner();
    spnrRandomCampaigns.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent e) {
            setRandomCampaigns((Integer) spnrRandomCampaigns.getValue());
        }
    });
    spnrRandomCampaigns.setModel(new SpinnerNumberModel(10000, 10, 100000, 1));
    spnrRandomCampaigns.setBounds(304, 119, 107, 22);
    spnrRandomCampaigns.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(spnrRandomCampaigns);

    spnrRatio3 = new JSpinner();
    spnrRatio3.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent e) {
            if (chckbxRatio3.isSelected()) {
                setRatio3((Integer) spnrRatio3.getValue());
            } else {
                setRatio3(0);
                spnrRatio3.setEnabled(false);
            }
        }
    });
    spnrRatio3.setModel(new SpinnerNumberModel(2, 0, 10000, 1));
    spnrRatio3.setBounds(330, 149, 81, 22);
    spnrRatio3.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(spnrRatio3);

    spnrRatio4 = new JSpinner();
    spnrRatio4.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent e) {
            if (chckbxRatio4.isSelected()) {
                setRatio4((Integer) spnrRatio4.getValue());
            } else {
                setRatio4(0);
                spnrRatio4.setEnabled(false);
            }
        }
    });
    spnrRatio4.setModel(new SpinnerNumberModel(5, 0, 10000, 1));
    spnrRatio4.setBounds(330, 179, 81, 22);
    spnrRatio4.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(spnrRatio4);

    spnrRatio5 = new JSpinner();
    spnrRatio5.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent e) {
            if (chckbxRatio5.isSelected()) {
                setRatio5((Integer) spnrRatio5.getValue());
            } else {
                setRatio5(0);
                spnrRatio5.setEnabled(false);
            }
        }
    });
    spnrRatio5.setModel(new SpinnerNumberModel(20, 0, 10000, 1));
    spnrRatio5.setBounds(330, 209, 81, 22);
    spnrRatio5.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(spnrRatio5);

    spnrRatio6 = new JSpinner();
    spnrRatio6.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent e) {
            if (chckbxRatio6.isSelected()) {
                setRatio6((Integer) spnrRatio6.getValue());
            } else {
                setRatio6(0);
                spnrRatio6.setEnabled(false);
            }
        }
    });
    spnrRatio6.setModel(new SpinnerNumberModel(73, 0, 10000, 1));
    spnrRatio6.setBounds(330, 239, 81, 22);
    spnrRatio6.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(spnrRatio6);

    spnrRandomNoise = new JSpinner();
    spnrRandomNoise.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent e) {
            if (chckbxRandomNoise.isSelected()) {
                setRandomNoise((Integer) spnrRandomNoise.getValue());
            } else {
                setRandomNoise(0);
                spnrRandomNoise.setEnabled(false);
            }
        }
    });
    spnrRandomNoise.setModel(new SpinnerNumberModel(5, 0, 20, 1));
    spnrRandomNoise.setBounds(153, 299, 83, 22);
    spnrRandomNoise.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(spnrRandomNoise);

    chckbxRatio3 = new JCheckBox("3 of 6");
    chckbxRatio3.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (chckbxRatio3.isSelected()) {
                if (rdbtnRandom.isSelected()) {
                    spnrRatio3.setEnabled(true);
                }
            } else {
                setRatio3(0);
                spnrRatio3.setEnabled(false);
            }
        }
    });
    chckbxRatio3.setBounds(237, 149, 80, 23);
    chckbxRatio3.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(chckbxRatio3);

    chckbxRatio4 = new JCheckBox("4 of 6");
    chckbxRatio4.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (chckbxRatio4.isSelected()) {
                if (rdbtnRandom.isSelected()) {
                    spnrRatio4.setEnabled(true);
                }
            } else {
                setRatio4(0);
                spnrRatio4.setEnabled(false);
            }
        }
    });
    chckbxRatio4.setBounds(237, 179, 80, 23);
    chckbxRatio4.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(chckbxRatio4);

    chckbxRatio5 = new JCheckBox("5 of 6");
    chckbxRatio5.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (chckbxRatio5.isSelected()) {
                if (rdbtnRandom.isSelected()) {
                    spnrRatio5.setEnabled(true);
                }
            } else {
                setRatio5(0);
                spnrRatio5.setEnabled(false);
            }
        }
    });
    chckbxRatio5.setBounds(237, 209, 80, 23);
    chckbxRatio5.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(chckbxRatio5);

    chckbxRatio6 = new JCheckBox("6 of 6");
    chckbxRatio6.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (chckbxRatio6.isSelected()) {
                if (rdbtnRandom.isSelected()) {
                    spnrRatio6.setEnabled(true);
                }
            } else {
                setRatio6(0);
                spnrRatio6.setEnabled(false);
            }
        }
    });
    chckbxRatio6.setBounds(237, 239, 80, 23);
    chckbxRatio6.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(chckbxRatio6);

    chckbxRandomNoise = new JCheckBox("Random noise");
    chckbxRandomNoise.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (chckbxRandomNoise.isSelected()) {
                if (chckbxRandomNoise.isEnabled()) {
                    spnrRandomNoise.setEnabled(true);
                }
            } else {
                setRandomNoise(0);
                spnrRandomNoise.setEnabled(false);
            }
        }
    });
    chckbxRandomNoise.setBounds(10, 299, 137, 23);
    chckbxRandomNoise.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(chckbxRandomNoise);

    btnRefresh = new JButton("Load");
    btnRefresh.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            if (txtOmbFile.getText() != null && !txtOmbFile.getText().equals("")
                    && !txtOmbFile.getText().equals(" ")) {
                txtOmbFile.setBackground(Color.WHITE);
                String ombPath = txtOmbFile.getText();
                String omb;
                String[] tmpFileName = ombPath.split("\\.");
                if (tmpFileName[tmpFileName.length - 1].equals("omb")) {
                    omb = "";
                } else {
                    omb = ".omb";
                }
                txtOmbFile.setText(ombPath + omb);
                setOmbFile(ombPath + omb);
                File ombFile = new File(ombPath + omb);
                if (ombFile.exists()) {
                    txtOmbFile.setBackground(Color.WHITE);
                    btnRefresh.setEnabled(false);
                    comboBoxSelectProject.setEnabled(false);
                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    progressBarSimulation.setVisible(true);
                    progressBarSimulation.setStringPainted(true);
                    progressBarSimulation.setIndeterminate(true);
                    refreshTask = new Refresh();
                    refreshTask.execute();
                } else {
                    txtOmbFile.setBackground(new Color(255, 222, 222, 128));
                    JOptionPane.showMessageDialog(null, "OMB-file not found, please check the file path!",
                            "Error", JOptionPane.ERROR_MESSAGE);
                }
            } else {
                txtOmbFile.setBackground(new Color(255, 222, 222, 128));
                JOptionPane.showMessageDialog(null, "Please select an OMB-file!", "Warning",
                        JOptionPane.WARNING_MESSAGE);
            }
        }
    });
    btnRefresh.setBounds(616, 61, 124, 23);
    btnRefresh.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(btnRefresh);

    lblHelp = new JLabel(
            "Select an OMB-Object file to run simulations. Limited random simulations can be saved as OMS-Simulation files used for analysis.");
    lblHelp.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    lblHelp.setForeground(Color.GRAY);
    lblHelp.setBounds(10, 10, 730, 14);
    add(lblHelp);

    txtOmbFile = new JTextField();
    txtOmbFile.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    txtOmbFile.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent arg0) {
            setOmbFile(txtOmbFile.getText());
        }
    });
    txtOmbFile.setBounds(152, 33, 454, 20);
    add(txtOmbFile);
    txtOmbFile.setColumns(10);

    btnBrowseOmb = new JButton("Browse");
    btnBrowseOmb.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    btnBrowseOmb.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            JFileChooser fileDialog = new JFileChooser();
            fileDialog.setFileFilter(new FileNameExtensionFilter("*.omb", "omb"));
            fileDialog.showOpenDialog(getParent());
            final File file = fileDialog.getSelectedFile();
            if (file != null) {
                String omb;
                String[] tmpFileName = file.getAbsolutePath().split("\\.");
                if (tmpFileName[tmpFileName.length - 1].equals("omb")) {
                    omb = "";
                } else {
                    omb = ".omb";
                }
                txtOmbFile.setText(file.getAbsolutePath() + omb);
                setOmbFile(file.getAbsolutePath() + omb);
            }
        }
    });
    btnBrowseOmb.setBounds(616, 32, 124, 23);
    add(btnBrowseOmb);

    rdbtnSystematic = new JRadioButton("Systematic all campaigns");
    rdbtnSystematic.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            if (rdbtnSystematic.isSelected()) {
                setSystematic(true);
                rdbtnRandom.setSelected(false);
                chckbxRatio6.setEnabled(false);
                chckbxRatio5.setEnabled(false);
                chckbxRatio4.setEnabled(false);
                chckbxRatio3.setEnabled(false);
                spnrRatio6.setEnabled(false);
                spnrRatio5.setEnabled(false);
                spnrRatio4.setEnabled(false);
                spnrRatio3.setEnabled(false);
                spnrRandomCampaigns.setEnabled(false);
                lblRatio.setEnabled(false);
                lblCampaigns.setEnabled(false);
                lblOmsFile.setEnabled(false);
                lblWarning.setVisible(true);
                txtOmsFile.setEnabled(false);
                btnBrowseOms.setEnabled(false);
            } else {
                setSystematic(false);
                rdbtnRandom.setSelected(true);
            }
        }
    });
    rdbtnSystematic.setBounds(152, 90, 259, 23);
    rdbtnSystematic.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(rdbtnSystematic);

    rdbtnRandom = new JRadioButton("Random");
    rdbtnRandom.setSelected(true);
    rdbtnRandom.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (rdbtnRandom.isSelected()) {
                setSystematic(false);
                rdbtnSystematic.setSelected(false);
                chckbxRatio6.setEnabled(true);
                chckbxRatio5.setEnabled(true);
                chckbxRatio4.setEnabled(true);
                chckbxRatio3.setEnabled(true);
                spnrRandomCampaigns.setEnabled(true);
                lblRatio.setEnabled(true);
                lblCampaigns.setEnabled(true);
                lblOmsFile.setEnabled(true);
                lblWarning.setVisible(false);
                txtOmsFile.setEnabled(true);
                btnBrowseOms.setEnabled(true);
            } else {
                setSystematic(true);
                rdbtnSystematic.setSelected(true);
            }
        }
    });
    rdbtnRandom.setBounds(152, 119, 142, 23);
    rdbtnRandom.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(rdbtnRandom);

    comboBoxSelectProject = new JComboBox<OMBuilding>();
    comboBoxSelectProject.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent arg0) {
            boolean b = false;
            if (comboBoxSelectProject.isEnabled()) {
                if (comboBoxSelectProject.getSelectedItem() != null) {
                    b = true;
                    setSelectedObject((OMBuilding) comboBoxSelectProject.getSelectedItem());
                    setProjectName(getSelectedObject().getName());
                } else {
                    b = false;
                }
            } else {
                b = false;
            }
            progressBarSimulation.setEnabled(b);
            btnStart.setEnabled(b);
            chckbxRandomNoise.setEnabled(b);
            rdbtnRandom.setEnabled(b);
            rdbtnSystematic.setEnabled(b);
            lblPercent.setEnabled(b);
            lblRatio.setEnabled(b);
            lblSimulationType.setEnabled(b);
            lblCampaigns.setEnabled(b);
        }
    });
    comboBoxSelectProject.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            boolean b = false;
            if (comboBoxSelectProject.isEnabled()) {
                if (comboBoxSelectProject.getSelectedItem() != null) {
                    b = true;
                    setSelectedObject((OMBuilding) comboBoxSelectProject.getSelectedItem());
                    setProjectName(getSelectedObject().getName());
                } else {
                    b = false;
                }
            } else {
                b = false;
            }
            progressBarSimulation.setEnabled(b);
            btnStart.setEnabled(b);
            chckbxRandomNoise.setEnabled(b);
            rdbtnRandom.setEnabled(b);
            rdbtnSystematic.setEnabled(b);
            lblPercent.setEnabled(b);
            lblRatio.setEnabled(b);
            lblSimulationType.setEnabled(b);
            lblCampaigns.setEnabled(b);
        }
    });
    comboBoxSelectProject.setBounds(152, 61, 454, 22);
    comboBoxSelectProject.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
    add(comboBoxSelectProject);

    btnStart.setEnabled(false);
    chckbxRandomNoise.setEnabled(false);
    chckbxRatio6.setEnabled(false);
    chckbxRatio5.setEnabled(false);
    chckbxRatio4.setEnabled(false);
    chckbxRatio3.setEnabled(false);
    spnrRandomNoise.setEnabled(false);
    spnrRatio6.setEnabled(false);
    spnrRatio5.setEnabled(false);
    spnrRatio4.setEnabled(false);
    spnrRatio3.setEnabled(false);
    spnrRandomCampaigns.setEnabled(false);
    rdbtnRandom.setEnabled(false);
    rdbtnSystematic.setEnabled(false);
    lblPercent.setEnabled(false);
    lblRatio.setEnabled(false);
    lblSimulationType.setEnabled(false);
    lblCampaigns.setEnabled(false);
    lblOmsFile.setEnabled(false);
    txtOmsFile.setEnabled(false);
    btnBrowseOms.setEnabled(false);
    spnrRatio6.setValue(73);
    spnrRatio5.setValue(20);
    spnrRatio4.setValue(5);
    spnrRatio3.setValue(2);
    spnrRandomNoise.setValue(5);
    lblWarning.setVisible(false);
}

From source file:it.isislab.dmason.util.SystemManagement.Master.thrower.DMasonMaster.java

private void initComponents() {
    menuBar1 = new JMenuBar();
    jMenuFile = new JMenu();
    //menuItemOpen = new JMenuItem();
    menuItemExit = new JMenuItem();
    jMenuAbout = new JMenu();
    menuItemInfo = new JMenuItem();
    menuItemHelp = new JMenuItem();
    panelMain = new JPanel();
    jPanelContainerConnection = new JPanel();
    jPanelConnection = new JPanel();
    jLabelAddress = new JLabel();
    textFieldAddress = new JTextField();
    jLabelPort = new JLabel();
    textFieldPort = new JTextField();
    refreshServerLabel = new JLabel();
    buttonRefreshServerLabel = new JButton();
    jPanelContainerSettings = new JPanel();
    jPanelSetDistribution = new JPanel();
    jPanelSettings = new JPanel();
    jLabelHorizontal = new JLabel();
    jLabelSquare = new JLabel();
    jLabelMaxDistance = new JLabel();
    jLabelWidth = new JLabel();
    jLabelInsertSteps = new JLabel();
    textFieldMaxDistance = new JTextField();
    textFieldWidth = new JTextField();
    jLabelHeight = new JLabel();
    textFieldHeight = new JTextField();
    jLabelAgents = new JLabel();
    textFieldAgents = new JTextField();
    textFieldColumns = new JTextField();
    textFieldRows = new JTextField();
    textFieldSteps = new JTextField();
    jLabelChooseSimulation = new JLabel();
    jComboBoxChooseSimulation = new JComboBox();
    jComboBoxNumRegionXPeer = new JComboBox();
    jPanelContainerTabbedPane = new JPanel();
    tabbedPane2 = new JTabbedPane();
    jPanelDefault = new JPanel();
    jPanelSimulation = new ModelPanel(tabbedPane2);
    labelSimulationConfigSet = new JLabel();
    labelRegionsResume = new JLabel();
    labelNumOfPeerResume = new JLabel();
    labelRegForPeerResume = new JLabel();
    labelWriteReg = new JLabel();
    labelWriteNumOfPeer = new JLabel();
    labelWriteRegForPeer = new JLabel();
    labelWidthRegion = new JLabel();
    labelheightRegion = new JLabel();
    labelDistrMode = new JLabel();
    labelWriteRegWidth = new JLabel();
    labelWriteRegHeight = new JLabel();
    labelWriteDistrMode = new JLabel();
    graphicONcheckBox2 = new JCheckBox();
    jPanelSetButton = new JPanel();
    buttonSetConfigDefault = new JButton();
    jPanelAdvanced = new JPanel();
    jPanelAdvancedMain = new JPanel();
    peerInfoStatus = new JDesktopPane();
    internalFrame1 = new JInternalFrame();
    architectureLabel = new JTextArea();
    architectureLabel.setBackground(Color.BLACK);
    architectureLabel.setForeground(Color.GREEN);
    architectureLabel.setEditable(false);
    advancedConfirmBut = new JLabel();
    graphicONcheckBox = new JCheckBox();
    jCheckBoxLoadBalancing = new JCheckBox("Load Balancing", false);
    jCheckBoxLoadBalancing.setEnabled(true);
    jCheckBoxLoadBalancing.setSelected(false);

    jCheckBoxMPI = new JCheckBox("Enable MPI", false);
    jCheckBoxMPI.setEnabled(true);// ww  w.  ja va 2 s.com
    jCheckBoxMPI.setSelected(false);

    scrollPaneTree = new JScrollPane();
    tree1 = new JTree();
    buttonSetConfigAdvanced = new JButton();
    jLabelPlayButton = new JLabel();
    jLabelPauseButton = new JLabel();
    jPanelNumStep = new JPanel();
    jLabelStep = new JLabel();
    jLabelStep.setHorizontalAlignment(SwingConstants.LEFT);
    jLabelStopButton = new JLabel();
    scrollPane1 = new JScrollPane();
    peerInfoStatus1 = new JDesktopPane();
    root = new DefaultMutableTreeNode("Simulation");
    ButtonGroup b = new ButtonGroup();
    ip = textFieldAddress.getText();
    port = textFieldPort.getText();
    menuBar1 = new JMenuBar();
    jMenuFile = new JMenu();
    menuItemExit = new JMenuItem();
    menuNewSim = new JMenuItem();
    jMenuAbout = new JMenu();
    menuItemInfo = new JMenuItem();
    menuItemHelp = new JMenuItem();
    scrollPane3 = new JScrollPane();
    scrollPane4 = new JScrollPane();
    notifyArea = new JTextArea();
    panelConsole = new JPanel();
    buttonSetConfigDefault2 = new JButton();
    jPanelSetButton2 = new JPanel();
    graphicONcheckBox = new JCheckBox();
    graphicONcheckBox.setEnabled(false);
    graphicONcheckBox.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            withGui = graphicONcheckBox.isSelected();
        }
    });

    jLabelChooseSimulation = new JLabel();
    jComboBoxChooseSimulation = new JComboBox();

    loadSimulation();

    selectedSimulation = ((SimComboEntry) jComboBoxChooseSimulation.getSelectedItem()).fullSimName;
    jPanelSimulation.updateHTML(selectedSimulation);
    jComboBoxChooseSimulation.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            // Prevent executing listener's actions two times
            if (e.getStateChange() != ItemEvent.SELECTED)
                return;
            selectedSimulation = ((SimComboEntry) jComboBoxChooseSimulation.getSelectedItem()).fullSimName;
            jPanelSimulation.updateHTML(selectedSimulation);
            isThin = isThinSimulation(selectedSimulation);
            jCheckBoxLoadBalancing.setSelected(false);
            jCheckBoxLoadBalancing.setEnabled(!isThin);
            initializeDefaultLabel();
        }
    });

    /*for(int i=2;i<100;i++)
       jComboRegions.addItem(i);*/

    buttonRefreshServerLabel.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            connect();
        }
    });

    refreshServerLabel.addMouseListener(new MouseListener() {

        @Override
        public void mouseReleased(MouseEvent arg0) {
            if (starter.isConnected())
                starter.execute("restart");
            else
                JOptionPane.showMessageDialog(null, "Not connected to the Server!");
        }

        @Override
        public void mousePressed(MouseEvent arg0) {
        }

        @Override
        public void mouseExited(MouseEvent arg0) {
        }

        @Override
        public void mouseEntered(MouseEvent arg0) {
        }

        @Override
        public void mouseClicked(MouseEvent arg0) {
        }
    });

    jCheckBoxLoadBalancing.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent arg0) {
            if (!isHorizontal) {
                if (jCheckBoxLoadBalancing.isSelected())
                    labelWriteDistrMode.setText("SQUARE BALANCED MODE");
                else
                    labelWriteDistrMode.setText("SQUARE MODE");
            }

            if (isHorizontal) {
                if (jCheckBoxLoadBalancing.isSelected())
                    labelWriteDistrMode.setText("HORIZONTAL BALANCED MODE");
                else
                    labelWriteDistrMode.setText("HORIZONTAL MODE");
            }

        }
    });

    buttonSetConfigDefault2.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (initializeDefaultLabel())
                submitCustomizeMode();
            else
                JOptionPane.showMessageDialog(null, "To start a simulation must fill in all fields...!");
        }
    });

    buttonSetConfigDefault.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (initializeDefaultLabel())
                submitDefaultMode();
            else
                JOptionPane.showMessageDialog(null, "To start a simulation must fill in all fields...!");
        }
    });

    advancedConfirmBut.addMouseListener(new MouseListener() {

        @Override
        public void mouseReleased(MouseEvent arg0) {
            confirm();
            res -= (Integer) jComboBoxNumRegionXPeer.getSelectedItem();

            withGui = graphicONcheckBox.isSelected();

            jComboBoxNumRegionXPeer.removeAllItems();
            graphicONcheckBox.setSelected(false);
            for (int i = 1; i <= res; i++)
                jComboBoxNumRegionXPeer.addItem(i);

            JOptionPane.showMessageDialog(null, "Region assigned !");

        }

        @Override
        public void mousePressed(MouseEvent arg0) {
        }

        @Override
        public void mouseExited(MouseEvent arg0) {
        }

        @Override
        public void mouseEntered(MouseEvent arg0) {
        }

        @Override
        public void mouseClicked(MouseEvent arg0) {
        }
    });

    //======== this ========

    Container contentPane = getContentPane();

    //======== menuBar1 ========
    {
        {
            jMenuFile.setText("    File    ");

            menuNewSim.setText("New    ");
            menuNewSim.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    me.dispose();
                    me = null;
                    DMasonMaster p = new DMasonMaster();
                    p.setVisible(true);
                }
            });

            jMenuFile.add(menuNewSim);

            //---- menuItemExit ----
            menuItemExit.setText("Exit");
            menuItemExit.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    me.dispose();
                }
            });

            jMenuFile.add(menuItemExit);
        }
        menuBar1.add(jMenuFile);
        menuBar1.add(getJMenuSystem());

        //======== jMenuAbout ========
        {
            jMenuAbout.setText(" ?  ");

            //---- menuItemInfo ----
            menuItemInfo.setText("Info");
            menuItemInfo.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    JOptionPane.showMessageDialog(null, Release.PRODUCT_RELEASE, "Info", 1);

                }
            });

            jMenuAbout.add(menuItemInfo);

            //---- menuItenHelp ----
            menuItemHelp.setText("Help");
            menuItemHelp.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent arg0) {
                    try {
                        java.net.URI uri = new java.net.URI(
                                "http://isis.dia.unisa.it/projects/it.isislab.dmason/");
                        try {
                            java.awt.Desktop.getDesktop().browse(uri);
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    } catch (URISyntaxException e) {
                        e.printStackTrace();
                    }

                }
            });

            jMenuAbout.add(menuItemHelp);

        }
        menuBar1.add(jMenuAbout);
    }

    setJMenuBar(menuBar1);

    //======== panelMain ========
    {

        //======== jPanelContainerConnection ========
        {

            //======== jPanelConnection ========
            {
                jPanelConnection.setBorder(new TitledBorder("Connection"));
                jPanelConnection.setPreferredSize(new Dimension(215, 125));

                //---- jLabelAddress ----
                jLabelAddress.setText("IP Address :");

                //---- textFieldAddress ----
                textFieldAddress.setText("127.0.0.1");

                //---- jLabelPort ----
                jLabelPort.setText("Port :");

                //---- textFieldPort ----
                textFieldPort.setText("61616");

                //---- refreshServerLabel ----

                refreshServerLabel.setIcon(new ImageIcon("resources/image/refresh.png"));

                //---- buttonRefreshServerLabel ----
                buttonRefreshServerLabel.setText("OK");

                JLabel lblStatus = new JLabel("Communication Server status :");

                lblStatusIcon = new JLabel("");
                lblStatusIcon.setIcon(new ImageIcon("resources/image/status-down.png"));

                buttonActiveMQRestart = new JButton("");
                buttonActiveMQRestart.setEnabled(false);
                buttonActiveMQRestart.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent arg0) {

                        notifyArea.append("ActiveMQ restarting...\n");
                        if (csManager.restartActiveMQ())
                            notifyArea.append("ActiveMQ restarted!\n");

                        checkCommunicationServerStatus();

                    }
                });
                buttonActiveMQRestart.setMinimumSize(new Dimension(24, 24));
                buttonActiveMQRestart.setMaximumSize(new Dimension(24, 24));
                buttonActiveMQRestart.setPreferredSize(new Dimension(24, 24));
                buttonActiveMQRestart.setIcon(new ImageIcon("resources/image/LH2 - Restart.png"));

                buttonActiveMQStart = new JButton("");
                buttonActiveMQStart.setEnabled(false);
                buttonActiveMQStart.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent arg0) {
                        notifyArea.append("ActiveMQ starting...\n");
                        if (csManager.startActiveMQ())
                            notifyArea.append("ActiveMQ started!\n");

                        checkCommunicationServerStatus();
                    }
                });
                buttonActiveMQStart.setPreferredSize(new Dimension(24, 24));
                buttonActiveMQStart.setMinimumSize(new Dimension(24, 24));
                buttonActiveMQStart.setMaximumSize(new Dimension(24, 24));
                buttonActiveMQStart.setIcon(new ImageIcon("resources/image/LH2 - Shutdown.png"));

                buttonActiveMQStop = new JButton("");
                buttonActiveMQStop.setEnabled(false);
                buttonActiveMQStop.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent arg0) {
                        notifyArea.append("ActiveMQ stopping...\n");
                        if (csManager.stopActiveMQ())
                            notifyArea.append("ActiveMQ stopped!\n");

                        checkCommunicationServerStatus();
                    }
                });
                buttonActiveMQStop.setPreferredSize(new Dimension(24, 24));
                buttonActiveMQStop.setMinimumSize(new Dimension(24, 24));
                buttonActiveMQStop.setMaximumSize(new Dimension(24, 24));
                buttonActiveMQStop.setIcon(new ImageIcon("resources/image/LH2 - Stop.png"));

                btnCheckPeers = new JButton("Check Peers");
                btnCheckPeers.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        try {
                            checkPeers();
                        } catch (Exception e1) {
                            // TODO Auto-generated catch block
                            e1.printStackTrace();
                        }
                    }
                });

                GroupLayout jPanelConnectionLayout = new GroupLayout(jPanelConnection);
                jPanelConnectionLayout.setHorizontalGroup(jPanelConnectionLayout
                        .createParallelGroup(Alignment.LEADING)
                        .addGroup(jPanelConnectionLayout.createSequentialGroup().addGroup(jPanelConnectionLayout
                                .createParallelGroup(Alignment.LEADING)
                                .addGroup(jPanelConnectionLayout.createSequentialGroup()
                                        .addGroup(jPanelConnectionLayout.createParallelGroup(Alignment.TRAILING)
                                                .addComponent(refreshServerLabel)
                                                .addGroup(jPanelConnectionLayout.createSequentialGroup()
                                                        .addComponent(buttonActiveMQStart,
                                                                GroupLayout.PREFERRED_SIZE,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(ComponentPlacement.RELATED)
                                                        .addComponent(buttonActiveMQRestart,
                                                                GroupLayout.PREFERRED_SIZE,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(ComponentPlacement.RELATED)
                                                        .addComponent(buttonActiveMQStop,
                                                                GroupLayout.PREFERRED_SIZE,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                GroupLayout.PREFERRED_SIZE)
                                                        .addGap(111).addComponent(jLabelAddress).addGap(18)
                                                        .addComponent(textFieldAddress,
                                                                GroupLayout.PREFERRED_SIZE, 91,
                                                                GroupLayout.PREFERRED_SIZE)
                                                        .addGap(18).addComponent(jLabelPort).addGap(18)
                                                        .addComponent(textFieldPort, GroupLayout.PREFERRED_SIZE,
                                                                85, GroupLayout.PREFERRED_SIZE)
                                                        .addGap(46).addComponent(buttonRefreshServerLabel)))
                                        .addGap(51).addComponent(btnCheckPeers))
                                .addGroup(jPanelConnectionLayout.createSequentialGroup().addComponent(lblStatus)
                                        .addPreferredGap(ComponentPlacement.RELATED)
                                        .addComponent(lblStatusIcon)))
                                .addContainerGap(71, Short.MAX_VALUE)));
                jPanelConnectionLayout.setVerticalGroup(jPanelConnectionLayout
                        .createParallelGroup(Alignment.TRAILING)
                        .addGroup(jPanelConnectionLayout.createSequentialGroup().addGroup(jPanelConnectionLayout
                                .createParallelGroup(Alignment.LEADING)
                                .addGroup(jPanelConnectionLayout.createSequentialGroup()
                                        .addGroup(jPanelConnectionLayout.createParallelGroup(Alignment.LEADING)
                                                .addComponent(lblStatus).addComponent(lblStatusIcon))
                                        .addPreferredGap(ComponentPlacement.RELATED)
                                        .addGroup(jPanelConnectionLayout.createParallelGroup(Alignment.LEADING)
                                                .addComponent(buttonActiveMQRestart, GroupLayout.PREFERRED_SIZE,
                                                        GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                                .addComponent(buttonActiveMQStart, GroupLayout.PREFERRED_SIZE,
                                                        GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                                .addComponent(buttonActiveMQStop, GroupLayout.PREFERRED_SIZE,
                                                        GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(ComponentPlacement.RELATED, 1, Short.MAX_VALUE))
                                .addGroup(jPanelConnectionLayout.createSequentialGroup()
                                        .addContainerGap(18, Short.MAX_VALUE).addComponent(refreshServerLabel)
                                        .addPreferredGap(ComponentPlacement.RELATED)
                                        .addGroup(jPanelConnectionLayout.createParallelGroup(Alignment.BASELINE)
                                                .addComponent(buttonRefreshServerLabel).addComponent(jLabelPort)
                                                .addComponent(textFieldPort, GroupLayout.PREFERRED_SIZE, 22,
                                                        GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabelAddress)
                                                .addComponent(textFieldAddress, GroupLayout.PREFERRED_SIZE, 22,
                                                        GroupLayout.PREFERRED_SIZE)
                                                .addComponent(btnCheckPeers))))
                                .addGap(10)));
                jPanelConnectionLayout.linkSize(SwingConstants.HORIZONTAL,
                        new Component[] { buttonActiveMQRestart, buttonActiveMQStart, buttonActiveMQStop });
                jPanelConnection.setLayout(jPanelConnectionLayout);
            }

            GroupLayout jPanelContainerConnectionLayout = new GroupLayout(jPanelContainerConnection);
            jPanelContainerConnection.setLayout(jPanelContainerConnectionLayout);
            jPanelContainerConnectionLayout
                    .setHorizontalGroup(jPanelContainerConnectionLayout.createParallelGroup()
                            .addGroup(jPanelContainerConnectionLayout
                                    .createSequentialGroup().addContainerGap().addComponent(jPanelConnection,
                                            GroupLayout.PREFERRED_SIZE, 829, GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap(153, Short.MAX_VALUE)));
            jPanelContainerConnectionLayout.setVerticalGroup(
                    jPanelContainerConnectionLayout.createParallelGroup().addComponent(jPanelConnection,
                            GroupLayout.PREFERRED_SIZE, 71, GroupLayout.PREFERRED_SIZE));
        }

        //======== jPanelContainerSettings ========
        {

            GroupLayout jPanelContainerSettingsLayout = new GroupLayout(jPanelContainerSettings);
            jPanelContainerSettings.setLayout(jPanelContainerSettingsLayout);
            jPanelContainerSettingsLayout.setHorizontalGroup(
                    jPanelContainerSettingsLayout.createParallelGroup().addGap(0, 1, Short.MAX_VALUE));
            jPanelContainerSettingsLayout.setVerticalGroup(
                    jPanelContainerSettingsLayout.createParallelGroup().addGap(0, 481, Short.MAX_VALUE));
        }

        //======== jPanelSetDistribution ========
        {
            jPanelSetDistribution.setBorder(new TitledBorder("Settings"));

            //======== jPanelSettings ========
            {

                //jLabelHorizontal.setIcon(new ImageIcon("it.isislab.dmason/resources/image/hori.png")));

                //---- jLabelSquare ----
                //jLabelSquare.setIcon(new ImageIcon("it.isislab.dmason/resources/image/square.png")));

                //---- jLabelMaxDistance ----
                jLabelMaxDistance.setText("MAX_DISTANCE :");

                //---- jLabelWidth ----
                jLabelWidth.setText("WIDTH :");

                //---- jLabelInsertSteps ----
                jLabelInsertSteps.setText("STEPS :");

                //---- textFieldMaxDistance ----
                textFieldMaxDistance.setText("1");

                //---- textFieldWidth ----
                textFieldWidth.setText("200");

                //---- jLabelHeight ----
                jLabelHeight.setText("HEIGHT :");

                //---- textFieldHeight ----
                textFieldHeight.setText("200");

                //---- jLabelAgents ----
                jLabelAgents.setText("AGENTS :");

                //---- textFieldAgents ----
                textFieldAgents.setText("15");

                //---- textFieldSteps
                textFieldSteps.setText("100");

                MouseListener textFieldMouseListener = new MouseListener() {

                    @Override
                    public void mouseReleased(MouseEvent e) {
                        // TODO Auto-generated method stub

                    }

                    @Override
                    public void mousePressed(MouseEvent e) {
                        // TODO Auto-generated method stub

                    }

                    @Override
                    public void mouseExited(MouseEvent e) {
                        initializeDefaultLabel();
                    }

                    @Override
                    public void mouseEntered(MouseEvent e) {
                        // TODO Auto-generated method stub

                    }

                    @Override
                    public void mouseClicked(MouseEvent e) {
                        // TODO Auto-generated method stub

                    }
                };

                textFieldAgents.addMouseListener(textFieldMouseListener);
                textFieldAgents.addKeyListener(new KeyListener() {

                    @Override
                    public void keyTyped(KeyEvent e) {
                        char v = e.getKeyChar();
                        if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) {
                            e.consume();
                        }
                        if (textFieldAgents.getText().length() > 0)
                            initializeDefaultLabel();
                    }

                    @Override
                    public void keyReleased(KeyEvent e) {
                        //initializeDefaultLabel();
                    }

                    @Override
                    public void keyPressed(KeyEvent e) {
                    }
                });

                textFieldColumns.addMouseListener(textFieldMouseListener);
                textFieldColumns.addKeyListener(new KeyListener() {

                    @Override
                    public void keyTyped(KeyEvent e) {
                        // TODO Auto-generated method stub
                        char v = e.getKeyChar();
                        if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) {
                            e.consume();
                        }
                        if (textFieldColumns.getText().length() > 0)
                            initializeDefaultLabel();
                    }

                    @Override
                    public void keyReleased(KeyEvent e) {
                        // TODO Auto-generated method stub

                    }

                    @Override
                    public void keyPressed(KeyEvent e) {
                        // TODO Auto-generated method stub
                    }
                });

                textFieldMaxDistance.addMouseListener(textFieldMouseListener);
                textFieldMaxDistance.addKeyListener(new KeyListener() {

                    @Override
                    public void keyTyped(KeyEvent e) {
                        char v = e.getKeyChar();
                        if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) {
                            e.consume();
                        }
                        if (textFieldMaxDistance.getText().length() > 0)
                            initializeDefaultLabel();
                    }

                    @Override
                    public void keyReleased(KeyEvent e) {
                        //initializeDefaultLabel();
                    }

                    @Override
                    public void keyPressed(KeyEvent e) {
                    }
                });

                textFieldWidth.addMouseListener(textFieldMouseListener);
                textFieldWidth.addKeyListener(new KeyListener() {

                    @Override
                    public void keyTyped(KeyEvent e) {
                        char v = e.getKeyChar();
                        if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) {
                            e.consume();
                        }
                        if (textFieldWidth.getText().length() > 0)
                            initializeDefaultLabel();
                    }

                    @Override
                    public void keyReleased(KeyEvent e) {
                        //initializeDefaultLabel();
                    }

                    @Override
                    public void keyPressed(KeyEvent e) {
                    }
                });

                textFieldRows.addMouseListener(textFieldMouseListener);
                textFieldRows.addKeyListener(new KeyListener() {

                    @Override
                    public void keyTyped(KeyEvent e) {
                        char v = e.getKeyChar();
                        if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) {
                            e.consume();
                        }
                        if (textFieldRows.getText().length() > 0)
                            initializeDefaultLabel();
                    }

                    @Override
                    public void keyReleased(KeyEvent e) {

                    }

                    @Override
                    public void keyPressed(KeyEvent e) {
                    }
                });

                textFieldHeight.addMouseListener(textFieldMouseListener);
                textFieldHeight.addKeyListener(new KeyListener() {

                    @Override
                    public void keyTyped(KeyEvent e) {
                        char v = e.getKeyChar();
                        if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) {
                            e.consume();
                        }
                        if (textFieldHeight.getText().length() > 0)
                            initializeDefaultLabel();
                    }

                    @Override
                    public void keyReleased(KeyEvent arg0) {
                        //initializeDefaultLabel();
                    }

                    @Override
                    public void keyPressed(KeyEvent arg0) {
                    }
                });

                textFieldSteps.addMouseListener(textFieldMouseListener);
                textFieldSteps.addKeyListener(new KeyListener() {

                    @Override
                    public void keyTyped(KeyEvent e) {
                        char v = e.getKeyChar();
                        if (!(Character.isDigit(v)) || v == KeyEvent.VK_BACK_SPACE) {
                            e.consume();
                        }
                        if (textFieldSteps.getText().length() > 0)
                            initializeDefaultLabel();
                    }

                    @Override
                    public void keyReleased(KeyEvent e) {
                        // TODO Auto-generated method stub

                    }

                    @Override
                    public void keyPressed(KeyEvent e) {
                        // TODO Auto-generated method stub

                    }
                });

                //---- jLabelChooseSimulation ----
                jLabelChooseSimulation.setText("Choose your simulation:");

                //---- jComboBoxChooseSimulation ----
                jComboBoxChooseSimulation.setMaximumRowCount(10);

                JLabel lblRows = new JLabel("ROWS :");

                JLabel lblColumns = new JLabel("COLUMNS :");

                textFieldRows.setText("1");
                textFieldRows.setEnabled(false);
                textFieldRows.setColumns(10);

                rows = Integer.parseInt(textFieldRows.getText());

                textFieldColumns.setText("2");
                textFieldColumns.setEnabled(false);
                textFieldColumns.setColumns(10);
                columns = Integer.parseInt(textFieldColumns.getText());

                textFieldSteps.setText("100");
                textFieldSteps.setEnabled(false);
                textFieldSteps.setColumns(10);
                steps = 100;

                GroupLayout jPanelSettingsLayout = new GroupLayout(jPanelSettings);
                jPanelSettingsLayout.setHorizontalGroup(jPanelSettingsLayout
                        .createParallelGroup(Alignment.LEADING)
                        .addGroup(jPanelSettingsLayout.createSequentialGroup().addGap(17)
                                .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.LEADING)
                                        .addComponent(jLabelChooseSimulation, GroupLayout.PREFERRED_SIZE, 245,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addGroup(jPanelSettingsLayout.createSequentialGroup().addGap(119)
                                                .addComponent(jLabelHorizontal))
                                        .addComponent(jComboBoxChooseSimulation, GroupLayout.PREFERRED_SIZE,
                                                214, GroupLayout.PREFERRED_SIZE)
                                        .addGroup(jPanelSettingsLayout.createSequentialGroup()
                                                .addGroup(jPanelSettingsLayout
                                                        .createParallelGroup(Alignment.TRAILING)
                                                        .addGroup(Alignment.LEADING, jPanelSettingsLayout
                                                                .createSequentialGroup()
                                                                .addGroup(jPanelSettingsLayout
                                                                        .createParallelGroup(Alignment.LEADING)
                                                                        .addComponent(lblRows,
                                                                                GroupLayout.PREFERRED_SIZE, 59,
                                                                                GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(lblColumns))
                                                                .addGap(60)
                                                                .addGroup(jPanelSettingsLayout
                                                                        .createParallelGroup(Alignment.LEADING)
                                                                        .addComponent(jLabelSquare)
                                                                        .addComponent(textFieldColumns,
                                                                                GroupLayout.DEFAULT_SIZE, 94,
                                                                                Short.MAX_VALUE)
                                                                        .addComponent(textFieldRows,
                                                                                GroupLayout.DEFAULT_SIZE, 94,
                                                                                Short.MAX_VALUE)))
                                                        .addGroup(Alignment.LEADING, jPanelSettingsLayout
                                                                .createSequentialGroup()
                                                                .addGroup(jPanelSettingsLayout
                                                                        .createParallelGroup(Alignment.LEADING)
                                                                        .addComponent(jLabelMaxDistance)
                                                                        .addComponent(jLabelWidth)
                                                                        .addComponent(jLabelHeight)
                                                                        .addComponent(jLabelAgents)
                                                                        .addComponent(jLabelInsertSteps)
                                                                        .addGap(132))
                                                                .addGroup(jPanelSettingsLayout
                                                                        .createParallelGroup(Alignment.LEADING)
                                                                        .addComponent(textFieldAgents,
                                                                                GroupLayout.PREFERRED_SIZE, 94,
                                                                                GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(textFieldHeight,
                                                                                GroupLayout.PREFERRED_SIZE, 94,
                                                                                GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(textFieldWidth,
                                                                                GroupLayout.PREFERRED_SIZE, 94,
                                                                                GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(textFieldMaxDistance,
                                                                                GroupLayout.PREFERRED_SIZE, 94,
                                                                                GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(textFieldSteps,
                                                                                GroupLayout.PREFERRED_SIZE, 94,
                                                                                GroupLayout.PREFERRED_SIZE)
                                                                        .addGap(20))))

                                                .addGap(20)))));
                jPanelSettingsLayout.setVerticalGroup(jPanelSettingsLayout
                        .createParallelGroup(Alignment.LEADING)
                        .addGroup(jPanelSettingsLayout.createSequentialGroup().addContainerGap()
                                .addComponent(jLabelHorizontal).addGap(41)
                                .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.LEADING)
                                        .addComponent(jLabelSquare)
                                        .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE)
                                                .addComponent(lblRows, GroupLayout.PREFERRED_SIZE, 22,
                                                        GroupLayout.PREFERRED_SIZE)
                                                .addComponent(textFieldRows, GroupLayout.PREFERRED_SIZE,
                                                        GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(textFieldColumns, GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                        .addComponent(lblColumns))
                                .addGap(18)
                                .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(jLabelMaxDistance).addComponent(textFieldMaxDistance,
                                                GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(ComponentPlacement.RELATED)
                                .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(jLabelWidth, GroupLayout.PREFERRED_SIZE, 16,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addComponent(textFieldWidth, GroupLayout.PREFERRED_SIZE, 19,
                                                GroupLayout.PREFERRED_SIZE))
                                .addGap(10)
                                .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(jLabelHeight, GroupLayout.PREFERRED_SIZE, 16,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addComponent(textFieldHeight, GroupLayout.PREFERRED_SIZE, 19,
                                                GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(ComponentPlacement.RELATED)
                                .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(jLabelAgents).addComponent(textFieldAgents,
                                                GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(ComponentPlacement.RELATED)
                                //.addGap(10)
                                .addGroup(jPanelSettingsLayout.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(jLabelInsertSteps, GroupLayout.PREFERRED_SIZE, 16,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addComponent(textFieldSteps, GroupLayout.PREFERRED_SIZE, 19,
                                                GroupLayout.PREFERRED_SIZE))
                                .addGap(35).addComponent(jLabelChooseSimulation)
                                .addPreferredGap(ComponentPlacement.UNRELATED)
                                .addComponent(jComboBoxChooseSimulation, GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addGap(52)));
                jPanelSettings.setLayout(jPanelSettingsLayout);
            }

            //======== jPanelContainerTabbedPane ========
            {

                //======== tabbedPane2 ========
                {

                    //======== jPanelDefault ========
                    {
                        jPanelDefault.setBorder(new EtchedBorder());
                        jPanelDefault.setPreferredSize(new Dimension(350, 331));

                        //---- labelSimulationConfigSet ----
                        labelSimulationConfigSet.setText("Simulation Configuration Settings");
                        labelSimulationConfigSet.setFont(labelSimulationConfigSet.getFont().deriveFont(
                                labelSimulationConfigSet.getFont().getStyle() | Font.BOLD,
                                labelSimulationConfigSet.getFont().getSize() + 8f));

                        //---- labelRegionsResume ----
                        labelRegionsResume.setText("REGIONS :");

                        //---- labelNumOfPeerResume ----
                        labelNumOfPeerResume.setText("NUMBER OF PEERS :");

                        //---- labelRegForPeerResume ----
                        labelRegForPeerResume.setText("REGIONS FOR PEER :");

                        //---- labelWriteReg ----
                        labelWriteReg.setText("text");

                        //---- labelWriteNumOfPeer ----
                        labelWriteNumOfPeer.setText("text");

                        //---- labelWriteRegForPeer ----
                        labelWriteRegForPeer.setText("text");

                        //---- labelWidthRegion ----
                        labelWidthRegion.setText("REGION WIDTH :");

                        //---- labelheightRegion ----
                        labelheightRegion.setText("REGION HEIGHT :");

                        //---- labelDistrMode ----
                        labelDistrMode.setText("DISTRIBUTION MODE :");

                        //---- labelWriteRegWidth ----
                        labelWriteRegWidth.setText("text");

                        //---- labelWriteRegHeight ----
                        labelWriteRegHeight.setText("text");

                        //---- labelWriteDistrMode ----
                        labelWriteDistrMode.setText("text");

                        //---- graphicONcheckBox2 ----
                        graphicONcheckBox2.setText("Graphic ON");

                        //======== jPanelSetButton ========
                        {

                            //---- buttonSetConfigDefault ----
                            buttonSetConfigDefault.setText("Set");
                            {
                                jCheckBoxLoadBalancing.setText("Load Balancing");
                            }

                            GroupLayout jPanelSetButtonLayout = new GroupLayout(jPanelSetButton);
                            jPanelSetButton.setLayout(jPanelSetButtonLayout);
                            jPanelSetButtonLayout.setVerticalGroup(jPanelSetButtonLayout.createSequentialGroup()

                                    .addGroup(jPanelSetButtonLayout.createParallelGroup().addGroup(
                                            GroupLayout.Alignment.TRAILING,
                                            jPanelSetButtonLayout.createSequentialGroup().addComponent(
                                                    jCheckBoxMPI, GroupLayout.PREFERRED_SIZE, 20,
                                                    GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(jPanelSetButtonLayout.createParallelGroup()
                                            .addGroup(GroupLayout.Alignment.LEADING,
                                                    jPanelSetButtonLayout.createSequentialGroup().addComponent(
                                                            jCheckBoxLoadBalancing, GroupLayout.PREFERRED_SIZE,
                                                            20, GroupLayout.PREFERRED_SIZE))
                                            .addGroup(GroupLayout.Alignment.LEADING, jPanelSetButtonLayout
                                                    .createSequentialGroup()
                                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 0,
                                                            Short.MAX_VALUE)
                                                    .addComponent(buttonSetConfigDefault,
                                                            GroupLayout.PREFERRED_SIZE,
                                                            GroupLayout.PREFERRED_SIZE,
                                                            GroupLayout.PREFERRED_SIZE)))

                                    .addContainerGap());

                            jPanelSetButtonLayout.setHorizontalGroup(jPanelSetButtonLayout
                                    .createSequentialGroup()
                                    .addComponent(jCheckBoxMPI, GroupLayout.PREFERRED_SIZE, 120,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap(0, 0)
                                    .addComponent(jCheckBoxLoadBalancing, GroupLayout.PREFERRED_SIZE, 114,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 150, Short.MAX_VALUE).addComponent(buttonSetConfigDefault,
                                            GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap(0, 0));

                            FlowLayout lsetbutt = new FlowLayout();
                            lsetbutt.addLayoutComponent("", jCheckBoxMPI);
                            lsetbutt.addLayoutComponent("", jCheckBoxLoadBalancing);
                            lsetbutt.addLayoutComponent("", buttonSetConfigDefault);
                            jPanelSetButton.setLayout(lsetbutt);

                        }

                        GroupLayout jPanelDefaultLayout = new GroupLayout(jPanelDefault);
                        jPanelDefaultLayout.setHorizontalGroup(jPanelDefaultLayout
                                .createParallelGroup(Alignment.LEADING)
                                .addGroup(jPanelDefaultLayout.createSequentialGroup().addContainerGap()
                                        .addGroup(jPanelDefaultLayout.createParallelGroup(Alignment.LEADING)
                                                .addComponent(labelSimulationConfigSet,
                                                        GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
                                                .addGroup(jPanelDefaultLayout.createSequentialGroup().addGap(6)
                                                        .addGroup(jPanelDefaultLayout
                                                                .createParallelGroup(Alignment.LEADING)
                                                                .addGroup(jPanelDefaultLayout
                                                                        .createSequentialGroup()
                                                                        .addGroup(jPanelDefaultLayout
                                                                                .createParallelGroup(
                                                                                        Alignment.LEADING)
                                                                                .addComponent(
                                                                                        labelNumOfPeerResume)
                                                                                .addComponent(
                                                                                        labelRegForPeerResume)
                                                                                .addComponent(labelWidthRegion)
                                                                                .addComponent(labelheightRegion)
                                                                                .addComponent(labelDistrMode)
                                                                                .addComponent(
                                                                                        labelRegionsResume))
                                                                        .addPreferredGap(
                                                                                ComponentPlacement.RELATED, 218,
                                                                                Short.MAX_VALUE)
                                                                        .addGroup(jPanelDefaultLayout
                                                                                .createParallelGroup(
                                                                                        Alignment.LEADING)
                                                                                .addComponent(
                                                                                        labelWriteNumOfPeer,
                                                                                        GroupLayout.PREFERRED_SIZE,
                                                                                        25,
                                                                                        GroupLayout.PREFERRED_SIZE)
                                                                                .addComponent(labelWriteReg)
                                                                                .addComponent(
                                                                                        labelWriteRegForPeer)
                                                                                .addComponent(
                                                                                        labelWriteRegWidth)
                                                                                .addComponent(
                                                                                        labelWriteRegHeight)
                                                                                .addComponent(
                                                                                        labelWriteDistrMode))
                                                                        .addGap(118))
                                                                .addComponent(graphicONcheckBox2))))
                                        .addGap(211))
                                .addGroup(jPanelDefaultLayout.createSequentialGroup()
                                        .addComponent(jPanelSetButton, GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                        .addContainerGap(23, Short.MAX_VALUE)));
                        jPanelDefaultLayout.setVerticalGroup(jPanelDefaultLayout
                                .createParallelGroup(Alignment.LEADING)
                                .addGroup(jPanelDefaultLayout.createSequentialGroup().addContainerGap()
                                        .addComponent(labelSimulationConfigSet, GroupLayout.PREFERRED_SIZE, 31,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addGap(28)
                                        .addGroup(jPanelDefaultLayout.createParallelGroup(Alignment.TRAILING)
                                                .addGroup(jPanelDefaultLayout.createSequentialGroup()
                                                        .addComponent(labelRegionsResume)
                                                        .addPreferredGap(ComponentPlacement.RELATED)
                                                        .addComponent(labelNumOfPeerResume)
                                                        .addPreferredGap(ComponentPlacement.RELATED)
                                                        .addComponent(labelRegForPeerResume).addGap(6)
                                                        .addComponent(labelWidthRegion).addGap(6)
                                                        .addComponent(labelheightRegion)
                                                        .addPreferredGap(ComponentPlacement.RELATED)
                                                        .addComponent(labelDistrMode))
                                                .addGroup(jPanelDefaultLayout.createSequentialGroup()
                                                        .addComponent(labelWriteReg)
                                                        .addPreferredGap(ComponentPlacement.RELATED)
                                                        .addComponent(labelWriteNumOfPeer)
                                                        .addPreferredGap(ComponentPlacement.RELATED)
                                                        .addComponent(labelWriteRegForPeer).addGap(6)
                                                        .addComponent(labelWriteRegWidth).addGap(6)
                                                        .addComponent(labelWriteRegHeight)
                                                        .addPreferredGap(ComponentPlacement.RELATED)
                                                        .addComponent(labelWriteDistrMode,
                                                                GroupLayout.PREFERRED_SIZE, 16,
                                                                GroupLayout.PREFERRED_SIZE)
                                                        .addGap(8)))
                                        .addPreferredGap(ComponentPlacement.UNRELATED)
                                        .addComponent(graphicONcheckBox2)
                                        .addPreferredGap(ComponentPlacement.RELATED, 82, Short.MAX_VALUE)
                                        .addComponent(jPanelSetButton, GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)));
                        jPanelDefault.setLayout(jPanelDefaultLayout);
                    }
                    tabbedPane2.addTab("Default", jPanelDefault);

                    //======== jPanelSimulation ========

                    tabbedPane2.addTab("Simulation", jPanelSimulation);
                    //======== End jPanelSimulation ========
                    //======== jPanelAdvanced ========
                    {
                        jPanelAdvanced.setBorder(new EtchedBorder());

                        //======== jPanelAdvancedMain ========
                        {

                            //======== scrollPaneTree ========
                            {

                                //---- tree1 ----
                                tree1.setModel(new DefaultTreeModel(root));
                                DefaultTreeCellRenderer render = new DefaultTreeCellRenderer();

                                render.setOpenIcon(new ImageIcon("resources/image/network.png"));

                                render.setLeafIcon(new ImageIcon("esource/image/computer.gif"));

                                render.setClosedIcon(new ImageIcon("resources/image/network.png"));
                                tree1.setCellRenderer(render);
                                tree1.setRowHeight(25);
                                scrollPaneTree.setViewportView(tree1);
                                tree1.addTreeSelectionListener(new TreeSelectionListener() {

                                    @Override
                                    public void valueChanged(TreeSelectionEvent arg0) {
                                        if (arg0.getPath().getLastPathComponent().equals(root)) {
                                            jComboBoxNumRegionXPeer.setEnabled(true);
                                            advancedConfirmBut.setEnabled(true);
                                            graphicONcheckBox.setEnabled(true);
                                            total = Integer.parseInt(textFieldRows.getText())
                                                    * Integer.parseInt(textFieldColumns.getText()); //(Integer)jComboRegions.getSelectedItem();
                                            res = total;
                                            jComboBoxNumRegionXPeer.removeAllItems();
                                            for (int i = 1; i < res; i++)
                                                jComboBoxNumRegionXPeer.addItem(i);
                                        } else
                                            clickTreeListener();
                                    }
                                });

                            }

                            //======== peerInfoStatus ========
                            {
                                peerInfoStatus.setBorder(new TitledBorder("Settings"));
                                peerInfoStatus.setBackground(Color.lightGray);

                                //======== peerInfoStatus1 ========
                                {
                                    peerInfoStatus1.setBackground(Color.lightGray);
                                    peerInfoStatus1.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
                                    peerInfoStatus1.setBorder(null);

                                    //======== internalFrame1 ========
                                    {
                                        internalFrame1.setVisible(true);
                                        Container internalFrame1ContentPane = internalFrame1.getContentPane();

                                        //======== scrollPane1 ========
                                        {

                                            //---- label8 ----
                                            architectureLabel.setText("Architecture Information");
                                            scrollPane1.setViewportView(architectureLabel);
                                        }

                                        GroupLayout internalFrame1ContentPaneLayout = new GroupLayout(
                                                internalFrame1ContentPane);
                                        internalFrame1ContentPane.setLayout(internalFrame1ContentPaneLayout);
                                        internalFrame1ContentPaneLayout.setHorizontalGroup(
                                                internalFrame1ContentPaneLayout.createParallelGroup()
                                                        .addGroup(internalFrame1ContentPaneLayout
                                                                .createSequentialGroup().addContainerGap()
                                                                .addComponent(scrollPane1,
                                                                        GroupLayout.DEFAULT_SIZE, 0,
                                                                        Short.MAX_VALUE)
                                                                .addContainerGap()));
                                        internalFrame1ContentPaneLayout.setVerticalGroup(
                                                internalFrame1ContentPaneLayout.createParallelGroup()
                                                        .addGroup(internalFrame1ContentPaneLayout
                                                                .createSequentialGroup().addContainerGap()
                                                                .addComponent(scrollPane1,
                                                                        GroupLayout.DEFAULT_SIZE, 0,
                                                                        Short.MAX_VALUE)
                                                                .addContainerGap()));
                                    }
                                    peerInfoStatus1.add(internalFrame1, JLayeredPane.DEFAULT_LAYER);
                                    internalFrame1.setBounds(15, 0, 365, 160);
                                }

                                //---- graphicONcheckBox ----
                                graphicONcheckBox.setText("Graphic ON");

                                //---- advancedConfirmBut ----
                                advancedConfirmBut.setIcon(new ImageIcon("resources/image/ok.png"));

                                GroupLayout peerInfoStatusLayout = new GroupLayout(peerInfoStatus);
                                peerInfoStatus.setLayout(peerInfoStatusLayout);
                                peerInfoStatusLayout.setHorizontalGroup(peerInfoStatusLayout
                                        .createParallelGroup()
                                        .addGroup(peerInfoStatusLayout.createSequentialGroup()
                                                .addGroup(peerInfoStatusLayout.createParallelGroup()
                                                        .addGroup(peerInfoStatusLayout.createSequentialGroup()
                                                                .addGap(26, 26, 26)
                                                                .addComponent(graphicONcheckBox)
                                                                .addGap(73, 73, 73)
                                                                .addComponent(jComboBoxNumRegionXPeer,
                                                                        GroupLayout.PREFERRED_SIZE,
                                                                        GroupLayout.DEFAULT_SIZE,
                                                                        GroupLayout.PREFERRED_SIZE)
                                                                .addGap(80, 80, 80)
                                                                .addComponent(advancedConfirmBut,
                                                                        GroupLayout.PREFERRED_SIZE, 33,
                                                                        GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(peerInfoStatusLayout.createSequentialGroup()
                                                                .addContainerGap().addComponent(peerInfoStatus1,
                                                                        GroupLayout.DEFAULT_SIZE, 387,
                                                                        Short.MAX_VALUE)))
                                                .addContainerGap()));
                                peerInfoStatusLayout.setVerticalGroup(peerInfoStatusLayout.createParallelGroup()
                                        .addGroup(peerInfoStatusLayout.createSequentialGroup()
                                                .addComponent(peerInfoStatus1, GroupLayout.PREFERRED_SIZE, 175,
                                                        GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(peerInfoStatusLayout
                                                        .createParallelGroup(GroupLayout.Alignment.TRAILING)
                                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                                peerInfoStatusLayout
                                                                        .createParallelGroup(
                                                                                GroupLayout.Alignment.BASELINE)
                                                                        .addComponent(graphicONcheckBox)
                                                                        .addComponent(jComboBoxNumRegionXPeer,
                                                                                GroupLayout.PREFERRED_SIZE,
                                                                                GroupLayout.DEFAULT_SIZE,
                                                                                GroupLayout.PREFERRED_SIZE))
                                                        .addComponent(advancedConfirmBut,
                                                                GroupLayout.Alignment.LEADING,
                                                                GroupLayout.PREFERRED_SIZE, 28,
                                                                GroupLayout.PREFERRED_SIZE))
                                                .addContainerGap(16, Short.MAX_VALUE)));
                            }

                            GroupLayout jPanelAdvancedMainLayout = new GroupLayout(jPanelAdvancedMain);
                            jPanelAdvancedMain.setLayout(jPanelAdvancedMainLayout);
                            jPanelAdvancedMainLayout.setHorizontalGroup(jPanelAdvancedMainLayout
                                    .createParallelGroup()
                                    .addGroup(jPanelAdvancedMainLayout.createSequentialGroup().addContainerGap()
                                            .addComponent(scrollPaneTree, GroupLayout.PREFERRED_SIZE, 207,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(peerInfoStatus, GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addContainerGap()));
                            jPanelAdvancedMainLayout.setVerticalGroup(jPanelAdvancedMainLayout
                                    .createParallelGroup()
                                    .addGroup(GroupLayout.Alignment.TRAILING, jPanelAdvancedMainLayout
                                            .createSequentialGroup().addContainerGap()
                                            .addGroup(jPanelAdvancedMainLayout
                                                    .createParallelGroup(GroupLayout.Alignment.TRAILING)
                                                    .addComponent(peerInfoStatus, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE)
                                                    .addComponent(scrollPaneTree, GroupLayout.Alignment.LEADING,
                                                            GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE))
                                            .addContainerGap()));
                        }

                        //======== jPanelSetButton2 ========
                        {

                            //---- buttonSetConfigDefault2 ----
                            buttonSetConfigDefault2.setText("Set");

                            GroupLayout jPanelSetButton2Layout = new GroupLayout(jPanelSetButton2);
                            jPanelSetButton2.setLayout(jPanelSetButton2Layout);
                            jPanelSetButton2Layout.setHorizontalGroup(jPanelSetButton2Layout
                                    .createParallelGroup().addGroup(GroupLayout.Alignment.TRAILING,
                                            jPanelSetButton2Layout.createSequentialGroup()
                                                    .addContainerGap(522, Short.MAX_VALUE)
                                                    .addComponent(buttonSetConfigDefault2,
                                                            GroupLayout.PREFERRED_SIZE, 76,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addGap(72, 72, 72)));
                            jPanelSetButton2Layout.setVerticalGroup(jPanelSetButton2Layout.createParallelGroup()
                                    .addGroup(GroupLayout.Alignment.TRAILING,
                                            jPanelSetButton2Layout.createSequentialGroup()
                                                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                    .addComponent(buttonSetConfigDefault2).addContainerGap()));
                        }

                        GroupLayout jPanelAdvancedLayout = new GroupLayout(jPanelAdvanced);
                        jPanelAdvancedLayout.setHorizontalGroup(jPanelAdvancedLayout
                                .createParallelGroup(Alignment.LEADING)
                                .addGroup(jPanelAdvancedLayout.createSequentialGroup()
                                        .addGroup(jPanelAdvancedLayout.createParallelGroup(Alignment.LEADING)
                                                .addComponent(jPanelAdvancedMain, GroupLayout.DEFAULT_SIZE, 689,
                                                        Short.MAX_VALUE)
                                                .addComponent(jPanelSetButton2, GroupLayout.PREFERRED_SIZE, 681,
                                                        GroupLayout.PREFERRED_SIZE))
                                        .addContainerGap()));
                        jPanelAdvancedLayout.setVerticalGroup(jPanelAdvancedLayout
                                .createParallelGroup(Alignment.TRAILING)
                                .addGroup(jPanelAdvancedLayout.createSequentialGroup().addContainerGap()
                                        .addComponent(jPanelAdvancedMain, GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                        .addGap(18).addComponent(jPanelSetButton2, GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)));
                        jPanelAdvanced.setLayout(jPanelAdvancedLayout);
                    }
                    tabbedPane2.addTab("Advanced", jPanelAdvanced);

                }

                //======== panelConsole ========
                {

                    //======== scrollPane3 ========
                    {

                        //---- textField1 ----
                        notifyArea.setEditable(false);
                        DefaultCaret caret = (DefaultCaret) notifyArea.getCaret();
                        caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
                        scrollPane3.setViewportView(notifyArea);
                    }

                    GroupLayout panelConsoleLayout = new GroupLayout(panelConsole);
                    panelConsole.setLayout(panelConsoleLayout);
                    panelConsoleLayout.setHorizontalGroup(panelConsoleLayout.createParallelGroup()
                            .addGroup(panelConsoleLayout.createParallelGroup()
                                    .addGroup(panelConsoleLayout.createSequentialGroup()
                                            .addGap(0, 0, Short.MAX_VALUE)
                                            .addComponent(scrollPane3, GroupLayout.PREFERRED_SIZE, 679,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(0, 0, Short.MAX_VALUE)))
                            .addGap(0, 679, Short.MAX_VALUE));
                    panelConsoleLayout.setVerticalGroup(panelConsoleLayout.createParallelGroup()
                            .addGroup(panelConsoleLayout.createParallelGroup()
                                    .addGroup(panelConsoleLayout.createSequentialGroup()
                                            .addGap(0, 0, Short.MAX_VALUE)
                                            .addComponent(scrollPane3, GroupLayout.PREFERRED_SIZE, 76,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(0, 0, Short.MAX_VALUE)))
                            .addGap(0, 76, Short.MAX_VALUE));
                }

                GroupLayout jPanelContainerTabbedPaneLayout = new GroupLayout(jPanelContainerTabbedPane);
                jPanelContainerTabbedPaneLayout.setHorizontalGroup(jPanelContainerTabbedPaneLayout
                        .createParallelGroup(Alignment.LEADING)
                        .addGroup(jPanelContainerTabbedPaneLayout.createSequentialGroup().addContainerGap()
                                .addGroup(jPanelContainerTabbedPaneLayout.createParallelGroup(Alignment.LEADING)
                                        .addComponent(tabbedPane2, GroupLayout.PREFERRED_SIZE, 686,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addComponent(panelConsole, GroupLayout.DEFAULT_SIZE, 708,
                                                Short.MAX_VALUE))
                                .addContainerGap()));
                jPanelContainerTabbedPaneLayout.setVerticalGroup(jPanelContainerTabbedPaneLayout
                        .createParallelGroup(Alignment.LEADING)
                        .addGroup(jPanelContainerTabbedPaneLayout.createSequentialGroup().addGap(3)
                                .addComponent(tabbedPane2, GroupLayout.PREFERRED_SIZE, 384,
                                        GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(ComponentPlacement.RELATED)
                                .addComponent(panelConsole, GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)));
                jPanelContainerTabbedPane.setLayout(jPanelContainerTabbedPaneLayout);
            }
            {
                jPanelDeploying = new JPanel();
                tabbedPane2.addTab("Simulation Jar", null, jPanelDeploying, null);
                GroupLayout jPanelDeployingLayout = new GroupLayout(jPanelDeploying);
                jPanelDeploying.setLayout(jPanelDeployingLayout);
                {
                    jButtonLoadJar = new JButton();
                    jButtonLoadJar.setText("Load Jar");
                    jButtonLoadJar.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent evt) {

                            if (simulationFile != null) {

                                File dest = new File(FTP_HOME + dirSeparator + SIMULATION_DIR + dirSeparator
                                        + simulationFile.getName());
                                try {
                                    FileUtils.copyFile(simulationFile, dest);

                                    Digester dg = new Digester(DigestAlgorithm.MD5);

                                    InputStream in = new FileInputStream(dest);

                                    Properties prop = new Properties();

                                    try {

                                        prop.setProperty("MD5", dg.getDigest(in));

                                        String fileName = FilenameUtils
                                                .removeExtension(simulationFile.getName());
                                        //save properties to project root folder
                                        prop.store(new FileOutputStream(FTP_HOME + dirSeparator + SIMULATION_DIR
                                                + dirSeparator + fileName + ".hash"), null);

                                    } catch (IOException ex) {
                                        ex.printStackTrace();
                                    }

                                    System.out.println("MD5: " + dg.getDigest(in));

                                    loadSimulation();
                                } catch (IOException e) {
                                    // TODO Auto-generated catch block
                                    e.printStackTrace();
                                }
                            }
                        }
                    });

                }

                jPanelDeployingLayout.setVerticalGroup(jPanelDeployingLayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(jPanelDeployingLayout.createParallelGroup().addGroup(
                                GroupLayout.Alignment.LEADING,
                                jPanelDeployingLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                        .addComponent(jButtonLoadJar, GroupLayout.Alignment.BASELINE,
                                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addComponent(getJTextFieldPathSimJar(), GroupLayout.Alignment.BASELINE,
                                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.PREFERRED_SIZE))
                                .addComponent(getJButtonChoseSimJar(), GroupLayout.Alignment.LEADING,
                                        GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 286,
                                GroupLayout.PREFERRED_SIZE));
                jPanelDeployingLayout
                        .setHorizontalGroup(jPanelDeployingLayout.createSequentialGroup().addGap(22, 22, 22)
                                .addComponent(getJTextFieldPathSimJar(), GroupLayout.PREFERRED_SIZE, 202,
                                        GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(getJButtonChoseSimJar(), GroupLayout.PREFERRED_SIZE, 27,
                                        GroupLayout.PREFERRED_SIZE)
                                .addGap(24)
                                .addComponent(jButtonLoadJar, GroupLayout.PREFERRED_SIZE, 146,
                                        GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 155, Short.MAX_VALUE));
            }

            jPanelRunBatchTests = new JPanel();
            tabbedPane2.addTab("Run batch tests", null, jPanelRunBatchTests, null);

            JLabel lblSelectConfigurationFile = new JLabel("Select configuration file:");

            textFieldConfigFilePath = new JTextField();
            textFieldConfigFilePath.setColumns(10);

            JButton buttonChooseConfigFile = new JButton();
            buttonChooseConfigFile.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent arg0) {

                    configFile = showFileChooser();
                    if (configFile != null)
                        textFieldConfigFilePath.setText(configFile.getAbsolutePath());
                }
            });
            buttonChooseConfigFile.setIcon(new ImageIcon("it/isislab/dmason/resources/image/openFolder.png"));

            JButton buttonLoadConfig = new JButton("Start");
            buttonLoadConfig.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {

                    try {
                        if (configFile.getName().contains(".xml")) {
                            ClassLoader.getSystemClassLoader();
                            //File xsd = new File(xsdFilename);
                            InputStream xsd = new FileInputStream("resources/batch/batchSchema.xsd");

                            if (xsd != null) {
                                if (validateXML(configFile, xsd)) {

                                    Batch batch = loadConfigFromXML(configFile);

                                    if (batch != null) {
                                        textAreaBatchInfo.append(configFile.getName() + " loaded.\n");
                                        if (batch.getNeededWorkers() > peers.size()
                                                || batch.getNeededWorkers() == 0)
                                            JOptionPane.showMessageDialog(DMasonMaster.this,
                                                    "There are not enough workers to start the simulation");
                                        else {
                                            textAreaBatchInfo
                                                    .append("Simulation: " + batch.getSimulationName() + "\n");
                                            textAreaBatchInfo.append(
                                                    "Needed Worker: " + batch.getNeededWorkers() + "\n");
                                            textAreaBatchInfo.append("Balance: " + batch.isBalanced() + "\n");

                                            Set<List<EntryParam<String, Object>>> testList = generateTestsFrom(
                                                    batch);

                                            textAreaBatchInfo
                                                    .append("--------------------------------------\n");
                                            textAreaBatchInfo
                                                    .append("Number of experiments: " + testList.size() + "\n");
                                            ConcurrentLinkedQueue<List<EntryParam<String, Object>>> testQueue = new ConcurrentLinkedQueue<List<EntryParam<String, Object>>>();

                                            for (List<EntryParam<String, Object>> test : testList)
                                                testQueue.offer(test);

                                            //System.out.println("Test queue: "+testQueue.size());

                                            try {

                                                List<List<EntryWorkerScore<Integer, String>>> workersPartition = Util
                                                        .chopped(scoreList, batch.getNeededWorkers());

                                                //System.out.println(workersPartition.toString());

                                                testCount.set(0);
                                                totalTests = testList.size();

                                                progressBarBatchTest.setValue(0);
                                                progressBarBatchTest.setString("0 %");
                                                progressBarBatchTest.setStringPainted(true);

                                                batchLogger = Logger
                                                        .getLogger(BatchExecutor.class.getCanonicalName());
                                                batchStartedTime = System.currentTimeMillis();

                                                textAreaBatchInfo.append("Batch started at: "
                                                        + Util.getCurrentDateTime(batchStartedTime) + "\n");
                                                textAreaBatchInfo
                                                        .append("--------------------------------------\n");
                                                batchLogger.debug("Started at: " + batchStartedTime);
                                                int i = 1;
                                                BatchExecutor batchExec;
                                                for (List<EntryWorkerScore<Integer, String>> workers : workersPartition) {
                                                    try {

                                                        batchExec = new BatchExecutor(batch.getSimulationName(),
                                                                batch.isBalanced(), testQueue, master,
                                                                connection, root.getChildCount(),
                                                                getFPTAddress(), workers, "Batch" + i, 1,
                                                                textAreaBatchInfo);

                                                        batchExec.getObservable()
                                                                .addObserver(DMasonMaster.this);
                                                        batchExec.start();

                                                        //Thread.sleep(2000);
                                                        //textAreaBatchInfo.append("Batch Executor "+i+" started\n");

                                                        i++;

                                                        //not paraller simulation, I use only one batch executor
                                                        if (!chckbxParallelBatch.isSelected())
                                                            break;
                                                    } catch (Exception e1) {
                                                        // TODO Auto-generated catch block
                                                        e1.printStackTrace();
                                                    }

                                                }

                                            } catch (Exception e3) {
                                                // TODO Auto-generated catch block
                                                e3.printStackTrace();
                                            }

                                        }

                                    } else
                                        JOptionPane.showMessageDialog(DMasonMaster.this,
                                                "Error when loading config file");
                                } else
                                    JOptionPane.showMessageDialog(DMasonMaster.this,
                                            "The configuration file is not a valid file");
                            } else
                                JOptionPane.showMessageDialog(DMasonMaster.this,
                                        xsdFilename + " not exists, can't validate configuration file.");
                        } else
                            JOptionPane.showMessageDialog(DMasonMaster.this,
                                    "The file " + configFile.getName() + "is not a configuration file.");
                    } catch (HeadlessException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }

                }

            });

            JPanel panel = new JPanel();
            panel.setBorder(
                    new TitledBorder(null, "Batch Status", TitledBorder.LEADING, TitledBorder.TOP, null, null));

            chckbxParallelBatch = new JCheckBox("Parallel Batch");

            GroupLayout gl_jPanelRunBatchTests = new GroupLayout(jPanelRunBatchTests);
            gl_jPanelRunBatchTests.setHorizontalGroup(gl_jPanelRunBatchTests
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_jPanelRunBatchTests.createSequentialGroup().addContainerGap()
                            .addGroup(gl_jPanelRunBatchTests.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_jPanelRunBatchTests.createSequentialGroup()
                                            .addComponent(lblSelectConfigurationFile,
                                                    GroupLayout.PREFERRED_SIZE, 139, GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED)
                                            .addComponent(textFieldConfigFilePath, GroupLayout.PREFERRED_SIZE,
                                                    250, GroupLayout.PREFERRED_SIZE)
                                            .addGap(10).addComponent(buttonChooseConfigFile,
                                                    GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))
                                    .addGroup(gl_jPanelRunBatchTests.createSequentialGroup()
                                            .addComponent(chckbxParallelBatch).addGap(18)
                                            .addComponent(buttonLoadConfig))
                                    .addComponent(panel, GroupLayout.PREFERRED_SIZE, 666,
                                            GroupLayout.PREFERRED_SIZE))
                            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
            gl_jPanelRunBatchTests.setVerticalGroup(gl_jPanelRunBatchTests
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_jPanelRunBatchTests.createSequentialGroup().addContainerGap()
                            .addGroup(gl_jPanelRunBatchTests.createParallelGroup(Alignment.TRAILING)
                                    .addComponent(buttonChooseConfigFile, GroupLayout.PREFERRED_SIZE, 25,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(textFieldConfigFilePath, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblSelectConfigurationFile))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_jPanelRunBatchTests.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(chckbxParallelBatch).addComponent(buttonLoadConfig))
                            .addPreferredGap(ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
                            .addComponent(panel, GroupLayout.PREFERRED_SIZE, 261, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap()));

            progressBarBatchTest = new JProgressBar();

            JLabel lblProgress = new JLabel("Progress:");
            GroupLayout gl_panel = new GroupLayout(panel);
            gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addGroup(gl_panel
                    .createSequentialGroup().addContainerGap()
                    .addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
                            .addComponent(scrollPane4, GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE)
                            .addGroup(gl_panel.createSequentialGroup().addComponent(lblProgress).addGap(18)
                                    .addComponent(progressBarBatchTest, GroupLayout.PREFERRED_SIZE, 169,
                                            GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
            gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panel.createSequentialGroup().addContainerGap()
                            .addGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(lblProgress)
                                    .addComponent(progressBarBatchTest, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(scrollPane4, GroupLayout.PREFERRED_SIZE, 202,
                                    GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
            panel.setLayout(gl_panel);
            jPanelRunBatchTests.setLayout(gl_jPanelRunBatchTests);
            GroupLayout jPanelSetDistributionLayout = new GroupLayout(jPanelSetDistribution);
            jPanelSetDistributionLayout
                    .setHorizontalGroup(
                            jPanelSetDistributionLayout.createParallelGroup(Alignment.LEADING)
                                    .addGroup(jPanelSetDistributionLayout.createSequentialGroup()
                                            .addComponent(jPanelSettings, GroupLayout.PREFERRED_SIZE, 254,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED)
                                            .addComponent(jPanelContainerTabbedPane, GroupLayout.PREFERRED_SIZE,
                                                    707, GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(21, Short.MAX_VALUE)));
            jPanelSetDistributionLayout.setVerticalGroup(jPanelSetDistributionLayout
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(jPanelSetDistributionLayout.createSequentialGroup()
                            .addGroup(jPanelSetDistributionLayout.createParallelGroup(Alignment.LEADING)
                                    .addComponent(jPanelSettings, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPanelContainerTabbedPane, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addContainerGap()));
            jPanelSetDistribution.setLayout(jPanelSetDistributionLayout);
        }

        textAreaBatchInfo = new JTextArea();
        textAreaBatchInfo.setEditable(false);
        DefaultCaret caret = (DefaultCaret) textAreaBatchInfo.getCaret();
        caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
        scrollPane4.setViewportView(textAreaBatchInfo);

        //---- jLabelPlayButton ----
        jLabelPlayButton.setIcon(new ImageIcon("resources/image/NotStopped.png"));

        //---- jLabelPauseButton ----
        jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png"));

        //---- labelStopButton ----
        jLabelPlayButton.setIcon(new ImageIcon("image/NotPlaying.png"));

        jLabelPlayButton.addMouseListener(new MouseListener() {

            @Override
            public void mouseReleased(MouseEvent arg0) {
            }

            @Override
            public void mousePressed(MouseEvent arg0) {
            }

            @Override
            public void mouseExited(MouseEvent arg0) {
            }

            @Override
            public void mouseEntered(MouseEvent arg0) {
            }

            @Override
            public void mouseClicked(MouseEvent arg0) {

                jLabelPlayButton.setIcon(new ImageIcon("resources/image/Playing.png"));
                jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png"));
                jLabelStopButton.setIcon(new ImageIcon("resources/image/NotStopped.png"));
                jLabelResetButton.setIcon(new ImageIcon("resources/image/NotReload.png"));
                try {

                    master.play();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });

        //---- labelStopButton2 ----   
        jLabelStopButton.setIcon(new ImageIcon("resources/image/NotStopped.png"));
        jLabelStopButton.addMouseListener(new MouseListener() {

            @Override
            public void mouseReleased(MouseEvent e) {
            }

            @Override
            public void mousePressed(MouseEvent e) {
            }

            @Override
            public void mouseExited(MouseEvent e) {
            }

            @Override
            public void mouseEntered(MouseEvent e) {
            }

            @Override
            public void mouseClicked(MouseEvent e) {
                jLabelStopButton.setIcon(new ImageIcon("resources/image/Stopped.png"));
                jLabelPlayButton.setIcon(new ImageIcon("resources/image/NotPlaying.png"));
                jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png"));

                try {

                    Address FTPAddress = getFPTAddress();

                    if (FTPAddress != null) {
                        UpdateData ud = new UpdateData("", FTPAddress);
                        master.stop(ud);
                    }

                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        });

        //---- labelPauseButton ----
        jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png"));
        jLabelPauseButton.addMouseListener(new MouseListener() {

            @Override
            public void mouseReleased(MouseEvent e) {
            }

            @Override
            public void mousePressed(MouseEvent e) {
            }

            @Override
            public void mouseExited(MouseEvent e) {
            }

            @Override
            public void mouseEntered(MouseEvent e) {
            }

            @Override
            public void mouseClicked(MouseEvent e) {
                jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOn.png"));
                jLabelStopButton.setIcon(new ImageIcon("resources/image/NotStopped.png"));
                jLabelPlayButton.setIcon(new ImageIcon("resources/image/NotPlaying.png"));
                try {
                    master.pause();
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        });

        //======== jPanelNumStep ========
        {

            GroupLayout jPanelNumStepLayout = new GroupLayout(jPanelNumStep);
            jPanelNumStepLayout.setHorizontalGroup(
                    jPanelNumStepLayout.createParallelGroup(Alignment.TRAILING).addGap(0, 25, Short.MAX_VALUE));
            jPanelNumStepLayout.setVerticalGroup(
                    jPanelNumStepLayout.createParallelGroup(Alignment.LEADING).addGap(0, 28, Short.MAX_VALUE));
            jPanelNumStep.setLayout(jPanelNumStepLayout);
            jPanelNumStep.setPreferredSize(new java.awt.Dimension(89, 23));
        }
        {
            jLabelResetButton = new JLabel();
            jLabelResetButton.setIcon(new ImageIcon("resources/image/NotReload.png"));
            jLabelResetButton.setPreferredSize(new java.awt.Dimension(20, 20));

            jLabelResetButton.setVisible(enableReset);
        }

        // for resetting simulation
        jLabelResetButton.addMouseListener(new MouseListener() {

            @Override
            public void mouseClicked(MouseEvent arg0) {

                if (connected) {
                    jLabelStopButton.setIcon(new ImageIcon("resources/image/NotStopped.png"));
                    jLabelPlayButton.setIcon(new ImageIcon("resources/image/NotPlaying.png"));
                    jLabelPauseButton.setIcon(new ImageIcon("resources/image/PauseOff.png"));
                    jLabelResetButton.setIcon(new ImageIcon("resources/image/Reload.png"));

                    //send message to workers for resetting simulation
                    try {
                        master.reset();

                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }

                    //clean up topic from AcitveMQ
                    connection.resetTopic();

                    setSystemSettingsEnabled(true);

                    notifyArea.append("Simulation resetted\n");

                }

            }

            @Override
            public void mouseEntered(MouseEvent arg0) {
                // TODO Auto-generated method stub

            }

            @Override
            public void mouseExited(MouseEvent arg0) {
                // TODO Auto-generated method stub

            }

            @Override
            public void mousePressed(MouseEvent arg0) {
                // TODO Auto-generated method stub

            }

            @Override
            public void mouseReleased(MouseEvent arg0) {
                // TODO Auto-generated method stub

            }
        });
        writeStepLabel = new JLabel();
        writeStepLabel.setText("0");

        lblTotalSteps = new JLabel("Steps:");

        GroupLayout panelMainLayout = new GroupLayout(panelMain);
        panelMainLayout.setHorizontalGroup(panelMainLayout.createParallelGroup(Alignment.LEADING)
                .addGroup(panelMainLayout.createSequentialGroup()
                        .addComponent(jPanelContainerSettings, GroupLayout.PREFERRED_SIZE, 0,
                                GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addGroup(panelMainLayout.createParallelGroup(Alignment.LEADING)
                                .addComponent(jPanelSetDistribution, 0, 986, Short.MAX_VALUE)
                                .addGroup(panelMainLayout.createSequentialGroup().addGap(636)
                                        .addGroup(panelMainLayout.createParallelGroup(Alignment.TRAILING)
                                                .addComponent(jLabelStep, GroupLayout.PREFERRED_SIZE,
                                                        GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                                                .addGroup(panelMainLayout.createSequentialGroup()
                                                        .addComponent(lblTotalSteps)
                                                        .addPreferredGap(ComponentPlacement.UNRELATED)
                                                        .addComponent(writeStepLabel)))
                                        .addPreferredGap(ComponentPlacement.RELATED)
                                        .addComponent(jPanelNumStep, GroupLayout.PREFERRED_SIZE, 25,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addGroup(panelMainLayout.createParallelGroup(Alignment.LEADING)
                                                .addGroup(panelMainLayout.createSequentialGroup().addGap(24)
                                                        .addComponent(jLabelPlayButton,
                                                                GroupLayout.PREFERRED_SIZE,
                                                                GroupLayout.PREFERRED_SIZE,
                                                                GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(ComponentPlacement.UNRELATED)
                                                        .addComponent(jLabelPauseButton,
                                                                GroupLayout.PREFERRED_SIZE,
                                                                GroupLayout.PREFERRED_SIZE,
                                                                GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(ComponentPlacement.UNRELATED)
                                                        .addComponent(jLabelStopButton,
                                                                GroupLayout.PREFERRED_SIZE,
                                                                GroupLayout.PREFERRED_SIZE,
                                                                GroupLayout.PREFERRED_SIZE))
                                                .addGroup(panelMainLayout.createSequentialGroup().addGap(116)
                                                        .addComponent(jLabelResetButton,
                                                                GroupLayout.PREFERRED_SIZE, 30,
                                                                GroupLayout.PREFERRED_SIZE)))))
                        .addGap(12))
                .addComponent(jPanelContainerConnection, 0, 1004, Short.MAX_VALUE));
        panelMainLayout.setVerticalGroup(panelMainLayout.createParallelGroup(Alignment.LEADING)
                .addGroup(panelMainLayout.createSequentialGroup()
                        .addComponent(jPanelContainerConnection, GroupLayout.PREFERRED_SIZE, 71,
                                GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addGroup(panelMainLayout.createParallelGroup(Alignment.LEADING)
                                .addComponent(jPanelSetDistribution, GroupLayout.PREFERRED_SIZE, 518,
                                        GroupLayout.PREFERRED_SIZE)
                                .addGroup(panelMainLayout.createSequentialGroup().addGap(29).addComponent(
                                        jPanelContainerSettings, GroupLayout.PREFERRED_SIZE, 489,
                                        GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addGroup(panelMainLayout.createParallelGroup(Alignment.LEADING)
                                .addComponent(jLabelStopButton, GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabelPlayButton, GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabelPauseButton, GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabelResetButton, GroupLayout.PREFERRED_SIZE, 24,
                                        GroupLayout.PREFERRED_SIZE)
                                .addGroup(panelMainLayout.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(writeStepLabel, GroupLayout.PREFERRED_SIZE, 16,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addComponent(lblTotalSteps))
                                .addGroup(panelMainLayout.createSequentialGroup()
                                        .addComponent(jLabelStep, GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(ComponentPlacement.RELATED).addComponent(jPanelNumStep,
                                                GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(13, Short.MAX_VALUE)));
        panelMain.setLayout(panelMainLayout);
    }

    GroupLayout contentPaneLayout = new GroupLayout(contentPane);
    contentPaneLayout.setHorizontalGroup(
            contentPaneLayout.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING,
                    contentPaneLayout
                            .createSequentialGroup().addContainerGap().addComponent(panelMain,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addContainerGap()));
    contentPaneLayout.setVerticalGroup(
            contentPaneLayout.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING,
                    contentPaneLayout.createSequentialGroup().addContainerGap().addComponent(panelMain,
                            GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    contentPane.setLayout(contentPaneLayout);
    pack();
    setLocationRelativeTo(null);

    refreshServerLabel.setVisible(false);

    jButtonChoseSimJar.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent arg0) {
            simulationFile = showFileChooser();
            if (simulationFile != null)
                jTextFieldPathSimJar.setText(simulationFile.getAbsolutePath());
        }
    });

}

From source file:nz.ac.massey.cs.gql4jung.browser.ResultBrowser.java

private void initStatusBar() {
    this.cursorField = new JLabel();
    this.queryField = new JLabel();
    this.dataField = new JLabel();
    this.statusField = new JProgressBar();
    statusField.setStringPainted(true);/*w  ww  .j a  v a  2  s  .  c  o  m*/
    statusField.setBorderPainted(true);

    this.timeField = new JLabel();
    Font font = new Font("monospaced", Font.PLAIN, this.cursorField.getFont().getSize());
    this.cursorField.setFont(font);
    this.dataField.setFont(font);
    this.queryField.setFont(font);
    this.timeField.setFont(font);
    this.statusField.setFont(font);

    JPanel statusBar = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    int cols = 6;
    c.insets = new Insets(0, 3, 0, 3);
    c.gridx = 0;
    c.gridy = 0;
    c.fill = c.NONE;
    c.weightx = 0;
    c.anchor = c.EAST;
    c.gridwidth = 1;
    statusBar.add(new JLabel("data:", JLabel.RIGHT), c);
    c.gridx = 1;
    c.fill = c.HORIZONTAL;
    c.weightx = 1;
    c.anchor = c.WEST;
    c.gridwidth = cols - 1;
    statusBar.add(dataField, c);
    c.gridx = 0;
    c.gridy = 1;
    c.fill = c.NONE;
    c.weightx = 0;
    c.anchor = c.EAST;
    c.gridwidth = 1;
    statusBar.add(new JLabel("query:", JLabel.RIGHT), c);
    c.gridx = 1;
    c.fill = c.HORIZONTAL;
    c.weightx = 1;
    c.anchor = c.WEST;
    c.gridwidth = cols - 1;
    statusBar.add(queryField, c);

    c.gridx = 0;
    c.gridy = 2;
    c.fill = c.NONE;
    c.weightx = 0;
    c.anchor = c.EAST;
    c.gridwidth = 1;
    statusBar.add(new JLabel("status:", JLabel.RIGHT), c);
    c.gridx = 1;
    c.fill = c.HORIZONTAL;
    c.weightx = 1;
    c.anchor = c.WEST;
    statusBar.add(statusField, c);

    c.gridx = 2;
    c.gridy = 2;
    c.fill = c.NONE;
    c.weightx = 0;
    c.anchor = c.EAST;
    c.gridwidth = 1;
    statusBar.add(new JLabel("cursor:", JLabel.RIGHT), c);
    c.gridx = 3;
    c.fill = c.HORIZONTAL;
    c.weightx = 1;
    c.anchor = c.WEST;
    statusBar.add(cursorField, c);

    c.gridx = 4;
    c.gridy = 2;
    c.fill = c.NONE;
    c.weightx = 0;
    c.anchor = c.EAST;
    c.gridwidth = 1;
    statusBar.add(new JLabel("computation time:", JLabel.RIGHT), c);
    c.gridx = 5;
    c.fill = c.HORIZONTAL;
    c.weightx = 1;
    c.anchor = c.WEST;
    statusBar.add(timeField, c);

    mainPanel.add(statusBar, BorderLayout.SOUTH);
    statusBar.setBorder(BorderFactory.createEtchedBorder());
}

From source file:ome.formats.importer.gui.ErrorTable.java

/**
 * Constructor for class//from w w  w.  j  a  va  2 s  .  com
 */
public ErrorTable() {
    // set to layout that will maximize on resizing
    setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
    this.setOpaque(false);

    // Main Panel containing all elements  
    // Set up the main panel layout
    double mainTable[][] = { { 5, 200, 140, TableLayout.FILL, 140, 5 }, // columns
            { 5, TableLayout.PREFERRED, TableLayout.FILL, 5, 29, 5 } }; // rows

    mainPanel = GuiCommonElements.addMainPanel(this, mainTable, 0, 0, 0, 0, debug);

    String message = "All errors accumulated during your import are displayed here, "
            + "and will be uploaded to us if check-marked. You can send us feedback on "
            + "these problems by clicking the 'Send Feedback' button.";

    JTextPane instructions = GuiCommonElements.addTextPane(mainPanel, message, "1,1,4,0", debug);
    instructions.setMargin(new Insets(10, 10, 10, 10));

    TableColumnModel cModel = eTable.getColumnModel();

    // *** remove last 3 rows from display ***
    TableColumn hiddenColumn = cModel.getColumn(6);
    cModel.removeColumn(hiddenColumn);
    hiddenColumn = cModel.getColumn(5);
    cModel.removeColumn(hiddenColumn);
    hiddenColumn = cModel.getColumn(4);
    cModel.removeColumn(hiddenColumn);

    MyTableHeaderRenderer myHeader = new MyTableHeaderRenderer();
    //LeftTableHeaderRenderer leftHeader = new LeftTableHeaderRenderer();

    // Create a custom header for the table
    cModel.getColumn(0).setHeaderRenderer(myHeader);
    cModel.getColumn(1).setHeaderRenderer(myHeader);
    cModel.getColumn(2).setHeaderRenderer(myHeader);
    cModel.getColumn(3).setHeaderRenderer(myHeader);

    cbe = new CheckboxCellEditor(new JCheckBox());
    cbe.checkbox.addMouseListener(this);
    cbr = new CheckboxRenderer();

    cModel.getColumn(0).setCellEditor(cbe);
    cModel.getColumn(0).setCellRenderer(cbr);
    cModel.getColumn(1).setCellRenderer(new LeftDotRenderer());
    cModel.getColumn(2).setCellRenderer(new TextLeftRenderer());
    cModel.getColumn(3).setCellRenderer(new StatusRenderer());

    // Set the width of the status column
    TableColumn statusColumn = eTable.getColumnModel().getColumn(3);
    statusColumn.setPreferredWidth(statusWidth);
    statusColumn.setMaxWidth(statusWidth);
    statusColumn.setMinWidth(statusWidth);

    // Set the width of the error column
    TableColumn dateColumn = eTable.getColumnModel().getColumn(2);
    dateColumn.setPreferredWidth(errorWidth);
    dateColumn.setMaxWidth(errorWidth);
    dateColumn.setMinWidth(errorWidth);

    // Set the width of the upload column
    TableColumn uploadColumn = eTable.getColumnModel().getColumn(0);
    uploadColumn.setPreferredWidth(uploadWidth);
    uploadColumn.setMaxWidth(uploadWidth);
    uploadColumn.setMinWidth(uploadWidth);

    eTable.setRowSelectionAllowed(false);

    // Add the table to the scollpane
    JScrollPane scrollPane = new JScrollPane(eTable);

    mainPanel.add(scrollPane, "1,2,4,1");

    double progressTable[][] = { { 200 }, // columns
            { 12, 5, 12 } }; // rows

    progressPanel = GuiCommonElements.addPlanePanel(mainPanel, progressTable, debug);

    runThread = new Thread() {
        public void run() {
            try {
                bytesProgressBar = new JProgressBar();
                progressPanel.add(bytesProgressBar, "0,0");

                filesProgressBar = new JProgressBar(0, 20);
                progressPanel.add(filesProgressBar, "0,2");
            } catch (Throwable error) {
            }
        }
    };
    runThread.start();

    mainPanel.add(progressPanel, "1,4");

    progressPanel.setVisible(false);

    cancelBtn = GuiCommonElements.addButton(mainPanel, "Cancel", 'c', "Cancel sending", "2,4,L,C", debug);
    cancelBtn.addActionListener(this);

    cancelBtn.setVisible(false);

    clearDoneBtn = GuiCommonElements.addButton(mainPanel, "Clear Done", 'd', "Clear done", "3,4,R,C", debug);
    clearDoneBtn.addActionListener(this);
    clearDoneBtn.setOpaque(false);
    clearDoneBtn.setEnabled(false);
    //clearDoneBtn.setVisible(false); // Disabled (See #5250)

    sendBtn = GuiCommonElements.addButton(mainPanel, "Send Feedback", 's', "Send your errors to the OMERO team",
            "4,4,R,C", debug);
    sendBtn.setOpaque(false);
    sendBtn.addActionListener(this);
    sendBtn.setEnabled(false);

    this.add(mainPanel);
}

From source file:ome.formats.importer.gui.FileQueueHandler.java

@SuppressWarnings("unchecked")
public void update(IObservable observable, ImportEvent event) {
    final OMEROMetadataStoreClient store = viewer.getLoginHandler().getMetadataStore();

    if (event instanceof ome.formats.importer.util.ErrorHandler.EXCEPTION_EVENT) {
        viewer.getErrorHandler().update(observable, event);

        if (event instanceof ome.formats.importer.util.ErrorHandler.UNKNOWN_FORMAT
                && fileChooser.getSelectedFiles().length == 1 && fileChooser.getSelectedFile().isFile()) {
            JOptionPane.showMessageDialog(viewer,
                    "This file's format is not recognized. \n" + "Perhaps the file is damaged?",
                    "Unknown Format", JOptionPane.WARNING_MESSAGE);
        }//from   w  ww  .java  2 s.  c om

        if (event instanceof ome.formats.importer.util.ErrorHandler.FILE_EXCEPTION) {
            candidatesFormatException = true;
        }
    }

    if (event instanceof ome.formats.importer.util.ErrorHandler.MISSING_LIBRARY) {
        JOptionPane.showMessageDialog(viewer, "You appear to be missing a required library needed for \n"
                + "this file import. See the debug log messages for details.");
    }

    else if (event instanceof ImportCandidates.SCANNING) {
        addEnabled(false);

        ImportCandidates.SCANNING ev = (ImportCandidates.SCANNING) event;
        if (scanEx.isShutdown() || cancelScan) {
            log.info("Cancelling scan");
            ev.cancel();
            cancelScan = false;
        }

        if (ev.totalFiles < 0) {
            if (progressDialog == null) {
                double layoutTable[][] = { { 10, 180, 100, 10 }, // columns
                        { 5, 20, 5, 30, 5 } }; // rows

                progressDialog = new JDialog(viewer, "Processing Files");
                progressDialog.setSize(300, 90);
                progressDialog.setLocationRelativeTo(viewer);
                TableLayout layout = new TableLayout(layoutTable);
                progressDialog.setLayout(layout);
                directoryProgressBar = new JProgressBar();
                directoryProgressBar.setString("Please wait.");
                directoryProgressBar.setStringPainted(true);
                directoryProgressBar.setIndeterminate(true);
                progressDialog.add(directoryProgressBar, "1,1,2,1");
                JButton cancelBtn = new JButton("Cancel");

                progressDialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);

                cancelBtn.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent event) {
                        cancelScan = true;
                        progressDialog.dispose();
                        progressDialog = null;
                        addEnabled(true);
                    }
                });

                progressDialog.add(cancelBtn, "2,3,R,C");
                progressDialog.getRootPane().setDefaultButton(cancelBtn);
                progressDialog.setVisible(true);
                progressDialog.toFront();
            }
        } else {
            if (progressDialog != null) {
                updateProgress(ev.totalFiles, ev.numFiles);
            }

            if (ev.totalFiles == ev.numFiles && progressDialog != null) {
                progressDialog.dispose();
                progressDialog = null;
                addEnabled(true);
            }
        }

        viewer.appendToOutput(
                "Processing files: Scanned " + ev.numFiles + " of " + ev.totalFiles + " total.\n");

        log.debug(ev.toLog());

    }

    else if (event instanceof ImportEvent.REIMPORT) {

        String objectName = "", projectName = "", fileName = "";
        Long objectID = 0L, projectID = 0L;
        File file = null;
        Integer finalCount = 0;
        IObject object;

        int[] selectedRows = null;

        if (historyTable != null)
            selectedRows = historyTable.eTable.getSelectedRows();

        for (int r : selectedRows) {
            Vector row = new Vector();

            objectID = (Long) historyTable.table.getValueAt(r, 5);
            projectID = (Long) historyTable.table.getValueAt(r, 6);

            fileName = (String) historyTable.table.getValueAt(r, 0);
            file = new File((String) historyTable.table.getValueAt(r, 4));

            if (projectID == null || projectID == 0) {
                object = null;

                try {
                    object = store.getTarget(Screen.class, objectID);
                    objectName = ((Screen) object).getName().getValue();
                } catch (Exception e) {
                    log.warn("Failed to retrieve screen: " + objectID, e);
                    continue;
                }
            } else {
                object = null;
                try {
                    object = store.getTarget(Dataset.class, objectID);
                    objectName = ((Dataset) object).getName().getValue();
                } catch (Exception e) {
                    log.warn("Failed to retrieve dataset: " + objectID, e);
                    continue;
                }

                try {
                    projectName = store.getProject(projectID).getName().getValue();
                } catch (Exception e) {
                    log.warn("Failed to retrieve project: " + projectID, e);
                    continue;
                }
            }

            // TODO: The 6th parameter should be 'format', not 'fileName'!
            ImportContainer container = new ImportContainer(file, projectID, object, cancelScan, null, fileName,
                    null, cancelScan);

            finalCount = finalCount + 1;

            Double[] pixelSizes = new Double[] { 1.0, 1.0, 1.0 };

            row.add(fileName);
            if (projectID == null || projectID == 0) {
                row.add(objectName);
            } else {
                row.add(projectName + "/" + objectName);
            }
            // WHY ISN'T THIS CODE USING addFiletoQueue?!!?
            row.add("added");
            row.add(container);
            row.add(file);
            row.add(false);
            row.add(projectID);
            row.add(pixelSizes);
            qTable.getTable().addRow(row);
        }

        if (finalCount == 0) {
            JOptionPane.showMessageDialog(viewer,
                    "None of the images in this history\n" + "list can be reimported.");
        } else if (finalCount == 1) {
            JOptionPane.showMessageDialog(viewer, "One of the images in this history list has been\n"
                    + "re-added to the import queue for reimport.");
        } else if (finalCount > 1) {
            JOptionPane.showMessageDialog(viewer,
                    finalCount + " images in this history list have been re-added\n"
                            + "to the import queue for reimport.");
        }

        if (qTable.getTable().getRowCount() > 0)
            qTable.importBtn.setEnabled(true);
        qTable.importBtn.doClick();
    }
}

From source file:ome.formats.importer.gui.StatusBar.java

/**
 * Initializes the components.//from  w  ww  .ja va2 s.  c  o m
 * 
 * @param statusIcon The icon displayed in the left corner.
 */
private void initComponents() {
    progressBar = new JProgressBar();
    status = new JLabel();
    status.setFont(getFont().deriveFont(11.0f));
}

From source file:op.FrmMain.java

/**
 * This method is called from within the constructor to
 * initialize the form.//from  ww w .j  ava2 s .c o  m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the PrinterForm Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    pnlMain = new JPanel();
    pnlMainMessage = new JPanel();
    btnTX = new JButton();
    panel1 = new JPanel();
    pnlIcons = new JPanel();
    lblMainMsg = new JLabel();
    btnExit = new JButton();
    lblSubMsg = new JideLabel();
    btnHelp = new JButton();
    pbMsg = new JProgressBar();
    btnReload = new JButton();
    splitPaneLeft = new JideSplitPane();
    pnlCard = new JPanel();
    pnlWait = new JPanel();
    lblWait = new JLabel();
    pbTimeout = new JProgressBar();
    panel2 = new JPanel();
    btnResetSplitpane = new JButton();
    statusBar = new StatusBar();

    //======== this ========
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Offene-Pflege.de");
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            thisWindowClosing(e);
        }
    });
    Container contentPane = getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS));

    //======== pnlMain ========
    {
        pnlMain.setLayout(new FormLayout("0dlu, $lcgap, pref, $lcgap, left:default:grow, 2*($rgap)",
                "$rgap, pref, $rgap, default:grow, 3dlu, $nlgap, bottom:pref, $lgap, 0dlu"));

        //======== pnlMainMessage ========
        {
            pnlMainMessage.setBackground(new Color(220, 223, 208));
            pnlMainMessage.setBorder(new SoftBevelBorder(SoftBevelBorder.RAISED));
            pnlMainMessage.setLayout(new FormLayout(
                    "0dlu, $lcgap, 23dlu, $lcgap, default:grow, $lcgap, min, $lcgap, 0dlu",
                    "0dlu, $lgap, 15dlu, $lgap, fill:11dlu, $lgap, fill:pref:grow, $lgap, pref, $lgap, 0dlu"));

            //---- btnTX ----
            btnTX.setIcon(new ImageIcon(getClass().getResource("/artwork/32x32/ambulance2.png")));
            btnTX.setBorder(null);
            btnTX.setBorderPainted(false);
            btnTX.setSelectedIcon(null);
            btnTX.setToolTipText("Verlegungsbericht drucken");
            btnTX.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnTX.setPressedIcon(
                    new ImageIcon(getClass().getResource("/artwork/32x32/ambulance2_pressed.png")));
            btnTX.setContentAreaFilled(false);
            btnTX.addActionListener(e -> btnTXActionPerformed(e));
            pnlMainMessage.add(btnTX, CC.xywh(3, 3, 1, 3));

            //======== panel1 ========
            {
                panel1.setOpaque(false);
                panel1.setLayout(new BoxLayout(panel1, BoxLayout.LINE_AXIS));

                //======== pnlIcons ========
                {
                    pnlIcons.setOpaque(false);
                    pnlIcons.setLayout(new BoxLayout(pnlIcons, BoxLayout.LINE_AXIS));
                }
                panel1.add(pnlIcons);

                //---- lblMainMsg ----
                lblMainMsg.setText("OPDE");
                lblMainMsg.setFont(new Font("Arial Rounded MT Bold", Font.PLAIN, 22));
                lblMainMsg.setForeground(new Color(105, 80, 69));
                lblMainMsg.setHorizontalAlignment(SwingConstants.CENTER);
                lblMainMsg.setIcon(null);
                lblMainMsg.setHorizontalTextPosition(SwingConstants.LEADING);
                panel1.add(lblMainMsg);
            }
            pnlMainMessage.add(panel1, CC.xy(5, 3, CC.CENTER, CC.DEFAULT));

            //---- btnExit ----
            btnExit.setIcon(new ImageIcon(getClass().getResource("/artwork/32x32/lock.png")));
            btnExit.setBorder(null);
            btnExit.setBorderPainted(false);
            btnExit.setOpaque(false);
            btnExit.setContentAreaFilled(false);
            btnExit.setToolTipText("Abmelden");
            btnExit.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnExit.setPressedIcon(new ImageIcon(getClass().getResource("/artwork/32x32/lock_pressed.png")));
            btnExit.addActionListener(e -> btnExitActionPerformed(e));
            pnlMainMessage.add(btnExit, CC.xywh(7, 3, 1, 3));

            //---- lblSubMsg ----
            lblSubMsg.setText("OPDE");
            lblSubMsg.setFont(new Font("Arial", Font.PLAIN, 14));
            lblSubMsg.setForeground(new Color(105, 80, 69));
            lblSubMsg.setHorizontalAlignment(SwingConstants.CENTER);
            lblSubMsg.setVerticalAlignment(SwingConstants.TOP);
            pnlMainMessage.add(lblSubMsg, CC.xywh(5, 5, 1, 3));

            //---- btnHelp ----
            btnHelp.setText(null);
            btnHelp.setIcon(new ImageIcon(getClass().getResource("/artwork/32x32/help.png")));
            btnHelp.setBorderPainted(false);
            btnHelp.setContentAreaFilled(false);
            btnHelp.setPressedIcon(new ImageIcon(getClass().getResource("/artwork/32x32/help_pressed.png")));
            btnHelp.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnHelp.addActionListener(e -> btnHelpActionPerformed(e));
            pnlMainMessage.add(btnHelp, CC.xywh(3, 7, 1, 3));

            //---- pbMsg ----
            pbMsg.setValue(50);
            pbMsg.setFont(new Font("Arial Rounded MT Bold", Font.PLAIN, 12));
            pbMsg.setForeground(new Color(105, 80, 69));
            pnlMainMessage.add(pbMsg, CC.xy(5, 9, CC.FILL, CC.FILL));

            //---- btnReload ----
            btnReload.setIcon(new ImageIcon(getClass().getResource("/artwork/32x32/reload0000.png")));
            btnReload.setBorder(null);
            btnReload.setBorderPainted(false);
            btnReload.setOpaque(false);
            btnReload.setContentAreaFilled(false);
            btnReload.setToolTipText("Ansicht aktualisieren");
            btnReload.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnReload
                    .setPressedIcon(new ImageIcon(getClass().getResource("/artwork/32x32/reload_pressed.png")));
            btnReload.addActionListener(e -> btnReloadActionPerformed(e));
            pnlMainMessage.add(btnReload, CC.xywh(7, 7, 1, 3));
        }
        pnlMain.add(pnlMainMessage, CC.xywh(3, 2, 4, 1, CC.DEFAULT, CC.FILL));

        //---- splitPaneLeft ----
        splitPaneLeft.setOneTouchExpandable(true);
        splitPaneLeft.setProportionalLayout(true);
        splitPaneLeft.setShowGripper(true);
        splitPaneLeft.addPropertyChangeListener("dividerLocation", e -> splitPaneLeftPropertyChange(e));
        pnlMain.add(splitPaneLeft, CC.xy(3, 4, CC.FILL, CC.FILL));

        //======== pnlCard ========
        {
            pnlCard.setLayout(new CardLayout());

            //======== pnlWait ========
            {
                pnlWait.setLayout(new BorderLayout());

                //---- lblWait ----
                lblWait.setText("text");
                lblWait.setFont(new Font("Arial", Font.BOLD, 22));
                lblWait.setHorizontalAlignment(SwingConstants.CENTER);
                pnlWait.add(lblWait, BorderLayout.CENTER);
            }
            pnlCard.add(pnlWait, "cardWait");
        }
        pnlMain.add(pnlCard, CC.xy(5, 4, CC.FILL, CC.FILL));
        pnlMain.add(pbTimeout, CC.xywh(3, 5, 4, 1, CC.FILL, CC.DEFAULT));

        //======== panel2 ========
        {
            panel2.setLayout(new BoxLayout(panel2, BoxLayout.X_AXIS));

            //---- btnResetSplitpane ----
            btnResetSplitpane.setText(null);
            btnResetSplitpane
                    .setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/view_top_bottom.png")));
            btnResetSplitpane.setAlignmentY(1.0F);
            btnResetSplitpane.addActionListener(e -> btnResetSplitpaneActionPerformed(e));
            panel2.add(btnResetSplitpane);

            //---- statusBar ----
            statusBar.setBackground(new Color(238, 238, 238));
            statusBar.setAlignmentY(1.0F);
            panel2.add(statusBar);
        }
        pnlMain.add(panel2, CC.xywh(3, 7, 4, 1, CC.FILL, CC.BOTTOM));
    }
    contentPane.add(pnlMain);
    setSize(945, 695);
    setLocationRelativeTo(getOwner());
}

From source file:org.deegree.tools.rendering.viewer.File3dImporter.java

public static List<WorldRenderableObject> open(Frame parent, String fileName) {

    if (fileName == null || "".equals(fileName.trim())) {
        throw new InvalidParameterException("the file name may not be null or empty");
    }/*from ww  w  .  ja  v a 2s. c o  m*/
    fileName = fileName.trim();

    CityGMLImporter openFile2;
    XMLInputFactory fac = XMLInputFactory.newInstance();
    InputStream in = null;
    try {
        XMLStreamReader reader = fac.createXMLStreamReader(in = new FileInputStream(fileName));
        reader.next();
        String ns = "http://www.opengis.net/citygml/1.0";
        openFile2 = new CityGMLImporter(null, null, null, reader.getNamespaceURI().equals(ns));
    } catch (Throwable t) {
        openFile2 = new CityGMLImporter(null, null, null, false);
    } finally {
        IOUtils.closeQuietly(in);
    }

    final CityGMLImporter openFile = openFile2;

    final JDialog dialog = new JDialog(parent, "Loading", true);

    dialog.getContentPane().setLayout(new BorderLayout());
    dialog.getContentPane().add(
            new JLabel("<HTML>Loading file:<br>" + fileName + "<br>Please wait!</HTML>", SwingConstants.CENTER),
            BorderLayout.NORTH);
    final JProgressBar progressBar = new JProgressBar();
    progressBar.setStringPainted(true);
    progressBar.setIndeterminate(false);
    dialog.getContentPane().add(progressBar, BorderLayout.CENTER);

    dialog.pack();
    dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    dialog.setResizable(false);
    dialog.setLocationRelativeTo(parent);

    final Thread openThread = new Thread() {
        /**
         * Opens the file in a separate thread.
         */
        @Override
        public void run() {
            // openFile.openFile( progressBar );
            if (dialog.isDisplayable()) {
                dialog.setVisible(false);
                dialog.dispose();
            }
        }
    };
    openThread.start();

    dialog.setVisible(true);
    List<WorldRenderableObject> result = null;
    try {
        result = openFile.importFromFile(fileName, 6, 2);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    gm = openFile.getQmList();

    //
    // if ( result != null ) {
    // openGLEventListener.addDataObjectToScene( result );
    // File f = new File( fileName );
    // setTitle( WIN_TITLE + f.getName() );
    // } else {
    // showExceptionDialog( "The file: " + fileName
    // + " could not be read,\nSee error log for detailed information." );
    // }
    return result;
}

From source file:org.drugis.addis.gui.components.progressgraph.ProgressGraph.java

public ProgressGraph(final MCMCPresentation model, JFrame main) {
    d_model = model;/*from www .j  ava 2 s .c  o  m*/
    d_cellHeight = (int) new JProgressBar().getPreferredSize().getHeight() + 4;
    d_gridCellSize = new Dimension(140, d_cellHeight);
    d_circleDiameter = 20;
    d_edgeLength = 30;
    d_arrowSize = 10;
    d_barWidth = 9;
    d_numberOfChains = model.getWrapper().getSettings().getNumberOfChains();
    d_numMainRows = (d_numberOfChains - 1) * 2 + 1;
    d_numTotalRows = d_numMainRows + 2;
    d_numCols = 17;

    JPanel progressGraph = createPanel();

    add(progressGraph);
}

From source file:org.kse.gui.dialogs.DCheckUpdate.java

private void initComponents() {
    jlCheckUpdate = new JLabel(res.getString("DCheckUpdate.jlCheckUpdate.text"));
    ImageIcon icon = new ImageIcon(getClass().getResource(res.getString("DCheckUpdate.jlCheckUpdate.image")));
    jlCheckUpdate.setIcon(icon);/*  w ww .  j  ava  2 s. c om*/
    jlCheckUpdate.setHorizontalTextPosition(SwingConstants.LEADING);
    jlCheckUpdate.setIconTextGap(15);

    jpCheckUpdate = new JPanel(new FlowLayout(FlowLayout.CENTER));
    jpCheckUpdate.add(jlCheckUpdate);
    jpCheckUpdate.setBorder(new EmptyBorder(5, 5, 5, 5));

    jpbCheckUpdate = new JProgressBar();
    jpbCheckUpdate.setIndeterminate(true);
    jpbCheckUpdate.setString("DCheckUpdate.jlCheckUpdate.text");

    jpProgress = new JPanel(new FlowLayout(FlowLayout.CENTER));
    jpProgress.add(jpbCheckUpdate);
    jpProgress.setBorder(new EmptyBorder(5, 5, 5, 5));

    jbCancel = new JButton(res.getString("DCheckUpdate.jbCancel.text"));
    jbCancel.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            cancelPressed();
        }
    });
    jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
            CANCEL_KEY);
    jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() {
        private static final long serialVersionUID = 1L;

        @Override
        public void actionPerformed(ActionEvent evt) {
            cancelPressed();
        }
    });

    jpCancel = PlatformUtil.createDialogButtonPanel(jbCancel, false);

    getContentPane().add(jpCheckUpdate, BorderLayout.NORTH);
    getContentPane().add(jpProgress, BorderLayout.CENTER);
    getContentPane().add(jpCancel, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent evt) {
            if ((checker != null) && (checker.isAlive())) {
                checker.interrupt();
            }
            closeDialog();
        }
    });

    setTitle(res.getString("DCheckUpdate.Title"));
    setResizable(false);

    pack();
}