deweese     2003/10/17 11:10:23

  Modified:    resources/org/apache/batik/bridge BrokenLink.svg
               resources/org/apache/batik/bridge/resources
                        Messages.properties
               sources/org/apache/batik/bridge SVGBrokenLinkProvider.java
                        SVGImageElementBridge.java
               sources/org/apache/batik/gvt ImageNode.java
               test-references/org/apache/batik/svggen Bug6535.svg
                        ContextBug6535.svg ContextRHints.svg RHints.svg
               test-references/org/apache/batik/svggen/rendering
                        Bug6535.png
               test-references/samples/tests/spec/scripting
                        text_content.png visibility.png
               test-references/samples/tests/spec/text textDecoration2.png
  Added:       test-references/samples/tests/spec/scripting display.png
  Log:
  1) Images are once again displayed as 'broken links' when the URL
     can not be opened.
  2) The 'explination' works again for broken link images and should
     be more useful than previously.
  3) Updated some regard references.
  
  Revision  Changes    Path
  1.7       +30 -27    xml-batik/resources/org/apache/batik/bridge/BrokenLink.svg
  
  Index: BrokenLink.svg
  ===================================================================
  RCS file: /home/cvs/xml-batik/resources/org/apache/batik/bridge/BrokenLink.svg,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BrokenLink.svg    8 Aug 2003 11:39:28 -0000       1.6
  +++ BrokenLink.svg    17 Oct 2003 18:10:22 -0000      1.7
  @@ -52,33 +52,36 @@
   
   -->
   
  -<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";  
viewBox="0 0 55.521 60.508" preserveAspectRatio="none">
  -    <defs>
  -     <g id="Broken_Border" style="stroke-width:0.2">
  -         <path 
d="M21.927,58.088l4.999-6.834l-4.999-4.166l0.404-1.441l3.526-12.556l0.235-0.837l-2.489-3.268l-0.177-0.232l1.222-7.64c-0.656-0.432-1.607-0.455-2.575,0.15c-0.065,0.047-0.132,0.104-0.197,0.161c-0.379-0.118-0.806-0.078-1.253,0.162c0.737-0.991,1.604-2.324,2.37-3.884l-2.566-3.949l0.096-0.35l1.404-5.15l-1.151-6.167H1.927v56.333h19.798l0.202-0.333z"/>
  -         <path 
d="M53.593,2.087h-24.11l-0.39,8.833l1.749,4.664l0.251,0.669l-0.124,0.965c0.061,0.173,0.13,0.331,0.21,0.468c-0.104,0.174-0.226,0.33-0.334,0.5l-0.585,4.567l0.072,1.644l0.261,5.856l-0.384,3.934l-0.283,2.9l2.875,6.468l0.459,1.032l-3.334,5.833l4,7.833l0.08,0.167h19.587V2.087z"/>
  -        </g>
  -    </defs>
  +<svg viewBox="0 0 55.521 60.508" preserveAspectRatio="none"
  +  xmlns="http://www.w3.org/2000/svg"; 
  +  xmlns:xlink="http://www.w3.org/1999/xlink";  >
  +  <defs>
  +    <g id="__Broken_Link_Border" style="stroke-width:0.2">
  +      <path 
d="M21.927,58.088l4.999-6.834l-4.999-4.166l0.404-1.441l3.526-12.556l0.235-0.837l-2.489-3.268l-0.177-0.232l1.222-7.64c-0.656-0.432-1.607-0.455-2.575,0.15c-0.065,0.047-0.132,0.104-0.197,0.161c-0.379-0.118-0.806-0.078-1.253,0.162c0.737-0.991,1.604-2.324,2.37-3.884l-2.566-3.949l0.096-0.35l1.404-5.15l-1.151-6.167H1.927v56.333h19.798l0.202-0.333z"/>
  +      <path 
d="M53.593,2.087h-24.11l-0.39,8.833l1.749,4.664l0.251,0.669l-0.124,0.965c0.061,0.173,0.13,0.331,0.21,0.468c-0.104,0.174-0.226,0.33-0.334,0.5l-0.585,4.567l0.072,1.644l0.261,5.856l-0.384,3.934l-0.283,2.9l2.875,6.468l0.459,1.032l-3.334,5.833l4,7.833l0.08,0.167h19.587V2.087z"/>
  +    </g>
  +  </defs>
   
  -    <g style="fill-rule:nonzero; clip-rule:nonzero; stroke-miterlimit:4;">
  -     <g id="Broken_Squiggle" style="stroke:none;">
  -         <path id="Border" style="stroke:black;fill:none;stroke-width:0.3" 
  -                  d="M55.371,60.358H0.15V0.15h55.221v60.208z"/>
  -            <use xlink:href="#Broken_Border" fill="white" fill-opacity="0.5"/>
  -         <path id="Broken_Green_1" style="fill:#33CC33" 
  -                  
d="M32.886,43.506c0.656-0.116,1.3-0.415,1.752-0.932c0.412-0.412,0.799-0.814,1.167-1.217c0.011,0.006,0.021,0.012,0.032,0.016c0.029-0.047,0.057-0.096,0.086-0.143c1.289-1.43,2.303-2.883,3.035-4.896c0.516-1.721-0.82-2.205-2.148-2.076c-0.212-1.113-1.281-1.869-2.893-1.283c-0.111,0.031-0.225,0.09-0.339,0.164c-0.809-0.396-2.029-0.135-2.78,0.314c-0.219,0.147-0.378,0.394-0.504,0.685l-0.282,2.9l2.874,6.468z"/>
  -         <path id="Broken_Green_2" style="fill:#33CC33" 
  -                  
d="M21.198,37.293c-0.479,0.961-0.72,2.881,0.961,2.881c0.004,0.002,0.008,0,0.013,0.002c-0.304,0.807-0.617,1.613-0.974,2.398c-1.019,1.891-0.093,2.895,1.219,3.022l3.527-12.556c-1.904,1.104-3.428,2.277-4.746,4.252z"/>
  -         <path id="Broken_Blue" style="fill:#6666FF" 
  -                  
d="M24.734,21.065c-0.656-0.432-1.607-0.455-2.575,0.15c-0.065,0.047-0.132,0.104-0.197,0.161c-0.379-0.118-0.806-0.078-1.253,0.162c0.737-0.991,1.604-2.324,2.37-3.884l-2.566-3.949l0.096-0.35c-3.104,1.641-5.654,3.857-7.81,6.66c-0.72,0.96-1.92,2.88-0.96,4.319c0.619,1.034,2.126,0.464,2.993-0.327c-0.946,1.314-2.54,3.808-3.713,6.808c-0.96,2.4,0.479,4.799,2.88,3.119c1.376-0.951,2.7-1.955,3.942-3.023c0.134,0.188,0.406,0.115,0.857-0.336c0.221-0.221,0.44-0.445,0.661-0.668c0.672,0.652,1.843,0.77,2.938-0.053c0.061-0.09,0.136-0.168,0.203-0.252c0.35-0.127,0.725-0.373,1.088-0.665l-0.177-0.232l1.222-7.64z"/>
  -         <path id="Broken_Red" style="fill:#FF0000" 
  -                  
d="M31.054,17.17c0.061,0.173,0.13,0.331,0.21,0.468c-0.104,0.174-0.226,0.33-0.334,0.5l-0.585,4.567l0.073,1.644c0.423,0.282,0.97,0.352,1.579-0.015c0.227-0.129,0.439-0.273,0.658-0.412c0.451,0.664,1.158,1.001,1.982,0.412c0.153-0.092,0.306-0.176,0.459-0.266c-0.298,1.618-0.162,3.473,1.434,3.401c0.37,0.98,1.139,1.785,2.188,1.186c1.439-0.959,2.879-1.92,4.32-2.879c1.439-0.721,2.158-2.641,1.92-4.321c0-1.08-0.977-2.341-2.223-2.058c0.021-0.034,0.041-0.068,0.063-0.103c0.719-1.199,1.199-2.64,0.719-4.079c-0.24-0.96-1.439-1.921-2.398-1.2c-1.075,0.645-2.147,1.24-3.201,1.832c-0.16-0.339-0.371-0.642-0.618-0.871c0.073-0.16,0.144-0.32,0.218-0.481c0.48-1.2,0.721-6-1.92-4.56c-1.199,0.72-2.16,1.439-3.119,2.399c-0.829,0.829-1.417,2.001-1.551,3.201l0.251,0.669l-0.124,0.965z"/>
  -            <use xlink:href="#Broken_Border" fill="none" stroke="black"/>
  -     </g>
  -     <g id="More_About">
  -         <circle 
style="fill:#FFFF66;fill-opacity:0.7;stroke:black;stroke-width:0.6;" 
  -                  cx="48.4" cy="53.25" r="3.5"/>
  -         <path style="fill:black;stroke:none;" 
d="M48.942,54.758c0,0.126,0,0.461,0.074,0.558c0.082,0.112,0.275,0.134,0.394,0.134v0.238c-0.297-0.007-0.602-0.022-0.914-0.029c-0.335,0.007-0.662,0.022-0.997,0.029v-0.238c0.119,0,0.313-0.022,0.395-0.134c0.074-0.097,0.074-0.431,0.074-0.558v-1.286c0-0.446-0.082-0.61-0.476-0.602v-0.246c0.483-0.037,0.959-0.104,1.45-0.223v2.356z
 
M47.805,51.212c0-0.313,0.253-0.565,0.565-0.565c0.32,0,0.55,0.253,0.55,0.565c0,0.319-0.26,0.55-0.572,0.55c-0.283,0-0.543-0.268-0.543-0.55z"/>
  -     </g>
  +  <g style="fill-rule:nonzero; clip-rule:nonzero; stroke-miterlimit:4;">
  +    <g style="stroke:none;">
  +      <path style="stroke:black;fill:none;stroke-width:0.3" 
  +        d="M55.371,60.358H0.15V0.15h55.221v60.208z"/>
  +      <use xlink:href="#__Broken_Link_Border" fill="white" fill-opacity="0.5"/>
  +      <path style="fill:#33CC33" 
  +        
d="M32.886,43.506c0.656-0.116,1.3-0.415,1.752-0.932c0.412-0.412,0.799-0.814,1.167-1.217c0.011,0.006,0.021,0.012,0.032,0.016c0.029-0.047,0.057-0.096,0.086-0.143c1.289-1.43,2.303-2.883,3.035-4.896c0.516-1.721-0.82-2.205-2.148-2.076c-0.212-1.113-1.281-1.869-2.893-1.283c-0.111,0.031-0.225,0.09-0.339,0.164c-0.809-0.396-2.029-0.135-2.78,0.314c-0.219,0.147-0.378,0.394-0.504,0.685l-0.282,2.9l2.874,6.468z"/>
  +      <path style="fill:#33CC33" 
  +        
d="M21.198,37.293c-0.479,0.961-0.72,2.881,0.961,2.881c0.004,0.002,0.008,0,0.013,0.002c-0.304,0.807-0.617,1.613-0.974,2.398c-1.019,1.891-0.093,2.895,1.219,3.022l3.527-12.556c-1.904,1.104-3.428,2.277-4.746,4.252z"/>
  +      <path style="fill:#6666FF" 
  +        
d="M24.734,21.065c-0.656-0.432-1.607-0.455-2.575,0.15c-0.065,0.047-0.132,0.104-0.197,0.161c-0.379-0.118-0.806-0.078-1.253,0.162c0.737-0.991,1.604-2.324,2.37-3.884l-2.566-3.949l0.096-0.35c-3.104,1.641-5.654,3.857-7.81,6.66c-0.72,0.96-1.92,2.88-0.96,4.319c0.619,1.034,2.126,0.464,2.993-0.327c-0.946,1.314-2.54,3.808-3.713,6.808c-0.96,2.4,0.479,4.799,2.88,3.119c1.376-0.951,2.7-1.955,3.942-3.023c0.134,0.188,0.406,0.115,0.857-0.336c0.221-0.221,0.44-0.445,0.661-0.668c0.672,0.652,1.843,0.77,2.938-0.053c0.061-0.09,0.136-0.168,0.203-0.252c0.35-0.127,0.725-0.373,1.088-0.665l-0.177-0.232l1.222-7.64z"/>
  +      <path style="fill:#FF0000" 
  +        
d="M31.054,17.17c0.061,0.173,0.13,0.331,0.21,0.468c-0.104,0.174-0.226,0.33-0.334,0.5l-0.585,4.567l0.073,1.644c0.423,0.282,0.97,0.352,1.579-0.015c0.227-0.129,0.439-0.273,0.658-0.412c0.451,0.664,1.158,1.001,1.982,0.412c0.153-0.092,0.306-0.176,0.459-0.266c-0.298,1.618-0.162,3.473,1.434,3.401c0.37,0.98,1.139,1.785,2.188,1.186c1.439-0.959,2.879-1.92,4.32-2.879c1.439-0.721,2.158-2.641,1.92-4.321c0-1.08-0.977-2.341-2.223-2.058c0.021-0.034,0.041-0.068,0.063-0.103c0.719-1.199,1.199-2.64,0.719-4.079c-0.24-0.96-1.439-1.921-2.398-1.2c-1.075,0.645-2.147,1.24-3.201,1.832c-0.16-0.339-0.371-0.642-0.618-0.871c0.073-0.16,0.144-0.32,0.218-0.481c0.48-1.2,0.721-6-1.92-4.56c-1.199,0.72-2.16,1.439-3.119,2.399c-0.829,0.829-1.417,2.001-1.551,3.201l0.251,0.669l-0.124,0.965z"/>
  +      <use xlink:href="#__Broken_Link_Border" 
  +        fill="none" stroke="black"/>
  +    </g>
  +    <g id="__More_About">
  +      <circle style="fill:#FFFF66;fill-opacity:0.7;stroke:black;stroke-width:0.6;" 
  +        cx="48.4" cy="53.25" r="3.5"/>
  +      <path style="fill:black;stroke:none;" 
d="M48.942,54.758c0,0.126,0,0.461,0.074,0.558c0.082,0.112,0.275,0.134,0.394,0.134v0.238c-0.297-0.007-0.602-0.022-0.914-0.029c-0.335,0.007-0.662,0.022-0.997,0.029v-0.238c0.119,0,0.313-0.022,0.395-0.134c0.074-0.097,0.074-0.431,0.074-0.558v-1.286c0-0.446-0.082-0.61-0.476-0.602v-0.246c0.483-0.037,0.959-0.104,1.45-0.223v2.356z
 
M47.805,51.212c0-0.313,0.253-0.565,0.565-0.565c0.32,0,0.55,0.253,0.55,0.565c0,0.319-0.26,0.55-0.572,0.55c-0.283,0-0.543-0.268-0.543-0.55z"/>
       </g>
  +  </g>
   </svg>
  
  
  
  1.16      +25 -15    
xml-batik/resources/org/apache/batik/bridge/resources/Messages.properties
  
  Index: Messages.properties
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/resources/org/apache/batik/bridge/resources/Messages.properties,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Messages.properties       8 Aug 2003 11:39:28 -0000       1.15
  +++ Messages.properties       17 Oct 2003 18:10:22 -0000      1.16
  @@ -47,55 +47,65 @@
   
   attribute.missing = \
   {0}:{1}\n\
  -The attribute ''{3}'' of the element <{2}> is required
  +The attribute "{3}" of the element <{2}> is required
   
   attribute.malformed = \
   {0}:{1}\n\
  -The attribute ''{3}'' of the element <{2}> is invalid
  +The attribute "{3}" of the element <{2}> is invalid
   
   length.negative = \
   {0}:{1}\n\
  -The attribute ''{3}'' of the element <{2}> can not be negative
  +The attribute "{3}" of the element <{2}> can not be negative
   
   css.length.negative = \
   {0}:{1}\n\
  -The CSS property ''{3}'' found on the element <{2}> can not be negative
  +The CSS property "{3}" found on the element <{2}> can not be negative
   
   css.uri.badTarget = \
   {0}:{1}\n\
  -The URI ''{3}'' for a CSS property found on the element <{2}> is invalid
  +The URI "{3}"\n\
  +for a CSS property found on the element <{2}> is invalid
   
   xlink.href.circularDependencies = \
   {0}:{1}\n\
  -A circular dependency has been detected on the element <{2}> for the URI ''{3}''
  +A circular dependency has been detected on the element <{2}> for the URI:\n\
  +"{3}"
   
   uri.malformed = \
   {0}:{1}\n\
  -The URI ''{3}'' specified on the element <{2}> is invalid
  +The URI "{3}"\n\
  +specified on the element <{2}> is invalid
   
   uri.badTarget = \
   {0}:{1}\n\
  -Cannot find the referenced element ''{3}'' specified on the element <{2}> - may be 
a problem of 'id'
  +Cannot find the referenced element:\n\
  +"{3}"\n\
  +specified on the element <{2}> - may be a problem of 'id'
   
   
   uri.io = \
   {0}:{1}\n\
  -An I/O error occured while processing the URI ''{3}'' specified on the \
  -element <{2}>
  +An I/O error occured while processing the URI:\n\
  +"{3}"\n\
  +specified on the element <{2}>
   
   uri.unsecure = \
   {0}:{1}\n\
  -A security exception occured while processing the URI ''{3}'' specified on the \
  -element <{2}>
  +A security exception occured while processing the URI:\n\
  +"{3}"\n\
  +specified on the element <{2}>
   
   uri.referenceDocument = \
   {0}:{1}\n\
  -The URI ''{3}'' specified on the element <{2}> references an entire document. \n \
  -This is illegal: The element <{2}> should reference an element inside that document 
instead.
  +The URI "{3}"\n\
  +specified on the element <{2}> references an entire document. \n\
  +This is illegal: The element <{2}> must reference an element\n\
  +inside a document.
   
   uri.image.invalid = \
   {0}:{1}\n\
  -The URI ''{3}'' specified on the element <{2}> is invalid
  +The URI "{3}"\n\
  +specified on the element <{2}> is invalid
   
   broken.link.title = \
   Broken Link:
  
  
  
  1.12      +31 -21    
xml-batik/sources/org/apache/batik/bridge/SVGBrokenLinkProvider.java
  
  Index: SVGBrokenLinkProvider.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGBrokenLinkProvider.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SVGBrokenLinkProvider.java        16 Sep 2003 01:12:52 -0000      1.11
  +++ SVGBrokenLinkProvider.java        17 Oct 2003 18:10:22 -0000      1.12
  @@ -114,28 +114,38 @@
        *        the circumstances of the failure.  */
       public Filter getBrokenLinkImage(Object base, String code, 
                                        Object[] params) {
  -        if (gvtRoot != null) {
  -            String message = formatMessage(base, code, params);
  -            Document doc = DOMUtilities.deepCloneDocument
  -              (svgDoc, svgDoc.getImplementation());
  -            Element infoE = doc.getElementById("More_About");
  -            Element title = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
  -                                                SVGConstants.SVG_TITLE_TAG);
  -            title.appendChild(doc.createTextNode
  -                              (Messages.formatMessage
  -                               (MSG_BROKEN_LINK_TITLE, null)));
  -            infoE.appendChild(title);
  -            Element desc = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
  -                                               SVGConstants.SVG_DESC_TAG);
  -            desc.appendChild(doc.createTextNode(message));
  -            infoE.appendChild(desc);
  +        if (gvtRoot == null) 
  +            return null;
   
  -            Map props = new HashMap();
  -            props.put(BROKEN_LINK_PROPERTY, message);
  -            props.put(SVG_BROKEN_LINK_DOCUMENT_PROPERTY, doc);
  +        String message = formatMessage(base, code, params);
  +        Document doc = getBrokenLinkDocument(message);
  +        Map props = new HashMap();
  +        props.put(BROKEN_LINK_PROPERTY, message);
  +        props.put(SVG_BROKEN_LINK_DOCUMENT_PROPERTY, doc);
  +        
  +        return new GraphicsNodeRable8Bit(gvtRoot, props);
  +    }
   
  -            return new GraphicsNodeRable8Bit(gvtRoot, props);
  -        }
  -        return null;
  +    public SVGDocument getBrokenLinkDocument(Object base, 
  +                                          String code, Object [] params) {
  +        String message = formatMessage(base, code, params);
  +        return getBrokenLinkDocument(message);
  +    }
  +
  +    public SVGDocument getBrokenLinkDocument(String message) {
  +        SVGDocument doc = (SVGDocument)DOMUtilities.deepCloneDocument
  +            (svgDoc, svgDoc.getImplementation());
  +        Element infoE = doc.getElementById("__More_About");
  +        Element title = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
  +                                            SVGConstants.SVG_TITLE_TAG);
  +        title.appendChild(doc.createTextNode
  +                          (Messages.formatMessage
  +                           (MSG_BROKEN_LINK_TITLE, null)));
  +        Element desc = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
  +                                           SVGConstants.SVG_DESC_TAG);
  +        desc.appendChild(doc.createTextNode(message));
  +        infoE.insertBefore(desc, infoE.getFirstChild());
  +        infoE.insertBefore(title, desc);
  +        return doc;
       }
   }
  
  
  
  1.64      +58 -22    
xml-batik/sources/org/apache/batik/bridge/SVGImageElementBridge.java
  
  Index: SVGImageElementBridge.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGImageElementBridge.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- SVGImageElementBridge.java        6 Oct 2003 00:56:00 -0000       1.63
  +++ SVGImageElementBridge.java        17 Oct 2003 18:10:22 -0000      1.64
  @@ -100,7 +100,7 @@
   public class SVGImageElementBridge extends AbstractGraphicsNodeBridge {
   
       protected SVGDocument imgDocument;
  -
  +    protected boolean hitCheckChildren = false;
       /**
        * Constructs a new bridge for the &lt;image> element.
        */
  @@ -134,6 +134,7 @@
               return null;
           }
   
  +        hitCheckChildren = false;
           GraphicsNode node = buildImageGraphicsNode(ctx,e);
   
           if (node == null) {
  @@ -143,6 +144,7 @@
           }
   
           imageNode.setImage(node);
  +        imageNode.setHitCheckChildren(hitCheckChildren);
   
           // 'image-rendering' and 'color-rendering'
           RenderingHints hints = CSSUtilities.convertImageRendering(e, null);
  @@ -257,6 +259,8 @@
           } catch (SecurityException ex) {
               throw new BridgeException(e, ERR_URI_UNSECURE,
                                         new Object[] {purl});
  +        } catch (IOException ioe) {
  +            return createBrokenImageNode(ctx, e, purl.toString());
           }
   
           {
  @@ -278,8 +282,13 @@
               // Reset the stream for next try.
               reference.retry();
           } catch (IOException ioe) {
  -            // Couldn't reset stream so reopen it.
  -            reference = openStream(e, purl);
  +            try {
  +                // Couldn't reset stream so reopen it.
  +                reference = openStream(e, purl);
  +            } catch (IOException ioe2) {
  +                // Since we already opened the stream this is unlikely.
  +                return createBrokenImageNode(ctx, e, purl.toString());
  +            }
           }
   
           try {
  @@ -301,8 +310,12 @@
           try {
               reference.retry();
           } catch (IOException ioe) {
  -            // Couldn't reset stream so reopen it.
  -            reference = openStream(e, purl);
  +            try {
  +                // Couldn't reset stream so reopen it.
  +                reference = openStream(e, purl);
  +            } catch (IOException ioe2) {
  +                return createBrokenImageNode(ctx, e, purl.toString());
  +            }
           }
   
           try {
  @@ -358,19 +371,13 @@
           }
       }
   
  -    protected ProtectedStream openStream(Element e, ParsedURL purl) {
  -        ProtectedStream ret = null;
  -        try {
  -            List mimeTypes = new ArrayList
  -                (ImageTagRegistry.getRegistry().getRegisteredMimeTypes());
  -            mimeTypes.add(MimeTypeConstants.MIME_TYPES_SVG);
  -            InputStream reference = purl.openStream(mimeTypes.iterator());
  -            ret = new ProtectedStream(reference);
  -        } catch (IOException ioe) {
  -            throw new BridgeException(e, ERR_URI_IO, 
  -                                      new Object[] {purl.toString()});
  -        }
  -        return ret;
  +    protected ProtectedStream openStream(Element e, ParsedURL purl) 
  +        throws IOException {
  +        List mimeTypes = new ArrayList
  +            (ImageTagRegistry.getRegistry().getRegisteredMimeTypes());
  +        mimeTypes.add(MimeTypeConstants.MIME_TYPES_SVG);
  +        InputStream reference = purl.openStream(mimeTypes.iterator());
  +        return new ProtectedStream(reference);
       }
   
       /**
  @@ -554,8 +561,6 @@
               sn.setShape(bounds);
               return sn;
           }
  -        RasterImageNode node = new RasterImageNode();
  -
           Object           obj = img.getProperty
               (SVGBrokenLinkProvider.SVG_BROKEN_LINK_DOCUMENT_PROPERTY);
           if ((obj != null) && (obj instanceof SVGDocument)) {
  @@ -564,6 +569,8 @@
               ctx.initializeDocument(doc);
               return createSVGImageNode(ctx, e, doc);
           }
  +
  +        RasterImageNode node = new RasterImageNode();
           node.setImage(img);
           Rectangle2D imgBounds = img.getBounds2D();
   
  @@ -865,7 +872,36 @@
           return new Rectangle2D.Float(x, y, w, h);
       }
   
  +    GraphicsNode createBrokenImageNode
  +        (BridgeContext ctx, Element e, String uri) {
  +        
  +        String lname = "<Unknown Element>";
  +        SVGDocument doc = null;
  +        if (e != null) {
  +            doc = (SVGDocument)e.getOwnerDocument();
  +            lname = e.getLocalName();
  +        }
  +        String docUri;
  +        if (doc == null)  docUri = "<Unknown Document>";
  +        else              docUri = doc.getURL();
  +        int line = ctx.getDocumentLoader().getLineNumber(e);
  +        Object [] fullparams = new Object[4];
  +        fullparams[0] = docUri;
  +        fullparams[1] = new Integer(line);
  +        fullparams[2] = lname;
  +        fullparams[3] = uri;
  +
  +        SVGDocument blDoc = brokenLinkProvider.getBrokenLinkDocument
  +            (this, ERR_URI_IO, fullparams);
  +        ctx.initializeDocument(blDoc);
  +        hitCheckChildren = true;
  +        return createSVGImageNode(ctx, e, blDoc);
  +    }
  +
  +
  +    static SVGBrokenLinkProvider brokenLinkProvider
  +        = new SVGBrokenLinkProvider();
       static {
  -        ImageTagRegistry.setBrokenLinkProvider(new SVGBrokenLinkProvider());
  +        ImageTagRegistry.setBrokenLinkProvider(brokenLinkProvider);
       }
   }
  
  
  
  1.16      +18 -2     xml-batik/sources/org/apache/batik/gvt/ImageNode.java
  
  Index: ImageNode.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/ImageNode.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ImageNode.java    6 Oct 2003 00:56:00 -0000       1.15
  +++ ImageNode.java    17 Oct 2003 18:10:22 -0000      1.16
  @@ -61,12 +61,27 @@
    */
   public class ImageNode extends CompositeGraphicsNode {
   
  +    protected boolean hitCheckChildren = false;
  +    
       /**
        * Constructs a new empty <tt>ImageNode</tt>.
        */
       public ImageNode() {}
   
       /**
  +     * If hitCheckChildren is true then nodeHitAt will return
  +     * child nodes of this image. Otherwise it will only
  +     * return this node (if the point is in the image).
  +     */
  +    public void setHitCheckChildren(boolean hitCheckChildren) {
  +        this.hitCheckChildren = hitCheckChildren;
  +    }
  +
  +    public boolean getHitCheckChildren() { 
  +        return hitCheckChildren; 
  +    }
  +
  +    /**
        * Paints this node.
        *
        * @param g2d the Graphics2D to use
  @@ -109,7 +124,8 @@
        * @param p the specified Point2D in the user space
        */
       public GraphicsNode nodeHitAt(Point2D p) {
  -        // Used to return super.nodeHitAt(p);
  +        if (hitCheckChildren) return super.nodeHitAt(p);
  +
           return (contains(p) ? this : null);
       }
   
  
  
  
  1.3       +1 -1      xml-batik/test-references/org/apache/batik/svggen/Bug6535.svg
  
  Index: Bug6535.svg
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-references/org/apache/batik/svggen/Bug6535.svg,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Bug6535.svg       20 Feb 2002 16:18:46 -0000      1.2
  +++ Bug6535.svg       17 Oct 2003 18:10:22 -0000      1.3
  @@ -5,7 +5,7 @@
     <!--Generated by the Batik Graphics2D SVG Generator-->
     <defs id="genericDefs" />
     <g>
  -    <g text-rendering="optimizeLegibility" font-size="1" transform="scale(10,10)">
  +    <g text-rendering="geometricPrecision" font-size="1" transform="scale(10,10)">
         <text xml:space="preserve" x="4" y="4" stroke="none">Hello, size 10</text>
         <text xml:space="preserve" x="4" font-size="1.5" y="8" stroke="none">Hello, 
size 15</text>
         <text x="160" font-size="10" y="40" transform="scale(0.1,0.1)" stroke="none" 
xml:space="preserve">Hello, size 10</text>
  
  
  
  1.5       +1 -1      
xml-batik/test-references/org/apache/batik/svggen/ContextBug6535.svg
  
  Index: ContextBug6535.svg
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/test-references/org/apache/batik/svggen/ContextBug6535.svg,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ContextBug6535.svg        5 Jul 2003 14:18:29 -0000       1.4
  +++ ContextBug6535.svg        17 Oct 2003 18:10:22 -0000      1.5
  @@ -6,7 +6,7 @@
     <defs id="genericDefs" />
     <g>
       <style type="text/css" xml:space="preserve">
  -      <![CDATA[.testC1 {text-rendering:optimizeLegibility;font-size:1;}
  +      <![CDATA[.testC1 {text-rendering:geometricPrecision;font-size:1;}
   .testC2 {stroke:none;}
   .testC3 {stroke:none;font-size:1.5;}
   .testC4 {stroke:none;font-size:10;}
  
  
  
  1.21      +21 -24    
xml-batik/test-references/org/apache/batik/svggen/ContextRHints.svg
  
  Index: ContextRHints.svg
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/test-references/org/apache/batik/svggen/ContextRHints.svg,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ContextRHints.svg 5 Jul 2003 14:18:29 -0000       1.20
  +++ ContextRHints.svg 17 Oct 2003 18:10:22 -0000      1.21
  @@ -1,25 +1,24 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
   <!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' 
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
  -<svg contentScriptType="text/ecmascript" width="300" 
xmlns:xlink="http://www.w3.org/1999/xlink"; zoomAndPan="magnify" class="testC14" 
contentStyleType="text/css" height="400" preserveAspectRatio="xMidYMid meet" 
xmlns="http://www.w3.org/2000/svg"; version="1.0">
  +<svg contentScriptType="text/ecmascript" width="300" 
xmlns:xlink="http://www.w3.org/1999/xlink"; zoomAndPan="magnify" class="testC13" 
contentStyleType="text/css" height="400" preserveAspectRatio="xMidYMid meet" 
xmlns="http://www.w3.org/2000/svg"; version="1.0">
     <!--Generated by the Batik Test Framework. Test:éj-->
     <defs id="genericDefs" />
     <g>
       <style type="text/css" xml:space="preserve">
         <![CDATA[.testC1 {text-rendering:optimizeLegibility;}
   .testC2 {stroke:none;}
  -.testC3 {shape-rendering:crispEdges;font-family:'Impact';stroke:none;font-size:25;}
  -.testC4 
{shape-rendering:crispEdges;text-rendering:optimizeSpeed;font-family:'Impact';font-size:25;}
  -.testC5 {stroke:none;}
  -.testC6 {text-rendering:optimizeLegibility;}
  -.testC7 {stroke:none;}
  -.testC8 {shape-rendering:crispEdges;stroke:none;}
  -.testC9 {stroke:none;}
  -.testC10 {image-rendering:optimizeSpeed;text-rendering:optimizeLegibility;}
  -.testC11 {stroke:none;}
  -.testC12 {}
  -.testC13 {image-rendering:optimizeQuality;}
  -.testC14 
{stroke-dashoffset:0;text-rendering:auto;color-rendering:auto;stroke-linecap:square;fill:black;font-size:12;stroke-linejoin:miter;font-weight:normal;stroke:black;fill-opacity:1;font-style:normal;stroke-dasharray:none;stroke-miterlimit:10;color-interpolation:auto;image-rendering:auto;shape-rendering:auto;font-family:'Arial';stroke-width:1;stroke-opacity:1;}
  +.testC3 
{shape-rendering:crispEdges;text-rendering:geometricPrecision;font-family:'Impact';font-size:25;}
  +.testC4 {stroke:none;}
  +.testC5 {text-rendering:optimizeSpeed;stroke:none;}
  +.testC6 {shape-rendering:auto;font-family:'Arial';stroke:none;font-size:12;}
  +.testC7 {font-family:'Arial';stroke:none;font-size:12;}
  +.testC8 {shape-rendering:auto;font-family:'Arial';stroke:none;font-size:12;}
  +.testC9 {image-rendering:optimizeSpeed;text-rendering:geometricPrecision;}
  +.testC10 {stroke:none;}
  +.testC11 {}
  +.testC12 {image-rendering:optimizeQuality;}
  +.testC13 
{stroke-dashoffset:0;text-rendering:auto;color-rendering:auto;stroke-linecap:square;fill:black;font-size:12;stroke-linejoin:miter;font-weight:normal;stroke:black;fill-opacity:1;font-style:normal;stroke-dasharray:none;stroke-miterlimit:10;color-interpolation:auto;image-rendering:auto;shape-rendering:auto;font-family:'Arial';stroke-width:1;stroke-opacity:1;}
   ]]>
       </style>
       <g>
  @@ -73,20 +72,18 @@
         </defs>
         <g class="testC1">
           <text xml:space="preserve" x="10" y="20" class="testC2">Text 
antialiasing</text>
  -        <text xml:space="preserve" x="30" y="60" class="testC3">HELLO 
antialiased</text>
         </g>
  -      <g class="testC4">
  +      <g class="testC3">
  +        <text xml:space="preserve" x="30" y="60" class="testC4">HELLO 
antialiased</text>
           <text xml:space="preserve" x="30" y="90" class="testC5">HELLO aliased</text>
  +        <text xml:space="preserve" x="10" y="20" class="testC6" 
transform="translate(0,100)">Shape antialiasing</text>
  +        <ellipse transform="translate(30,100)" rx="50" cx="60" class="testC7" 
ry="15" cy="45" />
  +        <ellipse transform="translate(30,140)" rx="50" cx="60" class="testC8" 
ry="15" cy="45" />
         </g>
  -      <g class="testC6" transform="translate(0,100)">
  -        <text xml:space="preserve" x="10" y="20" class="testC7">Shape 
antialiasing</text>
  -        <ellipse transform="translate(30,0)" rx="50" cx="60" class="testC8" ry="15" 
cy="45" />
  -        <ellipse transform="translate(30,40)" rx="50" cx="60" class="testC9" 
ry="15" cy="45" />
  -      </g>
  -      <g class="testC10" transform="translate(0,200)">
  -        <text xml:space="preserve" x="10" y="30" class="testC11">Interpolation 
Nearest Neighbor / Bicubic</text>
  -        <use transform="matrix(20,0,0,20,10,50)" 
xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:href="#testimage1" 
xlink:type="simple" class="testC12" xlink:actuate="onRequest" xlink:show="replace" />
  -        <use transform="matrix(20,0,0,20,60,50)" 
xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:href="#testimage1" 
xlink:type="simple" class="testC13" xlink:actuate="onRequest" xlink:show="replace" />
  +      <g class="testC9" transform="translate(0,200)">
  +        <text xml:space="preserve" x="10" y="30" class="testC10">Interpolation 
Nearest Neighbor / Bicubic</text>
  +        <use transform="matrix(20,0,0,20,10,50)" 
xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:href="#testimage1" 
xlink:type="simple" class="testC11" xlink:actuate="onRequest" xlink:show="replace" />
  +        <use transform="matrix(20,0,0,20,60,50)" 
xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:href="#testimage1" 
xlink:type="simple" class="testC12" xlink:actuate="onRequest" xlink:show="replace" />
         </g>
       </g>
     </g>
  
  
  
  1.17      +7 -9      xml-batik/test-references/org/apache/batik/svggen/RHints.svg
  
  Index: RHints.svg
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-references/org/apache/batik/svggen/RHints.svg,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- RHints.svg        3 Jul 2003 09:07:02 -0000       1.16
  +++ RHints.svg        17 Oct 2003 18:10:22 -0000      1.17
  @@ -7,17 +7,15 @@
     <g>
       <g text-rendering="optimizeLegibility">
         <text xml:space="preserve" x="10" y="20" stroke="none">Text 
antialiasing</text>
  -      <text font-size="25" x="30" y="60" font-family="&apos;Impact&apos;" 
shape-rendering="crispEdges" stroke="none" xml:space="preserve">HELLO 
antialiased</text>
       </g>
  -    <g text-rendering="optimizeSpeed" font-size="25" shape-rendering="crispEdges" 
font-family="&apos;Impact&apos;">
  -      <text xml:space="preserve" x="30" y="90" stroke="none">HELLO aliased</text>
  +    <g text-rendering="geometricPrecision" font-size="25" 
shape-rendering="crispEdges" font-family="&apos;Impact&apos;">
  +      <text xml:space="preserve" x="30" y="60" stroke="none">HELLO 
antialiased</text>
  +      <text text-rendering="optimizeSpeed" xml:space="preserve" x="30" y="90" 
stroke="none">HELLO aliased</text>
  +      <text font-size="12" x="10" y="20" transform="translate(0,100)" 
font-family="&apos;Arial&apos;" shape-rendering="auto" stroke="none" 
xml:space="preserve">Shape antialiasing</text>
  +      <ellipse transform="translate(30,100)" rx="50" cx="60" ry="15" cy="45" 
stroke="none" />
  +      <ellipse transform="translate(30,140)" shape-rendering="auto" rx="50" cx="60" 
ry="15" cy="45" stroke="none" />
       </g>
  -    <g text-rendering="optimizeLegibility" transform="translate(0,100)">
  -      <text xml:space="preserve" x="10" y="20" stroke="none">Shape 
antialiasing</text>
  -      <ellipse transform="translate(30,0)" shape-rendering="crispEdges" rx="50" 
cx="60" ry="15" cy="45" stroke="none" />
  -      <ellipse transform="translate(30,40)" rx="50" cx="60" ry="15" cy="45" 
stroke="none" />
  -    </g>
  -    <g text-rendering="optimizeLegibility" transform="translate(0,200)" 
image-rendering="optimizeSpeed">
  +    <g text-rendering="geometricPrecision" transform="translate(0,200)" 
image-rendering="optimizeSpeed">
         <text xml:space="preserve" x="10" y="30" stroke="none">Interpolation Nearest 
Neighbor / Bicubic</text>
         <image x="10" y="50" width="40" 
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAE0lEQVR42mP4/5/h
   PwMDIxADaQAq6gT93tAyKwAAAABJRU5ErkJggg==" height="40" preserveAspectRatio="none" />
  
  
  
  1.4       +5 -3      
xml-batik/test-references/org/apache/batik/svggen/rendering/Bug6535.png
  
        <<Binary file>>
  
  
  1.2       +210 -192  
xml-batik/test-references/samples/tests/spec/scripting/text_content.png
  
        <<Binary file>>
  
  
  1.4       +9 -3      
xml-batik/test-references/samples/tests/spec/scripting/visibility.png
  
        <<Binary file>>
  
  
  1.1                  
xml-batik/test-references/samples/tests/spec/scripting/display.png
  
        <<Binary file>>
  
  
  1.3       +95 -117   
xml-batik/test-references/samples/tests/spec/text/textDecoration2.png
  
        <<Binary file>>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to