use of jfxtras.scene.control.agenda.Agenda.AppointmentImplLocal in project phoebus by ControlSystemStudio.
the class LogEntryCalenderViewController method refresh.
private void refresh() {
map = new HashMap<Appointment, LogEntry>();
map = this.logEntries.stream().collect(Collectors.toMap(new Function<LogEntry, Appointment>() {
@Override
public Appointment apply(LogEntry logentry) {
AppointmentImplLocal appointment = new Agenda.AppointmentImplLocal();
appointment.withSummary(logentry.getDescription());
appointment.withDescription(logentry.getDescription());
appointment.withStartLocalDateTime(LocalDateTime.ofInstant(logentry.getCreatedDate(), ZoneId.systemDefault()));
appointment.withEndLocalDateTime(LocalDateTime.ofInstant(logentry.getCreatedDate().plusSeconds(2400), ZoneId.systemDefault()));
List<String> logbookNames = getLogbookNames();
if (logbookNames != null && !logbookNames.isEmpty()) {
int index = logbookNames.indexOf(logentry.getLogbooks().iterator().next().getName());
if (index >= 0 && index <= 22) {
appointment.setAppointmentGroup(appointmentGroupMap.get(String.format("group%02d", (index + 1))));
} else {
appointment.setAppointmentGroup(appointmentGroupMap.get(String.format("group%02d", 23)));
}
}
return appointment;
}
}, new Function<LogEntry, LogEntry>() {
@Override
public LogEntry apply(LogEntry logentry) {
return logentry;
}
}));
agenda.appointments().clear();
agenda.appointments().setAll(map.keySet());
}
use of jfxtras.scene.control.agenda.Agenda.AppointmentImplLocal in project phoebus by ControlSystemStudio.
the class LogEntryCalenderViewController method refresh.
private void refresh() {
map = new HashMap<Appointment, LogEntry>();
map = this.logEntries.stream().collect(Collectors.toMap(new Function<LogEntry, Appointment>() {
@Override
public Appointment apply(LogEntry logentry) {
AppointmentImplLocal appointment = new Agenda.AppointmentImplLocal();
appointment.withSummary(logentry.getDescription());
appointment.withDescription(logentry.getDescription());
appointment.withStartLocalDateTime(LocalDateTime.ofInstant(logentry.getCreatedDate(), ZoneId.systemDefault()));
appointment.withEndLocalDateTime(LocalDateTime.ofInstant(logentry.getCreatedDate().plusSeconds(2400), ZoneId.systemDefault()));
List<String> logbookNames = getLogbookNames();
if (logbookNames != null && !logbookNames.isEmpty()) {
int index = logbookNames.indexOf(logentry.getLogbooks().iterator().next().getName());
if (index >= 0 && index <= 22) {
appointment.setAppointmentGroup(appointmentGroupMap.get(String.format("group%02d", (index + 1))));
} else {
appointment.setAppointmentGroup(appointmentGroupMap.get(String.format("group%02d", 23)));
}
}
return appointment;
}
}, new Function<LogEntry, LogEntry>() {
@Override
public LogEntry apply(LogEntry logentry) {
return logentry;
}
}));
Platform.runLater(() -> {
agenda.appointments().clear();
agenda.appointments().setAll(map.keySet());
});
}
Aggregations