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:21:06 UTC
svn commit: r267453 - in /xmlgraphics/batik/trunk:
samples/tests/spec/structure/ sources/org/apache/batik/dom/events/
sources/org/apache/batik/svggen/ sources/org/apache/batik/swing/
test-references/samples/tests/spec/structure/
Author: deweese
Date: Sat Sep 3 05:20:52 2005
New Revision: 267453
URL: http://svn.apache.org/viewcvs?rev=267453&view=rev
Log:
1) Bug fixes from dvholten, Thanks!
2) Fix for tool tips on groups/use + updated test.
Modified:
xmlgraphics/batik/trunk/samples/tests/spec/structure/toolTips.svg
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/events/DOMMutationNameEvent.java
xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGGeneratorContext.java
xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGLinearGradient.java
xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGCanvas.java
xmlgraphics/batik/trunk/test-references/samples/tests/spec/structure/toolTips.png
Modified: xmlgraphics/batik/trunk/samples/tests/spec/structure/toolTips.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/samples/tests/spec/structure/toolTips.svg?rev=267453&r1=267452&r2=267453&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/samples/tests/spec/structure/toolTips.svg (original)
+++ xmlgraphics/batik/trunk/samples/tests/spec/structure/toolTips.svg Sat Sep 3 05:20:52 2005
@@ -41,13 +41,15 @@
<g id="content">
- <text class="title" x="50%" y="40"><title>and <desc></text>
- <text class="title" x="50%" y="55">tool tips on Graphical Elements</text>
+ <text class="title" x="50%" y="35"><title>and <desc></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: <text> with <title> and <desc></title>
<desc>Description: <text> with <desc> and <desc></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"><use></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><use> with <title> only</title>
+ </use>
+
+ <!-- desc -->
+ <use transform="translate(180, 0)" x="20" y="3"
+ xlink:href="#useElem">
+ <desc><use> with <desc> only</desc>
+ </use>
+
+ <!-- title and desc -->
+ <use transform="translate(240, 0)" x="20" y="3"
+ xlink:href="#useElem">
+ <title>Title: <use> with <title> and <desc></title>
+ <desc>Description: <use> with <desc> and <desc></desc>
+ </use>
</g>
</g> <!-- "textRow" -->
</g> <!-- id="graphicsElementsTable" -->
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/events/DOMMutationNameEvent.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/events/DOMMutationNameEvent.java?rev=267453&r1=267452&r2=267453&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/events/DOMMutationNameEvent.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/events/DOMMutationNameEvent.java Sat Sep 3 05:20:52 2005
@@ -57,8 +57,8 @@
null,
null,
(short) 0);
- prevNamespaceURI = prevNamespaceURIArg;
- prevNodeNameArg = prevNodeNameArg;
+ this.prevNamespaceURI = prevNamespaceURIArg;
+ this.prevNodeName = prevNodeNameArg;
}
/**
@@ -80,8 +80,8 @@
null,
null,
(short) 0);
- prevNamespaceURI = prevNamespaceURIArg;
- prevNodeNameArg = prevNodeNameArg;
+ this.prevNamespaceURI = prevNamespaceURIArg;
+ this.prevNodeName = prevNodeNameArg;
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGGeneratorContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGGeneratorContext.java?rev=267453&r1=267452&r2=267453&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGGeneratorContext.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGGeneratorContext.java Sat Sep 3 05:20:52 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/trunk/sources/org/apache/batik/svggen/SVGLinearGradient.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGLinearGradient.java?rev=267453&r1=267452&r2=267453&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGLinearGradient.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGLinearGradient.java Sat Sep 3 05:20:52 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/trunk/sources/org/apache/batik/swing/JSVGCanvas.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGCanvas.java?rev=267453&r1=267452&r2=267453&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGCanvas.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGCanvas.java Sat Sep 3 05:20:52 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/trunk/test-references/samples/tests/spec/structure/toolTips.png
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/test-references/samples/tests/spec/structure/toolTips.png?rev=267453&r1=267452&r2=267453&view=diff
==============================================================================
Binary files - no diff available.