// Path: src/main/java/com/readytalk/swt/helpers/DebugHelper.java
// public class DebugHelper {
//   private static final String NEWLINE = System.getProperty("line.separator");
// 
//   /**
//    * Get the stack trace from a Throwable exception as a String. Useful in printing log statements.
//    * @param t The <code>Throwable</code> that you want to extract the stacktrace from
//    * @return The extracted stacktrace
//    */
//   public static String getStackTraceAsString(Throwable t) {
//     StringBuilder buffer = new StringBuilder();
// 
//     for(StackTraceElement ste : t.getStackTrace()) {
//       buffer.append(ste + NEWLINE);
//     }
// 
//     return buffer.toString();
//   }
// }
// 
// Path: src/main/java/com/readytalk/swt/util/Executor.java
// public interface Executor {
//   public void timerExec(final int time, final Runnable runnable);
//   public void asyncExec(Runnable runnable);
// }


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;
import com.readytalk.swt.helpers.DebugHelper;
import com.readytalk.swt.util.Executor;
import org.eclipse.swt.widgets.Display;
package com.readytalk.swt.effects;



public abstract class LinkableEffect implements Runnable {
  private static final Logger log = Logger.getLogger(LinkableEffect.class.getName());
  private static final int DEFAULT_TIME_INTERVAL = 10;
  protected List<LinkableEffect> effectList;
  protected Executor executor;
  protected int timeInterval;
  protected boolean continueEffects = true;

  protected EffectAbortedCallback effectAbortedCallback;

  /**
   * this determines when all effects have executed and we need to stop.  it will reset when startEffect is called again
   */
  private int effectCompleteCount;

  public LinkableEffect(LinkableEffect parent, Executor executor, int timeInterval, LinkableEffect ... linkableEffects)
          throws InvalidEffectArgumentException {

    if(parent != null) {
      parent.linkEffect(this);
    } else {
      this.timeInterval = (timeInterval == 0) ? DEFAULT_TIME_INTERVAL : timeInterval;

      if(executor == null) {
// Path: src/main/java/com/readytalk/swt/helpers/DebugHelper.java
// public class DebugHelper {
//   private static final String NEWLINE = System.getProperty("line.separator");
// 
//   /**
//    * Get the stack trace from a Throwable exception as a String. Useful in printing log statements.
//    * @param t The <code>Throwable</code> that you want to extract the stacktrace from
//    * @return The extracted stacktrace
//    */
//   public static String getStackTraceAsString(Throwable t) {
//     StringBuilder buffer = new StringBuilder();
// 
//     for(StackTraceElement ste : t.getStackTrace()) {
//       buffer.append(ste + NEWLINE);
//     }
// 
//     return buffer.toString();
//   }
// }
// 
// Path: src/main/java/com/readytalk/swt/util/Executor.java
// public interface Executor {
//   public void timerExec(final int time, final Runnable runnable);
//   public void asyncExec(Runnable runnable);
// }


// Path: src/main/java/com/readytalk/swt/effects/LinkableEffect.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;
import com.readytalk.swt.helpers.DebugHelper;
import com.readytalk.swt.util.Executor;
import org.eclipse.swt.widgets.Display;

package com.readytalk.swt.effects;



public abstract class LinkableEffect implements Runnable {
  private static final Logger log = Logger.getLogger(LinkableEffect.class.getName());
  private static final int DEFAULT_TIME_INTERVAL = 10;
  protected List<LinkableEffect> effectList;
  protected Executor executor;
  protected int timeInterval;
  protected boolean continueEffects = true;

  protected EffectAbortedCallback effectAbortedCallback;

  /**
   * this determines when all effects have executed and we need to stop.  it will reset when startEffect is called again
   */
  private int effectCompleteCount;

  public LinkableEffect(LinkableEffect parent, Executor executor, int timeInterval, LinkableEffect ... linkableEffects)
          throws InvalidEffectArgumentException {

    if(parent != null) {
      parent.linkEffect(this);
    } else {
      this.timeInterval = (timeInterval == 0) ? DEFAULT_TIME_INTERVAL : timeInterval;

      if(executor == null) {
        executor = new Executor() {