// als de ronde is doorgestuurd een nieuwe ronde laden
 private void setRound(RoundSubmit round) {
   if (round != null) {
     questionAccordion.getPanes().clear();
     questionsForRound.get(round).addListener(questionListener);
     roundTitle.setText(round.getRoundName());
   }
 }
  @FXML
  private void submitOpenQuestion() {
    System.out.println("submit");

    QuestionSubmit submit = questionForPane.get(questionAccordion.expandedPaneProperty().get());
    answerForQuestion.put(submit, submit.createAnswerSubmit(openAnswer.getText(), teamId));
  }
예제 #3
0
 public void bind(final Accordion accordion, final String propertyName) {
   Object selectedPane = props.getProperty(propertyName);
   for (TitledPane tp : accordion.getPanes()) {
     if (tp.getText() != null && tp.getText().equals(selectedPane)) {
       accordion.setExpandedPane(tp);
       break;
     }
   }
   accordion
       .expandedPaneProperty()
       .addListener(
           (ov, t, expandedPane) -> {
             if (expandedPane != null) {
               props.setProperty(propertyName, expandedPane.getText());
             }
           });
 }
 @FXML
 private void submitMultipleQuestion() {
   String answer =
       choises.getSelectedToggle() == null
           ? ""
           : ((RadioButton) choises.getSelectedToggle()).getText();
   QuestionSubmit submit = questionForPane.get(questionAccordion.expandedPaneProperty().get());
   answerForQuestion.put(submit, submit.createAnswerSubmit(answer, teamId));
 }
예제 #5
0
 @Override
 public void initialize(URL location, ResourceBundle resources) {
   toValidate = creditRequestService.getNotValidatedCreditRequests();
   if (toValidate.isEmpty()) {
     statusLabel.setText("No Financial Reports to Validate");
   } else {
     statusLabel.setText("Validate the following Financial Reports");
   }
   toValidate.forEach(f -> creditRequestAccordion.getPanes().add(createTitledPane(f)));
 }
  private void initBindings() {
    // zorgen dat de content van de scrollpane de juiste brete aanhoud
    quizPane.prefWidthProperty().bind(questionScroll.widthProperty().add(-5));
    // wrappings zetten
    openQuestionText.wrappingWidthProperty().bind(openQuestionVbox.widthProperty().add(-20));
    multipleChoiceText.wrappingWidthProperty().bind(multipleChoiseVbox.widthProperty().add(-20));
    imageQuestionText.wrappingWidthProperty().bind(imageQuestionVbox.widthProperty().add(-20));

    questionListener =
        new ListChangeListener<QuestionSubmit>() {
          @Override
          public void onChanged(
              javafx.collections.ListChangeListener.Change<? extends QuestionSubmit> c) {
            for (QuestionSubmit s : c.getList()) {
              if (!questionForPane.values().contains(s)) {
                TitledPane p = new TitledPane(s.getQuestion(), new AnchorPane());
                questionAccordion.getPanes().add(p);
                questionForPane.put(p, s);
              }
            }
          }
        };

    questionAccordion
        .expandedPaneProperty()
        .addListener(
            new ChangeListener<TitledPane>() {
              @Override
              public void changed(
                  ObservableValue<? extends TitledPane> observable,
                  TitledPane oldValue,
                  TitledPane newValue) {
                if (oldValue != null) {
                  ((AnchorPane) oldValue.getContent()).getChildren().clear();
                }
                if (newValue != null) {
                  createQuestionFor(newValue);
                }
              }
            });

    currentPlayingRound.addListener(
        new ChangeListener<RoundSubmit>() {
          @Override
          public void changed(
              ObservableValue<? extends RoundSubmit> observable,
              RoundSubmit oldValue,
              RoundSubmit newValue) {
            removeRound(oldValue);
            setRound(newValue);
          }
        });

    quizPane.visibleProperty().bind(currentPlayingRound.isNotNull());
  }
 @Override
 public void initialize(URL location, ResourceBundle resources) {
   List<CreditInfo> creditHistory =
       creditInfoService.getCreditHistory(session.getUserUnderValidationId());
   if (creditHistory != null) {
     creditHistory.forEach(c -> creditHistoryAccordion.getPanes().add(createTitledPane(c)));
     statusLabel.setText("List of previous credits of the user");
   } else {
     statusLabel.setText("There is no credit history for this user");
   }
 }
예제 #8
0
 private void createConferences() {
   final TitledPane sf =
       createConference(
           "JavaOne SF",
           37.775057,
           -122.416534,
           "http://steveonjava.com/wp-content/uploads/2010/07/JavaOne-2010-Speaker.png");
   // "JavaOne India", 17.385371, 78.484268,
   // "http://steveonjava.com/wp-content/uploads/2011/03/javaone-india.png");
   conferenceAccordion.getPanes().add(sf);
   conferenceAccordion
       .getPanes()
       .add(
           createConference(
               "OSCON",
               45.515008,
               -122.693253,
               "http://steveonjava.com/wp-content/uploads/2011/05/oscon.png"));
   conferenceAccordion
       .getPanes()
       .add(
           createConference(
               "Devoxx",
               51.206883,
               4.44,
               "http://steveonjava.com/wp-content/uploads/2010/07/LogoDevoxxNeg150.png"));
   conferenceAccordion
       .getPanes()
       .add(
           createConference(
               "J-Fall",
               52.219913,
               5.474253,
               "http://steveonjava.com/wp-content/uploads/2011/11/jfall3.png"));
   conferenceAccordion
       .getPanes()
       .add(
           createConference(
               "JavaOne India",
               17.385371,
               78.484268,
               "http://steveonjava.com/wp-content/uploads/2011/03/javaone-india.png"));
   conferenceAccordion
       .getPanes()
       .add(
           createConference(
               "Jazoon",
               47.382079,
               8.528137,
               "http://steveonjava.com/wp-content/uploads/2010/04/jazoon.png"));
   conferenceAccordion
       .getPanes()
       .add(
           createConference(
               "GeeCON",
               50.064633,
               19.949799,
               "http://steveonjava.com/wp-content/uploads/2011/03/geecon.png"));
   sf.setExpanded(true);
   conferenceAccordion.setExpandedPane(sf);
   conferenceAccordion
       .expandedPaneProperty()
       .addListener(
           new ChangeListener<TitledPane>() {
             public void changed(
                 ObservableValue<? extends TitledPane> ov, TitledPane t, TitledPane t1) {
               if (t1 != null) {
                 ((ConferencePane) t1).navigateTo();
               }
             }
           });
 }
 @FXML
 private void submitImageQuestion() {
   QuestionSubmit submit = questionForPane.get(questionAccordion.expandedPaneProperty().get());
   answerForQuestion.put(submit, submit.createAnswerSubmit(imageAnswer.getText(), teamId));
 }
 // een oude ronde verwijderen
 private void removeRound(RoundSubmit round) {
   if (round != null && questionsForRound.get(round) != null) {
     questionsForRound.get(round).removeListener(questionListener);
     questionAccordion.getPanes().clear();
   }
 }
 @Override
 public void initialize(URL location, ResourceBundle resources) {
   menu.setExpandedPane(roomsPane);
   chatrooms = FXCollections.observableArrayList();
   observableUsers = FXCollections.observableArrayList();
 }
 public static void add(Accordion acc, Stage stage) {
   acc.expandedPaneProperty().addListener(new AccordionSizeHack(stage));
 }