Thread: [Patchanim-commit] SF.net SVN: patchanim:[253] trunk/patchanim/src/com/mebigfatguy/patchanim/ surfa
Brought to you by:
dbrosius
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: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. |