xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39714] New: - DefaultExtensionHandler derived class's handlePaint is not getting invoked
Date Sun, 04 Jun 2006 01:49:59 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39714>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39714

           Summary: DefaultExtensionHandler derived class's handlePaint is
                    not getting invoked
           Product: Batik
           Version: 1.6
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SVGGraphics2D
        AssignedTo: batik-dev@xmlgraphics.apache.org
        ReportedBy: aprinaresh97@gmail.com


I have following implementation to write out svg file. I have geometry with 
LinearGradient fill attribute. When I render that to the SVG2DGraphics, the 
handlePaint of the derived class is not getting invoked. Is this an known 
issue or am I missing something in my code? The following code is based on the 
example given in the svggen documentation.

      try
      {
         String scSvgNsURI = "http://www.w3.org/2000/svg";

         DOMImplementation zDomImpl =
                               GenericDOMImplementation.getDOMImplementation();
         Document zDocument = zDomImpl.createDocument(scSvgNsURI, "svg", null);

         SVGGeneratorContext zSvgCtx =
                                  SVGGeneratorContext.createDefault(zDocument);
         GenericImageHandler zImgHandler =
                                         new CachedImageHandlerBase64Encoder();
         zSvgCtx.setGenericImageHandler(zImgHandler);
         zSvgCtx.setExtensionHandler(new SvgExtensionHandler());

         SVGGraphics2D zSvgGraphics = new SVGGraphics2D(zSvgCtx, true);

         IDrawingSurface zDrawingSurface = super.getDrawingSurface();

         zSvgGraphics.setRenderingHint(
                                   RenderingHints.KEY_INTERPOLATION,
                                   RenderingHints.VALUE_INTERPOLATION_BICUBIC);
         zSvgGraphics.setRenderingHint(RenderingHints.KEY_RENDERING,
                                       RenderingHints.VALUE_RENDER_QUALITY);
         zSvgGraphics.setRenderingHint(
                                   RenderingHints.KEY_COLOR_RENDERING,
                                   RenderingHints.VALUE_COLOR_RENDER_QUALITY);

//       zSvgCtx.getGraphicContextDefaults().setRenderingHints(
//                                         zSvgGraphics.getRenderingHints());
//       SVGHintsDescriptor zSvgHintsDesc =
//                               SVGRenderingHints.toSVG(
//                                          zSvgGraphics.getRenderingHints());
         //
         // - Following code renders all the geometry primitives to the given
         //   graphics
         //
         zDrawingSurface.render( zSvgGraphics,
                                 super.getActiveGeomContainer() );

         Writer zWriter = new OutputStreamWriter(
                                          new FileOutputStream(zFile), 
                                         "UTF-8");
         zSvgGraphics.stream(zWriter, false);
      }
      catch( Exception zExcept )
      {
      }


   /**
    * Inner class to handle paint extensions.
    */
   private class SvgExtensionHandler extends    DefaultExtensionHandler
                                     implements SVGConstants
   {
      public SVGPaintDescriptor handlePaint( Paint               zPaint,
                                             SVGGeneratorContext zContext ) 
      {
         System.out.println( "HandlePaint called: " +
                            zPaint.getClass().getName() );
      }
   }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


Mime
View raw message