allTemplates.add(createDefaultTemplate("A0", false));
return allTemplates;
}
public PrintTemplate createTemplate(String pageSize, boolean landscape) {
PageComponentImpl page = createInstance(PageComponentImpl.class);
page.setSize(pageSize, landscape);
page.setTag(PrintTemplate.PAGE);
MapComponentImpl map = createMap();
ImageComponentImpl northarrow = createArrow();
ScaleBarComponentImpl bar = createBar();
LabelComponentImpl title = createTitle();
LegendComponentImpl legend = new LegendComponentImpl();
legend.setTag(PrintTemplate.LEGEND);
map.addComponent(bar);
map.addComponent(legend);
map.addComponent(northarrow);
page.addComponent(map);
page.addComponent(title);
PrintTemplate template = new PrintTemplate(true);
template.setName("Default" + "-" + pageSize + "-" + (landscape ? "landscape" : "portrait"));
template.setPage(page);
return template;
}