use of com.archimatetool.export.svg.graphiti.GraphicsToGraphics2DAdaptor in project archi by archimatetool.
the class AbstractExportProvider method initialiseGraphics.
protected void initialiseGraphics() {
// Ensure user fonts are loaded into AWT for Windows
loadUserFontsIntoAWT();
// Create a DOM Document
Document document = createDocument();
// Create a context for customisation
// Don't embed fonts
SVGGeneratorContext ctx = createContext(document, false);
// Create a Batik SVGGraphics2D instance
// Text is drawn as shapes
svgGraphics2D = new SVGGraphics2D(ctx, true);
// Create a Graphiti wrapper adapter
GraphicsToGraphics2DAdaptor graphicsAdaptor = createGraphicsToGraphics2DAdaptor(svgGraphics2D, viewPortBounds);
// Paint the figure onto the graphics instance
figure.paint(graphicsAdaptor);
// Dispose of this
graphicsAdaptor.dispose();
}
Aggregations