- Fix mindmap img export support. Now images are embedded in the SVG.

This commit is contained in:
Paulo Gustavo Veiga
2012-07-12 20:59:01 -03:00
parent 99ee5a7da9
commit 6582f073bd
14 changed files with 3028 additions and 155 deletions

View File

@@ -6,7 +6,6 @@ import com.wisemapping.exporter.ExportProperties;
import com.wisemapping.exporter.ExporterFactory;
import com.wisemapping.importer.ImporterException;
import com.wisemapping.model.MindMap;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.commons.io.FileUtils;
import org.jetbrains.annotations.NotNull;
@@ -33,20 +32,17 @@ public class ExportTest {
final ExportProperties properties = ExportProperties.create(format);
final ExportProperties.ImageProperties imageProperties = (ExportProperties.ImageProperties) properties;
imageProperties.setSize(ExportProperties.ImageProperties.Size.LARGE);
String baseUrl = "file://" + svgFile.getParentFile().getAbsolutePath() + "/../../../../../../wise-editor/src/main/webapp/icons";
properties.setBaseImagePath(baseUrl);
String baseUrl = svgFile.getParentFile().getAbsolutePath() + "/../../../../../../wise-editor/src/main/webapp";
ExporterFactory factory = new ExporterFactory(new File(baseUrl));
// Write content ...
if (pngFile.exists()) {
// Export mile content ...
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
ExporterFactory.export(imageProperties, null, bos, svgXml);
// Assert.assertEquals(expContent.toString().trim(), expContent.toString().trim());
factory.export(imageProperties, null, bos, svgXml);
} else {
OutputStream outputStream = new FileOutputStream(pngFile, false);
ExporterFactory.export(imageProperties, null, outputStream, svgXml);
factory.export(imageProperties, null, outputStream, svgXml);
outputStream.close();
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 215 KiB