// Path: src/main/java/com/googlecode/eckoit/events/ScreenGrabFinishEvent.java
// public class ScreenGrabFinishEvent {
// 
// }
// 
// Path: src/main/java/com/googlecode/eckoit/events/ScreenGrabStartEvent.java
// public class ScreenGrabStartEvent {
//     private File storageDir;
//     private long intervalInMilli;
//     private boolean presentationMode = false;
//     
//     public ScreenGrabStartEvent(File storageDir) {
//         this.storageDir = storageDir;
//         intervalInMilli = 5000; // default to 5 seconds
//     }
//     public ScreenGrabStartEvent(File storageDir, long intervalInMilli) {
//         this.storageDir = storageDir;
//         this.intervalInMilli = intervalInMilli; 
//     }
//     public ScreenGrabStartEvent(File storageDir, boolean presentationMode) {
//         this.storageDir = storageDir;
//         this.presentationMode = presentationMode;
//     }
//     public long getIntervalInMilli(){
//         return this.intervalInMilli;
//     }
//     
//     public File getStorageDir() {
//         return storageDir;
//     }
// 
//     public boolean getPresentationMode() {
//         return presentationMode;
//     }
// 
// }
// 
// Path: src/main/java/com/googlecode/eckoit/events/TargetClickedEvent.java
// public class TargetClickedEvent {
// 
// }


import com.github.couchapptakeout.events.ExitApplicationMessage;
import com.googlecode.eckoit.events.ScreenGrabFinishEvent;
import com.googlecode.eckoit.events.ScreenGrabStartEvent;
import com.googlecode.eckoit.events.TargetClickedEvent;
import java.awt.AWTException;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.InputEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import org.bushe.swing.event.EventBus;
import org.bushe.swing.event.EventSubscriber;

                }
            }

        });


        EventBus.subscribeStrongly(ScreenGrabStartEvent.class, new EventSubscriber<ScreenGrabStartEvent>() {
            @Override
            public void onEvent(ScreenGrabStartEvent t) {
                currentDir = t.getStorageDir();
                
                if (t.getPresentationMode()) {
                    inPresentationMode = true;
                    capture();
                } else {
                    if (timer != null) {
                        timer.cancel();
                    }
                    timer = new Timer();
                    
                    timer.schedule(new TimerTask() {
                        @Override
                        public void run() {
                            capture();
                        }
                    }, t.getIntervalInMilli(), t.getIntervalInMilli());
                }
            }
        });
// Path: src/main/java/com/googlecode/eckoit/events/ScreenGrabFinishEvent.java
// public class ScreenGrabFinishEvent {
// 
// }
// 
// Path: src/main/java/com/googlecode/eckoit/events/ScreenGrabStartEvent.java
// public class ScreenGrabStartEvent {
//     private File storageDir;
//     private long intervalInMilli;
//     private boolean presentationMode = false;
//     
//     public ScreenGrabStartEvent(File storageDir) {
//         this.storageDir = storageDir;
//         intervalInMilli = 5000; // default to 5 seconds
//     }
//     public ScreenGrabStartEvent(File storageDir, long intervalInMilli) {
//         this.storageDir = storageDir;
//         this.intervalInMilli = intervalInMilli; 
//     }
//     public ScreenGrabStartEvent(File storageDir, boolean presentationMode) {
//         this.storageDir = storageDir;
//         this.presentationMode = presentationMode;
//     }
//     public long getIntervalInMilli(){
//         return this.intervalInMilli;
//     }
//     
//     public File getStorageDir() {
//         return storageDir;
//     }
// 
//     public boolean getPresentationMode() {
//         return presentationMode;
//     }
// 
// }
// 
// Path: src/main/java/com/googlecode/eckoit/events/TargetClickedEvent.java
// public class TargetClickedEvent {
// 
// }


// Path: src/main/java/com/googlecode/eckoit/screengrab/ScreenGrabber.java
import com.github.couchapptakeout.events.ExitApplicationMessage;
import com.googlecode.eckoit.events.ScreenGrabFinishEvent;
import com.googlecode.eckoit.events.ScreenGrabStartEvent;
import com.googlecode.eckoit.events.TargetClickedEvent;
import java.awt.AWTException;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.InputEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import org.bushe.swing.event.EventBus;
import org.bushe.swing.event.EventSubscriber;


                }
            }

        });


        EventBus.subscribeStrongly(ScreenGrabStartEvent.class, new EventSubscriber<ScreenGrabStartEvent>() {
            @Override
            public void onEvent(ScreenGrabStartEvent t) {
                currentDir = t.getStorageDir();
                
                if (t.getPresentationMode()) {
                    inPresentationMode = true;
                    capture();
                } else {
                    if (timer != null) {
                        timer.cancel();
                    }
                    timer = new Timer();
                    
                    timer.schedule(new TimerTask() {
                        @Override
                        public void run() {
                            capture();
                        }
                    }, t.getIntervalInMilli(), t.getIntervalInMilli());
                }
            }
        });
        EventBus.subscribeStrongly(ScreenGrabFinishEvent.class, new EventSubscriber<ScreenGrabFinishEvent>() {