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 2006/08/07 14:48:52 UTC
svn commit: r429320 - in /xmlgraphics/batik/trunk:
resources/org/apache/batik/dom/svg/resources/
sources/org/apache/batik/anim/ sources/org/apache/batik/anim/timing/
sources/org/apache/batik/bridge/ sources/org/apache/batik/dom/svg/
sources/org/apache/...
Author: cam
Date: Mon Aug 7 05:48:50 2006
New Revision: 429320
URL: http://svn.apache.org/viewvc?rev=429320&view=rev
Log:
1. Implemented the pauseAnimations, unpauseAnimations, animationsPaused,
getCurrentTime and setCurrentTime methods on SVGSVGElement.
2. Implemented SVGPathElement.getPathSegAtLength.
3. Converted some RuntimeExceptions into UnsupportedOperationExceptions.
Modified:
xmlgraphics/batik/trunk/resources/org/apache/batik/dom/svg/resources/Messages.properties
xmlgraphics/batik/trunk/sources/org/apache/batik/anim/AnimationEngine.java
xmlgraphics/batik/trunk/sources/org/apache/batik/anim/InterpolatingAnimation.java
xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/AccesskeyTimingSpecifier.java
xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventLikeTimingSpecifier.java
xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventbaseTimingSpecifier.java
xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimeContainer.java
xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedDocumentRoot.java
xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimateMotionElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationEngine.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGSVGElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUseElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGDOMImplementation.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedPathData.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMComponentTransferFunctionElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEColorMatrixElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEConvolveMatrixElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDiffuseLightingElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEGaussianBlurElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMorphologyElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFETurbulenceElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFilterElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMGradientElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMMarkerElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPathElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPatternElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSVGElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMStyleElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSymbolElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMUseElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMViewElement.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathContext.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathSupport.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGSVGContext.java
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGTestsSupport.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/PathLength.java
xmlgraphics/batik/trunk/sources/org/apache/batik/util/RunnableQueue.java
Modified: xmlgraphics/batik/trunk/resources/org/apache/batik/dom/svg/resources/Messages.properties
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/dom/svg/resources/Messages.properties?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/resources/org/apache/batik/dom/svg/resources/Messages.properties (original)
+++ xmlgraphics/batik/trunk/resources/org/apache/batik/dom/svg/resources/Messages.properties Mon Aug 7 05:48:50 2006
@@ -84,3 +84,15 @@
animation.dur.indefinite = \
The simple duration of the animation element is indefinite.
+
+expected.point = \
+Expected an object of type SVGPoint.
+
+expected.length = \
+Expected an object of type SVGLength.
+
+expected.transform = \
+Expected an object of type SVGTransform.
+
+invalid.suspend.handle = \
+Invalid suspend handle ID {0}.
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/anim/AnimationEngine.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/anim/AnimationEngine.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/anim/AnimationEngine.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/anim/AnimationEngine.java Mon Aug 7 05:48:50 2006
@@ -17,6 +17,7 @@
*/
package org.apache.batik.anim;
+import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -53,6 +54,12 @@
protected TimedDocumentRoot timedDocumentRoot;
/**
+ * The time at which the document was paused, or 0 if the document is not
+ * paused.
+ */
+ protected long pauseTime;
+
+ /**
* Map of AnimationTargets to TargetInfo objects.
*/
protected HashMap targets = new HashMap();
@@ -76,6 +83,57 @@
}
/**
+ * Pauses the animations.
+ */
+ public void pause() {
+ if (pauseTime == 0) {
+ pauseTime = System.currentTimeMillis();
+ }
+ }
+
+ /**
+ * Unpauses the animations.
+ */
+ public void unpause() {
+ if (pauseTime != 0) {
+ Calendar begin = timedDocumentRoot.getDocumentBeginTime();
+ int dt = (int) (System.currentTimeMillis() - pauseTime);
+ begin.add(Calendar.MILLISECOND, dt);
+ pauseTime = 0;
+ }
+ }
+
+ /**
+ * Returns whether animations are currently paused.
+ */
+ public boolean isPaused() {
+ return pauseTime != 0;
+ }
+
+ /**
+ * Returns the current document time.
+ */
+ public float getCurrentTime() {
+ return timedDocumentRoot.getCurrentTime();
+ }
+
+ /**
+ * Sets the current document time.
+ */
+ public void setCurrentTime(float t) {
+ boolean p = pauseTime != 0;
+ unpause();
+ Calendar begin = timedDocumentRoot.getDocumentBeginTime();
+ float now =
+ timedDocumentRoot.convertEpochTime(System.currentTimeMillis());
+ begin.add(Calendar.MILLISECOND, (int) ((now - t) * 1000));
+ if (p) {
+ pause();
+ }
+ tick(t, true);
+ }
+
+ /**
* Adds an animation to the document.
* @param target the target element of the animation
* @param type the type of animation (must be one of the
@@ -196,9 +254,12 @@
/**
* Updates the animations in the document to the given document time.
+ * @param time the document time to sample at
+ * @param hyperlinking whether the document should be seeked to the given
+ * time, as with hyperlinking
*/
- protected void tick(float time) {
- timedDocumentRoot.seekTo(time);
+ protected void tick(float time, boolean hyperlinking) {
+ timedDocumentRoot.seekTo(time, hyperlinking);
Iterator i = targets.entrySet().iterator();
while (i.hasNext()) {
Map.Entry e = (Map.Entry) i.next();
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/anim/InterpolatingAnimation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/anim/InterpolatingAnimation.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/anim/InterpolatingAnimation.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/anim/InterpolatingAnimation.java Mon Aug 7 05:48:50 2006
@@ -18,7 +18,6 @@
package org.apache.batik.anim;
import org.apache.batik.anim.timing.TimedElement;
-import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.ext.awt.geom.Cubic;
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/AccesskeyTimingSpecifier.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/AccesskeyTimingSpecifier.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/AccesskeyTimingSpecifier.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/AccesskeyTimingSpecifier.java Mon Aug 7 05:48:50 2006
@@ -141,10 +141,8 @@
* Invoked to resolve an event-like timing specifier into an instance time.
*/
public void resolve(Event e) {
- long time = e.getTimeStamp() -
- owner.getRoot().getDocumentBeginTime().getTimeInMillis();
- InstanceTime instance =
- new InstanceTime(this, time / 1000f, null, true);
+ float time = owner.getRoot().convertEpochTime(e.getTimeStamp());
+ InstanceTime instance = new InstanceTime(this, time, null, true);
owner.addInstanceTime(instance, isBegin);
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventLikeTimingSpecifier.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventLikeTimingSpecifier.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventLikeTimingSpecifier.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventLikeTimingSpecifier.java Mon Aug 7 05:48:50 2006
@@ -18,7 +18,6 @@
package org.apache.batik.anim.timing;
import org.w3c.dom.events.Event;
-import org.w3c.dom.smil.TimeEvent;
/**
* Abstract class from which all event-like timing specifier classes derive.
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventbaseTimingSpecifier.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventbaseTimingSpecifier.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventbaseTimingSpecifier.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/EventbaseTimingSpecifier.java Mon Aug 7 05:48:50 2006
@@ -120,10 +120,8 @@
* Invoked to resolve an event-like timing specifier into an instance time.
*/
public void resolve(Event e) {
- long time = e.getTimeStamp() -
- owner.getRoot().getDocumentBeginTime().getTimeInMillis();
- InstanceTime instance =
- new InstanceTime(this, time / 1000f, null, true);
+ float time = owner.getRoot().convertEpochTime(e.getTimeStamp());
+ InstanceTime instance = new InstanceTime(this, time, null, true);
owner.addInstanceTime(instance, isBegin);
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimeContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimeContainer.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimeContainer.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimeContainer.java Mon Aug 7 05:48:50 2006
@@ -78,19 +78,19 @@
/**
* Calculates the local simple time.
*/
- protected void sampleAt(float parentSimpleTime) {
- super.sampleAt(parentSimpleTime);
- sampleChildren(parentSimpleTime);
+ protected void sampleAt(float parentSimpleTime, boolean hyperlinking) {
+ super.sampleAt(parentSimpleTime, hyperlinking);
+ sampleChildren(parentSimpleTime, hyperlinking);
}
/**
* Samples all the child timed elements.
*/
- protected void sampleChildren(float parentSimpleTime) {
+ protected void sampleChildren(float parentSimpleTime, boolean hyperlinking) {
Iterator i = children.iterator();
while (i.hasNext()) {
TimedElement e = (TimedElement) i.next();
- e.sampleAt(parentSimpleTime);
+ e.sampleAt(parentSimpleTime, hyperlinking);
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedDocumentRoot.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedDocumentRoot.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedDocumentRoot.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedDocumentRoot.java Mon Aug 7 05:48:50 2006
@@ -38,11 +38,6 @@
protected Calendar documentBeginTime;
/**
- * The wallclock time that the document was paused.
- */
- protected Calendar pauseTime;
-
- /**
* Allows the use of accessKey() timing specifiers with a single
* character, as specified in SVG 1.1.
*/
@@ -99,9 +94,17 @@
}
/**
+ * Returns the last sampled document time.
+ */
+ public float getCurrentTime() {
+ return lastSampleTime;
+ }
+
+ /**
* Samples the entire timegraph at the given time.
*/
- public void seekTo(float time) {
+ public void seekTo(float time, boolean hyperlinking) {
+ lastSampleTime = time;
// Trace.enter(this, "seekTo", new Object[] { new Float(time) } ); try {
propagationFlags.clear();
// No time containers in SVG, so we don't have to worry
@@ -109,7 +112,7 @@
TimedElement[] es = getChildren();
for (int i = 0; i < es.length; i++) {
// System.err.print("[" + ((Test.AnimateElement) es[i]).id + "] ");
- es[i].sampleAt(time);
+ es[i].sampleAt(time, hyperlinking);
}
boolean needsUpdates;
do {
@@ -118,7 +121,7 @@
if (es[i].shouldUpdateCurrentInterval) {
needsUpdates = true;
// System.err.print("{" + ((Test.AnimateElement) es[i]).id + "} ");
- es[i].sampleAt(time);
+ es[i].sampleAt(time, hyperlinking);
}
}
} while (needsUpdates);
@@ -142,6 +145,14 @@
*/
public Calendar getDocumentBeginTime() {
return documentBeginTime;
+ }
+
+ /**
+ * Converts an epoch time to document time.
+ */
+ public float convertEpochTime(long t) {
+ long begin = documentBeginTime.getTimeInMillis();
+ return (t - begin) / 1000f;
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/anim/timing/TimedElement.java Mon Aug 7 05:48:50 2006
@@ -532,9 +532,12 @@
}
/**
- * Calculates the local simple time.
+ * Calculates the local simple time. Currently the hyperlinking parameter
+ * is ignored, so DOM timing events are fired during hyperlinking seeks.
+ * If we were following SMIL 2.1 rather than SMIL Animation, then these
+ * events would have to be surpressed.
*/
- protected void sampleAt(float parentSimpleTime) {
+ protected void sampleAt(float parentSimpleTime, boolean hyperlinking) {
// Trace.enter(this, "sampleAt", new Object[] { new Float(parentSimpleTime) } ); try {
float time = parentSimpleTime; // No time containers in SVG.
@@ -588,14 +591,17 @@
}
isActive = true;
lastRepeatTime = begin;
- fireTimeEvent(SMIL_BEGIN_EVENT_NAME, currentInterval.getBegin(), 0);
+ fireTimeEvent
+ (SMIL_BEGIN_EVENT_NAME, currentInterval.getBegin(), 0);
}
}
boolean wasActive = isActive;
// For each sample, we might need to update the current interval's
// begin and end times, or end the current interval and compute
// a new one.
- boolean hasEnded = currentInterval != null && time >= currentInterval.getEnd();
+ boolean hasEnded = currentInterval != null
+ && (time < currentInterval.getBegin()
+ || time >= currentInterval.getEnd());
// Fire any repeat events that should have been fired since the
// last sample.
if (currentInterval != null) {
@@ -609,6 +615,9 @@
}
}
// Trace.print("begin loop");
+ if (hyperlinking) {
+ shouldUpdateCurrentInterval = true;
+ }
while (shouldUpdateCurrentInterval || hasEnded) {
if (hasEnded) {
previousIntervals.add(currentInterval);
@@ -619,9 +628,9 @@
boolean first =
currentInterval == null && previousIntervals.isEmpty();
if (currentInterval == null || hasEnded) {
- if (first || restartMode != RESTART_NEVER) {
+ if (first || hyperlinking || restartMode != RESTART_NEVER) {
float beginAfter;
- if (first) {
+ if (first || hyperlinking) {
beginAfter = Float.NEGATIVE_INFINITY;
} else {
beginAfter = ((Interval) previousIntervals.getLast()).getEnd();
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java Mon Aug 7 05:48:50 2006
@@ -21,9 +21,6 @@
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.lang.ref.SoftReference;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
import org.apache.batik.css.engine.CSSEngineEvent;
import org.apache.batik.css.engine.SVGCSSEngine;
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimateMotionElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimateMotionElementBridge.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimateMotionElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimateMotionElementBridge.java Mon Aug 7 05:48:50 2006
@@ -17,7 +17,6 @@
*/
package org.apache.batik.bridge;
-import java.awt.geom.Point2D;
import java.util.ArrayList;
import org.apache.batik.anim.AbstractAnimation;
@@ -30,7 +29,6 @@
import org.apache.batik.dom.svg.SVGAnimatedPathDataSupport;
import org.apache.batik.dom.svg.SVGOMElement;
import org.apache.batik.dom.svg.SVGOMPathElement;
-import org.apache.batik.dom.svg.SVGOMTransform;
import org.apache.batik.dom.util.XLinkSupport;
import org.apache.batik.parser.AWTPathProducer;
import org.apache.batik.parser.AngleHandler;
@@ -39,7 +37,6 @@
import org.apache.batik.parser.LengthPairListParser;
import org.apache.batik.parser.PathParser;
import org.apache.batik.parser.ParseException;
-import org.apache.batik.util.SVGTypes;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationEngine.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationEngine.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationEngine.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGAnimationEngine.java Mon Aug 7 05:48:50 2006
@@ -111,6 +111,11 @@
protected boolean started;
/**
+ * The Runnable that ticks the document.
+ */
+ protected AnimationTickRunnable animationTickRunnable;
+
+ /**
* The factory for unparsed string values.
*/
protected UncomputedAnimatableStringValueFactory
@@ -345,6 +350,23 @@
}
/**
+ * Pauses the animations.
+ */
+ public void pause() {
+ super.pause();
+ ctx.getUpdateManager().getUpdateRunnableQueue().setIdleRunnable(null);
+ }
+
+ /**
+ * Pauses the animations.
+ */
+ public void unpause() {
+ super.unpause();
+ ctx.getUpdateManager().getUpdateRunnableQueue().setIdleRunnable
+ (animationTickRunnable);
+ }
+
+ /**
* Creates a new returns a new TimedDocumentRoot object for the document.
*/
protected TimedDocumentRoot createDocumentRoot() {
@@ -544,11 +566,12 @@
bridge.initializeTimedElement();
}
started = true;
- tick(0);
+ tick(0, false);
// animationThread = new AnimationThread();
// animationThread.start();
+ animationTickRunnable = new AnimationTickRunnable();
ctx.getUpdateManager().getUpdateRunnableQueue().setIdleRunnable
- (new AnimationTickRunnable());
+ (animationTickRunnable);
} catch (AnimationException ex) {
throw new BridgeException(ctx, ex.getElement().getElement(),
ex.getMessage());
@@ -581,7 +604,7 @@
// System.err.println("fps: " + frames);
frames = 0;
}
- tick(t);
+ tick(t, false);
frames++;
} catch (AnimationException ex) {
throw new BridgeException(ctx, ex.getElement().getElement(),
@@ -668,7 +691,7 @@
* Ticks the animation over.
*/
public void run() {
- tick(t);
+ tick(t, false);
}
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGPathElementBridge.java Mon Aug 7 05:48:50 2006
@@ -159,4 +159,13 @@
PathLength pl = getPathLengthObj();
return pl.pointAtLength(distance);
}
+
+ /**
+ * Returns the index of the path segment at the given distance along the
+ * path.
+ */
+ public int getPathSegAtLength(float distance) {
+ PathLength pl = getPathLengthObj();
+ return pl.segmentAtLength(distance);
+ }
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGSVGElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGSVGElementBridge.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGSVGElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGSVGElementBridge.java Mon Aug 7 05:48:50 2006
@@ -863,4 +863,38 @@
um.forceRepaint();
}
+ /**
+ * Pauses animations in the document.
+ */
+ public void pauseAnimations() {
+ ctx.getAnimationEngine().pause();
+ }
+
+ /**
+ * Unpauses animations in the document.
+ */
+ public void unpauseAnimations() {
+ ctx.getAnimationEngine().unpause();
+ }
+
+ /**
+ * Returns whether animations are currently paused.
+ */
+ public boolean animationsPaused() {
+ return ctx.getAnimationEngine().isPaused();
+ }
+
+ /**
+ * Returns the current document time.
+ */
+ public float getCurrentTime() {
+ return ctx.getAnimationEngine().getCurrentTime();
+ }
+
+ /**
+ * Sets the current document time.
+ */
+ public void setCurrentTime(float t) {
+ ctx.getAnimationEngine().setCurrentTime(t);
+ }
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUseElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUseElementBridge.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUseElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUseElementBridge.java Mon Aug 7 05:48:50 2006
@@ -31,7 +31,6 @@
import org.apache.batik.dom.svg.SVGOMDocument;
import org.apache.batik.dom.svg.SVGOMUseElement;
import org.apache.batik.dom.svg.SVGOMUseShadowRoot;
-import org.apache.batik.dom.util.XLinkSupport;
import org.apache.batik.gvt.CompositeGraphicsNode;
import org.apache.batik.gvt.GraphicsNode;
import org.apache.batik.util.XMLConstants;
@@ -42,7 +41,6 @@
import org.w3c.dom.Node;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;
-import org.w3c.dom.events.MutationEvent;
import org.w3c.dom.svg.SVGUseElement;
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGDOMImplementation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGDOMImplementation.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGDOMImplementation.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGDOMImplementation.java Mon Aug 7 05:48:50 2006
@@ -158,8 +158,8 @@
* DOMImplementationCSS#createCSSStyleSheet(String,String)}.
*/
public CSSStyleSheet createCSSStyleSheet(String title, String media) {
-
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException
+ ("DOMImplementationCSS.createCSSStyleSheet is not implemented"); // XXX
}
// CSSStyleDeclarationFactory ///////////////////////////////////////////
@@ -169,7 +169,8 @@
* @return a CSSOMStyleDeclaration instance.
*/
public CSSStyleDeclaration createCSSStyleDeclaration() {
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException
+ ("CSSStyleDeclarationFactory.createCSSStyleDeclaration is not implemented"); // XXX
}
// StyleSheetFactory /////////////////////////////////////////////
@@ -179,14 +180,16 @@
* processing instruction or return null.
*/
public StyleSheet createStyleSheet(Node n, HashTable attrs) {
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException
+ ("StyleSheetFactory.createStyleSheet is not implemented"); // XXX
}
/**
* Returns the user-agent stylesheet.
*/
public CSSStyleSheet getUserAgentStyleSheet() {
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException
+ ("StyleSheetFactory.getUserAgentStyleSheet is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedPathData.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedPathData.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedPathData.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMAnimatedPathData.java Mon Aug 7 05:48:50 2006
@@ -91,7 +91,8 @@
* SVGAnimatedPathData#getAnimatedNormalizedPathSegList()}.
*/
public SVGPathSegList getAnimatedNormalizedPathSegList() {
- throw new RuntimeException("TODO : getAnimatedNormalizedPathSegList() !!");
+ throw new UnsupportedOperationException
+ ("SVGAnimatedPathData.getAnimatedNormalizedPathSegList is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMComponentTransferFunctionElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMComponentTransferFunctionElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMComponentTransferFunctionElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMComponentTransferFunctionElement.java Mon Aug 7 05:48:50 2006
@@ -78,7 +78,8 @@
* SVGComponentTransferFunctionElement#getTableValues()}.
*/
public SVGAnimatedNumberList getTableValues() {
- throw new RuntimeException("!!! TODO: getTableValues");
+ throw new UnsupportedOperationException
+ ("SVGComponentTransferFunctionElement.getTableValues is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEColorMatrixElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEColorMatrixElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEColorMatrixElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEColorMatrixElement.java Mon Aug 7 05:48:50 2006
@@ -89,7 +89,8 @@
* <b>DOM</b>: Implements {@link SVGFEColorMatrixElement#getValues()}.
*/
public SVGAnimatedNumberList getValues() {
- throw new RuntimeException("!!! TODO: getValues()");
+ throw new UnsupportedOperationException
+ ("SVGFEColorMatrixElement.getValues is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEConvolveMatrixElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEConvolveMatrixElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEConvolveMatrixElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEConvolveMatrixElement.java Mon Aug 7 05:48:50 2006
@@ -93,21 +93,24 @@
* <b>DOM</b>: Implements {@link SVGFEConvolveMatrixElement#getKernelMatrix()}.
*/
public SVGAnimatedNumberList getKernelMatrix() {
- throw new RuntimeException("!!! TODO: getKernelMatrix()");
+ throw new UnsupportedOperationException
+ ("SVGFEConvolveMatrixElement.getKernelMatrix is not implemented"); // XXX
}
/**
* <b>DOM</b>: Implements {@link SVGFEConvolveMatrixElement#getOrderX()}.
*/
public SVGAnimatedInteger getOrderX() {
- throw new RuntimeException("!!! TODO: getOrderX()");
+ throw new UnsupportedOperationException
+ ("SVGFEConvolveMatrixElement.getOrderX is not implemented"); // XXX
}
/**
* <b>DOM</b>: Implements {@link SVGFEConvolveMatrixElement#getOrderY()}.
*/
public SVGAnimatedInteger getOrderY() {
- throw new RuntimeException("!!! TODO: getOrderY()");
+ throw new UnsupportedOperationException
+ ("SVGFEConvolveMatrixElement.getOrderY is not implemented"); // XXX
}
/**
@@ -115,7 +118,8 @@
*/
public SVGAnimatedInteger getTargetX() {
// Default value relative to orderX...
- throw new RuntimeException("!!! TODO: getTargetX()");
+ throw new UnsupportedOperationException
+ ("SVGFEConvolveMatrixElement.getTargetX is not implemented"); // XXX
}
/**
@@ -123,7 +127,8 @@
*/
public SVGAnimatedInteger getTargetY() {
// Default value relative to orderY...
- throw new RuntimeException("!!! TODO: getTargetY()");
+ throw new UnsupportedOperationException
+ ("SVGFEConvolveMatrixElement.getTargetY is not implemented"); // XXX
}
/**
@@ -131,7 +136,8 @@
*/
public SVGAnimatedNumber getDivisor() {
// Default value relative to kernel matrix...
- throw new RuntimeException("!!! TODO: getDivisor()");
+ throw new UnsupportedOperationException
+ ("SVGFEConvolveMatrixElement.getDivisor is not implemented"); // XXX
}
/**
@@ -147,7 +153,8 @@
* org.w3c.dom.svg.SVGFEConvolveMatrixElement#getKernelUnitLengthX()}.
*/
public SVGAnimatedNumber getKernelUnitLengthX() {
- throw new RuntimeException("!!! TODO: getKernelUnitLengthX()");
+ throw new UnsupportedOperationException
+ ("SVGFEConvolveMatrixElement.getKernelUnitLengthX is not implemented"); // XXX
}
/**
@@ -155,7 +162,8 @@
* org.w3c.dom.svg.SVGFEConvolveMatrixElement#getKernelUnitLengthY()}.
*/
public SVGAnimatedNumber getKernelUnitLengthY() {
- throw new RuntimeException("!!! TODO: getKernelUnitLengthY()");
+ throw new UnsupportedOperationException
+ ("SVGFEConvolveMatrixElement.getKernelUnitLengthY is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDiffuseLightingElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDiffuseLightingElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDiffuseLightingElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEDiffuseLightingElement.java Mon Aug 7 05:48:50 2006
@@ -92,7 +92,8 @@
* org.w3c.dom.svg.SVGFEDiffuseLightingElement#getKernelUnitLengthX()}.
*/
public SVGAnimatedNumber getKernelUnitLengthX() {
- throw new RuntimeException("!!! TODO: getKernelUnitLengthX()");
+ throw new UnsupportedOperationException
+ ("SVGFEDiffuseLightingElement.getKernelUnitLengthX is not implemented"); // XXX
}
/**
@@ -100,7 +101,8 @@
* org.w3c.dom.svg.SVGFEDiffuseLightingElement#getKernelUnitLengthY()}.
*/
public SVGAnimatedNumber getKernelUnitLengthY() {
- throw new RuntimeException("!!! TODO: getKernelUnitLengthY()");
+ throw new UnsupportedOperationException
+ ("SVGFEDiffuseLightingElement.getKernelUnitLengthY is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEGaussianBlurElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEGaussianBlurElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEGaussianBlurElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEGaussianBlurElement.java Mon Aug 7 05:48:50 2006
@@ -71,7 +71,8 @@
* SVGFEGaussianBlurElement#getStdDeviationX()}.
*/
public SVGAnimatedNumber getStdDeviationX() {
- throw new RuntimeException("!!! TODO: getStdDeviationX");
+ throw new UnsupportedOperationException
+ ("SVGFEGaussianBlurElement.getStdDeviationX is not implemented"); // XXX
}
/**
@@ -79,7 +80,8 @@
* SVGFEGaussianBlurElement#getStdDeviationY()}.
*/
public SVGAnimatedNumber getStdDeviationY() {
- throw new RuntimeException("!!! TODO: getStdDeviationY");
+ throw new UnsupportedOperationException
+ ("SVGFEGaussianBlurElement.getStdDeviationY is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMorphologyElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMorphologyElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMorphologyElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFEMorphologyElement.java Mon Aug 7 05:48:50 2006
@@ -88,14 +88,16 @@
* <b>DOM</b>: Implements {@link SVGFEMorphologyElement#getRadiusX()}.
*/
public SVGAnimatedNumber getRadiusX() {
- throw new RuntimeException(" !!! TODO getRadiusX()");
+ throw new UnsupportedOperationException
+ ("SVGFEMorphologyElement.getRadiusX is not implemented"); // XXX
}
/**
* <b>DOM</b>: Implements {@link SVGFEMorphologyElement#getRadiusY()}.
*/
public SVGAnimatedNumber getRadiusY() {
- throw new RuntimeException(" !!! TODO getRadiusY()");
+ throw new UnsupportedOperationException
+ ("SVGFEMorphologyElement.getRadiusY is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFETurbulenceElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFETurbulenceElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFETurbulenceElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFETurbulenceElement.java Mon Aug 7 05:48:50 2006
@@ -84,7 +84,8 @@
* SVGFETurbulenceElement#getBaseFrequencyX()}.
*/
public SVGAnimatedNumber getBaseFrequencyX() {
- throw new RuntimeException("!!! TODO getBaseFrequencyX()");
+ throw new UnsupportedOperationException
+ ("SVGFETurbulenceElement.getBaseFrequencyX is not implemented"); // XXX
}
/**
@@ -92,7 +93,8 @@
* SVGFETurbulenceElement#getBaseFrequencyY()}.
*/
public SVGAnimatedNumber getBaseFrequencyY() {
- throw new RuntimeException("!!! TODO getBaseFrequencyY()");
+ throw new UnsupportedOperationException
+ ("SVGFETurbulenceElement.getBaseFrequencyY is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFilterElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFilterElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFilterElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMFilterElement.java Mon Aug 7 05:48:50 2006
@@ -148,21 +148,24 @@
* <b>DOM</b>: Implements {@link SVGFilterElement#getFilterResX()}.
*/
public SVGAnimatedInteger getFilterResX() {
- throw new RuntimeException(" !!! TODO: getFilterResX()");
+ throw new UnsupportedOperationException
+ ("SVGFilterElement.getFilterResX is not implemented"); // XXX
}
/**
* <b>DOM</b>: Implements {@link SVGFilterElement#getFilterResY()}.
*/
public SVGAnimatedInteger getFilterResY() {
- throw new RuntimeException(" !!! TODO: getFilterResY()");
+ throw new UnsupportedOperationException
+ ("SVGFilterElement.getFilterResY is not implemented"); // XXX
}
/**
* <b>DOM</b>: Implements {@link SVGFilterElement#setFilterRes(int,int)}.
*/
public void setFilterRes(int filterResX, int filterResY) {
- throw new RuntimeException(" !!! TODO: setFilterRes()");
+ throw new UnsupportedOperationException
+ ("SVGFilterElement.setFilterRes is not implemented"); // XXX
}
// SVGURIReference support /////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMGradientElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMGradientElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMGradientElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMGradientElement.java Mon Aug 7 05:48:50 2006
@@ -96,7 +96,8 @@
* org.w3c.dom.svg.SVGGradientElement#getGradientTransform()}.
*/
public SVGAnimatedTransformList getGradientTransform() {
- throw new RuntimeException(" !!! TODO: getGradientTransform()");
+ throw new UnsupportedOperationException
+ ("SVGGradientElement.getGradientTransform is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMMarkerElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMMarkerElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMMarkerElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMMarkerElement.java Mon Aug 7 05:48:50 2006
@@ -194,7 +194,8 @@
* org.w3c.dom.svg.SVGFitToViewBox#getViewBox()}.
*/
public SVGAnimatedRect getViewBox() {
- throw new RuntimeException(" !!! TODO: getViewBox()");
+ throw new UnsupportedOperationException
+ ("SVGMarkerElement.getViewBox is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPathElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPathElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPathElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPathElement.java Mon Aug 7 05:48:50 2006
@@ -77,14 +77,15 @@
* <b>DOM</b>: Implements {@link org.w3c.dom.Node#getLocalName()}.
*/
public String getLocalName() {
- return "path";
+ return SVG_PATH_TAG;
}
/**
* <b>DOM</b>: Implements {@link SVGPathElement#getPathLength()}.
*/
public SVGAnimatedNumber getPathLength() {
- throw new RuntimeException(" !!! getPathLength() Not Yet Implemented");
+ throw new UnsupportedOperationException
+ ("SVGPathElement.getPathLength is not implemented"); // XXX
}
/**
@@ -105,8 +106,7 @@
* <b>DOM</b>: Implements {@link SVGPathElement#getPathSegAtLength(float)}.
*/
public int getPathSegAtLength(float distance) {
- throw new RuntimeException
- (" !!! getPathSegAtLength() Not Yet Implemented");
+ return SVGPathSupport.getPathSegAtLength(this, distance);
}
/**
@@ -160,7 +160,6 @@
* SVGPathElement#createSVGPathSegMovetoAbs(float,float)}.
*/
public SVGPathSegMovetoAbs createSVGPathSegMovetoAbs(final float x_value, final float y_value) {
- //throw new RuntimeException(" !!! createSVGPathSegMovetoAbs()");
return new SVGPathSegMovetoAbs(){
protected float x = x_value;
protected float y = y_value;
@@ -191,7 +190,6 @@
* SVGPathElement#createSVGPathSegMovetoRel(float,float)}.
*/
public SVGPathSegMovetoRel createSVGPathSegMovetoRel(final float x_value, final float y_value) {
- //throw new RuntimeException(" !!! createSVGPathSegMovetoRel()");
return new SVGPathSegMovetoRel(){
protected float x = x_value;
protected float y = y_value;
@@ -215,7 +213,6 @@
this.y = y;
}
};
-
}
/**
@@ -223,7 +220,6 @@
* SVGPathElement#createSVGPathSegLinetoAbs(float,float)}.
*/
public SVGPathSegLinetoAbs createSVGPathSegLinetoAbs(final float x_value, final float y_value) {
- //throw new RuntimeException(" !!! createSVGPathSegLinetoAbs()");
return new SVGPathSegLinetoAbs(){
protected float x = x_value;
protected float y = y_value;
@@ -254,7 +250,6 @@
* SVGPathElement#createSVGPathSegLinetoRel(float,float)}.
*/
public SVGPathSegLinetoRel createSVGPathSegLinetoRel(final float x_value, final float y_value) {
- //throw new RuntimeException(" !!! createSVGPathSegLinetoRel()");
return new SVGPathSegLinetoRel(){
protected float x = x_value;
protected float y = y_value;
@@ -285,7 +280,6 @@
* SVGPathElement#createSVGPathSegLinetoHorizontalAbs(float)}.
*/
public SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs(final float x_value) {
- //throw new RuntimeException(" !!! createSVGPathSegLinetoHorizontalAbs()");
return new SVGPathSegLinetoHorizontalAbs(){
protected float x = x_value;
@@ -302,7 +296,6 @@
this.x = x;
}
};
-
}
/**
@@ -310,7 +303,6 @@
* SVGPathElement#createSVGPathSegLinetoHorizontalRel(float)}.
*/
public SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel(final float x_value) {
- //throw new RuntimeException(" !!! createSVGPathSegLinetoHorizontalRel()");
return new SVGPathSegLinetoHorizontalRel(){
protected float x = x_value;
@@ -327,7 +319,6 @@
this.x = x;
}
};
-
}
/**
@@ -335,7 +326,6 @@
* SVGPathElement#createSVGPathSegLinetoVerticalAbs(float)}.
*/
public SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs(final float y_value) {
- //throw new RuntimeException(" !!! createSVGPathSegLinetoVerticalAbs()");
return new SVGPathSegLinetoVerticalAbs(){
protected float y = y_value;
@@ -352,7 +342,6 @@
this.y = y;
}
};
-
}
/**
@@ -360,7 +349,6 @@
* SVGPathElement#createSVGPathSegLinetoVerticalRel(float)}.
*/
public SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel(final float y_value) {
- //throw new RuntimeException(" !!! createSVGPathSegLinetoVerticalRel()");
return new SVGPathSegLinetoVerticalRel(){
protected float y = y_value;
@@ -377,7 +365,6 @@
this.y = y;
}
};
-
}
/**
@@ -388,7 +375,6 @@
(final float x_value, final float y_value,
final float x1_value, final float y1_value,
final float x2_value, final float y2_value) {
- //throw new RuntimeException(" !!! createSVGPathSegCurvetoCubicAbs()");
return new SVGPathSegCurvetoCubicAbs(){
protected float x = x_value;
protected float y = y_value;
@@ -440,7 +426,6 @@
this.y2 = y2;
}
};
-
}
/**
@@ -451,7 +436,6 @@
(final float x_value, final float y_value,
final float x1_value, final float y1_value,
final float x2_value, final float y2_value) {
- //throw new RuntimeException(" !!! createSVGPathSegCurvetoCubicAbs()");
return new SVGPathSegCurvetoCubicRel(){
protected float x = x_value;
protected float y = y_value;
@@ -512,7 +496,6 @@
public SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs
(final float x_value, final float y_value,
final float x1_value, final float y1_value) {
- //throw new RuntimeException(" !!! createSVGPathSegCurvetoCubicAbs()");
return new SVGPathSegCurvetoQuadraticAbs(){
protected float x = x_value;
protected float y = y_value;
@@ -559,7 +542,6 @@
public SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel
(final float x_value, final float y_value,
final float x1_value, final float y1_value) {
- //throw new RuntimeException(" !!! createSVGPathSegCurvetoCubicAbs()");
return new SVGPathSegCurvetoQuadraticRel(){
protected float x = x_value;
protected float y = y_value;
@@ -607,7 +589,6 @@
createSVGPathSegCurvetoCubicSmoothAbs
(final float x_value, final float y_value,
final float x2_value, final float y2_value) {
- //throw new RuntimeException(" !!! createSVGPathSegCurvetoCubicAbs()");
return new SVGPathSegCurvetoCubicSmoothAbs(){
protected float x = x_value;
protected float y = y_value;
@@ -655,7 +636,6 @@
createSVGPathSegCurvetoCubicSmoothRel
(final float x_value, final float y_value,
final float x2_value, final float y2_value) {
- //throw new RuntimeException(" !!! createSVGPathSegCurvetoCubicAbs()");
return new SVGPathSegCurvetoCubicSmoothRel(){
protected float x = x_value;
protected float y = y_value;
@@ -702,7 +682,6 @@
public SVGPathSegCurvetoQuadraticSmoothAbs
createSVGPathSegCurvetoQuadraticSmoothAbs
(final float x_value, final float y_value) {
- //throw new RuntimeException(" !!! createSVGPathSegLinetoAbs()");
return new SVGPathSegCurvetoQuadraticSmoothAbs(){
protected float x = x_value;
protected float y = y_value;
@@ -736,7 +715,6 @@
public SVGPathSegCurvetoQuadraticSmoothRel
createSVGPathSegCurvetoQuadraticSmoothRel
(final float x_value, final float y_value) {
- //throw new RuntimeException(" !!! createSVGPathSegLinetoAbs()");
return new SVGPathSegCurvetoQuadraticSmoothRel(){
protected float x = x_value;
protected float y = y_value;
@@ -772,7 +750,6 @@
final float angle_value,
final boolean largeArcFlag_value,
final boolean sweepFlag_value) {
- //throw new RuntimeException(" !!! createSVGPathSegArcAbs()");
return new SVGPathSegArcAbs(){
protected float x = x_value;
protected float y = y_value;
@@ -845,7 +822,6 @@
final float angle_value,
final boolean largeArcFlag_value,
final boolean sweepFlag_value) {
- //throw new RuntimeException(" !!! createSVGPathSegArcAbs()");
return new SVGPathSegArcRel(){
protected float x = x_value;
protected float y = y_value;
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPatternElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPatternElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPatternElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMPatternElement.java Mon Aug 7 05:48:50 2006
@@ -100,7 +100,8 @@
* To implement {@link SVGPatternElement#getPatternTransform()}.
*/
public SVGAnimatedTransformList getPatternTransform() {
- throw new RuntimeException(" !!! TODO: getPatternTransform()");
+ throw new UnsupportedOperationException
+ ("SVGPatternElement.getPatternTransform is not implemented"); // XXX
}
/**
@@ -176,7 +177,8 @@
* org.w3c.dom.svg.SVGFitToViewBox#getViewBox()}.
*/
public SVGAnimatedRect getViewBox() {
- throw new RuntimeException(" !!! TODO: getViewBox()");
+ throw new UnsupportedOperationException
+ ("SVGFitToViewBox.getViewBox is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSVGElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSVGElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSVGElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSVGElement.java Mon Aug 7 05:48:50 2006
@@ -232,21 +232,24 @@
* <b>DOM</b>: Implements {@link SVGSVGElement#getUseCurrentView()}.
*/
public boolean getUseCurrentView() {
- throw new UnsupportedOperationException("!!! Not implemented.");
+ throw new UnsupportedOperationException
+ ("SVGSVGElement.getUseCurrentView is not implemented"); // XXX
}
/**
* <b>DOM</b>: Implements {@link SVGSVGElement#setUseCurrentView(boolean)}.
*/
public void setUseCurrentView(boolean useCurrentView) throws DOMException {
- throw new UnsupportedOperationException("!!! Not implemented.");
+ throw new UnsupportedOperationException
+ ("SVGSVGElement.setUseCurrentView is not implemented"); // XXX
}
/**
* <b>DOM</b>: Implements {@link SVGSVGElement#getCurrentView()}.
*/
public SVGViewSpec getCurrentView() {
- throw new UnsupportedOperationException("!!! Not implemented.");
+ throw new UnsupportedOperationException
+ ("SVGSVGElement.getCurrentView is not implemented"); // XXX
}
/**
@@ -326,71 +329,131 @@
};
}
- public int suspendRedraw ( int max_wait_milliseconds ) {
- if (max_wait_milliseconds > 60000)
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#suspendRedraw(int)}.
+ */
+ public int suspendRedraw(int max_wait_milliseconds) {
+ if (max_wait_milliseconds > 60000) {
max_wait_milliseconds = 60000;
- else if (max_wait_milliseconds < 0) max_wait_milliseconds = 0;
-
+ } else if (max_wait_milliseconds < 0) {
+ max_wait_milliseconds = 0;
+ }
SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
return ctx.suspendRedraw(max_wait_milliseconds);
}
- public void unsuspendRedraw ( int suspend_handle_id )
- throws DOMException {
+
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#unsuspendRedraw(int)}.
+ */
+ public void unsuspendRedraw(int suspend_handle_id) throws DOMException {
SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
- boolean ok = ctx.unsuspendRedraw(suspend_handle_id);
- if (!ok) {
- throw new DOMException(DOMException.NOT_FOUND_ERR,
- "Bad suspend_handle_id: " +
- suspend_handle_id);
+ if (!ctx.unsuspendRedraw(suspend_handle_id)) {
+ throw createDOMException
+ (DOMException.NOT_FOUND_ERR, "invalid.suspend.handle",
+ new Object[] { new Integer(suspend_handle_id) });
}
}
- public void unsuspendRedrawAll ( ) {
+
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#unsuspendRedrawAll()}.
+ */
+ public void unsuspendRedrawAll() {
SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
ctx.unsuspendRedrawAll();
}
- public void forceRedraw ( ) {
+
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#forceRedraw()}.
+ */
+ public void forceRedraw() {
SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
ctx.forceRedraw();
}
- public void pauseAnimations ( ) {
- throw new UnsupportedOperationException("!!! Not implemented.");
+
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#pauseAnimations()}.
+ */
+ public void pauseAnimations() {
+ SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
+ ctx.pauseAnimations();
}
- public void unpauseAnimations ( ) {
- throw new UnsupportedOperationException("!!! Not implemented.");
+
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#unpauseAnimations()}.
+ */
+ public void unpauseAnimations() {
+ SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
+ ctx.unpauseAnimations();
}
- public boolean animationsPaused ( ) {
- throw new UnsupportedOperationException("!!! Not implemented.");
+
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#animationsPaused()}.
+ */
+ public boolean animationsPaused() {
+ SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
+ return ctx.animationsPaused();
}
- public float getCurrentTime ( ) {
- throw new UnsupportedOperationException("!!! Not implemented.");
+
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#getCurrentTime()}.
+ */
+ public float getCurrentTime() {
+ SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
+ return ctx.getCurrentTime();
}
- public void setCurrentTime ( float seconds ) {
- throw new UnsupportedOperationException("!!! Not implemented.");
+
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#setCurrentTime(float)}.
+ */
+ public void setCurrentTime(float seconds) {
+ SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
+ ctx.setCurrentTime(seconds);
}
- public NodeList getIntersectionList ( SVGRect rect,
- SVGElement referenceElement ) {
+ /**
+ * <b>DOM</b>: Implements {@link
+ * SVGSVGElement#getIntersectionList(SVGRect,SVGElement)}.
+ */
+ public NodeList getIntersectionList(SVGRect rect,
+ SVGElement referenceElement) {
SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
List list = ctx.getIntersectionList(rect, referenceElement);
return new ListNodeList(list);
}
- public NodeList getEnclosureList ( SVGRect rect,
- SVGElement referenceElement ) {
+ /**
+ * <b>DOM</b>: Implements {@link
+ * SVGSVGElement#getEnclosureList(SVGRect,SVGElement)}.
+ */
+ public NodeList getEnclosureList(SVGRect rect,
+ SVGElement referenceElement) {
SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
List list = ctx.getEnclosureList(rect, referenceElement);
return new ListNodeList(list);
}
+
+ /**
+ * <b>DOM</b>: Implements {@link
+ * SVGSVGElement#checkIntersection(SVGElement,SVGRect)}.
+ */
public boolean checkIntersection(SVGElement element, SVGRect rect) {
SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
return ctx.checkIntersection(element, rect);
}
+
+ /**
+ * <b>DOM</b>: Implements {@link
+ * SVGSVGElement#checkEnclosure(SVGElement,SVGRect)}.
+ */
public boolean checkEnclosure(SVGElement element, SVGRect rect) {
SVGSVGContext ctx = (SVGSVGContext)getSVGContext();
return ctx.checkEnclosure(element, rect);
}
- public void deselectAll ( ) {
+ /**
+ * <b>DOM</b>: Implements {@link SVGSVGElement#deselectAll()}.
+ */
+ public void deselectAll() {
((SVGSVGContext)getSVGContext()).deselectAll();
}
@@ -482,7 +545,7 @@
* org.w3c.dom.svg.SVGLocatable#getNearestViewportElement()}.
*/
public SVGElement getNearestViewportElement() {
- return SVGLocatableSupport.getNearestViewportElement(this);
+ return SVGLocatableSupport.getNearestViewportElement(this);
}
/**
@@ -490,7 +553,7 @@
* org.w3c.dom.svg.SVGLocatable#getFarthestViewportElement()}.
*/
public SVGElement getFarthestViewportElement() {
- return SVGLocatableSupport.getFarthestViewportElement(this);
+ return SVGLocatableSupport.getFarthestViewportElement(this);
}
/**
@@ -498,7 +561,7 @@
* org.w3c.dom.svg.SVGLocatable#getBBox()}.
*/
public SVGRect getBBox() {
- return SVGLocatableSupport.getBBox(this);
+ return SVGLocatableSupport.getBBox(this);
}
/**
@@ -506,7 +569,7 @@
* org.w3c.dom.svg.SVGLocatable#getCTM()}.
*/
public SVGMatrix getCTM() {
- return SVGLocatableSupport.getCTM(this);
+ return SVGLocatableSupport.getCTM(this);
}
/**
@@ -514,7 +577,7 @@
* org.w3c.dom.svg.SVGLocatable#getScreenCTM()}.
*/
public SVGMatrix getScreenCTM() {
- return SVGLocatableSupport.getScreenCTM(this);
+ return SVGLocatableSupport.getScreenCTM(this);
}
/**
@@ -522,8 +585,8 @@
* org.w3c.dom.svg.SVGLocatable#getTransformToElement(SVGElement)}.
*/
public SVGMatrix getTransformToElement(SVGElement element)
- throws SVGException {
- return SVGLocatableSupport.getTransformToElement(this, element);
+ throws SVGException {
+ return SVGLocatableSupport.getTransformToElement(this, element);
}
// ViewCSS ////////////////////////////////////////////////////////////////
@@ -641,7 +704,8 @@
* org.w3c.dom.svg.SVGFitToViewBox#getViewBox()}.
*/
public SVGAnimatedRect getViewBox() {
- throw new RuntimeException(" !!! TODO: getViewBox()");
+ throw new UnsupportedOperationException
+ ("SVGFitToViewBox.getViewBox is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMStyleElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMStyleElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMStyleElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMStyleElement.java Mon Aug 7 05:48:50 2006
@@ -143,7 +143,8 @@
* org.w3c.dom.stylesheets.LinkStyle#getSheet()}.
*/
public org.w3c.dom.stylesheets.StyleSheet getSheet() {
- throw new RuntimeException(" !!! Not implemented.");
+ throw new UnsupportedOperationException
+ ("LinkStyle.getSheet() is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSymbolElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSymbolElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSymbolElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMSymbolElement.java Mon Aug 7 05:48:50 2006
@@ -110,7 +110,7 @@
* org.w3c.dom.svg.SVGZoomAndPan#getZoomAndPan()}.
*/
public short getZoomAndPan() {
- return SVGZoomAndPanSupport.getZoomAndPan(this);
+ return SVGZoomAndPanSupport.getZoomAndPan(this);
}
/**
@@ -118,7 +118,7 @@
* org.w3c.dom.svg.SVGZoomAndPan#getZoomAndPan()}.
*/
public void setZoomAndPan(short val) {
- SVGZoomAndPanSupport.setZoomAndPan(this, val);
+ SVGZoomAndPanSupport.setZoomAndPan(this, val);
}
// SVGFitToViewBox support ////////////////////////////////////////////
@@ -127,7 +127,8 @@
* <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGFitToViewBox#getViewBox()}.
*/
public SVGAnimatedRect getViewBox() {
- throw new RuntimeException(" !!! TODO: getViewBox()");
+ throw new UnsupportedOperationException
+ ("SVGFitToViewBox.getViewBox is not implemented"); // XXX
}
/**
@@ -145,7 +146,7 @@
* org.w3c.dom.svg.SVGExternalResourcesRequired}.
*/
public SVGAnimatedBoolean getExternalResourcesRequired() {
- return SVGExternalResourcesRequiredSupport.
+ return SVGExternalResourcesRequiredSupport.
getExternalResourcesRequired(this);
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMUseElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMUseElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMUseElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMUseElement.java Mon Aug 7 05:48:50 2006
@@ -122,14 +122,16 @@
* <b>DOM</b>: Implements {@link SVGUseElement#getInstanceRoot()}.
*/
public SVGElementInstance getInstanceRoot() {
- throw new RuntimeException(" !!! TODO: getInstanceRoot()");
+ throw new UnsupportedOperationException
+ ("SVGUseElement.getInstanceRoot is not implemented"); // XXX
}
/**
* <b>DOM</b>: Implements {@link SVGUseElement#getAnimatedInstanceRoot()}.
*/
public SVGElementInstance getAnimatedInstanceRoot() {
- throw new RuntimeException(" !!! TODO: getAnimatedInstanceRoot()");
+ throw new UnsupportedOperationException
+ ("SVGUseElement.getAnimatedInstanceRoot is not implemented"); // XXX
}
// CSSNavigableNode ///////////////////////////////////////////////
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMViewElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMViewElement.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMViewElement.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMViewElement.java Mon Aug 7 05:48:50 2006
@@ -80,7 +80,8 @@
* <b>DOM</b>: Implements {@link SVGViewElement#getViewTarget()}.
*/
public SVGStringList getViewTarget() {
- throw new RuntimeException("!!! TODO: getViewTarget()");
+ throw new UnsupportedOperationException
+ ("SVGViewElement.getViewTarget is not implemented"); // XXX
}
// SVGZoomAndPan support ///////////////////////////////////////////////
@@ -108,7 +109,8 @@
* org.w3c.dom.svg.SVGFitToViewBox#getViewBox()}.
*/
public SVGAnimatedRect getViewBox() {
- throw new RuntimeException(" !!! TODO: getViewBox()");
+ throw new UnsupportedOperationException
+ ("SVGFitToViewBox.getViewBox is not implemented"); // XXX
}
/**
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathContext.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathContext.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathContext.java Mon Aug 7 05:48:50 2006
@@ -37,4 +37,10 @@
* Returns the point at the given distance along the path.
*/
Point2D getPointAtLength(float distance);
+
+ /**
+ * Returns the index of the path segment at the given distance along the
+ * path.
+ */
+ int getPathSegAtLength(float distance);
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathSupport.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathSupport.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathSupport.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGPathSupport.java Mon Aug 7 05:48:50 2006
@@ -40,6 +40,14 @@
return pathCtx.getTotalLength();
}
+ /**
+ * To implement {@link
+ * org.w3c.dom.svg.SVGPathElement#getPathSegAtLength(float)}.
+ */
+ public static int getPathSegAtLength(SVGOMPathElement path, float x) {
+ SVGPathContext pathCtx = (SVGPathContext)path.getSVGContext();
+ return pathCtx.getPathSegAtLength(x);
+ }
/**
* To implement {@link org.w3c.dom.svg.SVGPathElement#getPointAtLength(float)}.
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGSVGContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGSVGContext.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGSVGContext.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGSVGContext.java Mon Aug 7 05:48:50 2006
@@ -85,4 +85,29 @@
* Forces an immediate redraw of the canvas.
*/
void forceRedraw();
-};
+
+ /**
+ * Pauses animations in the document.
+ */
+ void pauseAnimations();
+
+ /**
+ * Unpauses animations in the document.
+ */
+ void unpauseAnimations();
+
+ /**
+ * Returns whether animations are currently paused.
+ */
+ boolean animationsPaused();
+
+ /**
+ * Returns the current document time.
+ */
+ float getCurrentTime();
+
+ /**
+ * Sets the current document time.
+ */
+ void setCurrentTime(float t);
+}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGTestsSupport.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGTestsSupport.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGTestsSupport.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGTestsSupport.java Mon Aug 7 05:48:50 2006
@@ -38,27 +38,31 @@
* To implements {@link org.w3c.dom.svg.SVGTests#getRequiredFeatures()}.
*/
public static SVGStringList getRequiredFeatures(Element elt) {
- throw new RuntimeException(" !!! TODO: getRequiredFeatures()");
+ throw new UnsupportedOperationException
+ ("SVGTests.getRequiredFeatures is not implemented"); // XXX
}
/**
* To implements {@link org.w3c.dom.svg.SVGTests#getRequiredExtensions()}.
*/
public static SVGStringList getRequiredExtensions(Element elt) {
- throw new RuntimeException(" !!! TODO: getRequiredExtensions()");
+ throw new UnsupportedOperationException
+ ("SVGTests.getRequiredExtensions is not implemented"); // XXX
}
/**
* To implements {@link org.w3c.dom.svg.SVGTests#getSystemLanguage()}.
*/
public static SVGStringList getSystemLanguage(Element elt) {
- throw new RuntimeException(" !!! TODO: getSystemLanguage()");
+ throw new UnsupportedOperationException
+ ("SVGTests.getSystemLanguage is not implemented"); // XXX
}
/**
* To implements {@link org.w3c.dom.svg.SVGTests#hasExtension(String)}.
*/
public static boolean hasExtension(Element elt, String extension) {
- throw new RuntimeException(" !!! TODO: hasExtension()");
+ throw new UnsupportedOperationException
+ ("SVGTests.hasExtension is not implemented"); // XXX
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/PathLength.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/PathLength.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/PathLength.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/PathLength.java Mon Aug 7 05:48:50 2006
@@ -20,7 +20,6 @@
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.FlatteningPathIterator;
-import java.awt.geom.GeneralPath;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
import java.util.Vector;
@@ -119,6 +118,7 @@
segments = new Vector(20);
Vector indexes = new Vector(20);
int index = 0;
+ int origIndex = -1;
float lastMoveX = 0f;
float lastMoveY = 0f;
float currentX = 0f;
@@ -126,15 +126,17 @@
float[] seg = new float[6];
int segType;
- segments.add(new PathSegment(PathIterator.SEG_MOVETO, 0f, 0f, 0f));
+ segments.add(new PathSegment(PathIterator.SEG_MOVETO, 0f, 0f, 0f,
+ origIndex));
while (!pi.isDone()) {
+ origIndex++;
indexes.add(new Integer(index));
segType = pi.currentSegment(seg);
switch (segType) {
case PathIterator.SEG_MOVETO:
segments.add(new PathSegment(segType, seg[0], seg[1],
- pathLength));
+ pathLength, origIndex));
currentX = seg[0];
currentY = seg[1];
lastMoveX = currentX;
@@ -146,7 +148,7 @@
pathLength += Point2D.distance(currentX, currentY, seg[0],
seg[1]);
segments.add(new PathSegment(segType, seg[0], seg[1],
- pathLength));
+ pathLength, origIndex));
currentX = seg[0];
currentY = seg[1];
index++;
@@ -157,7 +159,7 @@
lastMoveX, lastMoveY);
segments.add(new PathSegment(PathIterator.SEG_LINETO,
lastMoveX, lastMoveY,
- pathLength));
+ pathLength, origIndex));
currentX = lastMoveX;
currentY = lastMoveY;
index++;
@@ -173,7 +175,8 @@
pathLength += Point2D.distance(currentX, currentY,
seg[0], seg[1]);
segments.add(new PathSegment(segType, seg[0],
- seg[1], pathLength));
+ seg[1], pathLength,
+ origIndex));
currentX = seg[0];
currentY = seg[1];
index++;
@@ -218,6 +221,26 @@
}
/**
+ * Returns the index of the segment at the given distance along the path.
+ */
+ public int segmentAtLength(float length) {
+ int upperIndex = findUpperIndex(length);
+ if (upperIndex == -1) {
+ // Length is off the end of the path.
+ return -1;
+ }
+
+ if (upperIndex == 0) {
+ // Length was probably zero, so return the upper segment.
+ PathSegment upper = (PathSegment) segments.elementAt(upperIndex);
+ return upper.getIndex();
+ }
+
+ PathSegment lower = (PathSegment) segments.elementAt(upperIndex - 1);
+ return lower.getIndex();
+ }
+
+ /**
* Returns the point that is the given proportion along the path segment
* given by the specified index.
*/
@@ -488,17 +511,26 @@
protected float length;
/**
+ * The index of the original path segment this flattened segment is a
+ * part of.
+ */
+ protected int index;
+
+ /**
* Creates a new PathSegment with the specified parameters.
* @param segType The segment type
* @param x The x coordinate
* @param y The y coordinate
* @param len The segment length
+ * @param idx The index of the original path segment this flattened
+ * segment is a part of
*/
- public PathSegment(int segType, float x, float y, float len) {
+ public PathSegment(int segType, float x, float y, float len, int idx) {
this.segType = segType;
this.x = x;
this.y = y;
this.length = len;
+ this.index = idx;
}
/**
@@ -555,6 +587,20 @@
*/
public void setLength(float v) {
this.length = v;
+ }
+
+ /**
+ * Returns the segment index.
+ */
+ public int getIndex() {
+ return index;
+ }
+
+ /**
+ * Sets the segment index.
+ */
+ public void setIndex(int v) {
+ this.index = v;
}
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/util/RunnableQueue.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/util/RunnableQueue.java?rev=429320&r1=429319&r2=429320&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/util/RunnableQueue.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/util/RunnableQueue.java Mon Aug 7 05:48:50 2006
@@ -92,7 +92,7 @@
* Count of preempt entries in queue, so preempt entries
* can be kept properly ordered.
*/
- protected int preemptCount = 0;
+ protected int preemptCount;
/**
* The object which handle run events.
@@ -161,7 +161,7 @@
executionSuspended();
synchronized (stateLock) {
- while (state != RUNNING ) {
+ while (state != RUNNING) {
state = SUSPENDED;
// notify suspendExecution in case it is
@@ -270,7 +270,7 @@
* Waits until the given Runnable's <tt>run()</tt> has returned.
* <em>Note: <tt>invokeAndWait()</tt> must not be called from the
* current thread (for example from the <tt>run()</tt> method of the
- * argument).
+ * argument).</em>
* @throws IllegalStateException if getThread() is null or if the
* thread returned by getThread() is the current one.
*/
@@ -476,7 +476,10 @@
* Sets a Runnable to be run whenever the queue is empty.
*/
public synchronized void setIdleRunnable(Runnable r) {
- idleRunnable = r;
+ synchronized (list) {
+ idleRunnable = r;
+ list.notify();
+ }
}
/**