コード例 #1
0
    public SessionContent(Session session, Event event, DataService dataService) {
      // event title
      eventTitle = new ResizableWrappingText(session.getTitle());
      eventTitle.setFont(BASE_FONT);
      eventTitle.setFill(Color.WHITE);

      item1Label = new Text(session == null ? "Time" : "Speakers");
      item1Label.setFill(VLIGHT_GRAY);
      item1Label.setFont(BASE_FONT);

      item1Value = new ResizableWrappingText(session.getSpeakersDisplay());
      item1Value.setFill(Color.WHITE);
      item1Value.setFont(LIGHT_FONT);

      item2Label = new Text("Time");
      item2Label.setFill(VLIGHT_GRAY);
      item2Label.setFont(BASE_FONT);

      item2Value =
          new ResizableWrappingText(
              DAY_TIME_FORMAT.format(event.getStart())
                  + " to "
                  + TIME_FORMAT.format(event.getEnd()));
      item2Value.setFill(Color.WHITE);
      item2Value.setFont(LIGHT_FONT);

      item3Label = new Text("Location");
      item3Label.setFill(VLIGHT_GRAY);
      item3Label.setFont(BASE_FONT);

      item3Value = new ResizableWrappingText(session.getSessionTimes()[0].getRoom().toString());
      item3Value.setFill(Color.WHITE);
      item3Value.setFont(LIGHT_FONT);

      // description
      desc = new ResizableWrappingText(session.getSummary());
      desc.setFill(Color.WHITE);
      desc.setFont(LIGHT_FONT);

      // Button is either a delete button or a favorite button
      fav = event.getSessionTime().getEvent() != null;
      button = fav ? new DeleteButton(event, dataService) : new AddButton(event, dataService);

      getChildren()
          .addAll(
              eventTitle,
              item1Label,
              item1Value,
              item2Label,
              item2Value,
              item3Label,
              item3Value,
              desc,
              button);
    }
コード例 #2
0
    public EventContent(Event event, DataService dataService) {
      // event title
      eventTitle = new ResizableWrappingText(event.getTitle());
      eventTitle.setFont(BASE_FONT);
      eventTitle.setFill(Color.WHITE);

      item1Label = new Text("Time");
      item1Label.setFill(VLIGHT_GRAY);
      item1Label.setFont(BASE_FONT);

      item1Value =
          new ResizableWrappingText(
              DAY_TIME_FORMAT.format(event.getStart())
                  + " to "
                  + TIME_FORMAT.format(event.getEnd()));
      item1Value.setFill(Color.WHITE);
      item1Value.setFont(LIGHT_FONT);

      getChildren().addAll(eventTitle, item1Label, item1Value);

      final String organizer = event.getOrganizer();
      if (organizer != null && !"null".equals(organizer)) {
        item2Label = new Text("Organizer");
        item2Label.setFill(VLIGHT_GRAY);
        item2Label.setFont(BASE_FONT);

        item2Value = new ResizableWrappingText(organizer);
        item2Value.setFill(Color.WHITE);
        item2Value.setFont(LIGHT_FONT);

        getChildren().addAll(item2Label, item2Value);
      }

      final String location = event.getLocation();
      if (location != null && !"null".equals(location)) {
        item3Label = new Text("Location");
        item3Label.setFill(VLIGHT_GRAY);
        item3Label.setFont(BASE_FONT);

        item3Value = new ResizableWrappingText(location);
        item3Value.setFill(Color.WHITE);
        item3Value.setFont(LIGHT_FONT);

        getChildren().addAll(item3Label, item3Value);
      }
    }