Package hec.swing.svg
Class SVGUtilities
java.lang.Object
hec.swing.svg.SVGUtilities
-
Method Summary
Modifier and TypeMethodDescriptionstatic SVGDatarenderToSVG(Dimension size, Consumer<Graphics2D> customPrintFunction) Render a component to a String in SVG Format.static SVGDatarenderToSVG(JComponent jcomponent) Draw the JComponent into an SVG.
-
Method Details
-
renderToSVG
Draw the JComponent into an SVG. This will call print() on the component.- Parameters:
jcomponent- The JComponent to draw- Returns:
- A string containing the component
- Throws:
SVGException
-
renderToSVG
public static SVGData renderToSVG(Dimension size, Consumer<Graphics2D> customPrintFunction) throws SVGException Render a component to a String in SVG Format.- Parameters:
customPrintFunction- A function that renders into the provided Graphics2D context. Useful when a standard print() isn't quite right.- Returns:
- SVGData containing the image rendered onto the graphics context.
- Throws:
SVGException
-