public void btnAddAssistantOrProfessor_Pressed() {
    if (!chBxAssistantsOrProfessors.getSelectionModel().isEmpty()) {
      ObservableList<String> updatedElements = listAssistantsOrProfessors.getItems();

      String valueSelected = chBxAssistantsOrProfessors.getSelectionModel().getSelectedItem();
      String rut = valueSelected.split("-")[valueSelected.split("-").length - 1];

      for (Professor professor : Manager.INSTANCE.professors) {
        if (rut.equals(professor.getRut())) {
          if (!((Lecture) Manager.INSTANCE.currentEditignICourse)
              .getProfessors()
              .contains(professor)) {
            ((Lecture) Manager.INSTANCE.currentEditignICourse).addProfessor(professor);
            updatedElements.add(valueSelected);
            listAssistantsOrProfessors.setItems(FXCollections.observableArrayList(updatedElements));
            break;
          } else {
            ViewUtilities.showAlert("El profesor ya se encuentra en ese curso");
            break;
          }
        }
      }
    } else {
      ViewUtilities.showAlert("Select a professor to add");
    }
  }
 public void setFromUnit(Unit unit) {
   if (unit != null) {
     fromCombo.getSelectionModel().select(unit);
   } else {
     fromCombo.getSelectionModel().clearSelection();
   }
 }
 public void setupBindings() {
   populateProdFreqValues();
   populateProdTypeValues();
   populateBillCategoryValues();
   refreshProdSpecialPriceTable();
   checkItems();
   dowTF
       .getItems()
       .addAll("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
   nameTF.setText(productRow.getName());
   typeTF.getSelectionModel().select(productRow.getType());
   priceTF.setText("" + productRow.getPrice());
   mondayTF.setText("" + productRow.getMonday());
   tuesdayTF.setText("" + productRow.getTuesday());
   wednesdayTF.setText("" + productRow.getWednesday());
   thursdayTF.setText("" + productRow.getThursday());
   fridayTF.setText("" + productRow.getFriday());
   saturdayTF.setText("" + productRow.getSaturday());
   sundayTF.setText("" + productRow.getSunday());
   codeTF.setText(productRow.getCode());
   dowTF.getSelectionModel().select(productRow.getDow());
   firstDeliveryDate.setValue(productRow.getFirstDeliveryDate());
   issueDate.setValue(productRow.getIssueDate());
   billCategoryTF.getSelectionModel().select(productRow.getBillCategory());
 }
 @FXML
 public void handleControlClock(ActionEvent e) {
   if (controlClock_hour.getText().isEmpty()
       || controlClock_min.getText().isEmpty()
       || controlClock_sec.getText().isEmpty()
       || controlClock_row.getText().isEmpty()
       || controlClock_column.getText().isEmpty()) {
     JOptionPane.showMessageDialog(null, "Every Field should have a value!");
   } else {
     try {
       ((RemoteOrderDisplay) service)
           .controlClock(
               RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                   controlClock_units.getSelectionModel().getSelectedItem()),
               RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                   controlClock_function.getSelectionModel().getSelectedItem()),
               controlClock_clockID.getSelectionModel().getSelectedItem(),
               Integer.parseInt(controlClock_hour.getText()),
               Integer.parseInt(controlClock_min.getText()),
               Integer.parseInt(controlClock_sec.getText()),
               Integer.parseInt(controlClock_row.getText()),
               Integer.parseInt(controlClock_column.getText()),
               Integer.parseInt(controlClock_attribute.getText()),
               RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                   controlClock_mode.getSelectionModel().getSelectedItem()));
     } catch (NumberFormatException e1) {
       JOptionPane.showMessageDialog(null, e1.getMessage());
       e1.printStackTrace();
     } catch (JposException e1) {
       JOptionPane.showMessageDialog(null, e1.getMessage());
       e1.printStackTrace();
     }
   }
 }
 @FXML
 public void handleDrawBox(ActionEvent e) {
   if (drawBox_row.getText().isEmpty()
       || drawBox_column.getText().isEmpty()
       || drawBox_height.getText().isEmpty()
       || drawBox_width.getText().isEmpty()) {
     JOptionPane.showMessageDialog(null, "Every Field should have a value!");
   } else {
     try {
       ((RemoteOrderDisplay) service)
           .drawBox(
               RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                   drawBox_units.getSelectionModel().getSelectedItem()),
               Integer.parseInt(drawBox_row.getText()),
               Integer.parseInt(drawBox_column.getText()),
               Integer.parseInt(drawBox_height.getText()),
               Integer.parseInt(drawBox_width.getText()),
               Integer.parseInt(drawBox_attribute.getText()),
               RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                   drawBox_borderType.getSelectionModel().getSelectedItem()));
     } catch (NumberFormatException e1) {
       JOptionPane.showMessageDialog(null, e1.getMessage());
       e1.printStackTrace();
     } catch (JposException e1) {
       JOptionPane.showMessageDialog(null, e1.getMessage());
       e1.printStackTrace();
     }
   }
 }
Example #6
0
  @Override
  protected void activate() {
    currencyComboBox.setItems(model.getTradeCurrencies());
    currencyComboBox.getSelectionModel().select(model.getTradeCurrency());
    currencyComboBox.setVisibleRowCount(Math.min(currencyComboBox.getItems().size(), 25));
    currencyComboBox.setOnAction(
        e -> {
          model.onSetTradeCurrency(currencyComboBox.getSelectionModel().getSelectedItem());
          updateChartData();
        });

    model.getOfferBookListItems().addListener(changeListener);
    tradeCurrencySubscriber =
        EasyBind.subscribe(
            model.tradeCurrency,
            newValue -> {
              String code = newValue.getCode();
              areaChart.setTitle("Offer book for " + newValue.getName());
              priceColumnLabel.set("Price (" + code + "/BTC)");
              volumeColumnLabel.set("Volume (" + code + ")");
              xAxis.setLabel(priceColumnLabel.get());
              xAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(xAxis, "", ""));
            });

    buyOfferTableView.setItems(model.getBuyOfferList());
    sellOfferTableView.setItems(model.getSellOfferList());

    updateChartData();
  }
 @FXML
 public void handleSaveVideoRegion(ActionEvent e) {
   if (saveVideoRegion_row.getText().isEmpty()
       || saveVideoRegion_column.getText().isEmpty()
       || saveVideoRegion_height.getText().isEmpty()
       || saveVideoRegion_width.getText().isEmpty()) {
     JOptionPane.showMessageDialog(null, "Every Field should have a value!");
   } else {
     try {
       ((RemoteOrderDisplay) service)
           .saveVideoRegion(
               RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                   saveVideoRegion_units.getSelectionModel().getSelectedItem()),
               Integer.parseInt(saveVideoRegion_row.getText()),
               Integer.parseInt(saveVideoRegion_column.getText()),
               Integer.parseInt(saveVideoRegion_height.getText()),
               Integer.parseInt(saveVideoRegion_height.getText()),
               saveVideoRegion_bufferID.getSelectionModel().getSelectedItem());
     } catch (NumberFormatException e1) {
       JOptionPane.showMessageDialog(null, e1.getMessage());
       e1.printStackTrace();
     } catch (JposException e1) {
       JOptionPane.showMessageDialog(null, e1.getMessage());
       e1.printStackTrace();
     }
   }
 }
 private void clearTabGezinInvoer() {
   // todo opgave 3
   cbOuder1Invoer.getSelectionModel().clearSelection();
   cbOuder2Invoer.getSelectionModel().clearSelection();
   tfHuwelijkInvoer.clear();
   tfScheidingInvoer.clear();
 }
  private void showPersoon(Persoon persoon) {
    if (persoon == null) {
      clearTabPersoon();
    } else {
      tfPersoonNr.setText(persoon.getNr() + "");
      tfVoornamen.setText(persoon.getVoornamen());
      tfTussenvoegsel.setText(persoon.getTussenvoegsel());
      tfAchternaam.setText(persoon.getAchternaam());
      tfGeslacht.setText(persoon.getGeslacht().toString());
      tfGebDatum.setText(StringUtilities.datumString(persoon.getGebDat()));
      tfGebPlaats.setText(persoon.getGebPlaats());
      if (persoon.getOuderlijkGezin() != null) {
        cbOuderlijkGezin.getSelectionModel().select(persoon.getOuderlijkGezin());
      } else {
        cbOuderlijkGezin.getSelectionModel().clearSelection();
      }
      // todo opgave 3

      this.alsOuderBetrokkenIn =
          FXCollections.observableArrayList(persoon.getAlsOuderBetrokkenIn());

      ArrayList<Persoon> pList = new ArrayList<Persoon>();
      for (Gezin g : persoon.getAlsOuderBetrokkenIn()) {
        pList.addAll(g.getKinderen());
      }

      this.kinderen = FXCollections.observableArrayList(pList);

      lvAlsOuderBetrokkenBij.setItems(this.getAlsOuderBetrokkenIn());
    }
  }
Example #10
0
  /**
   * Add filters according to the current emulation and chip model of the currently played tune.
   *
   * @param tune currently played tune
   * @param num SID chip number
   * @param filters resulting filter list to add matching filter names to
   * @param filter combo box to select currently selected filter
   */
  private void addFilters(
      final SidTune tune, int num, ObservableList<String> filters, ComboBox<String> filter) {
    EmulationSection emulationSection = util.getConfig().getEmulationSection();

    boolean filterEnable = emulationSection.isFilterEnable(num);

    Emulation emulation = Emulation.getEmulation(emulationSection, tune, num);
    ChipModel model = ChipModel.getChipModel(emulationSection, tune, num);
    String filterName = filterEnable ? emulationSection.getFilterName(num, emulation, model) : null;

    filters.clear();
    filters.add("");
    for (IFilterSection filterSection : util.getConfig().getFilterSection()) {
      if (emulation.equals(Emulation.RESIDFP)) {
        if (filterSection.isReSIDfpFilter6581() && model == ChipModel.MOS6581) {
          filters.add(filterSection.getName());
        } else if (filterSection.isReSIDfpFilter8580() && model == ChipModel.MOS8580) {
          filters.add(filterSection.getName());
        }
      } else {
        if (filterSection.isReSIDFilter6581() && model == ChipModel.MOS6581) {
          filters.add(filterSection.getName());
        } else if (filterSection.isReSIDFilter8580() && model == ChipModel.MOS8580) {
          filters.add(filterSection.getName());
        }
      }
    }
    if (filterEnable) {
      filter.getSelectionModel().select(filterName);
    } else {
      filter.getSelectionModel().select(0);
    }
  }
  private void eliminar() {

    if (comboListar.getSelectionModel().getSelectedIndex() == 0) {
      eliminar(
          5,
          listaDatos.get(tablaResultados.getSelectionModel().getSelectedIndex()).getIdAutor(),
          6);
      txtfNombre.setText(null);
    }
    if (comboListar.getSelectionModel().getSelectedIndex() == 1) {
      eliminar(
          6,
          listaDatos.get(tablaResultados.getSelectionModel().getSelectedIndex()).getIdAutor(),
          7);
      txtfNombre.setText(null);
    }
    if (comboListar.getSelectionModel().getSelectedIndex() == 2) {
      eliminar(
          7,
          listaDatos.get(tablaResultados.getSelectionModel().getSelectedIndex()).getIdAutor(),
          8);
      txtfNombre.setText(null);
    }
    if (comboListar.getSelectionModel().getSelectedIndex() == 3) {
      eliminar(
          8,
          listaDatos.get(tablaResultados.getSelectionModel().getSelectedIndex()).getIdAutor(),
          5);
      txtfNombre.setText(null);
    }
  }
  @FXML
  void actionComboBoxHandler(ActionEvent event) throws IOException {

    Parent parent;
    int selectedIndex = actionComboBox.getSelectionModel().getSelectedIndex();
    String title = actionComboBox.getSelectionModel().getSelectedItem();

    // Switch to a different scene based on choice selected by user
    switch (selectedIndex) {
      case 0:
        parent = FXMLLoader.load(getClass().getResource("/fxml/AddPlayer.fxml"));
        break;
      case 1:
        parent = FXMLLoader.load(getClass().getResource("/fxml/AddGame.fxml"));
        break;
      case 2:
        parent = FXMLLoader.load(getClass().getResource("/fxml/UpdatePlayer.fxml"));
        break;
      case 3:
        parent = FXMLLoader.load(getClass().getResource("/fxml/DisplayPlayerGame.fxml"));
        break;
      default:
        parent = FXMLLoader.load(getClass().getResource("/fxml/MainWindow.fxml"));
        break;
    }

    // Set scene
    super.setScreen(event, parent, title);
  }
 @FXML
 public void handleUpdateVideoRegionAttribute(ActionEvent e) {
   if (updateVideoRegionAttribute_row.getText().isEmpty()
       || updateVideoRegionAttribute_col.getText().isEmpty()
       || updateVideoRegionAttribute_height.getText().isEmpty()
       || updateVideoRegionAttribute_width.getText().isEmpty()) {
     JOptionPane.showMessageDialog(null, "Every Field should have a value!");
   } else {
     try {
       ((RemoteOrderDisplay) service)
           .updateVideoRegionAttribute(
               RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                   updateVideoRegionAttribute_units.getSelectionModel().getSelectedItem()),
               RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                   updateVideoRegionAttribute_function.getSelectionModel().getSelectedItem()),
               Integer.parseInt(updateVideoRegionAttribute_row.getText()),
               Integer.parseInt(updateVideoRegionAttribute_col.getText()),
               Integer.parseInt(updateVideoRegionAttribute_height.getText()),
               Integer.parseInt(updateVideoRegionAttribute_width.getText()),
               Integer.parseInt(updateVideoRegionAttribute_attribute.getText()));
     } catch (NumberFormatException e1) {
       JOptionPane.showMessageDialog(null, e1.getMessage());
       e1.printStackTrace();
     } catch (JposException e1) {
       JOptionPane.showMessageDialog(null, e1.getMessage());
       e1.printStackTrace();
     }
   }
 }
  public void confirm(ActionEvent event) {
    String name = nameField.getText();
    if (S.isEmpty(name)) {
      tipsLabel.setText("错误:工具名字不能为空!");
      nameField.requestFocus();
      return;
    }
    String command = commandText.getText();
    String order = orderField.getText();
    ToolsTray bandeja = (ToolsTray) parentCombo.getSelectionModel().getSelectedItem();
    Integer parentId = bandeja.getId();
    ToolType toolType = (ToolType) typeCombo.getSelectionModel().getSelectedItem();
    String type = toolType.getToolType();

    ToolsTray toolsTray = new ToolsTray();
    toolsTray.setTrayName(name);
    toolsTray.setCommand(command);
    toolsTray.setParentId(parentId);
    toolsTray.setToolOrder(order);
    toolsTray.setToolType(type);
    if (null == id) {
      dao.insert(toolsTray);
      id = toolsTray.getId();
      tipsLabel.setText("添加成功:" + name);
    } else {
      toolsTray.setId(id);
      dao.update(toolsTray);
      tipsLabel.setText("更新成功:" + name);
    }
    refresh(null);
  }
  public void btnSaveCourse_Pressed() {
    Schedule schedule = Manager.INSTANCE.currentEditingSchedule;
    Classroom classroom = null;

    if (!chBxClassrooms.getSelectionModel().isEmpty()) {
      String classroomString = chBxClassrooms.getSelectionModel().getSelectedItem();
      for (Classroom classroomLocal : Manager.INSTANCE.classrooms) {
        if (classroomLocal.getInitials().equals(classroomString)) {
          classroom = classroomLocal;
          break;
        }
      }

      String alertMessage = "";

      String clashes = "";
      ICourse iCourse = Manager.INSTANCE.currentEditignICourse;
      for (Professor professor : ((Lecture) iCourse).getProfessors()) {
        String pClash = CourseModificationChecker.professorClash(professor, schedule, iCourse);
        if (!pClash.equals("")) {
          clashes +=
              professor.getName() + " " + professor.getLastnameFather() + ":" + pClash + "\n";
        }
      }

      if (!clashes.equals("")) {
        alertMessage +=
            "No se puede usar este horario, ya que tiene problemas de topes de horarios de profesores:\n"
                + clashes;
      }

      clashes =
          CourseModificationChecker.classroomClash(
              classroom, schedule, Manager.INSTANCE.currentEditignICourse);

      if (clashes != "") {
        alertMessage +=
            "No se puede crear la clase debido a que la sala esta ocupada en ese horario por otro(s) curso(s):\n"
                + clashes;
      }

      if (!alertMessage.equals("")) {
        ViewUtilities.showAlert(alertMessage);
      } else {
        Manager.INSTANCE.currentEditignICourse.setSchedule(schedule);
        Manager.INSTANCE.currentEditignICourse.setClassroom(classroom);

        if (isCreating) {
          Manager.INSTANCE.currentEditignCourse.addCourse(Manager.INSTANCE.currentEditignICourse);
        }

        Manager.INSTANCE.currentEditignICourse = null;
        Manager.INSTANCE.currentEditingSchedule = null;
        super.btnBack_Pressed();
      }
    } else {
      ViewUtilities.showAlert("Primero debes asignar una sala a la clase");
    }
  }
  private boolean validate(String title) {
    if (instructionsTextArea.getText() == null || instructionsTextArea.getText().length() == 0) {
      String msg = "Instructions text field is empty";
      String details = "Must enter instructions into instructions text field";
      AppContext.getCommonDialogs().showErrorDialog(title, msg, details, workflowInitiationView);
      return false;
    }

    if (workflowProcessesComboBox.getSelectionModel().getSelectedItem()
        == WorkflowProcess.REVIEW3) {
      //			if (editPathCoordinateTextField.getText() == null
      //					|| editPathCoordinateTextField.getText().length() == 0) {
      //				String msg = "Edit view coordinate UUID text field is empty";
      //				String details = "Must enter edit view coordinate UUID into edit coordinate text field";
      //				AppContext.getCommonDialogs().showErrorDialog(title, msg, details,
      // AppContext.getMainApplicationWindow().getPrimaryStage());
      //				return false;
      //			}
      if (promotionPathCoordinateLabel.getText() == null
          || promotionPathCoordinateLabel.getText().length() == 0) {
        String msg = "Promotion view coordinate is unset";
        String details = "Promotion view coordinate must be set in config file app.xml";
        AppContext.getCommonDialogs().showErrorDialog(title, msg, details, workflowInitiationView);
        return false;
      }
    } else if (workflowProcessesComboBox.getSelectionModel().getSelectedItem()
        == WorkflowProcess.DUAL_REVIEW) {
      //			if (editPathCoordinateTextField.getText() == null
      //			|| editPathCoordinateTextField.getText().length() == 0) {
      //		String msg = "Edit view coordinate UUID text field is empty";
      //		String details = "Must enter edit view coordinate UUID into edit coordinate text field";
      //		AppContext.getCommonDialogs().showErrorDialog(title, msg, details,
      // AppContext.getMainApplicationWindow().getPrimaryStage());
      //		return false;
      //	}
      if (promotionPathCoordinateLabel.getText() == null
          || promotionPathCoordinateLabel.getText().length() == 0) {
        String msg = "Promotion view coordinate is unset";
        String details = "Promotion view coordinate must be set in config file app.xml";
        AppContext.getCommonDialogs().showErrorDialog(title, msg, details, workflowInitiationView);
        return false;
      }
    } else {
      String msg =
          "Unsupported WorkflowProcessModel: "
              + workflowProcessesComboBox.getSelectionModel().getSelectedItem();
      String details =
          "Only WorkflowProcess."
              + WorkflowProcess.REVIEW3
              + " and WorkflowProcess."
              + WorkflowProcess.DUAL_REVIEW
              + " currently supported";
      AppContext.getCommonDialogs().showErrorDialog(title, msg, details, workflowInitiationView);
      return false;
    }

    return true;
  }
 @Override
 public void acaoFinalizar() {
   if (validarFormulario()) {
     String idContaOrigem = contaOrigem.getSelectionModel().getSelectedItem().getIdCategoria();
     String idContaDestino = contaDestino.getSelectionModel().getSelectedItem().getIdCategoria();
     if (acao == Acao.CADASTRAR) {
       Transferencia item =
           new Transferencia(
               null,
               idContaOrigem,
               idContaDestino,
               itemController.getIdItem(),
               descricao.getText(),
               valor.getText(),
               data.getValue(),
               Datas.getHoraAtual());
       item.cadastrar();
       new Conta().alterarSaldo(Operacao.DECREMENTAR, idContaOrigem, valor.getText());
       new Conta().alterarSaldo(Operacao.INCREMENTAR, idContaDestino, valor.getText());
       Kernel.principal.acaoTransferencia();
       Janela.showTooltip(Status.SUCESSO, idioma.getMensagem("operacao_sucesso"), Duracao.CURTA);
       Animacao.fadeInOutClose(formulario);
     } else {
       Boolean contaOrigemMudou = !(Modelo.getIdContaOrigem().equals(idContaOrigem));
       if (contaOrigemMudou) {
         new Conta()
             .alterarSaldo(Operacao.INCREMENTAR, Modelo.getIdContaOrigem(), Modelo.getValor());
         new Conta().alterarSaldo(Operacao.DECREMENTAR, idContaOrigem, Modelo.getValor());
       }
       Modelo.setIdContaOrigem(contaOrigem.getValue());
       Boolean contaDestinoMudou = !(Modelo.getIdContaDestino().equals(idContaDestino));
       if (contaDestinoMudou) {
         new Conta()
             .alterarSaldo(Operacao.DECREMENTAR, Modelo.getIdContaDestino(), Modelo.getValor());
         new Conta().alterarSaldo(Operacao.INCREMENTAR, idContaDestino, Modelo.getValor());
       }
       Modelo.setIdContaDestino(contaDestino.getValue());
       Boolean valorMudou = !(Modelo.getValor().equals(valor.getText()));
       if (valorMudou) {
         BigDecimal valorDiferenca = new BigDecimal(Modelo.getValor());
         valorDiferenca = valorDiferenca.subtract(new BigDecimal(valor.getText()));
         new Conta()
             .alterarSaldo(
                 Operacao.INCREMENTAR, Modelo.getIdContaOrigem(), valorDiferenca.toString());
         new Conta()
             .alterarSaldo(
                 Operacao.DECREMENTAR, Modelo.getIdContaDestino(), valorDiferenca.toString());
       }
       Modelo.setValor(valor.getText());
       Modelo.setDescricao(descricao.getText());
       Modelo.setData(data.getValue());
       Modelo.alterar();
       Kernel.principal.acaoTransferencia();
       Janela.showTooltip(Status.SUCESSO, idioma.getMensagem("operacao_sucesso"), Duracao.CURTA);
       Animacao.fadeInOutClose(formulario);
     }
   }
 }
 private void clearTabPersoonInvoer() {
   // todo opgave 3
   tfVoornamenInvoer.clear();
   tfTussenvoegselInvoer.clear();
   tfAchternaamInvoer.clear();
   cbGeslachtInvoer.getSelectionModel().clearSelection();
   tfGeboortedatumInvoer.clear();
   tfGeboorteplaatsInvoer.clear();
   cbOuderlijkGezinInvoer.getSelectionModel().clearSelection();
 }
  private void cleanFieldValues() {
    Random random = new Random();
    String level = String.valueOf(1 + random.nextInt(99));
    levelField.setText(level);

    messageLabel.setText(Constants.EMPTY_STRING);
    characterNameField.setText(Constants.EMPTY_STRING);
    classBox.getSelectionModel().clearSelection();
    characterRaceBox.getSelectionModel().clearSelection();
  }
 @FXML
 public void guardarRegistro() {
   listaComputadoras.add(
       new Computadora(
           cboMarcas.getSelectionModel().getSelectedItem(),
           cboModelos.getSelectionModel().getSelectedItem(),
           Float.valueOf(txtProcesador.getText()),
           Float.valueOf(txtRAM.getText()),
           Float.valueOf(txtDiscoDuro.getText()),
           Float.valueOf(txtVideo.getText())));
 }
 public void refresh(ActionEvent event) {
   initData();
   searchCombo.getSelectionModel().selectFirst();
   parentCombo.getSelectionModel().selectFirst();
   typeCombo.getSelectionModel().selectFirst();
   try {
     TrayService.self.loadMenu(TrayService.self.popupMenu, null);
   } catch (Exception e) {
     logger.error(e.getMessage(), e);
   }
 }
 private void clearTabPersoon() {
   cbPersonen.getSelectionModel().clearSelection();
   tfPersoonNr.clear();
   tfVoornamen.clear();
   tfTussenvoegsel.clear();
   tfAchternaam.clear();
   tfGeslacht.clear();
   tfGebDatum.clear();
   tfGebPlaats.clear();
   cbOuderlijkGezin.getSelectionModel().clearSelection();
   lvAlsOuderBetrokkenBij.setItems(FXCollections.emptyObservableList());
 }
Example #23
0
 public void updateUnidades(Map<Integer, String> items) {
   unidades.getItems().clear();
   unidades.getItems().add(new ComboboxItem(0, "Selecione"));
   unidades.getSelectionModel().select(0);
   for (Map.Entry<Integer, String> entry : items.entrySet()) {
     ComboboxItem item = new ComboboxItem(entry.getKey(), entry.getValue());
     unidades.getItems().add(item);
     if (entry.getKey().equals(unidadeAtual)) {
       unidades.getSelectionModel().select(item);
       updateServicos(main.getService().buscarServicos(entry.getKey()));
     }
   }
 }
 @FXML
 public void handleFreeVideoRegion(ActionEvent e) {
   try {
     ((RemoteOrderDisplay) service)
         .freeVideoRegion(
             RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                 freeVideoRegion_units.getSelectionModel().getSelectedItem()),
             freeVideoRegion_bufferID.getSelectionModel().getSelectedItem());
   } catch (JposException e1) {
     JOptionPane.showMessageDialog(null, e1.getMessage());
     e1.printStackTrace();
   }
 }
 @FXML
 public void handleSelectCharacterSet(ActionEvent e) {
   try {
     ((RemoteOrderDisplay) service)
         .selectChararacterSet(
             RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                 selectCharacterSet_units.getSelectionModel().getSelectedItem()),
             selectCharacterSet_characterSet.getSelectionModel().getSelectedItem());
   } catch (JposException e1) {
     JOptionPane.showMessageDialog(null, e1.getMessage());
     e1.printStackTrace();
   }
 }
  private void initiateWorkflow() {
    if (!validate("Failed initiating workflow")) {
      return;
    }

    String description = generatedComponentDescriptionLabel.getText();
    WorkflowProcess process = workflowProcessesComboBox.getSelectionModel().getSelectedItem();

    Map<String, String> map = getOutputVariablesMap();

    LOG.debug(
        "Invoking createNewConceptWorkflowRequest(preferredDescription=\""
            + description
            + "\", conceptUuid=\""
            + componentOrConcept.getPrimordialUuid().toString()
            + "\", processName=\""
            + process
            + "\")");
    ProcessInstanceCreationRequestI createdRequest = null;

    try {
      createdRequest =
          getWorkflowService()
              .createNewComponentWorkflowRequest(
                  description, componentOrConcept.getPrimordialUuid(), process.getText(), map);
    } catch (Exception e) {
      LOG.error("Unexpected error creating request", e);
    }

    if (createdRequest == null) {
      String title = "Workflow Initiation Failed";
      String msg =
          "Failed creating WorkflowProcessModel "
              + workflowProcessesComboBox.getSelectionModel().getSelectedItem()
              + " (service call returned null)";
      String details = "Component: " + description + "\n" + map;
      AppContext.getCommonDialogs().showErrorDialog(title, msg, details, workflowInitiationView);
    } else {
      LOG.debug("Created ProcessInstanceCreationRequestI: " + createdRequest);

      AppContext.getCommonDialogs()
          .showInformationDialog(
              "Workflow initiation succeeded",
              "Created "
                  + workflowProcessesComboBox.getSelectionModel().getSelectedItem()
                  + "\nFor componentId "
                  + componentOrConcept.getPrimordialUuid());

      doCancel();
    }
  }
 @FXML
 public void handleTransactionDisplay(ActionEvent e) {
   try {
     ((RemoteOrderDisplay) service)
         .transactionDisplay(
             RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                 transactionDisplay_units.getSelectionModel().getSelectedItem()),
             RemoteOrderDisplayConstantMapper.getConstantNumberFromString(
                 transactionDisplay_function.getSelectionModel().getSelectedItem()));
   } catch (JposException e1) {
     JOptionPane.showMessageDialog(null, e1.getMessage());
     e1.printStackTrace();
   }
 }
Example #28
0
 private void updateUI() {
   final boolean running = model.isRunning();
   final boolean scriptRunning = model.isScriptRunning();
   startButton.setDisable(running || scriptRunning);
   stopButton.setDisable(!running && !scriptRunning);
   scriptsButton.setDisable(running || scriptRunning);
   final Settings settings = model.loadSettings();
   goldField.setText(settings.getGoldThreshold() + "");
   elixirField.setText(settings.getElixirThreshold() + "");
   deField.setText(settings.getDarkElixirThreshold() + "");
   maxThField.setText(settings.getMaxThThreshold() + "");
   detectEmptyCollectorsCheckBox.setSelected(settings.isDetectEmptyCollectors());
   isMatchAllConditionsCheckBox.setSelected(settings.isMatchAllConditions());
   collectResourcesCheckBox.setSelected(settings.isCollectResources());
   trainTroopsSlider.setValue(settings.getTrainMaxTroops());
   logLevelComboBox.getSelectionModel().select(settings.getLogLevel());
   autoAttackComboBox.getSelectionModel().select(settings.getAttackStrategy());
   rax1ComboBox.getSelectionModel().select(settings.getRaxInfo()[0]);
   rax2ComboBox.getSelectionModel().select(settings.getRaxInfo()[1]);
   rax3ComboBox.getSelectionModel().select(settings.getRaxInfo()[2]);
   rax4ComboBox.getSelectionModel().select(settings.getRaxInfo()[3]);
   rax5ComboBox.getSelectionModel().select(settings.getRaxInfo()[4]);
   rax6ComboBox.getSelectionModel().select(settings.getRaxInfo()[5]);
   extraFuncCheckBox.setSelected(settings.isExtraFunctions());
 }
  @FXML
  public void limpiarComponentes() {
    txtProcesador.setText(null);
    txtRAM.setText(null);
    txtDiscoDuro.setText(null);
    txtVideo.setText(null);
    cboMarcas.getSelectionModel().select(null);
    cboModelos.getSelectionModel().select(null);
    lstViewComputadoras.getSelectionModel().select(null);

    // Habilitar, Deshabilitar botones
    btnGuardar.setDisable(false);
    btnActualizar.setDisable(true);
    btnEliminar.setDisable(true);
  }
 public Unit getFromUnit() {
   String symbol = fromCombo.getSelectionModel().getSelectedItem().getSymbol();
   if (symbol != null) {
     return AbstractUnit.parse(symbol);
   }
   return null;
 }