package com.github.sarxos.webcam;

import java.awt.Point;
import java.util.EventObject;


/**
 * Webcam detected motion event.
 *
 * @author Bartosz Firyn (SarXos)
 */
public class WebcamMotionEvent extends EventObject {

	private static final long serialVersionUID = -7245768099221999443L;

	private final double strength;
	private final Point cog;

	/**
	 * Create detected motion event.
	 *
	 * @param detector
	 * @param strength
	 * @param cog center of motion gravity
	 */
	public WebcamMotionEvent(WebcamMotionDetector detector, double strength, Point cog) {

		super(detector);

		this.strength = strength;
		this.cog = cog;
	}

	/**
	 * Get percentage fraction of image covered by motion. 0 is no motion on image, and 100 is full
	 * image covered by motion.
	 *
	 * @return Motion area
	 */
	public double getArea() {
		return strength;
	}

	public Point getCog() {
		return cog;
	}
}

@@ -742,16 +742,21 @@
 otion on
+%0D%0A%09 *
  image, 
@@ -770,21 +770,16 @@
  is full
-%0D%0A%09 *
  image c
@@ -909,24 +909,24 @@
 getCog() %7B%0D%0A
-
 %09%09return cog
@@ -931,12 +931,222 @@
 og;%0D%0A%09%7D%0D
+%0A%0D%0A%09public Webcam getWebcam() %7B%0D%0A%09%09return ((WebcamMotionDetector) getSource()).getWebcam();%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public WebcamMotionDetector getSource() %7B%0D%0A%09%09return (WebcamMotionDetector) super.getSource();%0D%0A%09%7D%0D
 %0A%7D%0D%0A

Add some usable methods in WebcamMotionEvent