Search in sources :

Example 26 with TimeInterval

use of net.parostroj.timetable.model.TimeInterval in project grafikon by jub77.

the class PositionsExtractor method getStartPositions.

public List<Position> getStartPositions(Collection<TrainsCycle> cycles, Integer startingTime) {
    List<Position> result = new LinkedList<>();
    for (Pair<TrainsCycleItem, TimeInterval> cycleItem : this.getItemStarts(cycles, startingTime)) {
        TrainsCycleItem start = cycleItem.first;
        TrainsCycle cycle = start.getCycle();
        TimeInterval interval = cycleItem.second;
        String startName = interval.getOwnerAsNode().getName();
        String startTrack = interval.getTrack().getNumber();
        String startTime = diagram.getTimeConverter().convertIntToXml(interval.getEnd());
        result.add(new Position(cycle.getName(), cycle.getDisplayDescription(), startName, startTrack, startTime, start.getTrain().getName(), ae.extract(cycle.getAttributes())));
    }
    return result;
}
Also used : TrainsCycle(net.parostroj.timetable.model.TrainsCycle) TimeInterval(net.parostroj.timetable.model.TimeInterval) TrainsCycleItem(net.parostroj.timetable.model.TrainsCycleItem) LinkedList(java.util.LinkedList)

Aggregations

TimeInterval (net.parostroj.timetable.model.TimeInterval)26 Train (net.parostroj.timetable.model.Train)9 ArrayList (java.util.ArrayList)6 Node (net.parostroj.timetable.model.Node)6 List (java.util.List)5 LinkedList (java.util.LinkedList)4 TrainDiagram (net.parostroj.timetable.model.TrainDiagram)4 Component (java.awt.Component)3 Collection (java.util.Collection)3 Wrapper (net.parostroj.timetable.gui.wrappers.Wrapper)3 FNConnection (net.parostroj.timetable.model.FNConnection)3 LocalizedString (net.parostroj.timetable.model.LocalizedString)3 TranslatedString (net.parostroj.timetable.model.TranslatedString)3 Pair (net.parostroj.timetable.utils.Pair)3 BorderLayout (java.awt.BorderLayout)2 FlowLayout (java.awt.FlowLayout)2 Rectangle (java.awt.Rectangle)2 Shape (java.awt.Shape)2 ItemEvent (java.awt.event.ItemEvent)2 Collator (java.text.Collator)2