patchanim-commit Mailing List for patchanim (Page 8)
Brought to you by:
dbrosius
You can subscribe to this list here.
2008 |
Jan
(80) |
Feb
(158) |
Mar
|
Apr
|
May
(3) |
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(26) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(3) |
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dbr...@us...> - 2008-02-10 04:33:37
|
Revision: 130 http://patchanim.svn.sourceforge.net/patchanim/?rev=130&view=rev Author: dbrosius Date: 2008-02-09 20:33:41 -0800 (Sat, 09 Feb 2008) Log Message: ----------- start adding support for apngs Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties Added Paths: ----------- trunk/patchanim/src/com/mebigfatguy/apng/ trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java Added: trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java 2008-02-10 04:33:41 UTC (rev 130) @@ -0,0 +1,268 @@ +/* + * patchanim - A bezier surface patch color blend gif builder + * Copyright (C) 2008 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package com.mebigfatguy.apng; + +import java.awt.image.BufferedImage; +import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +import javax.imageio.ImageIO; + +import com.mebigfatguy.patchanim.ExportType; + +/** + * generates apng files by simply relying on the built in png encoder of ImageIO + * and sewing together multiple chunks from the underlying pngs. + */ +public class APngEncoder { + private static final byte[] HEADER = new byte[] { -119, 80, 78, 71, 13, 10, 26, 10 }; + private static final int IHDR = 0x49484452; + private static final int IDAT = 0x49444154; + private static final int IEND = 0x49454E44; + private static final int acTL = 0x6163544C; + private static final int fcTL = 0x6663544C; + private static final int fdAT = 0x66644154; + + private DataOutputStream out = null; + private boolean started = false; + private boolean closeStream = false; + private boolean headerWritten = false; + private boolean repeatInfinite = false; + private int delay = 100; + private int frameCount = 1; + private int seqNum = 0; + private boolean processedFirstFrame = false; + + public void setDelay(int ms) { + delay = ms; + } + + public void setRepeat(boolean infinite) { + repeatInfinite = infinite; + } + + public void setNumFrames(int frames) { + frameCount = frames; + } + + public boolean start(OutputStream os) { + if (os == null) + return false; + boolean ok = true; + closeStream = false; + out = new DataOutputStream(os); + try { + out.write(HEADER); + } catch (IOException e) { + ok = false; + } + return started = ok; + } + + public boolean start(String file) { + boolean ok = true; + try { + out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file))); + ok = start(out); + closeStream = true; + } catch (IOException e) { + ok = false; + } + return started = ok; + } + + public boolean finish() { + if (!started) + return false; + try { + if (closeStream) + out.close(); + } catch (IOException ioe) { + } + + return true; + } + + public boolean addFrame(BufferedImage im) { + if ((im == null) || !started) + return false; + try { + PngStream pStrm; + boolean sawIDAT = false; + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(im.getHeight() * im.getWidth()); //a conservative estimate + ImageIO.write(im, ExportType.Pngs.getExtension(), baos); + pStrm = new PngStream(baos.toByteArray()); + baos.reset(); + } + Chunk chunk = pStrm.readNextChunk(pStrm); + while (chunk != null) { + switch (chunk.type) { + case IHDR: + if (!headerWritten) { + chunk.write(out); + headerWritten = true; + Chunk acTLChunk = new Chunk(8, acTL); + + acTLChunk.injectInt(0, frameCount); + acTLChunk.injectInt(4, repeatInfinite ? 0 : 1); + acTLChunk.calcCRC(); + acTLChunk.write(out); + } + break; + + case IDAT: + if (!sawIDAT) { + Chunk fcTLChunk = new Chunk(26, fcTL); + fcTLChunk.injectInt(0, seqNum); + fcTLChunk.injectInt(4, im.getWidth()); + fcTLChunk.injectInt(8, im.getHeight()); + fcTLChunk.injectInt(12, 0); + fcTLChunk.injectInt(16, 0); + fcTLChunk.injectShort(20, delay); + fcTLChunk.injectShort(22, 1000); + fcTLChunk.injectShort(24, 0); + fcTLChunk.calcCRC(); + fcTLChunk.write(out); + sawIDAT = true; + } + if (!processedFirstFrame) { + chunk.write(out); + } else { + Chunk fdATChunk = new Chunk(chunk.length + 4, fdAT); + fdATChunk.injectInt(0, seqNum); + System.arraycopy(chunk.data, 0, fdATChunk.data, 4, chunk.length); + fdATChunk.calcCRC(); + fdATChunk.write(out); + } + break; + + case IEND: + if (seqNum >= frameCount) + chunk.write(out); + break; + } + chunk = pStrm.readNextChunk(pStrm); + } + processedFirstFrame = true; + seqNum++; + + return true; + } catch (IOException ioe) { + return false; + } finally { + + } + } + + static class PngStream { + public PngStream(byte[] pngData) { + pos = HEADER.length; + data = pngData; + } + + public Chunk readNextChunk(PngStream pStrm) { + if (pos >= data.length) + return null; + + Chunk c = new Chunk(readNextInt(), readNextInt()); + + System.arraycopy(data, pos, c.data, 0, c.length); + pos += c.length; + c.crc = readNextInt(); + return c; + } + + private int readNextInt() { + int val = 0; + for (int i = 0; i < 4; i++) { + val <<= 8; + val |= (0x00FF & data[pos++]); + } + return val; + } + + public int pos; + public byte[] data; + } + + static class Chunk { + private static long crcTable[] = new long[256]; + static { + long c; + int n, k; + + for (n = 0; n < 256; n++) { + c = (long) n; + for (k = 0; k < 8; k++) { + if ((c & 1) != 0) + c = 0xedb88320L ^ (c >> 1); + else + c = c >> 1; + } + crcTable[n] = c; + } + } + + public int length; + public int type; + public byte[] data; + public int crc; + + public Chunk(int len, int chunkType) { + length = len; + type = chunkType; + data = new byte[length]; + crc = 0; + } + + public void write(DataOutputStream out) throws IOException { + out.writeInt(length); + out.writeInt(type); + out.write(data); + out.writeInt(crc); + } + + public void injectInt(int offset, int value) { + data[offset++] = (byte)(value >> 24 & 0x00FF); + data[offset++] = (byte)(value >> 16 & 0x00FF); + data[offset++] = (byte)(value >> 8 & 0x00FF); + data[offset] = (byte)(value & 0x00FF); + } + + public void injectShort(int offset, int value) { + data[offset++] = (byte)(value >> 8 & 0x00FF); + data[offset] = (byte)(value & 0x00FF); + } + + public void calcCRC() { + long c = -1; + for (int n = 0; n < length; n++) { + c = crcTable[(int)((c ^ data[n]) & 0x00FF)] ^ (c >> 8); + } + + c &= -1; + crc = (int)c; + } + } +} Property changes on: trunk/patchanim/src/com/mebigfatguy/apng/APngEncoder.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java 2008-02-10 01:12:47 UTC (rev 129) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/ExportType.java 2008-02-10 04:33:41 UTC (rev 130) @@ -9,6 +9,7 @@ * <li><b>Pngs</b> a series of Png files in a directory</li> * <li><b>Gifs</b> a series of Gif files in a directory</li> * <li><b>AnimatedGif</b> an animated gif file</li> + * <li><b>AnimatedPng</b> an animated png file</li> * <li><b>Mpeg</b> an animated mpeg file</li> * </ul> */ @@ -17,6 +18,7 @@ Pngs("png", true, PatchAnimBundle.PNGSERIESFILTER), Gifs("gif", true, PatchAnimBundle.GIFSERIESFILTER), AnimatedGif("gif", false, PatchAnimBundle.ANIMATEDGIFFILTER), + AnimatedPng("png", false, PatchAnimBundle.ANIMATEDPNGFILTER), MPeg("mpeg", false, PatchAnimBundle.MPEGFILTER); private String ext; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-10 01:12:47 UTC (rev 129) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-10 04:33:41 UTC (rev 130) @@ -60,6 +60,7 @@ private JMenuItem exportPngsItem; private JMenuItem exportGifsItem; private JMenuItem exportAnimatedGifItem; + private JMenuItem exportAnimatedPngItem; private JMenuItem quitItem; private PatchAnimDocument document; private File documentLocation; @@ -106,11 +107,13 @@ exportPngsItem = new JMenuItem(rb.getString(PatchAnimBundle.PNGSERIES)); exportGifsItem = new JMenuItem(rb.getString(PatchAnimBundle.GIFSERIES)); exportAnimatedGifItem = new JMenuItem(rb.getString(PatchAnimBundle.ANIMATEDGIF)); + exportAnimatedPngItem = new JMenuItem(rb.getString(PatchAnimBundle.ANIMATEDPNG)); exportMenu.add(exportJpgsItem); exportMenu.add(exportPngsItem); exportMenu.add(exportGifsItem); exportMenu.addSeparator(); exportMenu.add(exportAnimatedGifItem); + exportMenu.add(exportAnimatedPngItem); fileMenu.add(exportMenu); fileMenu.addSeparator(); quitItem = new JMenuItem(rb.getString(PatchAnimBundle.QUIT)); @@ -236,6 +239,12 @@ } }); + exportAnimatedPngItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent ae) { + export(ExportType.AnimatedPng); + } + }); + quitItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { try { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 01:12:47 UTC (rev 129) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-10 04:33:41 UTC (rev 130) @@ -29,6 +29,7 @@ import javax.imageio.ImageIO; import com.fmsware.gif.AnimatedGifEncoder; +import com.mebigfatguy.apng.APngEncoder; import com.mebigfatguy.patchanim.AnimationType; import com.mebigfatguy.patchanim.ExportType; import com.mebigfatguy.patchanim.OutOfBoundsColor; @@ -42,6 +43,7 @@ private ExportType type; private File loc; private AnimatedGifEncoder agEncoder; + private APngEncoder apngEncoder; private int totalImages; private Set<ExportListener> elisteners = new HashSet<ExportListener>(); @@ -50,6 +52,8 @@ loc = location; if (type == ExportType.AnimatedGif) agEncoder = new AnimatedGifEncoder(); + else if (type == ExportType.AnimatedPng) + apngEncoder = new APngEncoder(); else agEncoder = null; } @@ -70,6 +74,8 @@ baseName = baseName + dotExt; if (type == ExportType.AnimatedGif) agEncoder.start(new File(loc, baseName).getPath()); + else if (type == ExportType.AnimatedPng) + apngEncoder.start(new File(loc, baseName).getPath()); } totalImages = calcImageCount(document); @@ -84,6 +90,9 @@ if (type == ExportType.AnimatedGif) { agEncoder.setRepeat((atype != AnimationType.None) ? 0 : -1); + } else if (type == ExportType.AnimatedPng) { + apngEncoder.setRepeat(atype != AnimationType.None); + apngEncoder.setNumFrames(totalImages); } if (lastPatch == 0) { @@ -118,6 +127,8 @@ } finally { if (type == ExportType.AnimatedGif) { agEncoder.finish(); + } else if (type == ExportType.AnimatedPng) { + apngEncoder.finish(); } } } @@ -137,6 +148,9 @@ } else if (type == ExportType.AnimatedGif) { agEncoder.addFrame(image); agEncoder.setDelay(100); + } else if (type == ExportType.AnimatedPng) { + apngEncoder.setDelay(100); + apngEncoder.addFrame(image); } else ImageIO.write(image, type.getExtension(), imageFile); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-10 01:12:47 UTC (rev 129) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-10 04:33:41 UTC (rev 130) @@ -38,6 +38,8 @@ public static final String GIFSERIESFILTER = "patchanim.filter.gifs"; public static final String ANIMATEDGIF = "patchanim.animatedgif"; public static final String ANIMATEDGIFFILTER = "patchanim.filter.animatedgif"; + public static final String ANIMATEDPNG = "patchanim.apng"; + public static final String ANIMATEDPNGFILTER = "patchanim.filter.apng"; public static final String MPEG = "patchanim.mpeg"; public static final String MPEGFILTER = "patchanim.filter.mpeg"; public static final String EXPORTINGFILE = "patchanim.exportfile"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-10 01:12:47 UTC (rev 129) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-10 04:33:41 UTC (rev 130) @@ -31,6 +31,8 @@ patchanim.filter.gifs = Gif Files (*.gif) patchanim.animatedgif = an Animated Gif patchanim.filter.animatedgif = Gif Files (*.gif) +patchanim.apng = an Animated Png +patchanim.filter.apng = (Png Files (*.png) patchanim.mpeg = an MPEG patchanim.filter.mpeg = MPEG Files (*.mpg) patchanim.exportfile = Exporting Animation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-10 01:12:42
|
Revision: 129 http://patchanim.svn.sourceforge.net/patchanim/?rev=129&view=rev Author: dbrosius Date: 2008-02-09 17:12:47 -0800 (Sat, 09 Feb 2008) Log Message: ----------- fix copyright comment order "padding stats" Modified Paths: -------------- trunk/patchanim/src/com/fmsware/gif/AnimatedGifEncoder.java trunk/patchanim/src/com/fmsware/gif/LZWEncoder.java trunk/patchanim/src/com/fmsware/gif/NeuQuant.java Modified: trunk/patchanim/src/com/fmsware/gif/AnimatedGifEncoder.java =================================================================== --- trunk/patchanim/src/com/fmsware/gif/AnimatedGifEncoder.java 2008-02-09 16:44:04 UTC (rev 128) +++ trunk/patchanim/src/com/fmsware/gif/AnimatedGifEncoder.java 2008-02-10 01:12:47 UTC (rev 129) @@ -1,4 +1,3 @@ -package com.fmsware.gif; /* * AnimatedGifEncoder * Copyright (C) 2003 FmsWare.com @@ -12,6 +11,8 @@ * copies from any such party to do so, with the only requirement being * that this copyright notice remain intact. */ +package com.fmsware.gif; + import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; Modified: trunk/patchanim/src/com/fmsware/gif/LZWEncoder.java =================================================================== --- trunk/patchanim/src/com/fmsware/gif/LZWEncoder.java 2008-02-09 16:44:04 UTC (rev 128) +++ trunk/patchanim/src/com/fmsware/gif/LZWEncoder.java 2008-02-10 01:12:47 UTC (rev 129) @@ -1,4 +1,3 @@ -package com.fmsware.gif; /* * LZW Encoder * Copyright (C) 2003 FmsWare.com @@ -12,6 +11,8 @@ * copies from any such party to do so, with the only requirement being * that this copyright notice remain intact. */ +package com.fmsware.gif; + import java.io.OutputStream; import java.io.IOException; Modified: trunk/patchanim/src/com/fmsware/gif/NeuQuant.java =================================================================== --- trunk/patchanim/src/com/fmsware/gif/NeuQuant.java 2008-02-09 16:44:04 UTC (rev 128) +++ trunk/patchanim/src/com/fmsware/gif/NeuQuant.java 2008-02-10 01:12:47 UTC (rev 129) @@ -1,4 +1,3 @@ -package com.fmsware.gif; /* * NeuQuant Neural-Net Quantization Algorithm * Copyright (c) 1994 Anthony Dekker @@ -17,6 +16,7 @@ * copies from any such party to do so, with the only requirement being * that this copyright notice remain intact. */ +package com.fmsware.gif; // Ported to Java 12/00 K Weiner This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 16:43:58
|
Revision: 128 http://patchanim.svn.sourceforge.net/patchanim/?rev=128&view=rev Author: dbrosius Date: 2008-02-09 08:44:04 -0800 (Sat, 09 Feb 2008) Log Message: ----------- Tag version 0.4.0 Added Paths: ----------- tags/patchanim/v0_4_0/ Copied: tags/patchanim/v0_4_0 (from rev 127, trunk/patchanim) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 16:43:14
|
Revision: 127 http://patchanim.svn.sourceforge.net/patchanim/?rev=127&view=rev Author: dbrosius Date: 2008-02-09 08:43:19 -0800 (Sat, 09 Feb 2008) Log Message: ----------- Removed file/folder Removed Paths: ------------- tags/v0_4_0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 16:41:39
|
Revision: 126 http://patchanim.svn.sourceforge.net/patchanim/?rev=126&view=rev Author: dbrosius Date: 2008-02-09 08:41:41 -0800 (Sat, 09 Feb 2008) Log Message: ----------- fix srczip target Modified Paths: -------------- trunk/patchanim/build.xml Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-09 16:27:02 UTC (rev 125) +++ trunk/patchanim/build.xml 2008-02-09 16:41:41 UTC (rev 126) @@ -99,17 +99,9 @@ </target> <target name="srczip" description="builds the source distribution zip file"> - <zip destfile="${jnlp.dir}/patchanim-src-${patchanim.version}.zip" basedir="${basedir}"> - <fileset dir="${basedir}"> - <include name="${src.dir}/**/*.java"/> - <include name="${src.dir}/**/*.properties"/> - <include name="${src.dir}/**/*.gif"/> - <include name="${src.dir}/**/*.xsd"/> - <include name="${src.dir}/**/*.xsl"/> - <include name="${lib.dir}/**/*.jar"/> - <include name="*.txt"/> - </fileset> - </zip> + <zip destfile="${jnlp.dir}/patchanim-src-${patchanim.version}.zip" + basedir="${basedir}" + includes="src/**/*.java, src/**/*.properties, src/**/*.gif, src/**/*.xsd, src/**/*.xsl, lib/**/*.jar, *.txt"/> </target> <target name="javadoc" depends="-init" description="build the javadoc for the project"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 16:27:00
|
Revision: 125 http://patchanim.svn.sourceforge.net/patchanim/?rev=125&view=rev Author: dbrosius Date: 2008-02-09 08:27:02 -0800 (Sat, 09 Feb 2008) Log Message: ----------- Tag version 0.4.0 Added Paths: ----------- tags/v0_4_0/ Copied: tags/v0_4_0 (from rev 124, trunk/patchanim) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 16:19:57
|
Revision: 124 http://patchanim.svn.sourceforge.net/patchanim/?rev=124&view=rev Author: dbrosius Date: 2008-02-09 08:20:01 -0800 (Sat, 09 Feb 2008) Log Message: ----------- update jnlp to 0.4.0 Modified Paths: -------------- trunk/patchanim/htdocs/jnlp/patchanim.jnlp Modified: trunk/patchanim/htdocs/jnlp/patchanim.jnlp =================================================================== --- trunk/patchanim/htdocs/jnlp/patchanim.jnlp 2008-02-09 16:15:18 UTC (rev 123) +++ trunk/patchanim/htdocs/jnlp/patchanim.jnlp 2008-02-09 16:20:01 UTC (rev 124) @@ -16,7 +16,7 @@ </security> <resources> <j2se version="1.5+" initial-heap-size="300m" max-heap-size="800m"/> - <jar href="patchanim-0.3.0.jar"/> + <jar href="patchanim-0.4.0.jar"/> <jar href="xml-apis.jar"/> <jar href="xalan.jar"/> <jar href="xercesImpl.jar"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 16:15:15
|
Revision: 123 http://patchanim.svn.sourceforge.net/patchanim/?rev=123&view=rev Author: dbrosius Date: 2008-02-09 08:15:18 -0800 (Sat, 09 Feb 2008) Log Message: ----------- auto generate the file version Modified Paths: -------------- trunk/patchanim/build.xml trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-09 16:01:47 UTC (rev 122) +++ trunk/patchanim/build.xml 2008-02-09 16:15:18 UTC (rev 123) @@ -34,7 +34,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="patchanim.version" value="0.3.0"/> + <property name="patchanim.version" value="0.4.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> @@ -74,6 +74,7 @@ <include name="**/*.xsl"/> </fileset> </copy> + <echo message="${patchanim.version}" file="${classes.dir}/com/mebigfatguy/patchanim/io/Version.txt"/> </target> <target name="jar" depends="compile, resources" description="produces the patchanim jar file"> @@ -84,6 +85,7 @@ <include name="**/*.gif"/> <include name="**/*.xsd"/> <include name="**/*.xsl"/> + <include name="**/*.txt"/> </fileset> <fileset dir="${basedir}"> <include name="license.txt"/> @@ -105,6 +107,7 @@ <include name="${src.dir}/**/*.xsd"/> <include name="${src.dir}/**/*.xsl"/> <include name="${lib.dir}/**/*.jar"/> + <include name="*.txt"/> </fileset> </zip> </target> Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl 2008-02-09 16:01:47 UTC (rev 122) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl 2008-02-09 16:15:18 UTC (rev 123) @@ -32,7 +32,10 @@ <xsl:variable name="ext" select="pae:new($doc)"/> <xsl:template match="/"> - <PatchAnimDoc version="0.2.0"> + <PatchAnimDoc> + <xsl:attribute name="version"> + <xsl:value-of select="pae:getVersion($ext)"/> + </xsl:attribute> <Settings> <xsl:attribute name="width"> <xsl:value-of select="pae:getWidth($ext)"/> Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java 2008-02-09 16:01:47 UTC (rev 122) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java 2008-02-09 16:15:18 UTC (rev 123) @@ -18,6 +18,10 @@ */ package com.mebigfatguy.patchanim.io; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -33,7 +37,7 @@ import com.mebigfatguy.patchanim.surface.PatchCoords; public class PatchAnimExtension { - + private static final String VERSION_URL = "/com/mebigfatguy/patchanim/io/Version.txt"; private PatchAnimDocument paDoc; private Document d; @@ -44,6 +48,18 @@ d = db.newDocument(); } + public String getVersion(@SuppressWarnings("unused") ExpressionContext context) { + BufferedReader br = null; + try { + br = new BufferedReader(new InputStreamReader(PatchAnimExtension.class.getResourceAsStream(VERSION_URL))); + return br.readLine(); + } catch (IOException ioe) { + return "0.0.0"; + } finally { + Closer.close(br); + } + } + public String getWidth(@SuppressWarnings("unused") ExpressionContext context) { return String.valueOf(paDoc.getWidth()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 16:01:42
|
Revision: 122 http://patchanim.svn.sourceforge.net/patchanim/?rev=122&view=rev Author: dbrosius Date: 2008-02-09 08:01:47 -0800 (Sat, 09 Feb 2008) Log Message: ----------- fire document changed on newItem Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-09 15:24:55 UTC (rev 121) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-09 16:01:47 UTC (rev 122) @@ -158,6 +158,8 @@ document = new PatchAnimDocument(); documentLocation = null; saveItem.setEnabled(false); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.setDocument(document); } catch (IOException ioe) { ResourceBundle rb = PatchAnimBundle.getBundle(); JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 15:24:50
|
Revision: 121 http://patchanim.svn.sourceforge.net/patchanim/?rev=121&view=rev Author: dbrosius Date: 2008-02-09 07:24:55 -0800 (Sat, 09 Feb 2008) Log Message: ----------- validate against the schema Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-02-09 07:49:00 UTC (rev 120) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-02-09 15:24:55 UTC (rev 121) @@ -147,9 +147,9 @@ } }); xmlIs = new BufferedInputStream(new FileInputStream(f)); - //reader.setFeature("http://apache.org/xml/features/validation/schema", true); - //reader.setFeature("http://xml.org/sax/features/validation", true); - //reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", PatchAnimDocument.class.getResource(PATCHANIMDOC_SCHEMA).getPath()); + reader.setFeature("http://apache.org/xml/features/validation/schema", true); + reader.setFeature("http://xml.org/sax/features/validation", true); + reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", PatchAnimDocument.class.getResource(PATCHANIMDOC_SCHEMA).toString()); reader.parse(new InputSource(xmlIs)); return doc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 07:48:56
|
Revision: 120 http://patchanim.svn.sourceforge.net/patchanim/?rev=120&view=rev Author: dbrosius Date: 2008-02-08 23:49:00 -0800 (Fri, 08 Feb 2008) Log Message: ----------- better schema Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-09 06:56:20 UTC (rev 119) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-09 07:49:00 UTC (rev 120) @@ -19,6 +19,33 @@ */ --> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:complexType name="PatchAnimDocClass"> + <xsd:sequence> + <xsd:element maxOccurs="1" minOccurs="1" name="Settings" type="SettingsClass"/> + <xsd:element maxOccurs="1" minOccurs="1" name="Patches" type="PatchesClass"/> + </xsd:sequence> + <xsd:attribute name="version" type="xsd:string" use="required"/> + </xsd:complexType> + <xsd:complexType name="SettingsClass"> + <xsd:attribute name="animationType" type="AnimationTypeClass" use="required"/> + <xsd:attribute name="height" type="xsd:integer" use="required"/> + <xsd:attribute name="outOfBoundsColor" type="OutOfBoundsColorClass" use="required"/> + <xsd:attribute name="tweenCount" type="xsd:integer" use="required"/> + <xsd:attribute name="width" type="xsd:integer" use="required"/> + </xsd:complexType> + <xsd:simpleType name="AnimationTypeClass"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="None"/> + <xsd:enumeration value="Cycle"/> + <xsd:enumeration value="Wave"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="OutOfBoundsColorClass"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Clip"/> + <xsd:enumeration value="Role"/> + </xsd:restriction> + </xsd:simpleType> <xsd:simpleType name="ColorClass"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Green"/> @@ -43,13 +70,6 @@ </xsd:sequence> <xsd:attribute name="name" type="NameClass" use="required"/> </xsd:complexType> - <xsd:complexType name="PatchAnimDocClass"> - <xsd:sequence> - <xsd:element maxOccurs="1" minOccurs="1" name="Settings" type="SettingsClass"/> - <xsd:element maxOccurs="1" minOccurs="1" name="Patches" type="PatchesClass"/> - </xsd:sequence> - <xsd:attribute name="version" type="xsd:string" use="required"/> - </xsd:complexType> <xsd:simpleType name="NameClass"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Patch Coordinates"/> @@ -60,12 +80,5 @@ <xsd:element maxOccurs="4" minOccurs="4" name="CombinedPatch" type="CombinedPatchClass"/> </xsd:sequence> </xsd:complexType> - <xsd:complexType name="SettingsClass"> - <xsd:attribute name="animationType" type="xsd:string" use="required"/> - <xsd:attribute name="height" type="xsd:integer" use="required"/> - <xsd:attribute name="outOfBoundsColor" type="xsd:string" use="required"/> - <xsd:attribute name="tweenCount" type="xsd:integer" use="required"/> - <xsd:attribute name="width" type="xsd:integer" use="required"/> - </xsd:complexType> <xsd:element name="PatchAnimDoc" type="PatchAnimDocClass"/> </xsd:schema> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 06:56:17
|
Revision: 119 http://patchanim.svn.sourceforge.net/patchanim/?rev=119&view=rev Author: dbrosius Date: 2008-02-08 22:56:20 -0800 (Fri, 08 Feb 2008) Log Message: ----------- comment out the validation for now as the xsd isn't loading Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-02-09 06:46:49 UTC (rev 118) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-02-09 06:56:20 UTC (rev 119) @@ -147,9 +147,9 @@ } }); xmlIs = new BufferedInputStream(new FileInputStream(f)); - reader.setFeature("http://apache.org/xml/features/validation/schema", true); - reader.setFeature("http://xml.org/sax/features/validation", true); - reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", PatchAnimDocument.class.getResource(PATCHANIMDOC_SCHEMA).getPath()); + //reader.setFeature("http://apache.org/xml/features/validation/schema", true); + //reader.setFeature("http://xml.org/sax/features/validation", true); + //reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", PatchAnimDocument.class.getResource(PATCHANIMDOC_SCHEMA).getPath()); reader.parse(new InputSource(xmlIs)); return doc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 06:46:44
|
Revision: 118 http://patchanim.svn.sourceforge.net/patchanim/?rev=118&view=rev Author: dbrosius Date: 2008-02-08 22:46:49 -0800 (Fri, 08 Feb 2008) Log Message: ----------- cleanup unused Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl 2008-02-09 06:40:32 UTC (rev 117) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl 2008-02-09 06:46:49 UTC (rev 118) @@ -58,7 +58,7 @@ <xsl:value-of select="pae:getPatchName($ext, $patchIndex)"/> </xsl:attribute> <Patch color="Red"> - <xsl:for-each select="pae:getCoordinates($ext, 'Red', $patchIndex)"> + <xsl:for-each select="pae:getCoordinates($ext)"> <Coordinate> <xsl:attribute name="x"> <xsl:value-of select="pae:getX($ext, 'Red', $patchIndex, .)"/> @@ -73,7 +73,7 @@ </xsl:for-each> </Patch> <Patch color="Green"> - <xsl:for-each select="pae:getCoordinates($ext, 'Green', $patchIndex)"> + <xsl:for-each select="pae:getCoordinates($ext)"> <Coordinate> <xsl:attribute name="x"> <xsl:value-of select="pae:getX($ext, 'Green', $patchIndex, .)"/> @@ -88,7 +88,7 @@ </xsl:for-each> </Patch> <Patch color="Blue"> - <xsl:for-each select="pae:getCoordinates($ext, 'Blue', $patchIndex)"> + <xsl:for-each select="pae:getCoordinates($ext)"> <Coordinate> <xsl:attribute name="x"> <xsl:value-of select="pae:getX($ext, 'Blue', $patchIndex, .)"/> Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java 2008-02-09 06:40:32 UTC (rev 117) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java 2008-02-09 06:46:49 UTC (rev 118) @@ -36,14 +36,12 @@ private PatchAnimDocument paDoc; private Document d; - private Node n; public PatchAnimExtension(PatchAnimDocument doc) throws ParserConfigurationException { paDoc = doc; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); d = db.newDocument(); - n = d.createElement("Patch"); } public String getWidth(@SuppressWarnings("unused") ExpressionContext context) { @@ -74,7 +72,6 @@ } public Node item(int index) { - // TODO Auto-generated method stub return d.createTextNode(String.valueOf(index)); } }; @@ -87,7 +84,7 @@ return paDoc.getPatches().get(patchIndex).getName(); } - public NodeList getCoordinates(@SuppressWarnings("unused") ExpressionContext context, String color, Node n) { + public NodeList getCoordinates(@SuppressWarnings("unused") ExpressionContext context) { NodeList nl = new NodeList() { public int getLength() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 06:40:29
|
Revision: 117 http://patchanim.svn.sourceforge.net/patchanim/?rev=117&view=rev Author: dbrosius Date: 2008-02-08 22:40:32 -0800 (Fri, 08 Feb 2008) Log Message: ----------- fix srczip Modified Paths: -------------- trunk/patchanim/build.xml Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-09 06:33:33 UTC (rev 116) +++ trunk/patchanim/build.xml 2008-02-09 06:40:32 UTC (rev 117) @@ -97,14 +97,14 @@ </target> <target name="srczip" description="builds the source distribution zip file"> - <zip destfile="${basedir}/patchanim-src-${patchanim.version}.zip" basedir="${basedir}"> + <zip destfile="${jnlp.dir}/patchanim-src-${patchanim.version}.zip" basedir="${basedir}"> <fileset dir="${basedir}"> - <include name="**/*.java"/> - <include name="**/*.properties"/> - <include name="**/*.gif"/> - <include name="**/*.xsd"/> - <include name="**/*.xsl"/> - <include name="${lib.dir}/*.jar"/> + <include name="${src.dir}/**/*.java"/> + <include name="${src.dir}/**/*.properties"/> + <include name="${src.dir}/**/*.gif"/> + <include name="${src.dir}/**/*.xsd"/> + <include name="${src.dir}/**/*.xsl"/> + <include name="${lib.dir}/**/*.jar"/> </fileset> </zip> </target> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 06:33:30
|
Revision: 116 http://patchanim.svn.sourceforge.net/patchanim/?rev=116&view=rev Author: dbrosius Date: 2008-02-08 22:33:33 -0800 (Fri, 08 Feb 2008) Log Message: ----------- sign the other jars Modified Paths: -------------- trunk/patchanim/build.xml Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-09 06:15:15 UTC (rev 115) +++ trunk/patchanim/build.xml 2008-02-09 06:33:33 UTC (rev 116) @@ -27,6 +27,7 @@ <property name="classes.dir" value="${basedir}/classes"/> <property name="lib.dir" value="${basedir}/lib"/> <property name="htdocs.dir" value="${basedir}/htdocs"/> + <property name="jnlp.dir" value="${htdocs.dir}/jnlp"/> <property name="javadoc.dir" value="${htdocs.dir}/javadoc"/> <property name="javac.source" value="1.5"/> <property name="javac.target" value="1.5"/> @@ -38,8 +39,8 @@ <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> <delete dir="${javadoc.dir}"/> - <delete file="${basedir}/patchanim-${patchanim.version}.jar"/> - <delete file="${basedir}/patchanim-src-${patchanim.version}.zip"/> + <delete file="${jnlp.dir}/patchanim-${patchanim.version}.jar"/> + <delete file="${jnlp.dir}/patchanim-src-${patchanim.version}.zip"/> </target> <target name="-init" description="prepares repository for a build"> @@ -76,7 +77,7 @@ </target> <target name="jar" depends="compile, resources" description="produces the patchanim jar file"> - <jar destfile="${basedir}/patchanim-${patchanim.version}.jar"> + <jar destfile="${jnlp.dir}/patchanim-${patchanim.version}.jar"> <fileset dir="${classes.dir}"> <include name="**/*.class"/> <include name="**/*.properties"/> @@ -92,14 +93,7 @@ <attribute name="Main-Class" value="com.mebigfatguy.patchanim.main.PatchMain"/> <attribute name="Class-Path" value="xml-apis.jar xalan.jar xercesImpl.jar serializer.jar"/> </manifest> - </jar> - <input message="Enter keystore password" addproperty="pass"/> - <signjar jar="${basedir}/patchanim-${patchanim.version}.jar" - keystore="patchanim.store" - alias="patchanim" - keypass="${pass}" - storepass="${pass}"/> - + </jar> </target> <target name="srczip" description="builds the source distribution zip file"> @@ -148,6 +142,26 @@ <target name="build" depends="clean, -init, compile, resources, test, jar" description="builds the patchanim jar"/> - <target name="release" depends="build, srczip, javadoc" description="prepares everything for a release"/> + <target name="jnlp" description="copy jars to jnlp directory"> + <copy todir="${jnlp.dir}"> + <fileset dir="${lib.dir}"> + <include name="*.jar"/> + </fileset> + <fileset dir="${basedir}"> + <include name="*.jar"/> + </fileset> + </copy> + <input message="Enter keystore password" addproperty="pass"/> + <signjar keystore="patchanim.store" + alias="patchanim" + keypass="${pass}" + storepass="${pass}"> + <fileset dir="${jnlp.dir}"> + <include name="*.jar"/> + </fileset> + </signjar> + </target> + + <target name="release" depends="build, jnlp, srczip, javadoc" description="prepares everything for a release"/> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 06:15:17
|
Revision: 115 http://patchanim.svn.sourceforge.net/patchanim/?rev=115&view=rev Author: dbrosius Date: 2008-02-08 22:15:15 -0800 (Fri, 08 Feb 2008) Log Message: ----------- make sure xsl and xsd get copied to jars, src, etc Modified Paths: -------------- trunk/patchanim/build.xml Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-09 06:12:58 UTC (rev 114) +++ trunk/patchanim/build.xml 2008-02-09 06:15:15 UTC (rev 115) @@ -69,6 +69,8 @@ <fileset dir="${src.dir}"> <include name="**/*.properties"/> <include name="**/*.gif"/> + <include name="**/*.xsd"/> + <include name="**/*.xsl"/> </fileset> </copy> </target> @@ -79,6 +81,8 @@ <include name="**/*.class"/> <include name="**/*.properties"/> <include name="**/*.gif"/> + <include name="**/*.xsd"/> + <include name="**/*.xsl"/> </fileset> <fileset dir="${basedir}"> <include name="license.txt"/> @@ -103,7 +107,9 @@ <fileset dir="${basedir}"> <include name="**/*.java"/> <include name="**/*.properties"/> - <include name="**/*.property"/> + <include name="**/*.gif"/> + <include name="**/*.xsd"/> + <include name="**/*.xsl"/> <include name="${lib.dir}/*.jar"/> </fileset> </zip> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 06:12:53
|
Revision: 114 http://patchanim.svn.sourceforge.net/patchanim/?rev=114&view=rev Author: dbrosius Date: 2008-02-08 22:12:58 -0800 (Fri, 08 Feb 2008) Log Message: ----------- change error message to loading Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-09 06:08:36 UTC (rev 113) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-09 06:12:58 UTC (rev 114) @@ -296,7 +296,7 @@ } } catch (Exception e) { ResourceBundle rb = PatchAnimBundle.getBundle(); - JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.SAVEFAILED)); + JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.LOADFAILED)); documentLocation = null; document = new PatchAnimDocument(); } finally { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 06:08:31
|
Revision: 113 http://patchanim.svn.sourceforge.net/patchanim/?rev=113&view=rev Author: dbrosius Date: 2008-02-08 22:08:36 -0800 (Fri, 08 Feb 2008) Log Message: ----------- get rid of xml directive Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-09 06:00:43 UTC (rev 112) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-09 06:08:36 UTC (rev 113) @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ --> - <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:simpleType name="ColorClass"> <xsd:restriction base="xsd:string"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 06:00:47
|
Revision: 112 http://patchanim.svn.sourceforge.net/patchanim/?rev=112&view=rev Author: dbrosius Date: 2008-02-08 22:00:43 -0800 (Fri, 08 Feb 2008) Log Message: ----------- add jars to jnlp Modified Paths: -------------- trunk/patchanim/htdocs/jnlp/patchanim.jnlp Modified: trunk/patchanim/htdocs/jnlp/patchanim.jnlp =================================================================== --- trunk/patchanim/htdocs/jnlp/patchanim.jnlp 2008-02-09 05:59:37 UTC (rev 111) +++ trunk/patchanim/htdocs/jnlp/patchanim.jnlp 2008-02-09 06:00:43 UTC (rev 112) @@ -17,6 +17,10 @@ <resources> <j2se version="1.5+" initial-heap-size="300m" max-heap-size="800m"/> <jar href="patchanim-0.3.0.jar"/> + <jar href="xml-apis.jar"/> + <jar href="xalan.jar"/> + <jar href="xercesImpl.jar"/> + <jar href="serializer.jar"/> </resources> <application-desc main-class="com.mebigfatguy.patchanim.main.PatchMain"/> </jnlp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 05:59:36
|
Revision: 111 http://patchanim.svn.sourceforge.net/patchanim/?rev=111&view=rev Author: dbrosius Date: 2008-02-08 21:59:37 -0800 (Fri, 08 Feb 2008) Log Message: ----------- update build file for jar files Modified Paths: -------------- trunk/patchanim/build.xml Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-02-09 05:53:58 UTC (rev 110) +++ trunk/patchanim/build.xml 2008-02-09 05:59:37 UTC (rev 111) @@ -25,6 +25,7 @@ <property name="src.dir" value="${basedir}/src"/> <property name="classes.dir" value="${basedir}/classes"/> + <property name="lib.dir" value="${basedir}/lib"/> <property name="htdocs.dir" value="${basedir}/htdocs"/> <property name="javadoc.dir" value="${htdocs.dir}/javadoc"/> <property name="javac.source" value="1.5"/> @@ -45,6 +46,10 @@ <mkdir dir="${classes.dir}"/> <mkdir dir="${javadoc.dir}"/> <path id="patchanim.classpath"> + <pathelement location="${lib.dir}/xml-apis.jar"/> + <pathelement location="${lib.dir}/xalan.jar"/> + <pathelement location="${lib.dir}/xercesImpl.jar"/> + <pathelement location="${lib.dir}/serializer.jar"/> </path> </target> @@ -81,6 +86,7 @@ <manifest> <attribute name="patchanim-version" value="${patchanim.version}"/> <attribute name="Main-Class" value="com.mebigfatguy.patchanim.main.PatchMain"/> + <attribute name="Class-Path" value="xml-apis.jar xalan.jar xercesImpl.jar serializer.jar"/> </manifest> </jar> <input message="Enter keystore password" addproperty="pass"/> @@ -98,6 +104,7 @@ <include name="**/*.java"/> <include name="**/*.properties"/> <include name="**/*.property"/> + <include name="${lib.dir}/*.jar"/> </fileset> </zip> </target> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 05:56:13
|
Revision: 110 http://patchanim.svn.sourceforge.net/patchanim/?rev=110&view=rev Author: dbrosius Date: 2008-02-08 21:53:58 -0800 (Fri, 08 Feb 2008) Log Message: ----------- rework io to use xml Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java Added Paths: ----------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java Added: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-02-09 05:53:58 UTC (rev 110) @@ -0,0 +1,72 @@ +<!-- +/* + * patchanim - A bezier surface patch color blend gif builder + * Copyright (C) 2008 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + --> + <?xml version="1.0" encoding="UTF-8" standalone="no"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:simpleType name="ColorClass"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Green"/> + <xsd:enumeration value="Blue"/> + <xsd:enumeration value="Red"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:complexType name="CoordinateClass"> + <xsd:attribute name="color" type="xsd:double" use="required"/> + <xsd:attribute name="x" type="xsd:double" use="required"/> + <xsd:attribute name="y" type="xsd:double" use="required"/> + </xsd:complexType> + <xsd:complexType name="PatchClass"> + <xsd:sequence> + <xsd:element maxOccurs="unbounded" minOccurs="1" name="Coordinate" type="CoordinateClass"/> + </xsd:sequence> + <xsd:attribute name="color" type="ColorClass" use="required"/> + </xsd:complexType> + <xsd:complexType name="CombinedPatchClass"> + <xsd:sequence> + <xsd:element maxOccurs="3" minOccurs="3" name="Patch" type="PatchClass"/> + </xsd:sequence> + <xsd:attribute name="name" type="NameClass" use="required"/> + </xsd:complexType> + <xsd:complexType name="PatchAnimDocClass"> + <xsd:sequence> + <xsd:element maxOccurs="1" minOccurs="1" name="Settings" type="SettingsClass"/> + <xsd:element maxOccurs="1" minOccurs="1" name="Patches" type="PatchesClass"/> + </xsd:sequence> + <xsd:attribute name="version" type="xsd:string" use="required"/> + </xsd:complexType> + <xsd:simpleType name="NameClass"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Patch Coordinates"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:complexType name="PatchesClass"> + <xsd:sequence> + <xsd:element maxOccurs="4" minOccurs="4" name="CombinedPatch" type="CombinedPatchClass"/> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="SettingsClass"> + <xsd:attribute name="animationType" type="xsd:string" use="required"/> + <xsd:attribute name="height" type="xsd:integer" use="required"/> + <xsd:attribute name="outOfBoundsColor" type="xsd:string" use="required"/> + <xsd:attribute name="tweenCount" type="xsd:integer" use="required"/> + <xsd:attribute name="width" type="xsd:integer" use="required"/> + </xsd:complexType> + <xsd:element name="PatchAnimDoc" type="PatchAnimDocClass"/> +</xsd:schema> Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + native Added: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl 2008-02-09 05:53:58 UTC (rev 110) @@ -0,0 +1,111 @@ +<!-- +/* + * patchanim - A bezier surface patch color blend gif builder + * Copyright (C) 2008 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + --> +<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xalan="http://xml.apache.org/xalan" + xmlns:pae="xalan://com.mebigfatguy.patchanim.io.PatchAnimExtension" + extension-element-prefixes="pae"> + + <xsl:output method="xml" + encoding="UTF-8" + indent="yes" + xalan:indent-amount="4"/> + + <xsl:param name="doc"/> + <xsl:variable name="ext" select="pae:new($doc)"/> + + <xsl:template match="/"> + <PatchAnimDoc version="0.2.0"> + <Settings> + <xsl:attribute name="width"> + <xsl:value-of select="pae:getWidth($ext)"/> + </xsl:attribute> + <xsl:attribute name="height"> + <xsl:value-of select="pae:getHeight($ext)"/> + </xsl:attribute> + <xsl:attribute name="animationType"> + <xsl:value-of select="pae:getAnimationType($ext)"/> + </xsl:attribute> + <xsl:attribute name="outOfBoundsColor"> + <xsl:value-of select="pae:getOutOfBoundsColor($ext)"/> + </xsl:attribute> + <xsl:attribute name="tweenCount"> + <xsl:value-of select="pae:getTweenCount($ext)"/> + </xsl:attribute> + </Settings> + <Patches> + <xsl:for-each select="pae:getPatches($ext)"> + <xsl:variable name="patchIndex" select="."/> + <CombinedPatch> + <xsl:attribute name="name"> + <xsl:value-of select="pae:getPatchName($ext, $patchIndex)"/> + </xsl:attribute> + <Patch color="Red"> + <xsl:for-each select="pae:getCoordinates($ext, 'Red', $patchIndex)"> + <Coordinate> + <xsl:attribute name="x"> + <xsl:value-of select="pae:getX($ext, 'Red', $patchIndex, .)"/> + </xsl:attribute> + <xsl:attribute name="y"> + <xsl:value-of select="pae:getY($ext, 'Red', $patchIndex, .)"/> + </xsl:attribute> + <xsl:attribute name="color"> + <xsl:value-of select="pae:getColor($ext, 'Red', $patchIndex, .)"/> + </xsl:attribute> + </Coordinate> + </xsl:for-each> + </Patch> + <Patch color="Green"> + <xsl:for-each select="pae:getCoordinates($ext, 'Green', $patchIndex)"> + <Coordinate> + <xsl:attribute name="x"> + <xsl:value-of select="pae:getX($ext, 'Green', $patchIndex, .)"/> + </xsl:attribute> + <xsl:attribute name="y"> + <xsl:value-of select="pae:getY($ext, 'Green', $patchIndex, .)"/> + </xsl:attribute> + <xsl:attribute name="color"> + <xsl:value-of select="pae:getColor($ext, 'Green', $patchIndex, .)"/> + </xsl:attribute> + </Coordinate> + </xsl:for-each> + </Patch> + <Patch color="Blue"> + <xsl:for-each select="pae:getCoordinates($ext, 'Blue', $patchIndex)"> + <Coordinate> + <xsl:attribute name="x"> + <xsl:value-of select="pae:getX($ext, 'Blue', $patchIndex, .)"/> + </xsl:attribute> + <xsl:attribute name="y"> + <xsl:value-of select="pae:getY($ext, 'Blue', $patchIndex, .)"/> + </xsl:attribute> + <xsl:attribute name="color"> + <xsl:value-of select="pae:getColor($ext, 'Blue', $patchIndex, .)"/> + </xsl:attribute> + </Coordinate> + </xsl:for-each> + </Patch> + </CombinedPatch> + </xsl:for-each> + </Patches> + </PatchAnimDoc> + </xsl:template> + +</xsl:transform> \ No newline at end of file Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + native Added: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java 2008-02-09 05:53:58 UTC (rev 110) @@ -0,0 +1,134 @@ +/* + * patchanim - A bezier surface patch color blend gif builder + * Copyright (C) 2008 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package com.mebigfatguy.patchanim.io; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.apache.xalan.extensions.ExpressionContext; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import com.mebigfatguy.patchanim.PatchAnimDocument; +import com.mebigfatguy.patchanim.PatchColor; +import com.mebigfatguy.patchanim.surface.Coordinate; +import com.mebigfatguy.patchanim.surface.PatchCoords; + +public class PatchAnimExtension { + + private PatchAnimDocument paDoc; + private Document d; + private Node n; + + public PatchAnimExtension(PatchAnimDocument doc) throws ParserConfigurationException { + paDoc = doc; + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + d = db.newDocument(); + n = d.createElement("Patch"); + } + + public String getWidth(@SuppressWarnings("unused") ExpressionContext context) { + return String.valueOf(paDoc.getWidth()); + } + + public String getHeight(@SuppressWarnings("unused") ExpressionContext context) { + return String.valueOf(paDoc.getHeight()); + } + + public String getAnimationType(@SuppressWarnings("unused") ExpressionContext context) { + return paDoc.getAnimationType().name(); + } + + public String getOutOfBoundsColor(@SuppressWarnings("unused") ExpressionContext context) { + return paDoc.getOutOfBoundsColor().name(); + } + + public String getTweenCount(@SuppressWarnings("unused") ExpressionContext context) { + return String.valueOf(paDoc.getTweenCount()); + } + + public NodeList getPatches(@SuppressWarnings("unused") ExpressionContext context) { + NodeList nl = new NodeList() { + + public int getLength() { + return paDoc.getPatches().size(); + } + + public Node item(int index) { + // TODO Auto-generated method stub + return d.createTextNode(String.valueOf(index)); + } + }; + + return nl; + } + + public String getPatchName(@SuppressWarnings("unused") ExpressionContext context, Node patchIndexNode) { + int patchIndex = Integer.parseInt(patchIndexNode.getNodeValue()); + return paDoc.getPatches().get(patchIndex).getName(); + } + + public NodeList getCoordinates(@SuppressWarnings("unused") ExpressionContext context, String color, Node n) { + NodeList nl = new NodeList() { + + public int getLength() { + return PatchCoords.ORDER * PatchCoords.ORDER; + } + + public Node item(int index) { + // TODO Auto-generated method stub + return d.createTextNode(String.valueOf(index)); + } + }; + + return nl; + } + + public String getX(@SuppressWarnings("unused") ExpressionContext context, String color, Node patchIndexNode, Node coordIndexNode) { + PatchColor patchColor = PatchColor.valueOf(PatchColor.class, color); + int patchIndex = Integer.parseInt(patchIndexNode.getNodeValue()); + int coordIndex = Integer.parseInt(coordIndexNode.getNodeValue()); + + Coordinate coord = paDoc.getPatches().get(patchIndex).getPatch(patchColor).getCoordinate(coordIndex % PatchCoords.ORDER, coordIndex / PatchCoords.ORDER); + return String.valueOf(coord.getX()); + } + + public String getY(@SuppressWarnings("unused") ExpressionContext context, String color, Node patchIndexNode, Node coordIndexNode) { + PatchColor patchColor = PatchColor.valueOf(PatchColor.class, color); + int patchIndex = Integer.parseInt(patchIndexNode.getNodeValue()); + int coordIndex = Integer.parseInt(coordIndexNode.getNodeValue()); + + Coordinate coord = paDoc.getPatches().get(patchIndex).getPatch(patchColor).getCoordinate(coordIndex % PatchCoords.ORDER, coordIndex / PatchCoords.ORDER); + return String.valueOf(coord.getY()); + } + + public String getColor(@SuppressWarnings("unused") ExpressionContext context, String color, Node patchIndexNode, Node coordIndexNode) { + PatchColor patchColor = PatchColor.valueOf(PatchColor.class, color); + int patchIndex = Integer.parseInt(patchIndexNode.getNodeValue()); + int coordIndex = Integer.parseInt(coordIndexNode.getNodeValue()); + + Coordinate coord = paDoc.getPatches().get(patchIndex).getPatch(patchColor).getCoordinate(coordIndex % PatchCoords.ORDER, coordIndex / PatchCoords.ORDER); + return String.valueOf(coord.getColor()); + } + + +} Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-02-09 05:51:40 UTC (rev 109) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-02-09 05:53:58 UTC (rev 110) @@ -24,38 +24,143 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.w3c.dom.Document; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; +import org.xml.sax.helpers.XMLReaderFactory; + +import com.mebigfatguy.patchanim.AnimationType; +import com.mebigfatguy.patchanim.OutOfBoundsColor; import com.mebigfatguy.patchanim.PatchAnimDocument; +import com.mebigfatguy.patchanim.PatchColor; +import com.mebigfatguy.patchanim.surface.CombinedPatch; +import com.mebigfatguy.patchanim.surface.Coordinate; +import com.mebigfatguy.patchanim.surface.PatchCoords; public class PatchAnimIO { + private static final String PATCHANIMDOC_SCHEMA = "/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd"; private PatchAnimIO() { } - + public static void saveFile(File f, PatchAnimDocument document) throws IOException { - ObjectOutputStream os = null; + InputStream xslIs = null; + OutputStream xmlOs = null; try { document.setDirty(false); - os = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(f))); - os.writeObject(document); - os.flush(); + + TransformerFactory tf = TransformerFactory.newInstance(); + xslIs = new BufferedInputStream(PatchAnimIO.class.getResourceAsStream("/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl")); + Transformer t = tf.newTransformer(new StreamSource(xslIs)); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document d = db.newDocument(); + xmlOs = new BufferedOutputStream(new FileOutputStream(f)); + t.setParameter("doc", document); + t.transform(new DOMSource(d), new StreamResult(xmlOs)); + } catch (IOException ioe) { + throw ioe; + } catch (Exception e) { + IOException ioe = new IOException("Failed saving document"); + ioe.initCause(e); + throw ioe; } finally { - Closer.close(os); + Closer.close(xslIs); + Closer.close(xmlOs); } } - - public static PatchAnimDocument loadFile(File f) throws IOException, ClassNotFoundException { - ObjectInputStream is = null; + + public static PatchAnimDocument loadFile(File f) throws IOException { + InputStream xmlIs = null; + final PatchAnimDocument doc = new PatchAnimDocument(); + doc.getPatches().clear(); + try { - is = new ObjectInputStream(new BufferedInputStream(new FileInputStream(f))); - return (PatchAnimDocument)is.readObject(); + XMLReader reader = XMLReaderFactory.createXMLReader(); + reader.setContentHandler(new DefaultHandler() { + private static final String SETTINGS = "Settings"; + private static final String WIDTH = "width"; + private static final String HEIGHT = "height"; + private static final String ANIMATIONTYPE = "animationType"; + private static final String OUTOFBOUNDSCOLOR = "outOfBoundsColor"; + private static final String TWEENCOUNT = "tweenCount"; + private static final String COMBINEDPATCH = "CombinedPatch"; + private static final String PATCH = "Patch"; + private static final String COLOR = "color"; + private static final String COORDINATE = "Coordinate"; + private static final String X = "x"; + private static final String Y = "y"; + + private CombinedPatch cPatch = null; + private PatchCoords patchCoords = null; + private PatchColor patchColor = null; + private int coordIndex = 0; + + @Override + public void startElement(String uri, String localName, String qName, Attributes atts) { + if (SETTINGS.equals(localName)) { + doc.setWidth(Integer.parseInt(atts.getValue(WIDTH))); + doc.setHeight(Integer.parseInt(atts.getValue(HEIGHT))); + doc.setAnimationType(AnimationType.valueOf(AnimationType.class, atts.getValue(ANIMATIONTYPE))); + doc.setOutOfBoundsColor(OutOfBoundsColor.valueOf(OutOfBoundsColor.class, atts.getValue(OUTOFBOUNDSCOLOR))); + doc.setTweenCount(Integer.parseInt(atts.getValue(TWEENCOUNT))); + } else if (COMBINEDPATCH.equals(localName)) { + cPatch = new CombinedPatch(false); + } else if (PATCH.equals(localName)) { + patchCoords = new PatchCoords(); + patchColor = PatchColor.valueOf(PatchColor.class, atts.getValue(COLOR)); + } else if (COORDINATE.equals(localName)) { + Coordinate c = new Coordinate(Double.parseDouble(atts.getValue(X)), + Double.parseDouble(atts.getValue(Y)), + Double.parseDouble(atts.getValue(COLOR))); + patchCoords.setCoordinate(coordIndex / PatchCoords.ORDER, coordIndex % PatchCoords.ORDER, c); + coordIndex++; + c = null; + } + } + + @Override + public void endElement(String uri, String localName, String qName) { + if (COMBINEDPATCH.equals(localName)) { + doc.getPatches().add(cPatch); + cPatch = null; + } else if (PATCH.equals(localName)) { + cPatch.setPatch(patchColor, patchCoords); + patchColor = null; + patchCoords = null; + coordIndex = 0; + } + } + }); + xmlIs = new BufferedInputStream(new FileInputStream(f)); + reader.setFeature("http://apache.org/xml/features/validation/schema", true); + reader.setFeature("http://xml.org/sax/features/validation", true); + reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", PatchAnimDocument.class.getResource(PATCHANIMDOC_SCHEMA).getPath()); + + reader.parse(new InputSource(xmlIs)); + return doc; + } catch (IOException ioe) { + throw ioe; + } catch (Exception e) { + IOException ioe = new IOException("Failed loading document"); + ioe.initCause(e); + throw ioe; } finally { - Closer.close(is); + Closer.close(xmlIs); } } - - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 05:52:56
|
Revision: 109 http://patchanim.svn.sourceforge.net/patchanim/?rev=109&view=rev Author: dbrosius Date: 2008-02-08 21:51:40 -0800 (Fri, 08 Feb 2008) Log Message: ----------- add xml libraries Modified Paths: -------------- trunk/patchanim/.classpath Added Paths: ----------- trunk/patchanim/lib/ trunk/patchanim/lib/serializer.jar trunk/patchanim/lib/xalan.jar trunk/patchanim/lib/xercesImpl.jar trunk/patchanim/lib/xml-apis.jar Modified: trunk/patchanim/.classpath =================================================================== --- trunk/patchanim/.classpath 2008-02-09 05:49:59 UTC (rev 108) +++ trunk/patchanim/.classpath 2008-02-09 05:51:40 UTC (rev 109) @@ -1,6 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> + <classpathentry kind="lib" path="O:/patchanim/lib/xalan.jar"/> + <classpathentry kind="lib" path="O:/patchanim/lib/serializer.jar"/> + <classpathentry kind="lib" path="O:/patchanim/lib/xml-apis.jar"/> + <classpathentry kind="lib" path="O:/patchanim/lib/xercesImpl.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path="classes"/> </classpath> Added: trunk/patchanim/lib/serializer.jar =================================================================== (Binary files differ) Property changes on: trunk/patchanim/lib/serializer.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/patchanim/lib/xalan.jar =================================================================== (Binary files differ) Property changes on: trunk/patchanim/lib/xalan.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/patchanim/lib/xercesImpl.jar =================================================================== (Binary files differ) Property changes on: trunk/patchanim/lib/xercesImpl.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/patchanim/lib/xml-apis.jar =================================================================== (Binary files differ) Property changes on: trunk/patchanim/lib/xml-apis.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-09 05:49:54
|
Revision: 108 http://patchanim.svn.sourceforge.net/patchanim/?rev=108&view=rev Author: dbrosius Date: 2008-02-08 21:49:59 -0800 (Fri, 08 Feb 2008) Log Message: ----------- cleanup imports Modified Paths: -------------- trunk/patchanim/src/com/fmsware/gif/AnimatedGifEncoder.java Modified: trunk/patchanim/src/com/fmsware/gif/AnimatedGifEncoder.java =================================================================== --- trunk/patchanim/src/com/fmsware/gif/AnimatedGifEncoder.java 2008-02-08 05:46:45 UTC (rev 107) +++ trunk/patchanim/src/com/fmsware/gif/AnimatedGifEncoder.java 2008-02-09 05:49:59 UTC (rev 108) @@ -12,9 +12,14 @@ * copies from any such party to do so, with the only requirement being * that this copyright notice remain intact. */ -import java.io.*; -import java.awt.*; -import java.awt.image.*; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferByte; +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; /** * Class AnimatedGifEncoder - Encodes a GIF file consisting of one or This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-08 05:46:43
|
Revision: 107 http://patchanim.svn.sourceforge.net/patchanim/?rev=107&view=rev Author: dbrosius Date: 2008-02-07 21:46:45 -0800 (Thu, 07 Feb 2008) Log Message: ----------- FCBL fix Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java 2008-02-08 05:44:45 UTC (rev 106) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java 2008-02-08 05:46:45 UTC (rev 107) @@ -29,10 +29,9 @@ import com.mebigfatguy.patchanim.PatchColor; public class JPatchAnimPanel extends JPanel { - - private static final long serialVersionUID = 7719900566976553103L; - private JPatchControlPanel ctrl; + private static final long serialVersionUID = 3030850111559417377L; + public JPatchAnimPanel() { initComponents(); } @@ -41,7 +40,7 @@ setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel p = new JPanel(); p.setLayout(new BorderLayout(4, 4)); - ctrl = new JPatchControlPanel(); + JPatchControlPanel ctrl = new JPatchControlPanel(); p.add(ctrl, BorderLayout.WEST); JPatchSamplePanel sample = new JPatchSamplePanel(PatchColor.Combined); JPanel q = new JPanel(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-08 05:44:52
|
Revision: 106 http://patchanim.svn.sourceforge.net/patchanim/?rev=106&view=rev Author: dbrosius Date: 2008-02-07 21:44:45 -0800 (Thu, 07 Feb 2008) Log Message: ----------- BAS fix Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-08 05:39:50 UTC (rev 105) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-02-08 05:44:45 UTC (rev 106) @@ -201,10 +201,10 @@ patchList.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent me) { - ResourceBundle rb = PatchAnimBundle.getBundle(); if (me.getClickCount() == 2) { CombinedPatch patch = (CombinedPatch)patchList.getSelectedValue(); if (patch != null) { + ResourceBundle rb = PatchAnimBundle.getBundle(); String newName = JOptionPane.showInputDialog(JPatchListPanel.this, rb.getString(PatchAnimBundle.ENTERNEWPATCHNAME), patch.getName()); if (newName != null) { patch.setName(newName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |