@Test public void testExportToSVG() { when(canvasExport.toContext2D(eq(canvasHandler), any(CanvasExportSettings.class))).thenReturn(context2D); tested.exportToSvg(canvasHandler, "file1"); verify(svgFileExport, times(1)).export(context2D, "file1.svg"); verify(clearSelectionEvent).fire(any(CanvasClearSelectionEvent.class)); }
public void exportToSvg(final AbstractCanvasHandler canvasHandler, final String fileName) { clearSelection(canvasHandler); final String fullFileName = fileName + "." + getFileExtension(CanvasExport.URLDataType.SVG); svgFileExport.export(canvasExport.toContext2D(canvasHandler, CanvasExportSettings.build()), fullFileName); }
CanvasFileExport { public void exportToSvg(final AbstractCanvasHandler canvasHandler, final String fileName) { clearSelection(canvasHandler); final String fullFileName = fileName + "." + getFileExtension(CanvasExport.URLDataType.SVG); svgFileExport.export(canvasExport.toContext2D(canvasHandler, CanvasExportSettings.build()), fullFileName); } }
CanvasFileExport { public void exportToSvg(final AbstractCanvasHandler canvasHandler, final String fileName) { clearSelection(canvasHandler); final String fullFileName = fileName + "." + getFileExtension(CanvasExport.URLDataType.SVG); svgFileExport.export(canvasExport.toContext2D(canvasHandler, CanvasExportSettings.build()), fullFileName); } protected  CanvasFileExport(); @Inject  CanvasFileExport(final CanvasExport<AbstractCanvasHandler> canvasExport,
                            final FileExport<ImageDataUriContent> imageFileExport,
                            final FileExport<PdfDocument> pdfFileExport,
                            final FileExportsPreferences preferences,
                            final SvgFileExport svgFileExport,
                            final Event<CanvasClearSelectionEvent> clearSelectionEvent); }
CanvasFileExport { public void exportToSvg(final AbstractCanvasHandler canvasHandler, final String fileName) { clearSelection(canvasHandler); final String fullFileName = fileName + "." + getFileExtension(CanvasExport.URLDataType.SVG); svgFileExport.export(canvasExport.toContext2D(canvasHandler, CanvasExportSettings.build()), fullFileName); } protected  CanvasFileExport(); @Inject  CanvasFileExport(final CanvasExport<AbstractCanvasHandler> canvasExport,
                            final FileExport<ImageDataUriContent> imageFileExport,
                            final FileExport<PdfDocument> pdfFileExport,
                            final FileExportsPreferences preferences,
                            final SvgFileExport svgFileExport,
                            final Event<CanvasClearSelectionEvent> clearSelectionEvent); void exportToSvg(final AbstractCanvasHandler canvasHandler,
                            final String fileName); String exportToSvg(final AbstractCanvasHandler canvasHandler); String exportToPng(final AbstractCanvasHandler canvasHandler); void exportToJpg(final AbstractCanvasHandler canvasHandler,
                            final String fileName); void exportToPng(final AbstractCanvasHandler canvasHandler,
                            final String fileName); void exportToPdf(final AbstractCanvasHandler canvasHandler,
                            final String fileName); }
CanvasFileExport { public void exportToSvg(final AbstractCanvasHandler canvasHandler, final String fileName) { clearSelection(canvasHandler); final String fullFileName = fileName + "." + getFileExtension(CanvasExport.URLDataType.SVG); svgFileExport.export(canvasExport.toContext2D(canvasHandler, CanvasExportSettings.build()), fullFileName); } protected  CanvasFileExport(); @Inject  CanvasFileExport(final CanvasExport<AbstractCanvasHandler> canvasExport,
                            final FileExport<ImageDataUriContent> imageFileExport,
                            final FileExport<PdfDocument> pdfFileExport,
                            final FileExportsPreferences preferences,
                            final SvgFileExport svgFileExport,
                            final Event<CanvasClearSelectionEvent> clearSelectionEvent); void exportToSvg(final AbstractCanvasHandler canvasHandler,
                            final String fileName); String exportToSvg(final AbstractCanvasHandler canvasHandler); String exportToPng(final AbstractCanvasHandler canvasHandler); void exportToJpg(final AbstractCanvasHandler canvasHandler,
                            final String fileName); void exportToPng(final AbstractCanvasHandler canvasHandler,
                            final String fileName); void exportToPdf(final AbstractCanvasHandler canvasHandler,
                            final String fileName);  }