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 ca...@apache.org on 2007/09/30 11:05:58 UTC

svn commit: r580684 - in /xmlgraphics/batik/trunk/sources/org/apache/batik/bridge: SVGAElementBridge.java SVGAnimationElementBridge.java SVGDocumentBridge.java

Author: cam
Date: Sun Sep 30 02:05:57 2007
New Revision: 580684

URL: http://svn.apache.org/viewvc?rev=580684&view=rev
Log:
Removed an unused import.

Modified:
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAElementBridge.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationElementBridge.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGDocumentBridge.java

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAElementBridge.java?rev=580684&r1=580683&r2=580684&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAElementBridge.java Sun Sep 30 02:05:57 2007
@@ -25,7 +25,10 @@
 
 import org.apache.batik.dom.events.AbstractEvent;
 import org.apache.batik.dom.events.NodeEventTarget;
+import org.apache.batik.dom.svg.SVGOMAnimationElement;
+import org.apache.batik.dom.svg.SVGOMDocument;
 import org.apache.batik.gvt.GraphicsNode;
+import org.apache.batik.util.ParsedURL;
 import org.apache.batik.util.XMLConstants;
 
 import org.w3c.dom.Element;
@@ -206,6 +209,27 @@
         
         public void run() {
             userAgent.setSVGCursor(holder.getCursor());
+            String href = elt.getHref().getAnimVal();
+            ParsedURL purl = new ParsedURL(elt.getBaseURI(), href);
+            SVGOMDocument doc = (SVGOMDocument) elt.getOwnerDocument();
+            ParsedURL durl = doc.getParsedURL();
+            if (purl.sameFile(durl)) {
+                String frag = purl.getRef();
+                if (frag != null && frag.length() != 0) {
+                    Element refElt = doc.getElementById(frag);
+                    if (refElt instanceof SVGOMAnimationElement) {
+                        SVGOMAnimationElement aelt =
+                            (SVGOMAnimationElement) refElt;
+                        float t = aelt.getHyperlinkBeginTime();
+                        if (Float.isNaN(t)) {
+                            aelt.beginElement();
+                        } else {
+                            doc.getRootElement().setCurrentTime(t);
+                        }
+                        return;
+                    }
+                }
+            }
             userAgent.openLink(elt);
         }
     }

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationElementBridge.java?rev=580684&r1=580683&r2=580684&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationElementBridge.java Sun Sep 30 02:05:57 2007
@@ -458,6 +458,15 @@
         return timedElement.getSimpleDur();
     }
 
+    /**
+     * Returns the time that the document would seek to if this animation
+     * element were hyperlinked to, or <code>NaN</code> if there is no
+     * such begin time.
+     */
+    public float getHyperlinkBeginTime() {
+        return timedElement.getHyperlinkBeginTime();
+    }
+
     // ElementTimeControl ////////////////////////////////////////////////////
 
     /**

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGDocumentBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGDocumentBridge.java?rev=580684&r1=580683&r2=580684&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGDocumentBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGDocumentBridge.java Sun Sep 30 02:05:57 2007
@@ -30,7 +30,6 @@
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 import org.w3c.dom.events.MutationEvent;
 
 /**