Beispiel #1
0
 private void setContents(Quiz quiz) {
   removeAllContent();
   titleTxt.setText(quiz.getTitle());
   authorTxt.setText(quiz.getAuthor());
   for (Question question : quiz.getQuestionList()) {
     addQuestion(question);
   }
 }
Beispiel #2
0
 public void limpaFormulario() {
   textField.setText("");
   textField_2.setText("");
   textField_3.setText("");
   textField_4.setText("");
   textField_5.setText("");
   textField_6.setText("");
   textField_7.setText("");
   textField_8.setText("");
   textField_9.setText("");
 }
 public void preencheCampos(setoresBean sb) {
   Object codigo = sb.getCod();
   String codS = "" + codigo;
   campoCod.setText(codS);
   campoDataAlteracao.setText(sb.getDataAltera());
   campoInclusao.setText(sb.getDataInclusao());
   campoDescricaoSet.setText(sb.getDescricao());
   campoInclusao.setText(sb.getUserInclusao());
   campoMunicipio.setText(sb.getMunicipio());
   campoSigla.setText(sb.getSigla());
   campoUserAltera.setText(sb.getUserAltera());
 }
  public void LimparProduto(
      JFormattedTextField txtCodProduto,
      JFormattedTextField txtDescProd,
      JFormattedTextField txtUnidade,
      JFormattedTextField txtQtdTotal,
      JFormattedTextField txtEstoqueMin) {

    txtCodProduto.setText("");
    txtDescProd.setText("");
    txtUnidade.setText("");
    txtQtdTotal.setText("");
    txtEstoqueMin.setText("");
  }
Beispiel #5
0
 @Override
 public void setSettings(final Map<String, Object> settings) {
   gaussFiltSigmaText.setText("" + settings.get(SIGMA_F_PARAMETER));
   aniDiffNIterText.setText("" + settings.get(N_AD_PARAMETER));
   aniDiffKappaText.setText("" + settings.get(KAPPA_PARAMETER));
   gaussGradSigmaText.setText("" + settings.get(SIGMA_G_PARAMETER));
   gammaText.setText("" + settings.get(GAMMA_PARAMETER));
   alphaText.setText("" + settings.get(ALPHA_PARAMETER));
   betaText.setText("" + settings.get(BETA_PARAMETER));
   epsilonText.setText("" + settings.get(EPSILON_PARAMETER));
   deltaText.setText("" + settings.get(DELTA_PARAMETER));
   thresholdFactorText.setText("" + settings.get(THRESHOLD_FACTOR_PARAMETER));
   collectMaskingParameters();
 }
  private void carregarDados() {

    Pousada pousada = new PousadaDao().consultar();

    if (pousada != null) {
      jTextFieldRazaoSocial.setText(pousada.getRazaoSocial());
      jTextFieldFantasia.setText(pousada.getFantasia());
      jTextFieldFormatCnpj.setText(pousada.getCnpj());
      jTextFieldTelefone.setText(pousada.getTelefone());
      jTextFieldEndereco.setText(pousada.getEndereco());
      jTextFieldNumero.setText(String.format("%s", pousada.getNumEndereco()));
      jTextFieldQuantQuartos.setText(String.format("%s", pousada.getQuantQuarto()));
    }
  }
Beispiel #7
0
 public void setParameters(ProblemDescriptors descriptors) {
   if (descriptors == null) {
     problemSizeEdit.setText("");
     stockLengthEdit.setText("");
     orderLengthLowerBoundEdit.setText("");
     orderLengthUpperBoundEdit.setText("");
     averageDemandEdit.setText("");
   } else {
     problemSizeEdit.setValue(descriptors.getSize());
     stockLengthEdit.setValue(descriptors.getStockLength());
     orderLengthLowerBoundEdit.setValue(descriptors.getOrderLengthLowerBound());
     orderLengthUpperBoundEdit.setValue(descriptors.getOrderLengthUpperBound());
     averageDemandEdit.setValue(descriptors.getAverageDemand());
   }
 }
  private JPanel createParametersPanel() {
    JPanel parametersPanel = new JPanel();
    parametersPanel.setBorder(BorderFactory.createTitledBorder(dataLayer.getString("PARAMETERS")));

    GridLayout parametersPanelLayout = new GridLayout(0, 3);
    parametersPanelLayout.setHgap(10);
    parametersPanelLayout.setVgap(5);
    parametersPanel.setLayout(parametersPanelLayout);
    //
    // -- DELAY ------------------------------------------------------------
    JLabel delayName = new JLabel(dataLayer.getString("DELAY") + ":");
    delayName.setFont(fontBold);
    parametersPanel.add(delayName);

    // create formatter
    RegexFormatter delayFormatter = new RegexFormatter(Validator.DELAY_PATTERN);
    delayFormatter.setAllowsInvalid(true); // allow to enter invalid value for short time
    delayFormatter.setCommitsOnValidEdit(true); // value is immedeatly published to textField
    delayFormatter.setOverwriteMode(false); // do not overwrite charracters

    jTextFieldDelay = new JFormattedTextField(delayFormatter);
    jTextFieldDelay.setText("" + cable.getDelay());
    jTextFieldDelay.setToolTipText(dataLayer.getString("REQUIRED_FORMAT_IS") + " 1-99");
    // add decorator that paints wrong input icon
    parametersPanel.add(new JLayer<JFormattedTextField>(jTextFieldDelay, layerUI));

    JLabel delayTip = new JLabel("1-99");
    parametersPanel.add(delayTip);

    // --  ------------------------------------------------------------
    return parametersPanel;
  }
Beispiel #9
0
  // This method is called when a cell value is edited by the user.
  public Component getTableCellEditorComponent(
      JTable table, Object value, boolean isSelected, int row, int column) {
    // Configure the component with the specified value
    if (!mitMaus) {
      ((JFormattedTextField) component).setText(String.valueOf(value));
      ((JFormattedTextField) component).selectAll();
      ((JFormattedTextField) component).setHorizontalAlignment(SwingConstants.RIGHT);
      ((JFormattedTextField) component).setBackground(Color.YELLOW);

    } else {
      final String xvalue = String.valueOf(value);
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              ((JFormattedTextField) component).setText(String.valueOf(xvalue).replace(".", ","));
              ((JFormattedTextField) component).selectAll();
              ((JFormattedTextField) component).setBackground(Color.YELLOW);
              ((JFormattedTextField) component).setHorizontalAlignment(SwingConstants.RIGHT);
              ((JFormattedTextField) component).setCaretPosition(0);
            }
          });
    }

    // Return the configured component
    //// System.out.println("I've been Called!!");
    return component;
  }
  /** @see Editor#addEditorForm() */
  @Override
  public void addEditorForm() {
    if (initiallyNull) {
      model = new JTextField();
    } else {
      model = new JTextField(item.model);
      model.setEnabled(false);
    }

    model.setPreferredSize(fieldSize);

    addField(TABLE_BUS_MODEL, model);

    try {
      MaskFormatter formatter = new MaskFormatter("####");
      formatter.setPlaceholderCharacter('Y');
      year = new JFormattedTextField(formatter);
      if (!initiallyNull) {
        ((JFormattedTextField) year).setText(item.year);
        year.setEnabled(false);
      }

      year.setPreferredSize(fieldSize);
      addField(TABLE_BUS_YEAR, year);
    } catch (ParseException e) {
    }
  }
Beispiel #11
0
 private JFormattedTextField getJFormattedTextField0() {
   if (jFormattedTextField0 == null) {
     jFormattedTextField0 = new JFormattedTextField();
     //	jFormattedTextField0.setfor
     jFormattedTextField0.setText("jFormattedTextField0");
   }
   return jFormattedTextField0;
 }
Beispiel #12
0
  public void atualizaFormulario(Fornecedor objFornec) {
    textField_2.setText(objFornec.getTelFornec());
    textField_4.setText(objFornec.getRuaFornec());
    textField_6.setText(objFornec.getNumEndFornec());
    textField_7.setText(objFornec.getBairroFornec());
    textField_8.setText(objFornec.getCidadeFornec());
    textField.setText(objFornec.getNomeFornec());
    textField_3.setText(objFornec.getCepFornec());
    textField_9.setText(objFornec.getComplFornec());

    Integer matr = objFornec.getNumFornec();
    textField_5.setText(matr.toString());

    lista.setVisible(false);
    formulario.setVisible(true);
    buttonPanel.setVisible(false);
  }
 @Override
 public JTextField getUserInputComponent() {
   inputField = new JFormattedTextField();
   if (variable.getValue() != null) {
     inputField.setText("" + variable.getValue());
   }
   return inputField;
 }
 private void showCurrentSettings() {
   Font editorFont = Base.getFontPref("editor.font", "Monospaced,plain,12");
   fontSizeField.setText(String.valueOf(editorFont.getSize()));
   String firmwareUrl =
       Base.preferences.get("replicatorg.updates.url", FirmwareUploader.DEFAULT_UPDATES_URL);
   firmwareUpdateUrlField.setText(firmwareUrl);
   String logPath = Base.preferences.get("replicatorg.logpath", "");
   logPathField.setText(logPath);
 }
 public void setData(Pizzeria pizzeria) {
   pizzeriaId = pizzeria.id;
   nameField.setText(pizzeria.nazwa);
   addressField.setText(pizzeria.adres);
   siteField.setText(pizzeria.strona);
   phoneField.setText(pizzeria.telefon);
   if (pizzeria.godziny != null) {
     for (int i = 0; i < pizzeria.godziny.length; i++) {
       if (pizzeria.godziny[i] != null) {
         String[] hours = pizzeria.godziny[i].split("-", -1);
         if (hours.length == 2) {
           fromHour[i] = hours[0];
           toHour[i] = hours[1];
         }
       }
     }
   }
   fromField.setText(fromHour[0]);
   toField.setText(toHour[0]);
 }
 public void limpaFormulario() {
   textField.setText("");
   textField_1.setText("");
   textField_3.setText("");
   textField_5.setText("");
   textField_9.setText("");
   textField_2.setText("");
   textField_4.setText("");
   textField_6.setText("");
   dateInicio.getEditor().setText("");
   dateFim.getEditor().setText("");
 }
  protected void readSizeFromTextField() {

    int size = ((Number) sizetf.getValue()).intValue();
    if (size == getParticlePicker().getSize()) return;

    if (!getParticlePicker().isValidSize(ParticlePickerJFrame.this, size)) {

      int prevsize = getParticlePicker().getSize();
      sizetf.setText(Integer.toString(prevsize));
      return;
    }
    updateSize(size);
  }
Beispiel #18
0
  /**
   * <i>Description:</i>
   *
   * <p>see <a href=https://en.wikipedia.org/wiki/Hostname>https://en.wikipedia.org
   * /wiki/Hostname</a> for valid hostname
   *
   * @return
   */
  @SuppressWarnings("unchecked")
  protected JPanel getHostEntryPanel() {
    if (pnlHostEntry == null) {
      pnlHostEntry = new JPanel(new BorderLayout(5, 5));
      pnlHostEntry.setOpaque(false);

      JPanel panel = new JPanel(new GridLayout(1, 2, 10, 5));
      panel.setOpaque(false);
      String hostNameChars = UIConstants.DIGITS + UIConstants.LETTERS + "-.";
      txtFldHostName = new SafeTextField(false, 253);
      ((SafeTextField) txtFldHostName).setValidChars(hostNameChars);
      for (DocumentListener listener : hostInfoListener.getDocumentListeners()) {
        txtFldHostName.getDocument().addDocumentListener(listener);
      }
      FieldPair<JFormattedTextField> fp =
          new FieldPair<JFormattedTextField>(STLConstants.K0051_HOST.getValue(), txtFldHostName);
      panel.add(fp);

      txtFldPortNum =
          new SafeNumberField<Integer>(new DecimalFormat("###"), 0, false, 65535, false);
      // only positive integer
      ((SafeNumberField<Integer>) txtFldPortNum).setValidChars(UIConstants.DIGITS);
      for (DocumentListener listener : hostInfoListener.getDocumentListeners()) {
        txtFldPortNum.getDocument().addDocumentListener(listener);
      }
      txtFldPortNum.setText(STLConstants.K3015_DEFAULT_PORT.getValue());
      fp =
          new FieldPair<JFormattedTextField>(
              STLConstants.K1035_CONFIGURATION_PORT.getValue(), txtFldPortNum);
      panel.add(fp);
      pnlHostEntry.add(panel, BorderLayout.CENTER);

      chkboxSecureConnect =
          ComponentFactory.getIntelCheckBox(STLConstants.K2003_SECURE_CONNECT.getValue());
      chkboxSecureConnect.setFont(UIConstants.H5_FONT.deriveFont(Font.BOLD));
      chkboxSecureConnect.setForeground(UIConstants.INTEL_DARK_GRAY);
      chkboxSecureConnect.setHorizontalAlignment(JLabel.TRAILING);
      chkboxSecureConnect.setSelected(false);
      chkboxSecureConnect.addItemListener(
          new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
              hostInfoListener.setDirty();
              boolean isSecureConnect = chkboxSecureConnect.isSelected();
              enableCerts(isSecureConnect);
            }
          });
      pnlHostEntry.add(chkboxSecureConnect, BorderLayout.EAST);
    }
    return pnlHostEntry;
  }
 private void handleText(final JFormattedTextField ftf) {
   if (ftf.getFormatter() instanceof DateFormatter) {
     try {
       DateFormatter formatter = (DateFormatter) ftf.getFormatter();
       int calendarField = TextUtils.getCalendarField(ftf);
       Date date = (Date) formatter.stringToValue(ftf.getText());
       date =
           increment > 0
               ? (Date) TextUtils.getNextValue(date, calendarField, null)
               : (Date) TextUtils.getPreviousValue(date, calendarField, null);
       ftf.setText(formatter.valueToString(date));
       TextUtils.selectCalendarField(ftf, calendarField);
     } catch (ParseException e) {
       e.printStackTrace();
     }
   }
 }
Beispiel #20
0
  private void calculate_profit(String sAbrMonat) {
    double dblMtlJahrKosten, dblEin, dblAus, dblSummeFixkosten, dblNutzBetrag;

    // jahressparbetrag ermitteln
    dblMtlJahrKosten = monatliche_jahreskosten(sAbrMonat);
    // System.out.println("Jahrsparwert: " + dblMtlJahrKosten);
    txtHinweis.append("Jahrsparwert: " + dblMtlJahrKosten + "\n");

    // die monatliche fixkosten in ein array schreiben
    monats_fixkosten(sAbrMonat);

    // einnahmen des abrechnungsmonats ermitteln
    dblEin = summiere_einnahmen(sAbrMonat);
    // System.out.println("Einnahmen: " + dblEin);
    txtHinweis.append("Einnahmen: " + dblEin + "\n");

    // ausgaben des abrechnungsmonats ermitteln (dabei sind die saetze mit
    // den ereignissid's der monatlichen fixausgaben ausgenommen, und auch die mit
    // der eieignissid 47 Jahresausgaben)
    dblAus = summiere_ausgaben(sAbrMonat);
    // System.out.println("Ausgaben: " + dblAus);
    txtHinweis.append("Ausgaben: " + dblAus + "\n");

    // die liquiditaetsfahigen teile von aufteilungsdatensaetzen zusammenaddieren
    // dabei werden einzeln haben und soll anteile zusammengerechnet
    // die ergebnisse werden dann jeweils den summen der einnahmen bzw der ausgaben
    // hinzugerechnet
    dblEin = dblEin + summiere_liqui_aus_aufteilung("h", sAbrMonat);
    dblAus = dblAus + summiere_liqui_aus_aufteilung("s", sAbrMonat);
    // System.out.println("Einnahmen(incl Aufteilung): " + dblEin);
    // System.out.println("Ausgaben(incl Aufteilung): " + dblAus);
    txtHinweis.append("Einnahmen(incl Aufteilung): " + dblEin + "\n");
    txtHinweis.append("Ausgaben(incl Aufteilung): " + dblAus + "\n");

    // nun wird von der differenz zwischen einnahmen und ausgaben
    // das jahressparen und alle gueltigen Monatlichen fixausgaben abgezogen
    dblSummeFixkosten = berechne_summe_fixkosten_aus_transaktionen(sAbrMonat);
    // System.out.println("Monatliche FixKost: " + dblSummeFixkosten);
    txtHinweis.append("Monatliche FixKost: " + roundScale2(dblSummeFixkosten) + "\n");

    // nun noch die endsumme berechnen und der textbox zuweisen
    dblNutzBetrag = roundScale2(dblEin - dblAus - dblSummeFixkosten - dblMtlJahrKosten);
    txtNutzBetr.setText(String.valueOf(dblNutzBetrag).replace(".", ","));
  }
  public void atualizaFormulario(FolhaPagamento objFolha) {
    textField_9.setText(objFolha.getNomeFunc());
    textField.setText(objFolha.getNumFunc().toString());
    textField_3.setText(objFolha.getSalarioFunc().toString());
    textField_1.setText(objFolha.getProfissaoFunc());
    textField_2.setText(objFolha.getComissaoFuncTotal().toString());
    textField_4.setText(objFolha.getBonusFunc().toString());
    textField_6.setText(String.valueOf(objFolha.getTotalFunc()));

    dateInicio.setDate(objFolha.getDataInicio());
    dateFim.setDate(objFolha.getDataFim());

    Integer matr = objFolha.getNumFunc();
    textField_5.setText(matr.toString());

    lista.setVisible(false);
    formulario.setVisible(true);
    buttonPanel.setVisible(false);
  }
  public void setJob(Job job) {
    jobNameTextField.setEnabled(false);
    enabledCheckBox.setEnabled(true);
    saveButton.setEnabled(true);

    id = job.getId();
    jobNameTextField.setText(job.getName());
    enabledCheckBox.setSelected(job.isEnabled());
    if (job.getIntervalUnit() == null) {
      onDemandRadioButton.setSelected(true);
    } else {
      scheduledRadioButton.setSelected(true);
      intervalFormattedTextField.setText(String.valueOf(job.getIntervalPeriod()));

      int index = 0;
      String[] units = Job.getUnits();
      for (int i = 0; i < units.length; i++) if (job.getIntervalUnit().equals(units[i])) index = i;

      intervalUnitComboBox.setSelectedIndex(index);
    }
  }
  public static void chamaFuncionario(int idFunc) {
    Funcionario objFunc = new Funcionario();

    FuncionarioDao objDao = new FuncionarioDao();

    try {
      objFunc = objDao.procurarFuncionarioID(idFunc);
    } catch (DaoException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }
    textField.setText(String.valueOf(idFunc));
    textField_9.setText(objFunc.getNomeFunc());
    textField_1.setText(objFunc.getProfissaoFunc());

    textField_3.setText(String.valueOf(objFunc.getSalarioFunc()));
    textField_3.getText().replace(",", ".");
    textField_3.setEditable(false);

    // Gerar a comissão automaticamente
    textField_2.setText(String.valueOf(objFunc.getComissaoFunc()));
    textField_2.setEditable(false);
  }
 public void preencheCampos(areasBean ab) {
   Object codigoArea = ab.getCodarea();
   String codA = "" + codigoArea;
   campoCod.setText(codA);
   Object codigoSetor = ab.getCodsetor();
   String codS = "" + codigoSetor;
   campoCodSetor.setText(codS);
   campoDescicao.setText(ab.getDescricao());
   campoDataAltera.setText(ab.getDataAltera());
   campoUserAltera.setText(ab.getUserAltera());
   campoDataInclusao.setText(ab.getUserDataInclusao());
   campoUserInclusao.setText(ab.getUserInclusao());
   Object codsu = ab.getCodSupervisor();
   int nomeS = Integer.parseInt(codS);
   String codSuper = "" + codsu;
   campoCodSup.setText(codSuper);
   campoNomeSup.setText(ps.selectComboFuncionario(nomeS));
   campoFiscaisL.setText(ab.getFiscaisL());
   campoFiscaisR.setText(ab.getFiscaisR());
   campoMunicipio.setText(ab.getMunicipio());
   campoExtensao.setText(ab.getExtensao());
   campoSigla.setText(ab.getSigla());
   campoRuas.setText(ab.getRuas());
 }
  public void HabilitaNovo(
      JFormattedTextField txtCodProduto,
      JFormattedTextField txtDescProd,
      JFormattedTextField txtUnidade,
      JFormattedTextField txtQtdTotal,
      JFormattedTextField txtEstoqueMin,
      JButton btnAlterar,
      JButton btnSalvar)
      throws SQLException {

    LimparProduto(txtCodProduto, txtDescProd, txtUnidade, txtQtdTotal, txtEstoqueMin);

    clsFunctions function = new clsFunctions();
    txtCodProduto.setText(Integer.toString(function.ProxRegistro("CC_CAD_PRODUTO", "ID_PROD")));

    txtCodProduto.setEnabled(false);
    txtDescProd.setEnabled(true);
    txtUnidade.setEnabled(true);
    txtQtdTotal.setEnabled(true);
    txtEstoqueMin.setEnabled(true);

    btnAlterar.setEnabled(false);
    btnSalvar.setEnabled(true);
  }
    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getActionCommand().equals("Acties")) {
            controller.add(new Actiescreen());
        }

        if (e.getActionCommand().equals("Editmenu")) {
            JDialog dialog = new JDialog();
            dialog.setBounds(0, 0, 300, 500);

            dialog.add(new EditScreen(1));
            dialog.pack();
            dialog.setLocationRelativeTo(null);
            dialog.setVisible(true);
        }

        if (e.getActionCommand().equals("Kalenderoverzicht")) {
            controller.add(new Kalenderscreen());
        }

        if (e.getActionCommand().equals("Gedachte toevoegen")) {
            JDialog dialog = new JDialog();
            dialog.setTitle("Gedachte Toevoegen");
            dialog.setModal(true);
            dialog.setBounds(0, 0, 300, 500);

            dialog.add(new EditScreen(2));
            dialog.pack();
            dialog.setLocationRelativeTo(null);
            dialog.setVisible(true);
            dialog.validate();
        }

        if (e.getActionCommand().equals("Edit gedachte")) {
            final JDialog dialog = new JDialog();
            dialog.setTitle("Edit gedachte");
            dialog.setModal(true);
            dialog.setBounds(0, 0, 300, 500);

            JPanel panel = new JPanel();
            panel.setLayout(new BorderLayout());
            final JTextField text = new JTextField();
            JButton button = new JButton("Toepassen");
            panel.add(text, BorderLayout.NORTH);
            panel.add(button, BorderLayout.SOUTH);
            button.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent ae) {
                    String change = text.getText();
                    int gedachte = controller.getCurrentThought();
                    DataLayer.changeThought(gedachte, change);
                    dialog.setVisible(false);
                    controller.updateThouhts();
                }
            });

            dialog.add(panel);
            dialog.pack();
            dialog.setLocationRelativeTo(null);
            dialog.setVisible(true);
            dialog.validate();
        }

        if (e.getActionCommand().equals("Gedachte omzetten naar actie")) {
            ArrayList<Projectscreen> test = controller.getProjects();
            if (test.get(0).getList().getSelectedIndex() == -1) {
                JOptionPane.showMessageDialog(null, "Selecteer eerst een gedachte", "Error", JOptionPane.ERROR_MESSAGE);
            } else {
                final JDialog dialog = new JDialog();
                dialog.setPreferredSize(new Dimension(500, 200));
                dialog.setTitle("Gedachte omzetten naar actie");
                dialog.setModal(true);

                JPanel master = new JPanel();
                dialog.add(master);
                master.setLayout(new GridLayout(0, 1));

                // Project kiezen
                JPanel projects = new JPanel();
                projects.setLayout(new BorderLayout());
                JLabel projectnaam = new JLabel("Project");
                final JComboBox box = new JComboBox();
                final ArrayList<Projectscreen> arraylist = controller.getProjects();
                Projectscreen thoughts = arraylist.get(0);
                for (Projectscreen s : arraylist) {
                    if (!s.getNaam().equals("Gedachten")){
                    String naam = s.getNaam();
                    box.addItem(naam);
                    box.validate();
                    }
                }
                projects.add(projectnaam, BorderLayout.WEST);
                projects.add(box, BorderLayout.CENTER);
                master.add(projects);

                //gedachte
                JPanel gedachten = new JPanel();
                gedachten.setLayout(new BorderLayout());
                JLabel n = new JLabel("Gedachte: ");
                final JTextField n1 = new JTextField();
                final int id = controller.getCurrentThought();
                final JList list = thoughts.getList();
                final String s = (String) list.getSelectedValue();
                String[] s1 = s.split(" ");
                String s2 = s1[0];
                n1.setText(s.replaceFirst(s2, ""));
                n1.setText(n1.getText().trim());
                gedachten.add(n, BorderLayout.WEST);
                gedachten.add(n1, BorderLayout.CENTER);
                master.add(gedachten);

                // beschrijving
                JPanel beschrijving = new JPanel();
                beschrijving.setLayout(new BorderLayout());
                JLabel b = new JLabel("Beschrijving");
                final JTextArea b1 = new JTextArea(0, 3);
                b1.setLineWrap(true);
                b1.setRows(3);
                b1.setWrapStyleWord(true);
                b1.setColumns(0);
                JScrollPane scroll = new JScrollPane();
                scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
                scroll.getViewport().setView(b1);
                beschrijving.add(b, BorderLayout.WEST);
                beschrijving.add(scroll, BorderLayout.CENTER);
                master.add(beschrijving);
                
                // context
                
                JPanel context = new JPanel();
                context.setLayout(new BorderLayout());
                JLabel co = new JLabel("Context");
                final JComboBox co1 = new JComboBox();
                co1.setEditable(true);
                final ArrayList<String> co2 = DataLayer.getContexts();
                if (!co2.isEmpty()){
                    for (String t : co2){
                        co1.addItem(t);
                    }
                }
                
                context.add(co, BorderLayout.WEST);
                context.add(co1, BorderLayout.CENTER);
                master.add(context);

                // status
                JPanel status = new JPanel();
                status.setLayout(new BorderLayout());
                JLabel st = new JLabel("Status");
                final JComboBox box1 = new JComboBox();
                ArrayList<String> arrayStatus = DataLayer.getStatuses();
                for (String t : arrayStatus) {
                    box1.addItem(t.toString());
                    box1.validate();
                }
                status.add(st, BorderLayout.WEST);
                status.add(box1, BorderLayout.CENTER);
                master.add(status);

                // datum
                JPanel datum = new JPanel();
                datum.setLayout(new BorderLayout());
                JLabel d = new JLabel("Datum");
                final JFormattedTextField d1 = new JFormattedTextField(new SimpleDateFormat("yyyy-mm-dd"));
                d1.setText("yyyy-mm-dd");
                datum.add(d, BorderLayout.WEST);
                datum.add(d1, BorderLayout.CENTER);
                master.add(datum);

                // button
                JButton toepassen = new JButton("Toepassen");
                master.add(toepassen);
                toepassen.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent ae) {
                        String description = n1.getText();
                        String notes = b1.getText();
                        
                        String co3 = (String) co1.getSelectedItem();
                        boolean bestaat = false;
                        for (String t : co2){
                            if (t.equals(co3)){
                                bestaat = true;
                            }
                        }
                        
                        if (!bestaat){
                            DataLayer.addContext(co3);
                        }
                        
                        String context = co3;
                        String status = box1.getSelectedItem().toString();
                        int projectid = arraylist.get(box.getSelectedIndex()).getID() + 1;
                        String datum = d1.getText();
                        int idGedachte = Integer.parseInt("" + s.charAt(0)) - 1;

                        if (datum.equals("yyyy-mm-dd") | datum.equals("")) {
                            JOptionPane.showMessageDialog(null, "Vul een datum in", "Error", JOptionPane.ERROR_MESSAGE);
                        } else {
                            DataLayer.addAction(description, notes, context, status, projectid, datum);
                            DataLayer.deleteThought(idGedachte);
                            controller.updateThouhts();
                            controller.updateProjects();
                            dialog.setVisible(false);
                            ArrayList<Projectscreen> project = controller.getProjects();
                            Projectscreen t = project.get(0);
                            int i = t.getList().getModel().getSize();
                            int x = t.getList().getSelectedIndex();
                        }
                    }
                });

                dialog.pack();
                dialog.setLocationRelativeTo(null);
                dialog.setVisible(true);
                dialog.validate();
            }
        }

        if (e.getActionCommand().equals("Wis gedachte")) {
            DataLayer.deleteThought(controller.getCurrentThought());
            controller.updateThouhts();
        }

        if (e.getActionCommand().equals("Voeg project toe")) {
            final JDialog dialog = new JDialog();
            dialog.setTitle("Project toevoegen");
            dialog.setModal(true);

            JPanel panel = new JPanel();
            panel.setLayout(new BorderLayout());
            final JTextField naam = new JTextField();

            JPanel projectnaam = new JPanel();
            projectnaam.setLayout(new BorderLayout());
            projectnaam.add(new JLabel("Projectnaam"), BorderLayout.WEST);
            projectnaam.add(naam, BorderLayout.CENTER);

            JButton button = new JButton("Aanmaken");
            panel.add(projectnaam, BorderLayout.NORTH);
            panel.add(button, BorderLayout.SOUTH);
            button.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent ae) {
                    String e = DataLayer.addProject(naam.getText());
                    controller.updateProjects(e);
                    dialog.setVisible(false);
                    validate();
                }
            });

            dialog.add(panel);
            dialog.pack();
            dialog.setLocationRelativeTo(null);
            dialog.setVisible(true);
            dialog.validate();
        }

        if (e.getActionCommand().equals("Bewerk project")) {
            final JDialog dialog = new JDialog();
            dialog.setTitle("Bewerk project");
            dialog.setModal(true);
            dialog.setBounds(0, 0, 300, 500);

            JPanel panel = new JPanel();
            panel.setLayout(new BorderLayout());
            final JTextField naam = new JTextField();
            final JComboBox box = new JComboBox();
            box.setEditable(false);
            final ArrayList<Projectscreen> projects = controller.getProjects();
            projects.remove(0);
            for (Projectscreen t : projects) {
                box.addItem(t.getNaam());
                box.validate();
            }

            JPanel projectid = new JPanel();
            projectid.setLayout(new BorderLayout());
            projectid.add(new JLabel("Kies project"), BorderLayout.WEST);
            projectid.add(box, BorderLayout.CENTER);

            JPanel projectnaam = new JPanel();
            projectnaam.setLayout(new BorderLayout());
            projectnaam.add(new JLabel("Nieuwe projectnaam"), BorderLayout.WEST);
            projectnaam.add(naam, BorderLayout.CENTER);

            JButton button = new JButton("Bewerk");
            panel.add(projectid, BorderLayout.NORTH);
            panel.add(projectnaam, BorderLayout.CENTER);
            panel.add(button, BorderLayout.SOUTH);
            button.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent ae) {
                    int d = box.getSelectedIndex();
                    projects.get(d).changeName(naam.getText());
                    DataLayer.changeProject(projects.get(d).getID(), naam.getText());
                    dialog.setVisible(false);
                    validate();
                }
            });

            dialog.add(panel);
            dialog.pack();
            dialog.setLocationRelativeTo(null);
            dialog.setVisible(true);
            dialog.validate();
        }

        if (e.getActionCommand().equals("Verwijder project")) {
            final JDialog dialog = new JDialog();
            dialog.setTitle("Wis project");
            dialog.setModal(true);
            dialog.setBounds(0, 0, 300, 500);

            JPanel panel = new JPanel();
            panel.setLayout(new BorderLayout());
            final JTextField naam = new JTextField();

            final JComboBox box = new JComboBox();
            box.setEditable(false);
            final ArrayList<Projectscreen> projects = controller.getProjects();
            projects.remove(0);
            for (Projectscreen t : projects) {
                box.addItem(t.getNaam());
                box.validate();
            }

            JPanel projectnaam = new JPanel();
            projectnaam.setLayout(new BorderLayout());
            projectnaam.add(new JLabel("Project"), BorderLayout.WEST);
            projectnaam.add(box, BorderLayout.CENTER);

            JButton button = new JButton("Wissen");
            panel.add(projectnaam, BorderLayout.NORTH);
            panel.add(button, BorderLayout.SOUTH);
            button.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent ae) {
                    //pj.deleteProject(naam.getText(), id.getNumber().intValue()); 
                    int d = box.getSelectedIndex();
                    projects.get(d).changeName(naam.getText());
                    DataLayer.deleteProject(projects.get(d).getID());
                    controller.updateIDprojects(d);
                    dialog.setVisible(false);
                    validate();
                }
            });

            dialog.add(panel);
            dialog.pack();
            dialog.setLocationRelativeTo(null);
            dialog.setVisible(true);
            dialog.validate();
        }

        if (e.getActionCommand().equals("Uitloggen")) {
            controller.logOff();
        }

        if (e.getActionCommand().equals("Afsluiten")) {
            controller.quit();
        }
    }
  /** Initialize the contents of the frame. */
  private void initialize() {
    frmCourseEditor = new JFrame();
    frmCourseEditor.setTitle("Course Editor");
    frmCourseEditor.setBounds(100, 100, 450, 300);
    frmCourseEditor.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    lblCourseName = new JLabel("Course Name:");

    txtEnterName = new JTextField();
    txtEnterName.setText("Enter Name");
    txtEnterName.setColumns(10);

    lblTerm = new JLabel("Term:");

    txtEnterTerm = new JTextField();
    txtEnterTerm.setText("Enter Term");
    txtEnterTerm.setColumns(10);

    lblCrn = new JLabel("CRN:");

    frmtdtxtfldEnterCrn = new JFormattedTextField();
    frmtdtxtfldEnterCrn.setText("Enter CRN");

    JLabel lblChooseWhatTo = new JLabel("Choose what to edit:");
    JComboBox comboBox = new JComboBox();
    comboBox.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            JComboBox box = (JComboBox) arg0.getSource();
            String a = "Assignment";
            String q = "Questions";
            if (box.getSelectedItem().equals(a)) {
              newTestFrame.main(null);
              frmCourseEditor.setVisible(false);
            }
            if (box.getSelectedItem().equals(q)) {
              TestQuestion.main(null);
              frmCourseEditor.setVisible(false);
            }
          }
        });
    comboBox.setModel(new DefaultComboBoxModel(new String[] {"Course", "Assignment", "Questions"}));
    GroupLayout groupLayout = new GroupLayout(frmCourseEditor.getContentPane());
    groupLayout.setHorizontalGroup(
        groupLayout
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                groupLayout
                    .createSequentialGroup()
                    .addGap(60)
                    .addComponent(lblChooseWhatTo)
                    .addGap(5)
                    .addComponent(
                        comboBox, GroupLayout.PREFERRED_SIZE, 192, GroupLayout.PREFERRED_SIZE))
            .addGroup(
                groupLayout
                    .createSequentialGroup()
                    .addGap(102)
                    .addComponent(lblCourseName)
                    .addGap(5)
                    .addComponent(
                        txtEnterName, GroupLayout.PREFERRED_SIZE, 192, GroupLayout.PREFERRED_SIZE))
            .addGroup(
                groupLayout
                    .createSequentialGroup()
                    .addGap(154)
                    .addComponent(lblTerm)
                    .addGap(5)
                    .addComponent(
                        txtEnterTerm, GroupLayout.PREFERRED_SIZE, 192, GroupLayout.PREFERRED_SIZE))
            .addGroup(
                groupLayout
                    .createSequentialGroup()
                    .addGap(159)
                    .addComponent(lblCrn)
                    .addGap(5)
                    .addComponent(
                        frmtdtxtfldEnterCrn,
                        GroupLayout.PREFERRED_SIZE,
                        192,
                        GroupLayout.PREFERRED_SIZE)));
    groupLayout.setVerticalGroup(
        groupLayout
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                groupLayout
                    .createSequentialGroup()
                    .addGroup(
                        groupLayout
                            .createParallelGroup(Alignment.LEADING)
                            .addGroup(
                                groupLayout
                                    .createSequentialGroup()
                                    .addGap(5)
                                    .addComponent(lblChooseWhatTo))
                            .addComponent(
                                comboBox,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE))
                    .addGap(35)
                    .addGroup(
                        groupLayout
                            .createParallelGroup(Alignment.LEADING)
                            .addGroup(
                                groupLayout
                                    .createSequentialGroup()
                                    .addGap(6)
                                    .addComponent(lblCourseName))
                            .addComponent(
                                txtEnterName,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE))
                    .addGap(35)
                    .addGroup(
                        groupLayout
                            .createParallelGroup(Alignment.LEADING)
                            .addGroup(
                                groupLayout.createSequentialGroup().addGap(6).addComponent(lblTerm))
                            .addComponent(
                                txtEnterTerm,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE))
                    .addGap(35)
                    .addGroup(
                        groupLayout
                            .createParallelGroup(Alignment.LEADING)
                            .addGroup(
                                groupLayout.createSequentialGroup().addGap(6).addComponent(lblCrn))
                            .addComponent(
                                frmtdtxtfldEnterCrn,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE))));
    frmCourseEditor.getContentPane().setLayout(groupLayout);

    menuBar = new JMenuBar();
    frmCourseEditor.setJMenuBar(menuBar);

    mnFile = new JMenu("File");
    menuBar.add(mnFile);

    mntmNew = new JMenuItem("New");
    mnFile.add(mntmNew);

    mntmOpen = new JMenuItem("Open");
    mnFile.add(mntmOpen);

    mntmSave = new JMenuItem("Save");
    mnFile.add(mntmSave);

    mnEdit = new JMenu("Edit");
    menuBar.add(mnEdit);

    mntmUndo = new JMenuItem("Undo");
    mnEdit.add(mntmUndo);

    mntmCut = new JMenuItem("Cut");
    mnEdit.add(mntmCut);

    mntmCopy = new JMenuItem("Copy");
    mnEdit.add(mntmCopy);

    mntmPaste = new JMenuItem("Paste");
    mnEdit.add(mntmPaste);
  }
Beispiel #28
0
 private void blankFields() {
   txtId.setText("");
   txtNombre.setText("");
   txtDescripcion.setText("");
   txtCosto.setText("");
 }
Beispiel #29
0
  public void actionPerformed(ActionEvent event) {

    // if clear button is pressed, clear all fields
    if (event.getSource() == clear_button) {
      // erase all fields

      taskname_field.setText("");
      taskdesc_field.setText("");

      priority_checkbox.setSelected(false);
      numberofdays_field.setText("");
      // isallocatedcheckbox.setSelected(false);
      duedate_field.setText("");
    }

    // if submit button is pressed, save all data onto database
    if (event.getSource() == submit_button) {
      try {
        {
          Calendar calendar = Calendar.getInstance();
          calendar.setTime(new Date()); // set to current date
          calendar.add(
              Calendar.DAY_OF_MONTH,
              Integer.parseInt(this.numberofdays_field.getText())
                  - 1); // add days required... then:
          // ^ subtract one day, because if task is created today and allocated tomorrow for one
          // day,
          // then it should be done by end of day tomorrow
          Date date = calendar.getTime(); // (see next *1) use this date to be the earliest
          // because of expected task duration

          /*This is a constraint
           * the date and the length of days that user expected to take
           * if not feasible then the program will say so
           * */
          // method compares the current date and the date that was entered by the user
          if (this.task_idfield.getText().length() != 7 // check chars
              || this.taskname_field.getText().length() > 50 // check chars
              || this.taskdesc_field.getText().length() > 50
              || ((Date) this.duedate_field.getValue()).compareTo(date)
                  < 0 // check that the date is possible (see last *1)
              || this.numberofdays_field.getText().length() > 2
              || this.numberofdays_field.getText().length() == 0 // check number of digits
              || Integer.parseInt(this.numberofdays_field.getText())
                  < 1) // check number of days required for task
          {
            JOptionPane.showMessageDialog(
                this,
                "Task ID has to be 7 chars; "
                    + "\n"
                    + "Description <= 50 chars; "
                    + "\n"
                    + "Because the expected duration of the task is "
                    + Integer.parseInt(this.numberofdays_field.getText())
                    + " days, the due date cannot be earlier than: "
                    + new StringBuffer(new SimpleDateFormat("dd/MM/yyyy").format(date)).toString()
                    + "; "
                    + "\n"
                    + "Task duration must be 2 digit number maximum and must be an integer greater than 0");
          } else

          // check if taskid_field is equals to any of the fields on the database

          if (task_idfield.equals("")) {
            JOptionPane.showMessageDialog(
                this, "Please insert an identification number for a task");

          } else // add constraint and tell customer to enter 7 values
          if (taskname_field.equals("")) {
            JOptionPane.showMessageDialog(this, "Please insert a name to identity the task");

          } else {

            // get all inputs from user inputs and store in variables
            taskid_input = task_idfield.getText();
            taskname_input = taskname_field.getText();
            taskdesc_input = taskdesc_field.getText();

            if (priority_checkbox.isSelected()) {
              priority_input = 1;
            } else {
              priority_input = 0;
            }

            // create and store date from user input
            date = (Date) duedate_field.getValue();

            // store number of days input from user
            numberofdays_input = Integer.parseInt(numberofdays_field.getText());

            // 	String[] column_names = { "Task ID", "Task Name", "Task Description", "Task
            // Priority", "Due Date", "Number of Days", "Is Allocated" , "Unallocateable" };

            task = new Object[8];
            task[0] = taskid_input;
            task[1] = taskname_input;
            task[2] = taskdesc_input;
            task[3] = priority_input;
            task[4] = date;
            task[5] = numberofdays_input;
            task[6] = 0;
            task[7] = 0;

            try {
              //
              SqlConnection.connect();

              SqlConnection.ps =
                  SqlConnection.connection.prepareStatement(
                      "INSERT  INTO TASK VALUES (?,?,?,?,?,?,?,?)");

              SqlConnection.ps.setString(1, taskid_input);
              SqlConnection.ps.setString(2, taskname_input);
              SqlConnection.ps.setString(3, taskdesc_input);
              SqlConnection.ps.setInt(4, priority_input);
              SqlConnection.ps.setDate(5, new java.sql.Date(date.getTime()));
              SqlConnection.ps.setInt(6, numberofdays_input);
              SqlConnection.ps.setInt(7, 0);
              SqlConnection.ps.setInt(8, 0);

              SqlConnection.ps.executeUpdate();

              // now enter skills into TASK SKILL database
              for (int i = 0; i < skill_list.size(); i++) {
                if (skill_list.get(i).isSelected()) {
                  String skillid = skill_list.get(i).getText();
                  SqlConnection.statement.executeUpdate(
                      "INSERT INTO TASKSKILL VALUES ('" + taskid_input + "', '" + skillid + "')");
                }
              }

              SqlConnection.ps.close();
            } catch (SQLException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
            // SqlConnection.ps.close();
            SqlConnection.closeConnection();
            this.setVisible(false);
          }
        }

      } catch (Exception exc) {
        JOptionPane.showMessageDialog(
            this,
            "Check your inputs:"
                + "\n"
                + "Priority has to be a 1-digit number;"
                + "\n"
                + "Date has to be in the format dd/MM/yyyy;"
                + "\n"
                + "Task length has to be 2-digit number");
        System.out.println(exc);
      }
    }
    // display dialog box asking task manager if they want to quit,
    // if task manager does not want to quit, go back to adding more tasks
    // if customer quits, close the dialog box and the frame

    // now close the window after saving
  }
Beispiel #30
0
  private void initGUI() {
    setLayout(new BorderLayout());

    tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    add(tabbedPane);

    {
      final JPanel panelIntroduction = new JPanel();
      tabbedPane.addTab("Intro", null, panelIntroduction, null);
      panelIntroduction.setLayout(null);

      final JLabel lblCrownwearingNucleiTracker = new JLabel("Crown-Wearing Nuclei Segmenter");
      lblCrownwearingNucleiTracker.setFont(BIG_FONT);
      lblCrownwearingNucleiTracker.setHorizontalAlignment(SwingConstants.CENTER);
      lblCrownwearingNucleiTracker.setBounds(10, 11, 268, 30);
      panelIntroduction.add(lblCrownwearingNucleiTracker);

      final JLabel labelIntro = new JLabel(INTRO_TEXT);
      labelIntro.setFont(SMALL_FONT.deriveFont(11f));
      labelIntro.setBounds(10, 52, 268, 173);
      panelIntroduction.add(labelIntro);

      final JButton btnTestParamtersLive =
          new JButton("<html><div align=\"center\">Live test parameters</dic></html>");
      btnTestParamtersLive.setBounds(10, 292, 103, 72);
      btnTestParamtersLive.setFont(FONT);
      liveLaunched = false;
      btnTestParamtersLive.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
              if (liveLaunched) {
                stopLive();
                btnTestParamtersLive.setText(
                    "<html><div align=\"center\">Live test parameters</div></html>");
                liveLaunched = false;
              } else {
                launchLive();
                btnTestParamtersLive.setText(
                    "<html><div align=\"center\">Stop live test</div></html>");
                liveLaunched = true;
              }
            }
          });
      panelIntroduction.add(btnTestParamtersLive);

      final String segFrameButtonText = "<html><CENTER>Segment current frame</center></html>";
      final JButton segFrameButton = new JButton(segFrameButtonText);
      segFrameButton.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
              new Thread("CWNT thread") {
                @Override
                public void run() {
                  segFrameButton.setText("Segmenting...");
                  segFrameButton.setEnabled(false);
                  try {
                    launchSingleFrameSegmentation();
                  } finally {
                    segFrameButton.setEnabled(true);
                    segFrameButton.setText(segFrameButtonText);
                  }
                }
              }.start();
            }
          });
      segFrameButton.setFont(FONT);
      segFrameButton.setBounds(175, 292, 103, 72);
      panelIntroduction.add(segFrameButton);

      labelDurationEstimate = new JLabel();
      labelDurationEstimate.setBounds(10, 375, 268, 14);
      panelIntroduction.setFont(FONT);
      panelIntroduction.add(labelDurationEstimate);
    }

    final JPanel panelParams1 = new JPanel();
    {
      tabbedPane.addTab("Param set 1", null, panelParams1, null);
      panelParams1.setLayout(null);

      final JLabel lblFiltering = new JLabel("1. Filtering");
      lblFiltering.setFont(BIG_FONT);
      lblFiltering.setBounds(10, 11, 268, 29);
      panelParams1.add(lblFiltering);

      {
        final JLabel lblGaussianFilter = new JLabel("Gaussian filter \u03C3:");
        lblGaussianFilter.setFont(SMALL_FONT);
        lblGaussianFilter.setBounds(10, 51, 268, 14);
        panelParams1.add(lblGaussianFilter);

        gaussFiltSigmaSlider =
            new DoubleJSlider(0, 5 * scale, (int) (maskingParams[0] * scale), scale);
        gaussFiltSigmaSlider.setBounds(10, 76, 223, 23);
        panelParams1.add(gaussFiltSigmaSlider);

        gaussFiltSigmaText = new JFormattedTextField(new Double(maskingParams[0]));
        gaussFiltSigmaText.setHorizontalAlignment(SwingConstants.CENTER);
        gaussFiltSigmaText.setBounds(243, 76, 35, 23);
        gaussFiltSigmaText.setFont(FONT);
        panelParams1.add(gaussFiltSigmaText);

        link(gaussFiltSigmaSlider, gaussFiltSigmaText);
        gaussFiltSigmaSlider.addChangeListener(step1ChangeListener);
        gaussFiltSigmaText.addKeyListener(step1KeyListener);
      }

      final JLabel lblAnisotropicDiffusion = new JLabel("2. Anisotropic diffusion");
      lblAnisotropicDiffusion.setFont(BIG_FONT);
      lblAnisotropicDiffusion.setBounds(10, 128, 268, 29);
      panelParams1.add(lblAnisotropicDiffusion);

      {
        final JLabel lblNumberOfIterations = new JLabel("Number of iterations:");
        lblNumberOfIterations.setFont(SMALL_FONT);
        lblNumberOfIterations.setBounds(10, 168, 268, 14);
        panelParams1.add(lblNumberOfIterations);

        aniDiffNIterText = new JFormattedTextField(new Integer((int) maskingParams[1]));
        aniDiffNIterText.setHorizontalAlignment(SwingConstants.CENTER);
        aniDiffNIterText.setFont(FONT);
        aniDiffNIterText.setBounds(243, 193, 35, 23);
        panelParams1.add(aniDiffNIterText);

        aniDiffNIterSlider = new DoubleJSlider(0, 10, (int) maskingParams[1], 1);
        aniDiffNIterSlider.setBounds(10, 193, 223, 23);
        panelParams1.add(aniDiffNIterSlider);

        link(aniDiffNIterSlider, aniDiffNIterText);
        aniDiffNIterSlider.addChangeListener(step2ChangeListener);
        aniDiffNIterText.addKeyListener(step2KeyListener);
      }

      {
        final JLabel lblGradientDiffusionThreshold =
            new JLabel("Gradient diffusion threshold \u03BA:");
        lblGradientDiffusionThreshold.setFont(SMALL_FONT);
        lblGradientDiffusionThreshold.setBounds(10, 227, 268, 14);
        panelParams1.add(lblGradientDiffusionThreshold);

        aniDiffKappaText = new JFormattedTextField(new Double(maskingParams[2]));
        aniDiffKappaText.setHorizontalAlignment(SwingConstants.CENTER);
        aniDiffKappaText.setFont(FONT);
        aniDiffKappaText.setBounds(243, 252, 35, 23);
        panelParams1.add(aniDiffKappaText);

        aniDiffKappaSlider = new DoubleJSlider(1, 100, (int) maskingParams[2], 1);
        aniDiffKappaSlider.setBounds(10, 252, 223, 23);
        panelParams1.add(aniDiffKappaSlider);

        link(aniDiffKappaSlider, aniDiffKappaText);
        aniDiffKappaSlider.addChangeListener(step2ChangeListener);
        aniDiffKappaText.addKeyListener(step2KeyListener);
      }

      final JLabel lblDerivativesCalculation = new JLabel("3. Derivatives calculation");
      lblDerivativesCalculation.setFont(BIG_FONT);
      lblDerivativesCalculation.setBounds(10, 298, 268, 29);
      panelParams1.add(lblDerivativesCalculation);

      {
        final JLabel lblGaussianGradient = new JLabel("Gaussian gradient \u03C3:");
        lblGaussianGradient.setFont(FONT);
        lblGaussianGradient.setBounds(10, 338, 268, 14);
        panelParams1.add(lblGaussianGradient);

        gaussGradSigmaText = new JFormattedTextField(new Double(maskingParams[3]));
        gaussGradSigmaText.setFont(FONT);
        gaussGradSigmaText.setHorizontalAlignment(SwingConstants.CENTER);
        gaussGradSigmaText.setBounds(243, 363, 35, 23);
        panelParams1.add(gaussGradSigmaText);

        gaussGradSigmaSlider =
            new DoubleJSlider(0, 5 * scale, (int) (maskingParams[3] * scale), scale);
        gaussGradSigmaSlider.setBounds(10, 363, 223, 23);
        panelParams1.add(gaussGradSigmaSlider);

        link(gaussGradSigmaSlider, gaussGradSigmaText);
        gaussGradSigmaSlider.addChangeListener(step3ChangeListener);
        gaussGradSigmaText.addKeyListener(step3KeyListener);
      }
    }

    final JPanel panelParams2 = new JPanel();
    {
      tabbedPane.addTab("Param set 2", panelParams2);
      panelParams2.setLayout(null);

      final JLabel lblMasking = new JLabel("4. Masking");
      lblMasking.setFont(BIG_FONT);
      lblMasking.setBounds(10, 11, 268, 29);
      panelParams2.add(lblMasking);

      {
        final JLabel gammeLabel = new JLabel("\u03B3: tanh shift");
        gammeLabel.setFont(SMALL_FONT);
        gammeLabel.setBounds(10, 51, 268, 14);
        panelParams2.add(gammeLabel);

        gammaSlider =
            new DoubleJSlider(-5 * scale, 5 * scale, (int) (maskingParams[4] * scale), scale);
        gammaSlider.setBounds(10, 76, 223, 23);
        panelParams2.add(gammaSlider);

        gammaText = new JFormattedTextField(new Double(maskingParams[4]));
        gammaText.setFont(FONT);
        gammaText.setBounds(243, 76, 35, 23);
        panelParams2.add(gammaText);

        link(gammaSlider, gammaText);
        gammaSlider.addChangeListener(step4ChangeListener);
        gammaSlider.addKeyListener(step4KeyListener);
      }
      {
        final JLabel lblNewLabel_3 = new JLabel("\u03B1: gradient prefactor");
        lblNewLabel_3.setFont(SMALL_FONT);
        lblNewLabel_3.setBounds(10, 110, 268, 14);
        panelParams2.add(lblNewLabel_3);

        alphaSlider = new DoubleJSlider(0, 20 * scale, (int) (maskingParams[5] * scale), scale);
        alphaSlider.setBounds(10, 135, 223, 23);
        panelParams2.add(alphaSlider);

        alphaText = new JFormattedTextField(new Double(maskingParams[5]));
        alphaText.setFont(FONT);
        alphaText.setBounds(243, 135, 35, 23);
        panelParams2.add(alphaText);

        link(alphaSlider, alphaText);
        alphaSlider.addChangeListener(step4ChangeListener);
        alphaText.addKeyListener(step4KeyListener);
      }
      {
        final JLabel betaLabel = new JLabel("\u03B2: positive laplacian magnitude prefactor");
        betaLabel.setFont(SMALL_FONT);
        betaLabel.setBounds(10, 169, 268, 14);
        panelParams2.add(betaLabel);

        betaSlider = new DoubleJSlider(0, 20 * scale, (int) (maskingParams[6] * scale), scale);
        betaSlider.setBounds(10, 194, 223, 23);
        panelParams2.add(betaSlider);

        betaText = new JFormattedTextField(new Double(maskingParams[6]));
        betaText.setFont(FONT);
        betaText.setBounds(243, 194, 35, 23);
        panelParams2.add(betaText);

        link(betaSlider, betaText);
        betaSlider.addChangeListener(step4ChangeListener);
        betaText.addKeyListener(step4KeyListener);
      }
      {
        final JLabel epsilonLabel = new JLabel("\u03B5: negative hessian magnitude");
        epsilonLabel.setFont(SMALL_FONT);
        epsilonLabel.setBounds(10, 228, 268, 14);
        panelParams2.add(epsilonLabel);

        epsilonSlider = new DoubleJSlider(0, 20 * scale, (int) (scale * maskingParams[7]), scale);
        epsilonSlider.setBounds(10, 253, 223, 23);
        panelParams2.add(epsilonSlider);

        epsilonText = new JFormattedTextField(new Double(maskingParams[7]));
        epsilonText.setFont(FONT);
        epsilonText.setText("" + maskingParams[7]);
        epsilonText.setBounds(243, 253, 35, 23);
        panelParams2.add(epsilonText);

        link(epsilonSlider, epsilonText);
        epsilonSlider.addChangeListener(step4ChangeListener);
        epsilonText.addKeyListener(step4KeyListener);
      }
      {
        final JLabel deltaLabel = new JLabel("\u03B4: derivatives sum scale");
        deltaLabel.setFont(SMALL_FONT);
        deltaLabel.setBounds(10, 287, 268, 14);
        panelParams2.add(deltaLabel);

        deltaText = new JFormattedTextField(new Double(maskingParams[8]));
        deltaText.setFont(FONT);
        deltaText.setText("" + maskingParams[8]);
        deltaText.setBounds(243, 312, 35, 23);
        panelParams2.add(deltaText);

        deltaSlider = new DoubleJSlider(0, 5 * scale, (int) (maskingParams[8] * scale), scale);
        deltaSlider.setBounds(10, 312, 223, 23);
        panelParams2.add(deltaSlider);

        link(deltaSlider, deltaText);
        deltaSlider.addChangeListener(step4ChangeListener);
        deltaText.addKeyListener(step4KeyListener);
      }

      final JLabel lblEquation =
          new JLabel(
              "<html>M = \u00BD ( 1 + <i>tanh</i> ( \u03B3 - ( \u03B1 G + \u03B2 L + \u03B5 H ) / \u03B4 ) )</html>");
      lblEquation.setHorizontalAlignment(SwingConstants.CENTER);
      lblEquation.setFont(FONT.deriveFont(12f));
      lblEquation.setBounds(10, 364, 268, 35);
      panelParams2.add(lblEquation);
    }

    {
      final JPanel panel = new JPanel();
      tabbedPane.addTab("Param set 3", null, panel, null);
      panel.setLayout(null);

      final JLabel labelThresholding = new JLabel("5. Thresholding");
      labelThresholding.setBounds(10, 11, 268, 28);
      labelThresholding.setFont(BIG_FONT);
      panel.add(labelThresholding);

      final JLabel labelThresholdFactor = new JLabel("Threshold factor:");
      labelThresholdFactor.setFont(SMALL_FONT);
      labelThresholdFactor.setBounds(10, 50, 268, 14);
      panel.add(labelThresholdFactor);

      thresholdFactorSlider =
          new DoubleJSlider(0, 5 * scale, (int) (thresholdFactor * scale), scale);
      thresholdFactorSlider.setBounds(10, 75, 223, 23);
      panel.add(thresholdFactorSlider);

      thresholdFactorText = new JFormattedTextField(new Double(thresholdFactor));
      thresholdFactorText.setFont(FONT);
      thresholdFactorText.setBounds(243, 75, 35, 23);
      panel.add(thresholdFactorText);

      link(thresholdFactorSlider, thresholdFactorText);
      thresholdFactorSlider.addChangeListener(step5ChangeListener);
      thresholdFactorText.addKeyListener(step5KeyListener);
    }
  }