use of net.parostroj.timetable.utils.Tuple in project grafikon by jub77.
the class FreightDestinationPanel method addFreightToNodes.
private void addFreightToNodes(DataModel model, NodeFreight nodeFreight) {
Locale locale = Locale.getDefault();
Collator collator = Collator.getInstance();
List<Tuple<String>> lines = nodeFreight.getNodeConnections().stream().filter(e -> e.getTo().isVisible()).map(e -> {
String node = util.freightNodeToString(e.getTo(), locale, false);
String trains = util.intervalsToString(diagram, e.getTransport().getTrains(), locale).stream().collect(Collectors.joining(", "));
return new Tuple<>(node, trains);
}).sorted(comparator(collator)).collect(Collectors.toList());
model.addLinesWithEmpty(lines);
}
use of net.parostroj.timetable.utils.Tuple in project grafikon by jub77.
the class FreightDestinationPanel method addFreightToRegions.
private void addFreightToRegions(DataModel model, NodeFreight nodeFreight) {
Locale locale = Locale.getDefault();
Collator collator = Collator.getInstance();
List<Tuple<String>> lines = nodeFreight.getRegionConnections().stream().map(e -> {
String region = util.freightRegionsToString(e.getTo(), locale).stream().collect(Collectors.joining(", "));
String transport = util.transportToString(diagram, e.getTransport(), locale).stream().collect(Collectors.joining(", "));
return new Tuple<>(region, transport);
}).sorted(comparator(collator)).collect(Collectors.toList());
model.addLinesWithEmpty(lines);
}
use of net.parostroj.timetable.utils.Tuple in project grafikon by jub77.
the class FreightDestinationPanel method addFreightTrainsFromNode.
private void addFreightTrainsFromNode(DataModel model, Node node, FreightAnalyser analyser) {
Locale locale = Locale.getDefault();
List<TimeInterval> intervalsFrom = analyser.getFreightIntervalsFrom(node);
List<Tuple<String>> trains = intervalsFrom.stream().map(i -> new Tuple<>(util.intervalToString(diagram, i, locale), util.freightListToString(analyser.getConnectionStrategy().getFreightToNodes(i), locale).stream().collect(Collectors.joining(", ")))).collect(Collectors.toList());
model.addLinesWithEmpty(trains);
}
use of net.parostroj.timetable.utils.Tuple in project grafikon by jub77.
the class FreightDestinationPanel method addFreightTrainUnitsFromNode.
private void addFreightTrainUnitsFromNode(DataModel model, Node node, FreightAnalyser analyser) {
Locale locale = Locale.getDefault();
List<TimeInterval> intervals = analyser.getFreightTrainUnitIntervals(node);
List<Tuple<String>> trains = intervals.stream().map(i -> new Tuple<>(util.intervalToString(diagram, i, locale), util.intervalFreightTrainUnitToString(diagram, i).stream().collect(Collectors.joining(", ")))).collect(Collectors.toList());
model.addLinesWithEmpty(trains);
}
use of net.parostroj.timetable.utils.Tuple in project grafikon by jub77.
the class FreightDestinationPanel method addFreightToColors.
private void addFreightToColors(DataModel model, NodeFreight nodeFreight) {
Locale locale = Locale.getDefault();
List<Tuple<String>> lines = nodeFreight.getFreightColorConnections().stream().map(e -> {
String color = util.freightColorsToString(e.getTo(), locale).stream().collect(Collectors.joining(", "));
String transport = util.transportToString(diagram, e.getTransport(), locale).stream().collect(Collectors.joining(", "));
return new Tuple<>(color, transport);
}).collect(Collectors.toList());
model.addLinesWithEmpty(lines);
}
Aggregations