Class SwingSVGPrettyPrint

  • All Implemented Interfaces:
    XMLConstants, SVGSyntax, CSSConstants, SVGConstants

    public abstract class SwingSVGPrettyPrint
    extends java.lang.Object
    implements SVGSyntax
    This class offers a way to create an SVG document with grouping that reflects the Swing composite structure (container/components).
    Version:
    $Id: SwingSVGPrettyPrint.java 1831630 2018-05-15 12:56:55Z ssteiner $
    • Constructor Detail

      • SwingSVGPrettyPrint

        public SwingSVGPrettyPrint()
    • Method Detail

      • print

        public static void print​(javax.swing.JComponent cmp,
                                 SVGGraphics2D svgGen)
        Parameters:
        cmp - Swing component to be converted to SVG
        svgGen - SVGraphics2D to use to paint Swing components
      • printHack

        private static void printHack​(javax.swing.JComponent cmp,
                                      SVGGraphics2D svgGen)
        Parameters:
        cmp - Swing component to be converted to SVG
        svgGen - SVGraphics2D to use to paint Swing components
      • paintComponent

        private static void paintComponent​(javax.swing.JComponent cmp,
                                           SVGGraphics2D svgGen)
      • paintBorder

        private static void paintBorder​(javax.swing.JComponent cmp,
                                        SVGGraphics2D svgGen)
        WARNING: The following code does some special case processing depending on the class of the input JComponent. This is needed because there is no generic way I could find to determine whether a component should be painted or not.
      • paintChildren

        private static void paintChildren​(javax.swing.JComponent cmp,
                                          SVGGraphics2D svgGen)