Class SvgBaseTranscoder

java.lang.Object
org.pushingpixels.radiance.tools.svgtranscoder.api.SvgBaseTranscoder
Direct Known Subclasses:
SvgStreamTranscoder, SvgTranscoder

abstract class SvgBaseTranscoder extends Object
SVG to Java2D transcoder.
  • Field Details

  • Constructor Details

    • SvgBaseTranscoder

      public SvgBaseTranscoder(String classname, LanguageRenderer languageRenderer)
      Creates a new transcoder.
      Parameters:
      classname - Classname for the generated Java2D code.
      languageRenderer - Language renderer (Java, Kotlin, ...)
  • Method Details

    • setPackageName

      public void setPackageName(String packageName)
    • setListener

      public void setListener(TranscoderListener listener)
      Sets the listener.
      Parameters:
      listener - Listener.
    • setPrintWriter

      public void setPrintWriter(PrintWriter printWriter)
    • transcode

      public void transcode(org.apache.batik.gvt.GraphicsNode gvtRoot, InputStream templateStream)
      Transcodes the SVG image into Java2D code.
      Parameters:
      gvtRoot - Graphics vector tree root.
      templateStream - Stream with the template content.
    • transcodePathIterator

      private void transcodePathIterator(PathIterator pathIterator, String suffix)
      Transcodes the specified path iterator.
      Parameters:
      pathIterator - Path iterator.
    • transcodeShape

      private void transcodeShape(Shape shape, String suffix) throws UnsupportedOperationException
      Transcodes the specified shape.
      Parameters:
      shape - Shape.
      Throws:
      UnsupportedOperationException - if the shape is unsupported.
    • transcodeLinearGradientPaint

      private void transcodeLinearGradientPaint(org.apache.batik.ext.awt.LinearGradientPaint paint) throws IllegalArgumentException
      Transcodes the specified linear gradient paint.
      Parameters:
      paint - Linear gradient paint.
      Throws:
      IllegalArgumentException - if the fractions are not strictly increasing.
    • transcodePatternPaint

      private void transcodePatternPaint(org.apache.batik.gvt.PatternPaint paint)
    • transcodeRadialGradientPaint

      private void transcodeRadialGradientPaint(org.apache.batik.ext.awt.RadialGradientPaint paint) throws IllegalArgumentException
      Transcodes the specified radial gradient paint.
      Parameters:
      paint - Radial gradient paint.
      Throws:
      IllegalArgumentException - if the fractions are not strictly increasing.
    • transcodePaint

      private void transcodePaint(Paint paint) throws UnsupportedOperationException
      Transcodes the specified paint.
      Parameters:
      paint - Paint.
      Throws:
      UnsupportedOperationException - if the paint is unsupported.
    • transcodePaintAndFill

      private void transcodePaintAndFill(Paint paint) throws UnsupportedOperationException
      Transcodes the specified paint.
      Parameters:
      paint - Paint.
      Throws:
      UnsupportedOperationException - if the paint is unsupported.
    • transcodeShapePainter

      private void transcodeShapePainter(org.apache.batik.gvt.ShapePainter painter, Shape shape, String comment) throws UnsupportedOperationException
      Transcodes the specified shape painter.
      Parameters:
      painter - Shape painter.
      Throws:
      UnsupportedOperationException - if the shape painter is unsupported.
    • transcodeCompositeShapePainter

      private void transcodeCompositeShapePainter(org.apache.batik.gvt.CompositeShapePainter painter, Shape shape, String comment)
      Transcodes the specified composite shape painter.
      Parameters:
      painter - Composite shape painter.
    • transcodeFillShapePainter

      private void transcodeFillShapePainter(org.apache.batik.gvt.FillShapePainter painter)
      Transcodes the specified fill shape painter.
      Parameters:
      painter - Fill shape painter.
    • transcodeStrokeShapePainter

      private void transcodeStrokeShapePainter(org.apache.batik.gvt.StrokeShapePainter painter)
      Transcodes the specified stroke shape painter.
      Parameters:
      painter - Stroke shape painter.
    • transcodeMarkerShapePainter

      private void transcodeMarkerShapePainter(org.apache.batik.gvt.MarkerShapePainter painter, Shape shape, String comment)
      Transcodes the specified marker shape painter.
      Parameters:
      painter - Marker shape painter.
    • rotate

      private void rotate(double angle)
    • transcodeShapeNode

      private void transcodeShapeNode(org.apache.batik.gvt.ShapeNode node, String comment)
      Transcodes the specified shape node.
      Parameters:
      node - Shape node.
      comment - Comment (for associating the Java2D section with the corresponding SVG section).
    • transcodeCompositeGraphicsNode

      private void transcodeCompositeGraphicsNode(org.apache.batik.gvt.CompositeGraphicsNode node, String comment)
      Transcodes the specified composite graphics node.
      Parameters:
      node - Composite graphics node.
      comment - Comment (for associating the Java2D section with the corresponding SVG section).
    • transcodeRenderedImage

      private void transcodeRenderedImage(RenderedImage image, String graphicsName)
    • transcodeRasterImageNode

      private void transcodeRasterImageNode(org.apache.batik.gvt.RasterImageNode node, String comment)
    • transcodeTextNode

      private void transcodeTextNode(org.apache.batik.bridge.TextNode node, String comment)
    • transcodeGraphicsNode

      private void transcodeGraphicsNode(org.apache.batik.gvt.GraphicsNode node, String comment) throws UnsupportedOperationException
      Transcodes the specified graphics node.
      Parameters:
      node - Graphics node.
      comment - Comment (for associating the Java2D section with the corresponding SVG section).
      Throws:
      UnsupportedOperationException - if the graphics node is unsupported.
    • isNonIdentityTransform

      private boolean isNonIdentityTransform(AffineTransform transform)