Exemplo n.º 1
0
 @FXML
 private void setCode() {
   if (submission.getSelectionModel().isEmpty()) return;
   try {
     obj.call(
         "setCode",
         api.getCode(
             submission.getSelectionModel().getSelectedItem().getId(),
             contest.getSelectionModel().getSelectedItem().getValue()));
   } catch (Exception e) {
     getAlert(e, "提出コードの取得に失敗しました。").show();
     return;
   }
   languageLabel.setText(submission.getSelectionModel().getSelectedItem().getLanguage());
   Extension lang = Extension.of(languageLabel.getText());
   if (Stream.of(Extension.C, Extension.CPP).anyMatch(e -> e.equals(lang)))
     obj.call("setMode", "c_cpp");
   else obj.call("setMode", lang.toString().toLowerCase());
 }
Exemplo n.º 2
0
  public static void run(Folder f) {
    System.out.println("+" + f.path);

    for (Extension x : f.allowedExtensions) {
      System.out.println(x.toString());
    }

    f.getFilePaths();

    for (String path : f.files) {
      File file = FileFactory.Create(path);
      System.out.println(file.getPath());
      file.read();

      file.getWords().forEach((k, v) -> words.merge(k, v, (v1, v2) -> v1 + v2));
    }

    int times =
        Integer.parseInt(
            JOptionPane.showInputDialog("Qual o mínimo de repetições a serem mostradas"));
    File.ListWords(words, times);
  }