[7676] | 1 | Only in kitfox/svg: animation
|
---|
| 2 | Only in kitfox/svg/app/ant: SVGToImageAntTask.java
|
---|
| 3 | Only in kitfox/svg/app/beans: ProportionalLayoutPanel.form
|
---|
| 4 | Only in kitfox/svg/app/beans: ProportionalLayoutPanel.java
|
---|
| 5 | Only in kitfox/svg/app/beans: SVGPanel.form
|
---|
| 6 | Only in kitfox/svg/app/beans: SVGPanel.java
|
---|
| 7 | Only in kitfox/svg/app/data: HandlerFactory.java
|
---|
| 8 | Only in kitfox/svg/app: MainFrame.form
|
---|
| 9 | Only in kitfox/svg/app: MainFrame.java
|
---|
| 10 | Only in kitfox/svg/app: PlayerDialog.form
|
---|
| 11 | Only in kitfox/svg/app: PlayerDialog.java
|
---|
| 12 | Only in kitfox/svg/app: PlayerThread.java
|
---|
| 13 | Only in kitfox/svg/app: PlayerThreadListener.java
|
---|
| 14 | Only in kitfox/svg/app: SVGPlayer.form
|
---|
| 15 | Only in kitfox/svg/app: SVGPlayer.java
|
---|
| 16 | Only in kitfox/svg/app: SVGViewer.form
|
---|
| 17 | Only in kitfox/svg/app: SVGViewer.java
|
---|
| 18 | Only in kitfox/svg/app: VersionDialog.form
|
---|
| 19 | Only in kitfox/svg/app: VersionDialog.java
|
---|
| 20 | Only in kitfox/svg: SVGDisplayPanel.form
|
---|
| 21 | diff -ur kitfox/svg/SVGElement.java src/com/kitfox/svg/SVGElement.java
|
---|
| 22 | --- kitfox/svg/SVGElement.java 2014-10-30 11:31:46.229650244 +0100
|
---|
| 23 | +++ src/com/kitfox/svg/SVGElement.java 2014-10-29 23:30:19.882171106 +0100
|
---|
| 24 | @@ -35,9 +35,6 @@
|
---|
| 25 | */
|
---|
| 26 | package com.kitfox.svg;
|
---|
| 27 |
|
---|
| 28 | -import com.kitfox.svg.animation.AnimationElement;
|
---|
| 29 | -import com.kitfox.svg.animation.TrackBase;
|
---|
| 30 | -import com.kitfox.svg.animation.TrackManager;
|
---|
| 31 | import com.kitfox.svg.pathcmd.Arc;
|
---|
| 32 | import com.kitfox.svg.pathcmd.BuildHistory;
|
---|
| 33 | import com.kitfox.svg.pathcmd.Cubic;
|
---|
| 34 | @@ -122,10 +119,6 @@
|
---|
| 35 | * The diagram this element belongs to
|
---|
| 36 | */
|
---|
| 37 | protected SVGDiagram diagram;
|
---|
| 38 | - /**
|
---|
| 39 | - * Link to the universe we reside in
|
---|
| 40 | - */
|
---|
| 41 | - protected final TrackManager trackManager = new TrackManager();
|
---|
| 42 | boolean dirty = true;
|
---|
| 43 |
|
---|
| 44 | /**
|
---|
| 45 | @@ -305,65 +298,6 @@
|
---|
| 46 | }
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | - public void removeAttribute(String name, int attribType)
|
---|
| 50 | - {
|
---|
| 51 | - switch (attribType)
|
---|
| 52 | - {
|
---|
| 53 | - case AnimationElement.AT_CSS:
|
---|
| 54 | - inlineStyles.remove(name);
|
---|
| 55 | - return;
|
---|
| 56 | - case AnimationElement.AT_XML:
|
---|
| 57 | - presAttribs.remove(name);
|
---|
| 58 | - return;
|
---|
| 59 | - }
|
---|
| 60 | - }
|
---|
| 61 | -
|
---|
| 62 | - public void addAttribute(String name, int attribType, String value) throws SVGElementException
|
---|
| 63 | - {
|
---|
| 64 | - if (hasAttribute(name, attribType))
|
---|
| 65 | - {
|
---|
| 66 | - throw new SVGElementException(this, "Attribute " + name + "(" + AnimationElement.animationElementToString(attribType) + ") already exists");
|
---|
| 67 | - }
|
---|
| 68 | -
|
---|
| 69 | - //Alter layout for id attribute
|
---|
| 70 | - if ("id".equals(name))
|
---|
| 71 | - {
|
---|
| 72 | - if (diagram != null)
|
---|
| 73 | - {
|
---|
| 74 | - diagram.removeElement(id);
|
---|
| 75 | - diagram.setElement(value, this);
|
---|
| 76 | - }
|
---|
| 77 | - this.id = value;
|
---|
| 78 | - }
|
---|
| 79 | -
|
---|
| 80 | - switch (attribType)
|
---|
| 81 | - {
|
---|
| 82 | - case AnimationElement.AT_CSS:
|
---|
| 83 | - inlineStyles.put(name, new StyleAttribute(name, value));
|
---|
| 84 | - return;
|
---|
| 85 | - case AnimationElement.AT_XML:
|
---|
| 86 | - presAttribs.put(name, new StyleAttribute(name, value));
|
---|
| 87 | - return;
|
---|
| 88 | - }
|
---|
| 89 | -
|
---|
| 90 | - throw new SVGElementException(this, "Invalid attribute type " + attribType);
|
---|
| 91 | - }
|
---|
| 92 | -
|
---|
| 93 | - public boolean hasAttribute(String name, int attribType) throws SVGElementException
|
---|
| 94 | - {
|
---|
| 95 | - switch (attribType)
|
---|
| 96 | - {
|
---|
| 97 | - case AnimationElement.AT_CSS:
|
---|
| 98 | - return inlineStyles.containsKey(name);
|
---|
| 99 | - case AnimationElement.AT_XML:
|
---|
| 100 | - return presAttribs.containsKey(name);
|
---|
| 101 | - case AnimationElement.AT_AUTO:
|
---|
| 102 | - return inlineStyles.containsKey(name) || presAttribs.containsKey(name);
|
---|
| 103 | - }
|
---|
| 104 | -
|
---|
| 105 | - throw new SVGElementException(this, "Invalid attribute type " + attribType);
|
---|
| 106 | - }
|
---|
| 107 | -
|
---|
| 108 | /**
|
---|
| 109 | * @return a set of Strings that corespond to CSS attributes on this element
|
---|
| 110 | */
|
---|
| 111 | @@ -389,12 +323,6 @@
|
---|
| 112 | children.add(child);
|
---|
| 113 | child.parent = this;
|
---|
| 114 | child.setDiagram(diagram);
|
---|
| 115 | -
|
---|
| 116 | - //Add info to track if we've scanned animation element
|
---|
| 117 | - if (child instanceof AnimationElement)
|
---|
| 118 | - {
|
---|
| 119 | - trackManager.addTrackElement((AnimationElement) child);
|
---|
| 120 | - }
|
---|
| 121 | }
|
---|
| 122 |
|
---|
| 123 | protected void setDiagram(SVGDiagram diagram)
|
---|
| 124 | @@ -529,61 +457,6 @@
|
---|
| 125 | return getStyle(attrib, true);
|
---|
| 126 | }
|
---|
| 127 |
|
---|
| 128 | - public void setAttribute(String name, int attribType, String value) throws SVGElementException
|
---|
| 129 | - {
|
---|
| 130 | - StyleAttribute styAttr;
|
---|
| 131 | -
|
---|
| 132 | -
|
---|
| 133 | - switch (attribType)
|
---|
| 134 | - {
|
---|
| 135 | - case AnimationElement.AT_CSS:
|
---|
| 136 | - {
|
---|
| 137 | - styAttr = (StyleAttribute) inlineStyles.get(name);
|
---|
| 138 | - break;
|
---|
| 139 | - }
|
---|
| 140 | - case AnimationElement.AT_XML:
|
---|
| 141 | - {
|
---|
| 142 | - styAttr = (StyleAttribute) presAttribs.get(name);
|
---|
| 143 | - break;
|
---|
| 144 | - }
|
---|
| 145 | - case AnimationElement.AT_AUTO:
|
---|
| 146 | - {
|
---|
| 147 | - styAttr = (StyleAttribute) inlineStyles.get(name);
|
---|
| 148 | -
|
---|
| 149 | - if (styAttr == null)
|
---|
| 150 | - {
|
---|
| 151 | - styAttr = (StyleAttribute) presAttribs.get(name);
|
---|
| 152 | - }
|
---|
| 153 | - break;
|
---|
| 154 | - }
|
---|
| 155 | - default:
|
---|
| 156 | - throw new SVGElementException(this, "Invalid attribute type " + attribType);
|
---|
| 157 | - }
|
---|
| 158 | -
|
---|
| 159 | - if (styAttr == null)
|
---|
| 160 | - {
|
---|
| 161 | - throw new SVGElementException(this, "Could not find attribute " + name + "(" + AnimationElement.animationElementToString(attribType) + "). Make sure to create attribute before setting it.");
|
---|
| 162 | - }
|
---|
| 163 | -
|
---|
| 164 | - //Alter layout for relevant attributes
|
---|
| 165 | - if ("id".equals(styAttr.getName()))
|
---|
| 166 | - {
|
---|
| 167 | - if (diagram != null)
|
---|
| 168 | - {
|
---|
| 169 | - diagram.removeElement(this.id);
|
---|
| 170 | - diagram.setElement(value, this);
|
---|
| 171 | - }
|
---|
| 172 | - this.id = value;
|
---|
| 173 | - }
|
---|
| 174 | -
|
---|
| 175 | - styAttr.setStringValue(value);
|
---|
| 176 | - }
|
---|
| 177 | -
|
---|
| 178 | - public boolean getStyle(StyleAttribute attrib, boolean recursive) throws SVGException
|
---|
| 179 | - {
|
---|
| 180 | - return getStyle(attrib, recursive, true);
|
---|
| 181 | - }
|
---|
| 182 | -
|
---|
| 183 | /**
|
---|
| 184 | * Copies the current style into the passed style attribute. Checks for
|
---|
| 185 | * inline styles first, then internal and extranal style sheets, and finally
|
---|
| 186 | @@ -595,8 +468,7 @@
|
---|
| 187 | * style attribute, checks attributes of parents back to root until one
|
---|
| 188 | * found.
|
---|
| 189 | */
|
---|
| 190 | - public boolean getStyle(StyleAttribute attrib, boolean recursive, boolean evalAnimation)
|
---|
| 191 | - throws SVGException
|
---|
| 192 | + public boolean getStyle(StyleAttribute attrib, boolean recursive) throws SVGException
|
---|
| 193 | {
|
---|
| 194 | String styName = attrib.getName();
|
---|
| 195 |
|
---|
| 196 | @@ -605,17 +477,6 @@
|
---|
| 197 |
|
---|
| 198 | attrib.setStringValue(styAttr == null ? "" : styAttr.getStringValue());
|
---|
| 199 |
|
---|
| 200 | - //Evalutate coresponding track, if one exists
|
---|
| 201 | - if (evalAnimation)
|
---|
| 202 | - {
|
---|
| 203 | - TrackBase track = trackManager.getTrack(styName, AnimationElement.AT_CSS);
|
---|
| 204 | - if (track != null)
|
---|
| 205 | - {
|
---|
| 206 | - track.getValue(attrib, diagram.getUniverse().getCurTime());
|
---|
| 207 | - return true;
|
---|
| 208 | - }
|
---|
| 209 | - }
|
---|
| 210 | -
|
---|
| 211 | //Return if we've found a non animated style
|
---|
| 212 | if (styAttr != null)
|
---|
| 213 | {
|
---|
| 214 | @@ -628,17 +489,6 @@
|
---|
| 215 |
|
---|
| 216 | attrib.setStringValue(presAttr == null ? "" : presAttr.getStringValue());
|
---|
| 217 |
|
---|
| 218 | - //Evalutate coresponding track, if one exists
|
---|
| 219 | - if (evalAnimation)
|
---|
| 220 | - {
|
---|
| 221 | - TrackBase track = trackManager.getTrack(styName, AnimationElement.AT_XML);
|
---|
| 222 | - if (track != null)
|
---|
| 223 | - {
|
---|
| 224 | - track.getValue(attrib, diagram.getUniverse().getCurTime());
|
---|
| 225 | - return true;
|
---|
| 226 | - }
|
---|
| 227 | - }
|
---|
| 228 | -
|
---|
| 229 | //Return if we've found a presentation attribute instead
|
---|
| 230 | if (presAttr != null)
|
---|
| 231 | {
|
---|
| 232 | @@ -700,14 +550,6 @@
|
---|
| 233 | //Copy presentation value directly
|
---|
| 234 | attrib.setStringValue(presAttr == null ? "" : presAttr.getStringValue());
|
---|
| 235 |
|
---|
| 236 | - //Evalutate coresponding track, if one exists
|
---|
| 237 | - TrackBase track = trackManager.getTrack(presName, AnimationElement.AT_XML);
|
---|
| 238 | - if (track != null)
|
---|
| 239 | - {
|
---|
| 240 | - track.getValue(attrib, diagram.getUniverse().getCurTime());
|
---|
| 241 | - return true;
|
---|
| 242 | - }
|
---|
| 243 | -
|
---|
| 244 | //Return if we found presentation attribute
|
---|
| 245 | if (presAttr != null)
|
---|
| 246 | {
|
---|
| 247 | diff -ur kitfox/svg/SVGLoaderHelper.java src/com/kitfox/svg/SVGLoaderHelper.java
|
---|
| 248 | --- kitfox/svg/SVGLoaderHelper.java 2014-10-29 22:49:38.193473772 +0100
|
---|
| 249 | +++ src/com/kitfox/svg/SVGLoaderHelper.java 2014-10-29 22:54:17.671385584 +0100
|
---|
| 250 | @@ -37,9 +37,6 @@
|
---|
| 251 | package com.kitfox.svg;
|
---|
| 252 |
|
---|
| 253 | import java.net.*;
|
---|
| 254 | -import java.io.*;
|
---|
| 255 | -
|
---|
| 256 | -import com.kitfox.svg.animation.parser.*;
|
---|
| 257 |
|
---|
| 258 | /**
|
---|
| 259 | * @author Mark McKay
|
---|
| 260 | @@ -58,11 +55,6 @@
|
---|
| 261 | public final SVGDiagram diagram;
|
---|
| 262 |
|
---|
| 263 | public final URI xmlBase;
|
---|
| 264 | -
|
---|
| 265 | - /**
|
---|
| 266 | - * Animate nodes use this to parse their time strings
|
---|
| 267 | - */
|
---|
| 268 | - public final AnimTimeParser animTimeParser = new AnimTimeParser(new StringReader(""));
|
---|
| 269 |
|
---|
| 270 | /** Creates a new instance of SVGLoaderHelper */
|
---|
| 271 | public SVGLoaderHelper(URI xmlBase, SVGUniverse universe, SVGDiagram diagram)
|
---|
| 272 | diff -ur kitfox/svg/SVGLoader.java src/com/kitfox/svg/SVGLoader.java
|
---|
| 273 | --- kitfox/svg/SVGLoader.java 2014-10-29 22:49:38.193473772 +0100
|
---|
| 274 | +++ src/com/kitfox/svg/SVGLoader.java 2014-10-29 22:53:56.462392128 +0100
|
---|
| 275 | @@ -42,7 +42,6 @@
|
---|
| 276 | import org.xml.sax.*;
|
---|
| 277 | import org.xml.sax.helpers.DefaultHandler;
|
---|
| 278 |
|
---|
| 279 | -import com.kitfox.svg.animation.*;
|
---|
| 280 | import java.util.logging.Level;
|
---|
| 281 | import java.util.logging.Logger;
|
---|
| 282 |
|
---|
| 283 | @@ -88,10 +87,6 @@
|
---|
| 284 |
|
---|
| 285 | //Compile a list of important builder classes
|
---|
| 286 | nodeClasses.put("a", A.class);
|
---|
| 287 | - nodeClasses.put("animate", Animate.class);
|
---|
| 288 | - nodeClasses.put("animatecolor", AnimateColor.class);
|
---|
| 289 | - nodeClasses.put("animatemotion", AnimateMotion.class);
|
---|
| 290 | - nodeClasses.put("animatetransform", AnimateTransform.class);
|
---|
| 291 | nodeClasses.put("circle", Circle.class);
|
---|
| 292 | nodeClasses.put("clippath", ClipPath.class);
|
---|
| 293 | nodeClasses.put("defs", Defs.class);
|
---|
| 294 | @@ -115,7 +110,6 @@
|
---|
| 295 | nodeClasses.put("polyline", Polyline.class);
|
---|
| 296 | nodeClasses.put("radialgradient", RadialGradient.class);
|
---|
| 297 | nodeClasses.put("rect", Rect.class);
|
---|
| 298 | - nodeClasses.put("set", SetSmil.class);
|
---|
| 299 | nodeClasses.put("shape", ShapeElement.class);
|
---|
| 300 | nodeClasses.put("stop", Stop.class);
|
---|
| 301 | nodeClasses.put("style", Style.class);
|
---|