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;
}
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;
}
};
}
Aggregations