net.sourceforge.doyen
Class EventManager

java.lang.Object
  extended byjava.lang.Thread
      extended bynet.sourceforge.doyen.EventManager
All Implemented Interfaces:
Runnable

class EventManager
extends Thread


Nested Class Summary
private  class EventManager.CurrentTaskUIUpdater
           
private static class EventManager.EventRec
           
 
Field Summary
private  boolean mContinue
           
private  TaskType mCurrentTask
           
private  List mEarlyEvents
           
private  SortedSet mEvents
           
private  EventFrame mEVT
           
private static Logger mLogger
           
private  Doyen mParent
           
private  ProfileType mProfile
           
private  Calendar mStart
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EventManager(Doyen parent)
           
 
Method Summary
private  void addTimeLogEntry()
           
 void checkForPendingEvents()
           
private  void checkForPendingEvents(ProfileType profile)
           
private  void checkForPendingEvents(ProjectType proj)
           
private  void checkForPendingEvents(TaskType task)
          Task are checked for pending events in the following precendence 1) If the task is completed If recurrence True: clear the completed and schedule the next event False: done 2) If next occurence set If it's before now, post event If early notification is before now, post notification Check for pending 3) It's not done, they didn't set when to do it, and it's never been worked on before: it's ready to be worked on now.
(package private)  void clearEarlyEvent(TaskType task)
           
(package private)  void completeCurrentTask()
           
(package private)  void endCurrentTask()
           
(package private)  boolean isPaused()
           
private  void postEarlyEvent(TaskType task)
           
private  void postEvent(TaskType task, Calendar time, TaskType.ScheduleType.RecurrenceType rec)
           
private  void processEvents()
           
 void run()
           
 void setCurrentTask(TaskType task)
           
private  void setNextOccurrence(TaskType task)
          Sets the next occurence of a completed task based on recurrence
private  void setNextOccurrence(TaskType task, TaskType.ScheduleType sched, TaskType.ScheduleType.RecurrenceType rec)
          Sets the next occurence of a completed task based on recurrence
 void setProfile(ProfileType profile)
           
 void shutdown()
           
private  void startTimeLogging()
           
(package private)  void switchTask()
           
(package private)  void togglePauseResume()
           
(package private)  void updatedObject(Object o)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mLogger

private static Logger mLogger

mProfile

private ProfileType mProfile

mContinue

private boolean mContinue

mEvents

private SortedSet mEvents

mEVT

private EventFrame mEVT

mCurrentTask

private TaskType mCurrentTask

mStart

private Calendar mStart

mEarlyEvents

private List mEarlyEvents

mParent

private Doyen mParent
Constructor Detail

EventManager

public EventManager(Doyen parent)
Method Detail

setProfile

public void setProfile(ProfileType profile)

run

public void run()

processEvents

private void processEvents()

shutdown

public void shutdown()

checkForPendingEvents

public void checkForPendingEvents()

checkForPendingEvents

private void checkForPendingEvents(ProfileType profile)

checkForPendingEvents

private void checkForPendingEvents(ProjectType proj)

setNextOccurrence

private void setNextOccurrence(TaskType task)
Sets the next occurence of a completed task based on recurrence

Parameters:
task - the task to set the next occurence

setNextOccurrence

private void setNextOccurrence(TaskType task,
                               TaskType.ScheduleType sched,
                               TaskType.ScheduleType.RecurrenceType rec)
Sets the next occurence of a completed task based on recurrence

Parameters:
task - the task to set the next occurence
sched - the schedule to base the next occurence on
rec - the recurrence to use

checkForPendingEvents

private void checkForPendingEvents(TaskType task)
Task are checked for pending events in the following precendence 1) If the task is completed If recurrence True: clear the completed and schedule the next event False: done 2) If next occurence set If it's before now, post event If early notification is before now, post notification Check for pending 3) It's not done, they didn't set when to do it, and it's never been worked on before: it's ready to be worked on now.


postEvent

private void postEvent(TaskType task,
                       Calendar time,
                       TaskType.ScheduleType.RecurrenceType rec)

postEarlyEvent

private void postEarlyEvent(TaskType task)

clearEarlyEvent

void clearEarlyEvent(TaskType task)

setCurrentTask

public void setCurrentTask(TaskType task)

endCurrentTask

void endCurrentTask()

addTimeLogEntry

private void addTimeLogEntry()

completeCurrentTask

void completeCurrentTask()

switchTask

void switchTask()

startTimeLogging

private void startTimeLogging()

togglePauseResume

void togglePauseResume()

isPaused

boolean isPaused()

updatedObject

void updatedObject(Object o)