Search in sources :

Example 1 with AfterLoadCheck

use of net.parostroj.timetable.actions.AfterLoadCheck in project grafikon by jub77.

the class LoadSave method loadTrainDiagram.

private TrainDiagram loadTrainDiagram(ModelVersion modelVersion, Properties metadata, Reader reader, LSTrainTypeList types) throws LSException, IOException {
    LSSerializer serializer = LSSerializer.getLSSerializer(modelVersion);
    TrainDiagram diagram = serializer.load(reader, types);
    for (TrainDiagramFilter filter : loadFilters) {
        diagram = filter.filter(diagram, modelVersion);
    }
    (new AfterLoadCheck()).check(diagram);
    return diagram;
}
Also used : AfterLoadCheck(net.parostroj.timetable.actions.AfterLoadCheck) TrainDiagram(net.parostroj.timetable.model.TrainDiagram)

Example 2 with AfterLoadCheck

use of net.parostroj.timetable.actions.AfterLoadCheck in project grafikon by jub77.

the class TrainDiagramBuilder method getTrainDiagram.

public TrainDiagram getTrainDiagram() throws LSException {
    if (diagram == null) {
        throw new IllegalStateException("Diagram already created");
    }
    this.finishDelaydObjectWithIds();
    this.finishCirculationSequences();
    // after load check
    (new AfterLoadCheck()).check(diagram);
    // tracking of changes has to be enabled at the end, otherwise
    // it would also track changes caused by loading of the diagram
    diagram.getChangesTracker().setTrackingEnabled(trackChanges);
    if (trackChanges) {
        diagram.getChangesTracker().addVersion(null, null, null);
        diagram.getChangesTracker().setLastAsCurrent();
    }
    TrainDiagram retValue = diagram;
    diagram = null;
    return retValue;
}
Also used : AfterLoadCheck(net.parostroj.timetable.actions.AfterLoadCheck) TrainDiagram(net.parostroj.timetable.model.TrainDiagram)

Aggregations

AfterLoadCheck (net.parostroj.timetable.actions.AfterLoadCheck)2 TrainDiagram (net.parostroj.timetable.model.TrainDiagram)2