コード例 #1
0
 // 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());
   }
 }
コード例 #2
0
  @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
ファイル: SessionContext.java プロジェクト: pjBooms/jfxvnc
 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());
             }
           });
 }
コード例 #4
0
 @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)));
 }
コード例 #6
0
  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());
  }
コード例 #7
0
 @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();
               }
             }
           });
 }
コード例 #9
0
 @FXML
 private void submitImageQuestion() {
   QuestionSubmit submit = questionForPane.get(questionAccordion.expandedPaneProperty().get());
   answerForQuestion.put(submit, submit.createAnswerSubmit(imageAnswer.getText(), teamId));
 }
コード例 #10
0
 // een oude ronde verwijderen
 private void removeRound(RoundSubmit round) {
   if (round != null && questionsForRound.get(round) != null) {
     questionsForRound.get(round).removeListener(questionListener);
     questionAccordion.getPanes().clear();
   }
 }
コード例 #11
0
 @Override
 public void initialize(URL location, ResourceBundle resources) {
   menu.setExpandedPane(roomsPane);
   chatrooms = FXCollections.observableArrayList();
   observableUsers = FXCollections.observableArrayList();
 }
コード例 #12
0
 public static void add(Accordion acc, Stage stage) {
   acc.expandedPaneProperty().addListener(new AccordionSizeHack(stage));
 }