java.de.TimeSlice
Class TaskManager

java.lang.Object
  |
  +--java.de.TimeSlice.TaskManager

public class TaskManager
extends java.lang.Object
implements ControlPanelListener, java.de.TimeSlice.TimerListener

class

TaskManager
is one of the main processing classes. It manages the existing tasks and the active task. It is called to update periodically by the Timer by implementing
TimerListener
Changes due to user-interaction with the GUI are notified trough
ControlPanelListener


Field Summary
static long MAXPERIODE
           
 
Constructor Summary
TaskManager()
          some constructors are really boring
 
Method Summary
 void activateTask(boolean active, java.lang.String TaskName)
          sets the stae of the Task named TaskName to active and has to check and adjust ActiveTask
 void addTask(Task t)
          add Task t to Tasks if it fulfills all restrictions like uniqueness of the Taskname and ranges of data
 void deleteTask(java.lang.String TaskName)
          since the timer accesses ActiveTask periodically one has to escape access conflicts by a synchronized access
 void editTask(java.lang.String OldName, Task t)
          nearly the same like addTask() but the existing Task is preserved and the properties are set to the new values
 Task getActiveTask()
           
 Task getTask(java.lang.String TaskName)
           
 void setActiveTask(Task Value)
           
 void setTask(java.lang.String OldName, Task Value)
           
 void updateActiveTask(long delta)
          part of the interface TimerListener called periodically.
 void updateDayChange(long now)
          under construction !!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXPERIODE

public static final long MAXPERIODE
Constructor Detail

TaskManager

public TaskManager()
some constructors are really boring
Method Detail

addTask

public void addTask(Task t)
             throws java.de.TimeSlice.TaskNameAlreadyExist,
                    java.security.InvalidParameterException
add Task t to
Tasks
if it fulfills all restrictions like uniqueness of the Taskname and ranges of data
Specified by:
addTask in interface ControlPanelListener
Parameters:
t - Task to add
Throws:
java.de.TimeSlice.TaskNameAlreadyExist -  
java.security.InvalidParameterException -  

editTask

public void editTask(java.lang.String OldName,
                     Task t)
              throws java.de.TimeSlice.TaskNameAlreadyExist,
                     java.security.InvalidParameterException
nearly the same like
addTask()
but the existing Task is preserved and the properties are set to the new values
Specified by:
editTask in interface ControlPanelListener
Parameters:
OldName -  
t -  
Throws:
java.de.TimeSlice.TaskNameAlreadyExist -  
java.security.InvalidParameterException -  

deleteTask

public void deleteTask(java.lang.String TaskName)
since the timer accesses
ActiveTask
periodically one has to escape access conflicts by a synchronized access
Specified by:
deleteTask in interface ControlPanelListener
Parameters:
TaskName -  

activateTask

public void activateTask(boolean active,
                         java.lang.String TaskName)
sets the stae of the Task named
TaskName
to
active
and has to check and adjust
ActiveTask
Specified by:
activateTask in interface ControlPanelListener
Parameters:
active -  
TaskName -  

getActiveTask

public Task getActiveTask()

setActiveTask

public void setActiveTask(Task Value)

getTask

public Task getTask(java.lang.String TaskName)

setTask

public void setTask(java.lang.String OldName,
                    Task Value)

updateActiveTask

public void updateActiveTask(long delta)
part of the interface
TimerListener
called periodically. Updates the
Restdauer
of the currently active Task (only one Task can be active a time). Like explained in the preceeding this access has to be synchronized
Specified by:
updateActiveTask in interface java.de.TimeSlice.TimerListener
Parameters:
delta -  

updateDayChange

public void updateDayChange(long now)
under construction !!
Specified by:
updateDayChange in interface java.de.TimeSlice.TimerListener
Parameters:
now -