use of jfxtras.scene.control.agenda.Agenda.LocalDateTimeRange in project Gargoyle by callakrsos.
the class AgendaExam method start.
/* (non-Javadoc)
* @see javafx.application.Application#start(javafx.stage.Stage)
*/
@Override
public void start(Stage primaryStage) throws Exception {
Agenda agenda = new Agenda() {
@Override
public Skin<?> createDefaultSkin() {
return new AgendaDaysFromDisplayedSkin(this);
}
};
// setup appointment groups
final Map<String, Agenda.AppointmentGroup> lAppointmentGroupMap = new TreeMap<String, Agenda.AppointmentGroup>();
for (Agenda.AppointmentGroup lAppointmentGroup : agenda.appointmentGroups()) {
lAppointmentGroupMap.put(lAppointmentGroup.getDescription(), lAppointmentGroup);
}
// accept new appointments
agenda.newAppointmentCallbackProperty().set(new Callback<Agenda.LocalDateTimeRange, Agenda.Appointment>() {
@Override
public Agenda.Appointment call(LocalDateTimeRange dateTimeRange) {
return new Agenda.AppointmentImplLocal().withStartLocalDateTime(dateTimeRange.getStartLocalDateTime()).withEndLocalDateTime(dateTimeRange.getEndLocalDateTime()).withSummary("new").withDescription("new").withAppointmentGroup(lAppointmentGroupMap.get("group01"));
}
});
BorderPane root = new BorderPane(agenda);
root.getStylesheets().add(AgendaSkinSwitcher.class.getResource("/jfxtras/internal/scene/control/skin/agenda/" + AgendaSkinSwitcher.class.getSimpleName() + ".css").toExternalForm());
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
Aggregations