diff --git a/core/src/build/conf/checkstyle.xml b/core/src/build/conf/checkstyle.xml
index a08dbad..d23ff3c 100644
--- a/core/src/build/conf/checkstyle.xml
+++ b/core/src/build/conf/checkstyle.xml
@@ -161,7 +161,7 @@
+ * Create a new PColorActivity. * * @param duration the length of one loop of the activity * @param stepRate the amount of time between steps of the activity @@ -112,6 +111,10 @@ destination = newDestination; } + /** + * Overrides it's parent to ensure that the source color is the color of the + * node being animated. + */ protected void activityStarted() { if (getFirstLoop()) { source = target.getColor(); @@ -119,6 +122,11 @@ super.activityStarted(); } + /** + * Interpolates the target node's color by mixing the source color and the destination color. + * + * @param zeroToOne 0 = all source color, 1 = all destination color + */ public void setRelativeTargetValue(final float zeroToOne) { super.setRelativeTargetValue(zeroToOne); final float red = source.getRed() + zeroToOne * (destination.getRed() - source.getRed()); diff --git a/core/src/main/java/edu/umd/cs/piccolo/activities/PInterpolatingActivity.java b/core/src/main/java/edu/umd/cs/piccolo/activities/PInterpolatingActivity.java index 364d76f..0c78074 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/activities/PInterpolatingActivity.java +++ b/core/src/main/java/edu/umd/cs/piccolo/activities/PInterpolatingActivity.java @@ -46,8 +46,22 @@ */ public class PInterpolatingActivity extends PActivity { + /** + * Specifies that interpolation will be from the source value to the + * destination value. + */ public static final int SOURCE_TO_DESTINATION = 1; + + /** + * Specifies that interpolation will be from the destination value to the + * source value. + */ public static final int DESTINATION_TO_SOURCE = 2; + + /** + * Specifies that interpolation proceed from the source to the destination + * then back to the source. Can be used to perform flashes. source value. + */ public static final int SOURCE_TO_DESTINATION_TO_SOURCE = 3; private int mode; @@ -118,6 +132,8 @@ /** * Return the number of times the activity should automatically reschedule * itself after it has finished. + * + * @return number of times to repeat this activity */ public int getLoopCount() { return loopCount; @@ -126,6 +142,8 @@ /** * Set the number of times the activity should automatically reschedule * itself after it has finished. + * + * @param loopCount number of times to repeat this activity */ public void setLoopCount(final int loopCount) { this.loopCount = loopCount; @@ -134,6 +152,8 @@ /** * Return true if the activity is executing its first loop. Subclasses * normally initialize their source state on the first loop. + * + * @return true if executing first loop */ public boolean getFirstLoop() { return firstLoop; @@ -143,15 +163,30 @@ * Set if the activity is executing its first loop. Subclasses normally * initialize their source state on the first loop. This method will rarely * need to be called, unless your are reusing activities. + * + * @param firstLoop true if executing first loop */ public void setFirstLoop(final boolean firstLoop) { this.firstLoop = firstLoop; } + /** + * Returns whether this interpolation accelerates and then decelerates as it + * interpolates. + * + * @return true if accelerations are being applied apply + */ public boolean getSlowInSlowOut() { return slowInSlowOut; } + /** + * Sets whether this interpolation accelerates and then decelerates as it + * interpolates. + * + * @param isSlowInSlowOut true if this interpolation inovolves some + * accelerations + */ public void setSlowInSlowOut(final boolean isSlowInSlowOut) { slowInSlowOut = isSlowInSlowOut; } @@ -226,6 +261,11 @@ } } + /** + * Computes relative target value taking the mode into account. + * + * @param zeroToOne Percentage of activity completed + */ protected void setRelativeTargetValueAdjustingForMode(float zeroToOne) { switch (mode) { case SOURCE_TO_DESTINATION: