KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtriver > open > vectorvisuals > task > TaskEvent


1 /*
2  * TaskEvent.java
3  *
4  * Created on 11 November 2004, 15:06
5  */

6
7 package com.thoughtriver.open.vectorvisuals.task;
8
9 import java.util.*;
10
11 /**
12  * This type of event is produced when an <CODE>AnimationTask</CODE> starts or
13  * ends execution. These events are distributed to <CODE>TaskListener</CODE>s
14  * by the <CODE>TaskManager</CODE>.
15  *
16  * @author Brandon Franklin
17  * @version $Date: 2006/11/25 09:15:41 $
18  */

19 public class TaskEvent extends EventObject {
20
21     private static final long serialVersionUID = 3618705184017102646L;
22
23     /** The approximate system millisecond during which this event was generated */
24     private final long time;
25
26     /** The <CODE>ExecutionState</CODE> type that the task is now in */
27     private final ExecutionState state;
28
29     /**
30      * Creates a new instance of <CODE>TaskEvent</CODE>.
31      *
32      * @param source the <CODE>AnimationTask</CODE> that triggered the event
33      * @param state the <CODE>ExecutionState</CODE> type that the task is now
34      * in
35      */

36     public TaskEvent(final AnimationTask source, final ExecutionState state) {
37         super(source);
38         time = System.nanoTime() / 1000000;
39         this.state = state;
40     }
41
42     /**
43      * Returns the approximate system millisecond during which this event was
44      * generated.
45      *
46      * @return the approximate system millisecond during which this event was
47      * generated
48      */

49     public long getTime() {
50         return time;
51     }
52
53     /**
54      * Returns the <CODE>ExecutionState</CODE> type that the task is now in.
55      *
56      * @return the <CODE>ExecutionState</CODE> type that the task is now in
57      */

58     public ExecutionState getState() {
59         return state;
60     }
61
62 }
63
Popular Tags