Search in sources :

Example 1 with Template

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

the class TemplatePM method ok.

public boolean ok() {
    // write back
    Template template = ref != null ? ref.get() : null;
    if (template != null) {
        // write values back
        template.setName(name.getCurrentEdit().get());
        template.setDescription(description.getCurrentEdit().get());
    }
    return true;
}
Also used : Template(net.parostroj.timetable.model.templates.Template)

Example 2 with Template

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

the class NewModelPM method create.

private void create() {
    final Template templateInstance = template.getValue();
    final Scale scaleValue = scale.getValue();
    final double timeScaleValue = timeScale.getBigDecimal().doubleValue();
    this.createTask = new Callable<TrainDiagram>() {

        @Override
        public TrainDiagram call() throws LSException {
            TrainDiagram diagram = templateLoader.loadTemplate(templateInstance);
            diagram.setAttribute(TrainDiagram.ATTR_SCALE, scaleValue);
            diagram.setAttribute(TrainDiagram.ATTR_TIME_SCALE, timeScaleValue);
            return diagram;
        }
    };
}
Also used : Scale(net.parostroj.timetable.model.Scale) LSException(net.parostroj.timetable.model.ls.LSException) Template(net.parostroj.timetable.model.templates.Template) TrainDiagram(net.parostroj.timetable.model.TrainDiagram)

Aggregations

Template (net.parostroj.timetable.model.templates.Template)2 Scale (net.parostroj.timetable.model.Scale)1 TrainDiagram (net.parostroj.timetable.model.TrainDiagram)1 LSException (net.parostroj.timetable.model.ls.LSException)1