You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by de...@apache.org on 2005/09/03 14:12:47 UTC

svn commit: r267452 - in /xmlgraphics/batik/branches/svg11: samples/tests/spec/structure/ sources/org/apache/batik/svggen/ sources/org/apache/batik/swing/ test-references/samples/tests/spec/structure/

Author: deweese
Date: Sat Sep  3 05:12:28 2005
New Revision: 267452

URL: http://svn.apache.org/viewcvs?rev=267452&view=rev
Log:
1) Bug fixes from dvholten, Thanks!
2) Fix for tool tips on groups/use + updated test.


Modified:
    xmlgraphics/batik/branches/svg11/samples/tests/spec/structure/toolTips.svg
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGLinearGradient.java
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/swing/JSVGCanvas.java
    xmlgraphics/batik/branches/svg11/test-references/samples/tests/spec/structure/toolTips.png

Modified: xmlgraphics/batik/branches/svg11/samples/tests/spec/structure/toolTips.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/samples/tests/spec/structure/toolTips.svg?rev=267452&r1=267451&r2=267452&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/samples/tests/spec/structure/toolTips.svg (original)
+++ xmlgraphics/batik/branches/svg11/samples/tests/spec/structure/toolTips.svg Sat Sep  3 05:12:28 2005
@@ -41,13 +41,15 @@
 
     <g id="content">
 
-        <text class="title" x="50%" y="40">&lt;title&gt;and &lt;desc&gt;</text>
-        <text class="title" x="50%" y="55">tool tips on Graphical Elements</text>
+        <text class="title" x="50%" y="35">&lt;title&gt;and &lt;desc&gt;</text>
+        <text class="title" x="50%" y="50">tool tips on Graphical Elements</text>
 
         <defs>
+           <rect id="useElem" fill="crimson" stroke="black"
+                 x="0" y="0" width="20" height="14"/>
         </defs>
 
-        <g id="graphicsElementsTable" transform="translate(75, 80)">
+        <g id="graphicsElementsTable" transform="translate(75, 60)">
 
             <g id="additionalInfoHeader" transform="translate(60, 0)">
                 <rect x="0"   y="0" width="60" height="20" fill="#eeeeee" stroke="black" />
@@ -359,6 +361,43 @@
                         <title>Title: &lt;text&gt; with &lt;title&gt; and &lt;desc&gt;</title>
                         <desc>Description: &lt;text&gt; with &lt;desc&gt; and &lt;desc&gt;</desc>
                     </text>
+                </g>
+            </g> <!-- "textRow" -->
+
+            <g id="useRow" transform="translate(0, 200)">
+                <g fill="white" stroke="black">
+                    <rect x="0"   y="0" width="60" height="20"  />
+                    <rect x="60"  y="0" width="60" height="20"  />
+                    <rect x="120" y="0" width="60" height="20"  />
+                    <rect x="180" y="0" width="60" height="20"  />
+                    <rect x="240" y="0" width="60" height="20"  />
+                </g>
+               
+                <text x="30" y="15" class="label">&lt;use&gt;</text>
+
+                <g id="useSamples" stroke="none" fill="none">
+                    <!-- No info -->
+                    <use transform="translate(60, 0)" x="20" y="3"
+                         xlink:href="#useElem"/>
+
+                    <!-- title -->
+                    <use transform="translate(120, 0)" x="20" y="3"
+                         xlink:href="#useElem">
+                        <title>&lt;use&gt; with &lt;title&gt; only</title>
+                    </use>
+
+                    <!-- desc -->
+                    <use transform="translate(180, 0)" x="20" y="3"
+                         xlink:href="#useElem">
+                        <desc>&lt;use&gt; with &lt;desc&gt; only</desc>
+                    </use>
+
+                    <!-- title and desc -->
+                    <use transform="translate(240, 0)" x="20" y="3"
+                         xlink:href="#useElem">
+                        <title>Title: &lt;use&gt; with &lt;title&gt; and &lt;desc&gt;</title>
+                        <desc>Description: &lt;use&gt; with &lt;desc&gt; and &lt;desc&gt;</desc>
+                    </use>
                 </g>
             </g> <!-- "textRow" -->
         </g> <!-- id="graphicsElementsTable"  -->

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java?rev=267452&r1=267451&r2=267452&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java Sat Sep  3 05:12:28 2005
@@ -444,7 +444,7 @@
         decimalFormats[0] = new DecimalFormat("#", dsf);
 
         String format = "#.";
-        for (int i=0; i<=12; i++) {
+        for (int i=1; i<decimalFormats.length; i++) {
             format += "#";
             decimalFormats[i] = new DecimalFormat(format, dsf);
         }

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGLinearGradient.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGLinearGradient.java?rev=267452&r1=267451&r2=267452&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGLinearGradient.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGLinearGradient.java Sat Sep  3 05:12:28 2005
@@ -81,13 +81,13 @@
             Point2D p1 = gradient.getPoint1();
             Point2D p2 = gradient.getPoint2();
             gradientDef.setAttributeNS(null, SVG_X1_ATTRIBUTE,
-                                       "" + doubleString(p1.getX()));
+                                       doubleString(p1.getX()));
             gradientDef.setAttributeNS(null, SVG_Y1_ATTRIBUTE,
-                                       "" + doubleString(p1.getY()));
+                                       doubleString(p1.getY()));
             gradientDef.setAttributeNS(null, SVG_X2_ATTRIBUTE,
-                                       "" + doubleString(p2.getX()));
+                                       doubleString(p2.getX()));
             gradientDef.setAttributeNS(null, SVG_Y2_ATTRIBUTE,
-                                       "" + doubleString(p2.getY()));
+                                       doubleString(p2.getY()));
 
             //
             // Spread method

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/swing/JSVGCanvas.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/swing/JSVGCanvas.java?rev=267452&r1=267451&r2=267452&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/swing/JSVGCanvas.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/swing/JSVGCanvas.java Sat Sep  3 05:12:28 2005
@@ -46,6 +46,7 @@
 import javax.swing.ToolTipManager;
 
 import org.apache.batik.bridge.UserAgent;
+import org.apache.batik.css.engine.CSSEngine;
 import org.apache.batik.swing.gvt.AbstractImageZoomInteractor;
 import org.apache.batik.swing.gvt.AbstractPanInteractor;
 import org.apache.batik.swing.gvt.AbstractResetTransformInteractor;
@@ -1156,10 +1157,17 @@
             }
 
             if (toolTipMap != null) {
-                Object o = toolTipMap.get(lastTarget);
-                final String theToolTip;
-                if (o == null) theToolTip = null;
-                else           theToolTip = (String)o;
+                Element e = (Element)lastTarget;
+                Object o = null;
+                while (e != null) {
+                    // Search the parents of the current node for ToolTips.
+                    o = toolTipMap.get(e);
+                    if (o != null) {
+                        break;
+                    }
+                    e = CSSEngine.getParentElement(e);
+                }
+                final String theToolTip = (String)o;
                 if (prevLastTarget != lastTarget)
                     EventQueue.invokeLater(new ToolTipRunnable(theToolTip));
             }

Modified: xmlgraphics/batik/branches/svg11/test-references/samples/tests/spec/structure/toolTips.png
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/samples/tests/spec/structure/toolTips.png?rev=267452&r1=267451&r2=267452&view=diff
==============================================================================
Binary files - no diff available.