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
 @FXML
 private void setProblem() {
   if (userField.getActiveValidator() != null || contest.getSelectionModel().isEmpty()) return;
   submission.getItems().clear();
   try {
     problem
         .getItems()
         .addAll(
             api.getInfo(
                 userField.getText(), contest.getSelectionModel().getSelectedItem().getValue()));
   } catch (Exception e) {
     getAlert(e, "投稿情報の取得に失敗しました。").show();
     return;
   }
 }
Exemplo n.º 3
0
 @FXML
 private void setSubmission() {
   submission.getItems().addAll(problem.getSelectionModel().getSelectedItem().getValue());
 }