test_class.declarator: configurationService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private PrintConfigurationService configurationService;
test_class.type: PrintConfigurationService
test_class.var_name: configurationService
test_class.declarator: printDtoService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private PrintDtoConverterService printDtoService;
test_class.type: PrintDtoConverterService
test_class.var_name: printDtoService
test_class.declarator: printService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private PrintService printService;
test_class.type: PrintService
test_class.var_name: printService
test_class.declarator: securityManager
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private SecurityManager securityManager;
test_class.type: SecurityManager
test_class.var_name: securityManager
test_class.file: plugin/print/print/src/test/java/org/geomajas/plugin/printing/document/DefaultDocumentTest.java
test_class.identifier: DefaultDocumentTest
test_case.body: @Test
  	public void testRenderLegend() throws Exception {
  		LegendComponentInfo legend = new LegendComponentInfo();
  		FontStyleInfo style = new FontStyleInfo();
  		style.setFamily("Dialog");
  		style.setStyle("Italic");
  		style.setSize(12);
  		legend.setFont(style);
  		legend.setMapId("mainMap");
  		legend.setTag("legend");
  		legend.setTitle("legend");
  		for (ClientLayerInfo layer : configurationService.getMapInfo("mainMap", "application").getLayers()) {
  			if (layer instanceof ClientVectorLayerInfo) {
  				ClientVectorLayerInfo layerInfo = (ClientVectorLayerInfo) layer;
  				String label = layerInfo.getLabel();
  				List<FeatureStyleInfo> defs = layerInfo.getNamedStyleInfo().getFeatureStyles();
  				for (FeatureStyleInfo styleDefinition : defs) {
  					String text = "";
  					if (defs.size() > 1) {
  						text = label + "(" + styleDefinition.getName() + ")";
  					} else {
  						text = label;
  					}
  					LegendItemComponentInfo item = new LegendItemComponentInfo();
  					LegendIconComponentInfo icon = new LegendIconComponentInfo();
  					icon.setLabel(text);
  					icon.setStyleInfo(styleDefinition);
  					icon.setLayerType(layerInfo.getLayerType());
  					LabelComponentInfo legendLabel = new LabelComponentInfo();
  					legendLabel.setBackgroundColor("0xFFFFFF");
  					legendLabel.setBorderColor("0x000000");
  					legendLabel.setFontColor("0x000000");
  					legendLabel.setFont(legend.getFont());
  					legendLabel.setText(text);
  					legendLabel.setTextOnly(true);
  					item.addChild(icon);
  					item.addChild(legendLabel);
  					legend.addChild(item);
  				}
  			} else if (layer instanceof ClientRasterLayerInfo) {
  				ClientRasterLayerInfo layerInfo = (ClientRasterLayerInfo) layer;
  				LegendItemComponentInfo item = new LegendItemComponentInfo();
  				LegendIconComponentInfo icon = new LegendIconComponentInfo();
  				icon.setLabel(layerInfo.getLabel());
  				icon.setLayerType(layerInfo.getLayerType());
  				LabelComponentInfo legendLabel = new LabelComponentInfo();
  				legendLabel.setFont(legend.getFont());
  				legendLabel.setBackgroundColor("0xFFFFFF");
  				legendLabel.setBorderColor("black");
  				legendLabel.setFontColor("0x000000");
  				legendLabel.setText(layerInfo.getLabel());
  				legendLabel.setTextOnly(true);
  				item.addChild(icon);
  				item.addChild(legendLabel);
  				legend.addChild(item);
  			}
  		}
  		LegendComponent comp = (LegendComponent) printDtoService.toInternal(legend);
  		PageComponentImpl page = new PageComponentImpl();
  		page.setSize("0 0", false);
  		page.addComponent(comp);
  		PrintTemplate template = new PrintTemplate();
  		template.setPage(page);
  		SinglePageDocument pdfDoc = new SinglePageDocument(page, null);
  		FileOutputStream fo = new FileOutputStream("target/legend.png");
  		pdfDoc.render(fo, Format.PNG, 200);
  		fo.flush();
  		fo.close();
  	}
test_case.class_method_signature: DefaultDocumentTest.testRenderLegend()
test_case.full_signature: @Test public void testRenderLegend()
test_case.identifier: testRenderLegend
test_case.invocations: setFamily setStyle setSize setFont setMapId setTag setTitle getLayers getMapInfo getLabel getFeatureStyles getNamedStyleInfo size getName setLabel setStyleInfo setLayerType getLayerType setBackgroundColor setBorderColor setFontColor setFont getFont setText setTextOnly addChild addChild addChild setLabel getLabel setLayerType getLayerType setFont getFont setBackgroundColor setBorderColor setFontColor setText getLabel setTextOnly addChild addChild addChild toInternal setSize addComponent setPage render flush close
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRenderLegend()
focal_class.declarator: defaultVisitor
focal_class.modifier: private
focal_class.original_string: private DefaultConfigurationVisitor defaultVisitor;
focal_class.type: DefaultConfigurationVisitor
focal_class.var_name: defaultVisitor
focal_class.declarator: visitor
focal_class.modifier: private
focal_class.original_string: private MapConfigurationVisitor visitor;
focal_class.type: MapConfigurationVisitor
focal_class.var_name: visitor
focal_class.file: plugin/print/print/src/main/java/org/geomajas/plugin/printing/document/DefaultDocument.java
focal_class.identifier: DefaultDocument
focal_class.class_method_signature: DefaultDocument.DefaultDocument(PrintTemplate template, Map<String, String> filters,
  			DefaultConfigurationVisitor defaultVisitor, MapConfigurationVisitor visitor)
focal_class.full_signature: public  DefaultDocument(PrintTemplate template, Map<String, String> filters,
  			DefaultConfigurationVisitor defaultVisitor, MapConfigurationVisitor visitor)
focal_class.identifier: DefaultDocument
focal_class.modifiers: public
focal_class.parameters: (PrintTemplate template, Map<String, String> filters,
  			DefaultConfigurationVisitor defaultVisitor, MapConfigurationVisitor visitor)
focal_class.signature:  DefaultDocument(PrintTemplate template, Map<String, String> filters,
  			DefaultConfigurationVisitor defaultVisitor, MapConfigurationVisitor visitor)
focal_class.class_method_signature: DefaultDocument.render(OutputStream outputStream, Format format, int dpi)
focal_class.full_signature: @Override public void render(OutputStream outputStream, Format format, int dpi)
focal_class.identifier: render
focal_class.modifiers: @Override public
focal_class.parameters: (OutputStream outputStream, Format format, int dpi)
focal_class.return: void
focal_class.signature: void render(OutputStream outputStream, Format format, int dpi)
focal_class.superclass: extends SinglePageDocument
focal_method.body: @Override
  	public void render(OutputStream outputStream, Format format, int dpi) throws PrintingException {
  		defaultVisitor.visitTree(getPage());
  		visitor.visitTree(getPage());
  		super.render(outputStream, format, dpi);
  	}
focal_method.class_method_signature: DefaultDocument.render(OutputStream outputStream, Format format, int dpi)
focal_method.full_signature: @Override public void render(OutputStream outputStream, Format format, int dpi)
focal_method.identifier: render
focal_method.invocations: visitTree getPage visitTree getPage render
focal_method.modifiers: @Override public
focal_method.parameters: (OutputStream outputStream, Format format, int dpi)
focal_method.return: void
focal_method.signature: void render(OutputStream outputStream, Format format, int dpi)