use of net.parostroj.timetable.output2.util.OutputFreightUtil in project grafikon by jub77.
the class FreightDestinationInfo method convert.
public static FreightDestinationInfo convert(Locale locale, FreightConnection dst) {
FreightDestinationInfo info = new FreightDestinationInfo();
if (dst.getTo().isNode()) {
Node to = dst.getTo().getNode();
info.setName(to.getName());
info.setAbbr(to.getAbbr());
List<FreightColor> sortedColors = OutputFreightUtil.sortFreightColors(dst.getTo().getFreightColors());
info.setColors(sortedColors == null || sortedColors.isEmpty() ? null : sortedColors);
if (!dst.getTo().isVisible()) {
info.setHidden(true);
}
}
if (dst.getTo().isRegions()) {
Set<Region> regions = dst.getTo().getRegions();
info.setRegions(new OutputFreightUtil().regionsToString(regions, locale));
}
return info;
}
Aggregations