Search in sources :

Example 1 with OutputFreightUtil

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;
}
Also used : Node(net.parostroj.timetable.model.Node) Region(net.parostroj.timetable.model.Region) OutputFreightUtil(net.parostroj.timetable.output2.util.OutputFreightUtil) FreightColor(net.parostroj.timetable.model.FreightColor)

Aggregations

FreightColor (net.parostroj.timetable.model.FreightColor)1 Node (net.parostroj.timetable.model.Node)1 Region (net.parostroj.timetable.model.Region)1 OutputFreightUtil (net.parostroj.timetable.output2.util.OutputFreightUtil)1