patchanim-commit Mailing List for patchanim (Page 3)
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-12-25 18:35:55
|
Revision: 255 http://patchanim.svn.sourceforge.net/patchanim/?rev=255&view=rev Author: dbrosius Date: 2008-12-25 18:35:51 +0000 (Thu, 25 Dec 2008) Log Message: ----------- put in a bogus algo, till we fix other stuff Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-12-25 18:16:48 UTC (rev 254) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-12-25 18:35:51 UTC (rev 255) @@ -27,7 +27,7 @@ public class PatchCoords implements Serializable, Cloneable { private static final long serialVersionUID = -4052789167154764908L; - private int order; + private final int order; private Coordinate[][] coords; public static PatchCoords buildRandomPatch(int patchOrder) { @@ -84,16 +84,37 @@ public static PatchCoords tween(PatchCoords startCoords, PatchCoords endCoords, TweenStyle tweenStyle, double frac) { PatchCoords tweenCoords = new PatchCoords(startCoords.getOrder()); - for (int x = 0; x < tweenCoords.order; x++) { - for (int y = 0; y < tweenCoords.order; y++) { - Coordinate startC = startCoords.getCoordinate(x,y); - Coordinate endC = endCoords.getCoordinate(x,y); - double startColor = startC.getColor(); - int tweenColor = (int)(startColor + (endC.getColor() - startColor) * frac); - Coordinate tweenC = new Coordinate(startC.getX(), endC.getY(), tweenColor); - tweenCoords.setCoordinate(x, y, tweenC); - } + switch (tweenStyle) { + case Linear: + /* this only works if the lattice is fixed */ + for (int x = 0; x < tweenCoords.order; x++) { + for (int y = 0; y < tweenCoords.order; y++) { + Coordinate startC = startCoords.getCoordinate(x,y); + Coordinate endC = endCoords.getCoordinate(x,y); + double startColor = startC.getColor(); + int tweenColor = (int)(startColor + (endC.getColor() - startColor) * frac); + Coordinate tweenC = new Coordinate(startC.getX(), endC.getY(), tweenColor); + tweenCoords.setCoordinate(x, y, tweenC); + } + } + break; + + case Radial: + /* this is completely bogus right now, just to fool 'em, till we fix stuff elsewhere */ + for (int x = 0; x < tweenCoords.order; x++) { + for (int y = 0; y < tweenCoords.order; y++) { + Coordinate startC = startCoords.getCoordinate(x,y); + Coordinate endC = endCoords.getCoordinate(x,y); + double[] startVector = new double[] { startC.getX(), startC.getY(), startC.getColor() }; + double[] endVector = new double[] { endC.getX(), endC.getY(), endC.getColor() }; + double ran = Math.random(); + Coordinate tweenC = new Coordinate(startVector[0], endVector[1], startVector[2] * ran + endVector[2] * (1 - ran)); + tweenCoords.setCoordinate(x, y, tweenC); + } + } + break; } + return tweenCoords; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-12-25 18:16:50
|
Revision: 254 http://patchanim.svn.sourceforge.net/patchanim/?rev=254&view=rev Author: dbrosius Date: 2008-12-25 18:16:48 +0000 (Thu, 25 Dec 2008) Log Message: ----------- push tweenStyle down to PatchCoord.tween Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-12-25 18:15:30 UTC (rev 253) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-12-25 18:16:48 UTC (rev 254) @@ -75,17 +75,17 @@ { PatchCoords sRedCoords = startPatch.getPatch(PatchColor.Red); PatchCoords eRedCoords = endPatch.getPatch(PatchColor.Red); - tweenPatch.setPatch(PatchColor.Red, PatchCoords.tween(sRedCoords, eRedCoords, frac)); + tweenPatch.setPatch(PatchColor.Red, PatchCoords.tween(sRedCoords, eRedCoords, tweenStyle, frac)); } { PatchCoords sGreenCoords = startPatch.getPatch(PatchColor.Green); PatchCoords eGreenCoords = endPatch.getPatch(PatchColor.Green); - tweenPatch.setPatch(PatchColor.Green, PatchCoords.tween(sGreenCoords, eGreenCoords, frac)); + tweenPatch.setPatch(PatchColor.Green, PatchCoords.tween(sGreenCoords, eGreenCoords, tweenStyle, frac)); } { PatchCoords sBlueCoords = startPatch.getPatch(PatchColor.Blue); PatchCoords eBlueCoords = endPatch.getPatch(PatchColor.Blue); - tweenPatch.setPatch(PatchColor.Blue, PatchCoords.tween(sBlueCoords, eBlueCoords, frac)); + tweenPatch.setPatch(PatchColor.Blue, PatchCoords.tween(sBlueCoords, eBlueCoords, tweenStyle, frac)); } PatchPanelMediator mediator = PatchPanelMediator.getMediator(); @@ -93,7 +93,7 @@ { PatchCoords sAlphaCoords = startPatch.getPatch(PatchColor.Alpha); PatchCoords eAlphaCoords = endPatch.getPatch(PatchColor.Alpha); - tweenPatch.setPatch(PatchColor.Alpha, PatchCoords.tween(sAlphaCoords, eAlphaCoords, frac)); + tweenPatch.setPatch(PatchColor.Alpha, PatchCoords.tween(sAlphaCoords, eAlphaCoords, tweenStyle, frac)); } return tweenPatch; } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-12-25 18:15:30 UTC (rev 253) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-12-25 18:16:48 UTC (rev 254) @@ -22,6 +22,8 @@ import java.util.Arrays; import java.util.Random; +import com.mebigfatguy.patchanim.TweenStyle; + public class PatchCoords implements Serializable, Cloneable { private static final long serialVersionUID = -4052789167154764908L; @@ -79,7 +81,7 @@ return order; } - public static PatchCoords tween(PatchCoords startCoords, PatchCoords endCoords, double frac) { + public static PatchCoords tween(PatchCoords startCoords, PatchCoords endCoords, TweenStyle tweenStyle, double frac) { PatchCoords tweenCoords = new PatchCoords(startCoords.getOrder()); for (int x = 0; x < tweenCoords.order; x++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-12-25 18:15:33
|
Revision: 253 http://patchanim.svn.sourceforge.net/patchanim/?rev=253&view=rev Author: dbrosius Date: 2008-12-25 18:15:30 +0000 (Thu, 25 Dec 2008) Log Message: ----------- push tweenStyle down to tweener Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-12-25 18:12:33 UTC (rev 252) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/CombinedPatch.java 2008-12-25 18:15:30 UTC (rev 253) @@ -24,6 +24,7 @@ import java.util.ResourceBundle; import com.mebigfatguy.patchanim.PatchColor; +import com.mebigfatguy.patchanim.TweenStyle; import com.mebigfatguy.patchanim.gui.PatchPanelMediator; import com.mebigfatguy.patchanim.main.PatchAnimBundle; @@ -69,7 +70,7 @@ return new CombinedPatch(getPatch(PatchColor.Red).getOrder(), true); } } - public static CombinedPatch tween(CombinedPatch startPatch, CombinedPatch endPatch, double frac) { + public static CombinedPatch tween(CombinedPatch startPatch, CombinedPatch endPatch, TweenStyle tweenStyle, double frac) { CombinedPatch tweenPatch = new CombinedPatch(startPatch.getPatch(PatchColor.Red).getOrder(), false); { PatchCoords sRedCoords = startPatch.getPatch(PatchColor.Red); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java 2008-12-25 18:12:33 UTC (rev 252) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchAnimator.java 2008-12-25 18:15:30 UTC (rev 253) @@ -26,13 +26,14 @@ import com.mebigfatguy.patchanim.AnimationType; import com.mebigfatguy.patchanim.OutOfBoundsColor; import com.mebigfatguy.patchanim.PatchAnimDocument; +import com.mebigfatguy.patchanim.TweenStyle; import com.mebigfatguy.patchanim.gui.events.PatchCompletionEvent; import com.mebigfatguy.patchanim.gui.events.PatchCompletionListener; public class PatchAnimator { - private Set<PatchCompletionListener> pcListeners = new HashSet<PatchCompletionListener>(); - private PatchAnimDocument document; + private final Set<PatchCompletionListener> pcListeners = new HashSet<PatchCompletionListener>(); + private final PatchAnimDocument document; public PatchAnimator(PatchAnimDocument paDocument) { document = paDocument; @@ -49,6 +50,7 @@ int tweenCount = document.getTweenCount(); OutOfBoundsColor oob = document.getOutOfBoundsColor(); AnimationType atype = document.getAnimationType(); + TweenStyle tweenStyle = document.getTweenStyle(); if (lastPatch == 0) { PatchGenerator.recalcCombinedImage(patches.get(0), image, oob); @@ -58,7 +60,7 @@ CombinedPatch startPatch = patches.get(p); CombinedPatch endPatch = patches.get(p+1); for (int t = 0; t < tweenCount + 1; t++) { - CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)(tweenCount + 1)); + CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, tweenStyle, (double)t / (double)(tweenCount + 1)); PatchGenerator.recalcCombinedImage(tweenPatch, image, oob); firePatchCompleted(image); } @@ -78,7 +80,7 @@ CombinedPatch startPatch = patches.get(lastPatch); CombinedPatch endPatch = patches.get(0); for (int t = 0; t < tweenCount + 1; t++) { - CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)(tweenCount + 1)); + CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, tweenStyle, (double)t / (double)(tweenCount + 1)); PatchGenerator.recalcCombinedImage(tweenPatch, image, oob); firePatchCompleted(image); } @@ -90,7 +92,7 @@ CombinedPatch startPatch = patches.get(p-1); CombinedPatch endPatch = patches.get(p); for (int t = tweenCount + 1; t > 0; t--) { - CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, (double)t / (double)(tweenCount + 1)); + CombinedPatch tweenPatch = CombinedPatch.tween(startPatch, endPatch, tweenStyle, (double)t / (double)(tweenCount + 1)); PatchGenerator.recalcCombinedImage(tweenPatch, image, oob); firePatchCompleted(image); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-12-25 18:12:35
|
Revision: 252 http://patchanim.svn.sourceforge.net/patchanim/?rev=252&view=rev Author: dbrosius Date: 2008-12-25 18:12:33 +0000 (Thu, 25 Dec 2008) Log Message: ----------- add TweenStyle setting (not impled yet) Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 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 trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java 2008-12-25 18:00:20 UTC (rev 251) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/PatchAnimDocument.java 2008-12-25 18:12:33 UTC (rev 252) @@ -32,14 +32,15 @@ private static final long serialVersionUID = -7412254429829665944L; private boolean dirty; - private int order; - private boolean useAlpha; + private final int order; + private final boolean useAlpha; private List<CombinedPatch> patches; private int width; private int height; private AnimationType animationType; private OutOfBoundsColor outOfBoundsColor; private int tweenCount; + private TweenStyle tweenStyle; /** * constructs a new document for the New menu item @@ -55,6 +56,7 @@ animationType = AnimationType.Wave; outOfBoundsColor = OutOfBoundsColor.Clip; tweenCount = 10; + tweenStyle = TweenStyle.Linear; } /** @@ -184,4 +186,20 @@ public void setTweenCount(int tweenCount) { this.tweenCount = tweenCount; } + + /** + * gets the algorithm used to tween between one patch and another + * @return the tween algorithm + */ + public TweenStyle getTweenStyle() { + return tweenStyle; + } + + /** + * sets the algorithm used to tween between one patch and another + * @param tweenStyle the tween algorithm + */ + public void setTweenStyle(TweenStyle tweenStyle) { + this.tweenStyle = tweenStyle; + } } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java 2008-12-25 18:00:20 UTC (rev 251) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java 2008-12-25 18:12:33 UTC (rev 252) @@ -33,7 +33,7 @@ Linear, Radial; - private static final String TWEEN = "tween."; + private static final String TWEEN = "tweenstyle."; /** * returns the localized value of the enum * @return the localized display value Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-12-25 18:00:20 UTC (rev 251) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-12-25 18:12:33 UTC (rev 252) @@ -42,6 +42,7 @@ import com.mebigfatguy.patchanim.AnimationType; import com.mebigfatguy.patchanim.OutOfBoundsColor; import com.mebigfatguy.patchanim.PatchAnimDocument; +import com.mebigfatguy.patchanim.TweenStyle; import com.mebigfatguy.patchanim.gui.events.DocumentChangedEvent; import com.mebigfatguy.patchanim.gui.events.DocumentChangedListener; import com.mebigfatguy.patchanim.main.PatchAnimBundle; @@ -56,6 +57,7 @@ private JComboBox animationCB; private JComboBox outOfBoundsColorCB; private JTextField tweenFramesField; + private JComboBox tweenStyleCB; private JButton testButton; public JPatchControlPanel() { @@ -73,6 +75,7 @@ JLabel animationLabel; JLabel outOfBoundsLabel; JLabel tweenFramesLabel; + JLabel tweenStyleLabel; { widthLabel = new JLabel(rb.getString(PatchAnimBundle.WIDTH)); @@ -132,13 +135,23 @@ add(p); } add(Box.createVerticalStrut(5)); + { + tweenStyleLabel = new JLabel(rb.getString(PatchAnimBundle.TWEENSTYLE)); + tweenStyleCB = new JComboBox(new Object[] { TweenStyle.Linear, + TweenStyle.Radial }); + tweenStyleCB.setToolTipText(rb.getString(PatchAnimBundle.TWEENSTYLE_TT)); + outOfBoundsLabel.setLabelFor(tweenStyleCB); + JPanel p = Utils.createFormPanel(tweenStyleLabel, tweenStyleCB); + Utils.limitPanelHeight(p, tweenStyleCB); + add(p); + } testButton = new JButton(rb.getString(PatchAnimBundle.TEST)); testButton.setToolTipText(rb.getString(PatchAnimBundle.TEST_TT)); add(testButton); - Utils.sizeUniformly(Utils.Sizing.Both, widthLabel, heightLabel, animationLabel, outOfBoundsLabel, tweenFramesLabel); - Utils.sizeUniformly(Utils.Sizing.Width, new JComponent[] { widthField, heightField, animationCB, outOfBoundsColorCB, tweenFramesField }); + Utils.sizeUniformly(Utils.Sizing.Both, widthLabel, heightLabel, animationLabel, outOfBoundsLabel, tweenFramesLabel, tweenStyleLabel); + Utils.sizeUniformly(Utils.Sizing.Width, new JComponent[] { widthField, heightField, animationCB, outOfBoundsColorCB, tweenFramesField, tweenStyleCB }); add(Box.createVerticalGlue()); @@ -160,6 +173,7 @@ animationCB.setSelectedIndex(document.getAnimationType().ordinal()); outOfBoundsColorCB.setSelectedIndex(document.getOutOfBoundsColor().ordinal()); tweenFramesField.setText(String.valueOf(document.getTweenCount())); + tweenStyleCB.setSelectedIndex(document.getTweenStyle().ordinal()); } }); } @@ -263,6 +277,17 @@ } }); + tweenStyleCB.addItemListener(new ItemListener() { + + public void itemStateChanged(ItemEvent ie) { + if (ie.getStateChange() == ItemEvent.SELECTED) { + document.setTweenStyle((TweenStyle)ie.getItem()); + PatchPanelMediator mediator = PatchPanelMediator.getMediator(); + mediator.fireSettingsChanged(); + } + } + }); + testButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { JTestFrame tf = new JTestFrame(); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-12-25 18:00:20 UTC (rev 251) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsd 2008-12-25 18:12:33 UTC (rev 252) @@ -34,6 +34,7 @@ <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:attribute name="tweenStyle" type="xsd:TweenStyleClass" use="required"/> </xsd:complexType> <xsd:simpleType name="AnimationTypeClass"> <xsd:restriction base="xsd:string"> @@ -57,6 +58,12 @@ <xsd:enumeration value="Alpha"/> </xsd:restriction> </xsd:simpleType> + <xsd:simpleType name="TweenStyleClass"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Linear"/> + <xsd:enumeration value="Radial"/> + </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"/> Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl 2008-12-25 18:00:20 UTC (rev 251) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimDoc.xsl 2008-12-25 18:12:33 UTC (rev 252) @@ -58,6 +58,9 @@ <xsl:attribute name="tweenCount"> <xsl:value-of select="pae:getTweenCount($ext)"/> </xsl:attribute> + <xsl:attribute name="tweenStyle"> + <xsl:value-of select="pae:getTweenStyle($ext)"/> + </xsl:attribute> </Settings> <Patches> <xsl:for-each select="pae:getPatches($ext)"> Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java 2008-12-25 18:00:20 UTC (rev 251) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimExtension.java 2008-12-25 18:12:33 UTC (rev 252) @@ -37,8 +37,8 @@ public class PatchAnimExtension { private static final String VERSION_URL = "/com/mebigfatguy/patchanim/io/Version.txt"; - private PatchAnimDocument paDoc; - private Document d; + private final PatchAnimDocument paDoc; + private final Document d; public PatchAnimExtension(PatchAnimDocument doc) throws ParserConfigurationException { paDoc = doc; @@ -82,6 +82,10 @@ public String getTweenCount(@SuppressWarnings("unused") ExpressionContext context) { return String.valueOf(paDoc.getTweenCount()); } + + public String getTweenStyle(@SuppressWarnings("unused") ExpressionContext context) { + return String.valueOf(paDoc.getTweenStyle()); + } public String useAlpha(@SuppressWarnings("unused") ExpressionContext context) { return String.valueOf(paDoc.useAlpha()); Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-12-25 18:00:20 UTC (rev 251) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-12-25 18:12:33 UTC (rev 252) @@ -46,6 +46,7 @@ import com.mebigfatguy.patchanim.OutOfBoundsColor; import com.mebigfatguy.patchanim.PatchAnimDocument; import com.mebigfatguy.patchanim.PatchColor; +import com.mebigfatguy.patchanim.TweenStyle; import com.mebigfatguy.patchanim.surface.CombinedPatch; import com.mebigfatguy.patchanim.surface.Coordinate; import com.mebigfatguy.patchanim.surface.PatchCoords; @@ -121,6 +122,7 @@ private static final String ANIMATIONTYPE = "animationType"; private static final String OUTOFBOUNDSCOLOR = "outOfBoundsColor"; private static final String TWEENCOUNT = "tweenCount"; + private static final String TWEENSTYLE = "tweenStyle"; private static final String COMBINEDPATCH = "CombinedPatch"; private static final String PATCH = "Patch"; private static final String COLOR = "color"; @@ -147,6 +149,7 @@ 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))); + doc.setTweenStyle(TweenStyle.valueOf(TweenStyle.class, atts.getValue(TWEENSTYLE))); } else if (COMBINEDPATCH.equals(localName)) { cPatch = new CombinedPatch(doc.getOrder(), false); } else if (PATCH.equals(localName)) { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-12-25 18:00:20 UTC (rev 251) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-12-25 18:12:33 UTC (rev 252) @@ -70,6 +70,8 @@ public static final String OOBWAVE = "patchanim.oob.wave"; public static final String TWEENFRAMES = "patchanim.tween"; public static final String TWEENFRAMES_TT = "patchanim.tooltip.tween"; + public static final String TWEENSTYLE = "patchanim.tweenstyle"; + public static final String TWEENSTYLE_TT = "patchanim.tooltip.tweenstyle"; public static final String TEST = "patchanim.test"; public static final String TEST_TT = "patchanim.tooltip.test"; public static final String STOP = "patchanim.stop"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-12-25 18:00:20 UTC (rev 251) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-12-25 18:12:33 UTC (rev 252) @@ -63,6 +63,10 @@ patchanim.oob.wave = Wave patchanim.tween = In-between frames patchanim.tooltip.tween = How many frames are generated as transitions from one patch to the next +patchanim.tweenstyle = Tween Style +patchanim.tooltip.tweenstyle = The algorithm used to transition from one patch to another +patchanim.tweenstyle.linear = Linear +patchanim.tweenstyle.radial = Radial patchanim.test = Test patchanim.tooltip.test = Test the animation using the export settings patchanim.stop = Stop This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-12-25 18:00:24
|
Revision: 251 http://patchanim.svn.sourceforge.net/patchanim/?rev=251&view=rev Author: dbrosius Date: 2008-12-25 18:00:20 +0000 (Thu, 25 Dec 2008) Log Message: ----------- an enum that describes how to tween one patch into another Added Paths: ----------- trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java Added: trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java 2008-12-25 18:00:20 UTC (rev 251) @@ -0,0 +1,46 @@ +/* + * 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; + +import java.util.ResourceBundle; + +import com.mebigfatguy.patchanim.main.PatchAnimBundle; + +/** + * denotes the algorithm to use to tween two patches + * <ul> + * <li><b>Linear</b> Control points are tweened linearly</li> + * <li><b>Radial</b> Control points are tweened radially</li> + * </ul> + */ +public enum TweenStyle { + Linear, + Radial; + + private static final String TWEEN = "tween."; + /** + * returns the localized value of the enum + * @return the localized display value + */ + @Override + public String toString() { + ResourceBundle rb = PatchAnimBundle.getBundle(); + return rb.getString(PatchAnimBundle.ROOT + TWEEN + name().toLowerCase()); + } +} Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/TweenStyle.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-12-25 17:46:47
|
Revision: 250 http://patchanim.svn.sourceforge.net/patchanim/?rev=250&view=rev Author: dbrosius Date: 2008-12-25 17:46:43 +0000 (Thu, 25 Dec 2008) Log Message: ----------- add a focus listener so that when the test frame losses focus it closes. (As you could break stuff if you remove patches in the main window [index out of bounds exceptions]) Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JTestFrame.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JTestFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JTestFrame.java 2008-12-25 17:40:56 UTC (rev 249) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JTestFrame.java 2008-12-25 17:46:43 UTC (rev 250) @@ -21,6 +21,8 @@ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Graphics; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.image.BufferedImage; @@ -44,7 +46,7 @@ private transient Thread animThread = null; private TestPanel testPanel = null; - private PatchAnimDocument document; + private final PatchAnimDocument document; private long lastRedraw; public JTestFrame() { @@ -115,6 +117,15 @@ dispose(); } }); + + this.addFocusListener(new FocusAdapter() { + @Override + public void focusLost(FocusEvent e) { + super.focusLost(e); + endAnimation(); + dispose(); + } + }); } class TestPanel extends JPanel { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-12-25 17:40:59
|
Revision: 249 http://patchanim.svn.sourceforge.net/patchanim/?rev=249&view=rev Author: dbrosius Date: 2008-12-25 17:40:56 +0000 (Thu, 25 Dec 2008) Log Message: ----------- make the test frame always on top Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-06-07 22:57:14 UTC (rev 248) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-12-25 17:40:56 UTC (rev 249) @@ -268,6 +268,7 @@ JTestFrame tf = new JTestFrame(); tf.setLocationRelativeTo(JPatchControlPanel.this.getRootPane()); tf.setVisible(true); + tf.setAlwaysOnTop(true); tf.beginAnimation(); } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-06-08 00:11:14
|
Revision: 244 http://patchanim.svn.sourceforge.net/patchanim/?rev=244&view=rev Author: dbrosius Date: 2008-06-07 15:48:31 -0700 (Sat, 07 Jun 2008) Log Message: ----------- PRMC fix Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-06-07 22:46:22 UTC (rev 243) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/surface/PatchCoords.java 2008-06-07 22:48:31 UTC (rev 244) @@ -86,7 +86,8 @@ for (int y = 0; y < tweenCoords.order; y++) { Coordinate startC = startCoords.getCoordinate(x,y); Coordinate endC = endCoords.getCoordinate(x,y); - int tweenColor = (int)(startC.getColor() + (endC.getColor() - startC.getColor()) * frac); + double startColor = startC.getColor(); + int tweenColor = (int)(startColor + (endC.getColor() - startColor) * frac); Coordinate tweenC = new Coordinate(startC.getX(), endC.getY(), tweenColor); tweenCoords.setCoordinate(x, y, tweenC); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-06-07 23:35:39
|
Revision: 245 http://patchanim.svn.sourceforge.net/patchanim/?rev=245&view=rev Author: dbrosius Date: 2008-06-07 15:49:56 -0700 (Sat, 07 Jun 2008) Log Message: ----------- PRMC 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-06-07 22:48:31 UTC (rev 244) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchListPanel.java 2008-06-07 22:49:56 UTC (rev 245) @@ -90,8 +90,9 @@ add(modCtrls, BorderLayout.SOUTH); JPanel moveCtrls = new JPanel(); - upButton = new JButton(new ImageIcon(getClass().getResource(UPBUTTON))); - downButton = new JButton(new ImageIcon(getClass().getResource(DOWNBUTTON))); + Class<?> panelClass = getClass(); + upButton = new JButton(new ImageIcon(panelClass.getResource(UPBUTTON))); + downButton = new JButton(new ImageIcon(panelClass.getResource(DOWNBUTTON))); upButton.setEnabled(false); downButton.setEnabled(false); Utils.sizeUniformly(Utils.Sizing.Both, new JComponent[] {upButton, downButton}); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-06-07 23:02:51
|
Revision: 243 http://patchanim.svn.sourceforge.net/patchanim/?rev=243&view=rev Author: dbrosius Date: 2008-06-07 15:46:22 -0700 (Sat, 07 Jun 2008) Log Message: ----------- fb fix (NP) Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-06-07 22:38:55 UTC (rev 242) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-06-07 22:46:22 UTC (rev 243) @@ -543,6 +543,9 @@ case Up: srcC = srcCoords.getCoordinate(i, (j + 1) % order); break; + + default: + return; } c.setColor(srcC.getColor()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-06-07 22:58:32
|
Revision: 248 http://patchanim.svn.sourceforge.net/patchanim/?rev=248&view=rev Author: dbrosius Date: 2008-06-07 15:57:14 -0700 (Sat, 07 Jun 2008) Log Message: ----------- WEM fixes Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-06-07 22:53:31 UTC (rev 247) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-06-07 22:57:14 UTC (rev 248) @@ -75,7 +75,7 @@ } catch (IOException ioe) { throw ioe; } catch (Exception e) { - IOException ioe = new IOException("Failed saving document"); + IOException ioe = new IOException("Failed saving document " + f.getPath()); ioe.initCause(e); throw ioe; } finally { @@ -104,7 +104,7 @@ } catch (IOException ioe) { throw ioe; } catch (Exception e) { - IOException ioe = new IOException("Failed loading document"); + IOException ioe = new IOException("Failed loading document " + f.getPath()); ioe.initCause(e); throw ioe; } finally { Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-06-07 22:53:31 UTC (rev 247) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-06-07 22:57:14 UTC (rev 248) @@ -131,7 +131,7 @@ try { writeSingleFile(pce.getImage(), imageIndex++, loc, baseName, type); } catch (IOException ioe) { - InterruptedException ie = new InterruptedException("Failed saving animation"); + InterruptedException ie = new InterruptedException("Failed saving animation at index " + (imageIndex-1)); ie.initCause(ioe); throw ie; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-06-07 22:53:22
|
Revision: 247 http://patchanim.svn.sourceforge.net/patchanim/?rev=247&view=rev Author: dbrosius Date: 2008-06-07 15:53:31 -0700 (Sat, 07 Jun 2008) Log Message: ----------- Se fixes Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JTestFrame.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-06-07 22:51:14 UTC (rev 246) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JColorControlPatchPanel.java 2008-06-07 22:53:31 UTC (rev 247) @@ -53,7 +53,7 @@ private JPatchSamplePanel sample; private JLabel colorLabel; private JTextField colorField; - private ValueDocumentListener docListener = new ValueDocumentListener(); + private transient ValueDocumentListener docListener = new ValueDocumentListener(); private int selectedXPt; private int selectedYPt; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-06-07 22:51:14 UTC (rev 246) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchSamplePanel.java 2008-06-07 22:53:31 UTC (rev 247) @@ -64,9 +64,9 @@ private PatchColor color; private Color rgb; private OutOfBoundsColor oob; - private BufferedImage image; + private transient BufferedImage image; private PatchDecorator decorator; - private Thread redrawThread = null; + private transient Thread redrawThread = null; private Object redrawLock = new Object(); private boolean redrawing = false; private boolean dragging = false; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JTestFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JTestFrame.java 2008-06-07 22:51:14 UTC (rev 246) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JTestFrame.java 2008-06-07 22:53:31 UTC (rev 247) @@ -42,7 +42,7 @@ private static final long serialVersionUID = -7975149184522257748L; - private Thread animThread = null; + private transient Thread animThread = null; private TestPanel testPanel = null; private PatchAnimDocument document; private long lastRedraw; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-06-07 22:51:13
|
Revision: 246 http://patchanim.svn.sourceforge.net/patchanim/?rev=246&view=rev Author: dbrosius Date: 2008-06-07 15:51:14 -0700 (Sat, 07 Jun 2008) Log Message: ----------- be specific about the exceptions being caught 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-06-07 22:49:56 UTC (rev 245) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-06-07 22:51:14 UTC (rev 246) @@ -350,7 +350,7 @@ documentLocation = chooser.getSelectedFile(); document = PatchAnimIO.loadFile(documentLocation); } - } catch (Exception e) { + } catch (IOException e) { ResourceBundle rb = PatchAnimBundle.getBundle(); JOptionPane.showMessageDialog(JPatchAnimFrame.this, rb.getString(PatchAnimBundle.LOADFAILED)); documentLocation = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-06-07 22:38:47
|
Revision: 242 http://patchanim.svn.sourceforge.net/patchanim/?rev=242&view=rev Author: dbrosius Date: 2008-06-07 15:38:55 -0700 (Sat, 07 Jun 2008) Log Message: ----------- DLS 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-05-31 18:20:23 UTC (rev 241) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-06-07 22:38:55 UTC (rev 242) @@ -159,7 +159,6 @@ int order = doc.getOrder(); patchCoords.setCoordinate(coordIndex % order, coordIndex / order, c); coordIndex++; - c = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-05-31 18:20:19
|
Revision: 241 http://patchanim.svn.sourceforge.net/patchanim/?rev=241&view=rev Author: dbrosius Date: 2008-05-31 11:20:23 -0700 (Sat, 31 May 2008) Log Message: ----------- Tag version 1.2.0 Added Paths: ----------- tags/patchanim/v1_2_0/ Copied: tags/patchanim/v1_2_0 (from rev 240, trunk/patchanim) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-05-31 18:00:27
|
Revision: 240 http://patchanim.svn.sourceforge.net/patchanim/?rev=240&view=rev Author: dbrosius Date: 2008-05-31 11:00:35 -0700 (Sat, 31 May 2008) Log Message: ----------- update to 1.2 for release Modified Paths: -------------- trunk/patchanim/build.xml Modified: trunk/patchanim/build.xml =================================================================== --- trunk/patchanim/build.xml 2008-05-31 17:59:32 UTC (rev 239) +++ trunk/patchanim/build.xml 2008-05-31 18:00:35 UTC (rev 240) @@ -35,7 +35,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="patchanim.version" value="1.1.0"/> + <property name="patchanim.version" value="1.2.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-05-31 17:59:25
|
Revision: 239 http://patchanim.svn.sourceforge.net/patchanim/?rev=239&view=rev Author: dbrosius Date: 2008-05-31 10:59:32 -0700 (Sat, 31 May 2008) Log Message: ----------- update store Modified Paths: -------------- trunk/patchanim/patchanim.store Modified: trunk/patchanim/patchanim.store =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 16:07:22
|
Revision: 238 http://patchanim.svn.sourceforge.net/patchanim/?rev=238&view=rev Author: dbrosius Date: 2008-02-24 08:07:24 -0800 (Sun, 24 Feb 2008) Log Message: ----------- put file filter string in resources strings Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchAnimFileFilter.java trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchAnimFileFilter.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchAnimFileFilter.java 2008-02-24 16:05:05 UTC (rev 237) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchAnimFileFilter.java 2008-02-24 16:07:24 UTC (rev 238) @@ -19,9 +19,12 @@ package com.mebigfatguy.patchanim.gui; import java.io.File; +import java.util.ResourceBundle; import javax.swing.filechooser.FileFilter; +import com.mebigfatguy.patchanim.main.PatchAnimBundle; + public class PatchAnimFileFilter extends FileFilter { @Override public boolean accept(File f) { @@ -32,6 +35,7 @@ @Override public String getDescription() { - return "PatchAnim Files (*.paf)"; + ResourceBundle rb = PatchAnimBundle.getBundle(); + return rb.getString(PatchAnimBundle.FILEFILTER); } } Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-24 16:05:05 UTC (rev 237) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/main/PatchAnimBundle.java 2008-02-24 16:07:24 UTC (rev 238) @@ -31,6 +31,7 @@ public static final String OPEN = "patchanim.open"; public static final String SAVE = "patchanim.save"; public static final String SAVEAS = "patchanim.saveas"; + public static final String FILEFILTER = "patchanim.patchanimfilter"; public static final String EXPORT = "patchanim.export"; public static final String JPGSERIES = "patchanim.jpgs"; public static final String JPGSERIESFILTER = "patchanim.filter.jpgs"; Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-24 16:05:05 UTC (rev 237) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/resources.properties 2008-02-24 16:07:24 UTC (rev 238) @@ -24,6 +24,7 @@ patchanim.open = Open... patchanim.save = Save patchanim.saveas = Save As... +patchanim.patchanimfilter = PatchAnim Files (*.paf) patchanim.export = Export As... patchanim.jpgs = a series of JPGs patchanim.filter.jpgs = Files (*.jpg) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 16:05:01
|
Revision: 237 http://patchanim.svn.sourceforge.net/patchanim/?rev=237&view=rev Author: dbrosius Date: 2008-02-24 08:05:05 -0800 (Sun, 24 Feb 2008) Log Message: ----------- split out file filter to separate class, and use in save dialog as well. Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java Added Paths: ----------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchAnimFileFilter.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-24 16:01:04 UTC (rev 236) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimFrame.java 2008-02-24 16:05:05 UTC (rev 237) @@ -343,20 +343,7 @@ try { JFileChooser chooser = new JFileChooser(); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - chooser.setFileFilter(new FileFilter() { - - @Override - public boolean accept(File f) { - if (f.isDirectory()) - return true; - return (f.getPath().endsWith("paf")); - } - - @Override - public String getDescription() { - return "PatchAnim Files (*.paf)"; - } - }); + chooser.setFileFilter(new PatchAnimFileFilter()); chooser.setCurrentDirectory(new File(System.getProperty("user.dir"))); int option = chooser.showOpenDialog(JPatchAnimFrame.this); if (option == JFileChooser.APPROVE_OPTION) { @@ -385,6 +372,7 @@ defLocation = documentLocation.getParentFile(); chooser.setCurrentDirectory(defLocation); + chooser.setFileFilter(new PatchAnimFileFilter()); int option = chooser.showSaveDialog(JPatchAnimFrame.this); if (option == JFileChooser.APPROVE_OPTION) { String path = chooser.getSelectedFile().getPath(); Added: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchAnimFileFilter.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchAnimFileFilter.java (rev 0) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchAnimFileFilter.java 2008-02-24 16:05:05 UTC (rev 237) @@ -0,0 +1,37 @@ +/* + * 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.gui; + +import java.io.File; + +import javax.swing.filechooser.FileFilter; + +public class PatchAnimFileFilter extends FileFilter { + @Override + public boolean accept(File f) { + if (f.isDirectory()) + return true; + return (f.getPath().endsWith("paf")); + } + + @Override + public String getDescription() { + return "PatchAnim Files (*.paf)"; + } +} Property changes on: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/PatchAnimFileFilter.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 16:01:01
|
Revision: 236 http://patchanim.svn.sourceforge.net/patchanim/?rev=236&view=rev Author: dbrosius Date: 2008-02-24 08:01:04 -0800 (Sun, 24 Feb 2008) Log Message: ----------- use save safe file idiom 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-24 15:38:47 UTC (rev 235) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchAnimIO.java 2008-02-24 16:01:04 UTC (rev 236) @@ -60,18 +60,18 @@ public static void saveFile(File f, PatchAnimDocument document) throws IOException { InputStream xslIs = null; OutputStream xmlOs = null; + File temporary = File.createTempFile("patchanim", "paf", f.getParentFile()); try { - document.setDirty(false); - 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)); + xmlOs = new BufferedOutputStream(new FileOutputStream(temporary)); t.setParameter("doc", document); t.transform(new DOMSource(d), new StreamResult(xmlOs)); + document.setDirty(false); } catch (IOException ioe) { throw ioe; } catch (Exception e) { @@ -81,6 +81,9 @@ } finally { Closer.close(xslIs); Closer.close(xmlOs); + f.delete(); + if (!temporary.renameTo(f)) + throw new IOException("Failed saving file " + f.getPath()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 15:38:47
|
Revision: 235 http://patchanim.svn.sourceforge.net/patchanim/?rev=235&view=rev Author: dbrosius Date: 2008-02-24 07:38:47 -0800 (Sun, 24 Feb 2008) Log Message: ----------- throw exception if you can't create export directory Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-24 15:32:21 UTC (rev 234) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/io/PatchExporter.java 2008-02-24 15:38:47 UTC (rev 235) @@ -72,7 +72,8 @@ try { baseName = loc.getName(); if (type.isMultipleFiles()) { - loc.mkdir(); + if (!loc.mkdir()) + throw new IOException("Failed to create directory " + loc.getName()); } else { loc = loc.getParentFile(); String dotExt = "." + type.getExtension(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 15:32:15
|
Revision: 234 http://patchanim.svn.sourceforge.net/patchanim/?rev=234&view=rev Author: dbrosius Date: 2008-02-24 07:32:21 -0800 (Sun, 24 Feb 2008) Log Message: ----------- section 508 compliance Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/NewDocumentDialog.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/NewDocumentDialog.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/NewDocumentDialog.java 2008-02-24 15:30:36 UTC (rev 233) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/NewDocumentDialog.java 2008-02-24 15:32:21 UTC (rev 234) @@ -67,6 +67,7 @@ Integer.valueOf(7), Integer.valueOf(8), Integer.valueOf(9) }); + orderLabel.setLabelFor(orderCombo); orderCombo.setSelectedItem(Integer.valueOf(4)); JPanel p = 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-24 15:30:31
|
Revision: 233 http://patchanim.svn.sourceforge.net/patchanim/?rev=233&view=rev Author: dbrosius Date: 2008-02-24 07:30:36 -0800 (Sun, 24 Feb 2008) Log Message: ----------- PCOA fixes Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java 2008-02-24 15:29:54 UTC (rev 232) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java 2008-02-24 15:30:36 UTC (rev 233) @@ -55,7 +55,7 @@ }); } - public void rebuild(final boolean useAlpha) { + public final void rebuild(final boolean useAlpha) { SwingUtilities.invokeLater(new Runnable() { public void run() { Container c = SourcePatchesPanel.this.getParent(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 15:29:51
|
Revision: 232 http://patchanim.svn.sourceforge.net/patchanim/?rev=232&view=rev Author: dbrosius Date: 2008-02-24 07:29:54 -0800 (Sun, 24 Feb 2008) Log Message: ----------- remove unneeded member variable Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java 2008-02-24 15:28:32 UTC (rev 231) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/SourcePatchesPanel.java 2008-02-24 15:29:54 UTC (rev 232) @@ -31,9 +31,8 @@ public class SourcePatchesPanel extends JPanel { - private static final long serialVersionUID = 4186927445084750958L; + private static final long serialVersionUID = -6986592027015551508L; - private boolean useAlpha; JColorControlPatchPanel redPatch; JColorControlPatchPanel greenPatch; JColorControlPatchPanel bluePatch; @@ -41,14 +40,12 @@ public SourcePatchesPanel() { - useAlpha = false; - redPatch = new JColorControlPatchPanel(PatchColor.Red); greenPatch = new JColorControlPatchPanel(PatchColor.Green); bluePatch = new JColorControlPatchPanel(PatchColor.Blue); alphaPatch = new JColorControlPatchPanel(PatchColor.Alpha); - rebuild(useAlpha); + rebuild(false); PatchPanelMediator mediator = PatchPanelMediator.getMediator(); mediator.addDocumentChangedListener(new DocumentChangedListener() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2008-02-24 15:28:27
|
Revision: 231 http://patchanim.svn.sourceforge.net/patchanim/?rev=231&view=rev Author: dbrosius Date: 2008-02-24 07:28:32 -0800 (Sun, 24 Feb 2008) Log Message: ----------- FCBL fixes 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-24 15:26:52 UTC (rev 230) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchAnimPanel.java 2008-02-24 15:28:32 UTC (rev 231) @@ -31,8 +31,6 @@ private static final long serialVersionUID = 3030850111559417377L; - private SourcePatchesPanel sourcesPanel; - public JPatchAnimPanel() { initComponents(); } @@ -61,7 +59,7 @@ Utils.sizeUniformly(Utils.Sizing.Width, ctrl, listPanel ); - sourcesPanel = new SourcePatchesPanel(); + SourcePatchesPanel sourcesPanel = new SourcePatchesPanel(); p.add(sourcesPanel, BorderLayout.CENTER); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |