01: package org.swingml.task.monitoring;
02:
03: import org.swingml.task.*;
04:
05: /**
06: * Monitor passed in to tasks so that they can report progress on their behavior.
07: *
08: * @author CrossLogic
09: */
10: public interface ITaskMonitor {
11:
12: /**
13: * Should only be called once, at the start of the task. Reports the name of the task to execute, and the number of ticks it will take to complete.
14: *
15: * @param name
16: * @param totalTicks
17: */
18: void beginTask(ITask task);
19:
20: /**
21: * Should only be called once, at the end of the task.
22: */
23: void endTask(ITask task);
24:
25: /**
26: * Analogous to {@link #progressMade(int)} with a value of '1'
27: */
28: void progressMade(ITask task);
29:
30: /**
31: * Reports that 'ticks' units of work have been completed since the last report. This value is not absolute, but is relative to the last call.
32: *
33: * @param ticks
34: */
35: void progressMade(ITask task, int ticks);
36:
37: /**
38: * Reports that 1 'tick' of progress was made, but also provides a message to display.
39: *
40: * @param message
41: */
42: void progressMade(ITask task, String aMessage);
43:
44: /**
45: * Reports that 'ticks' units of work have been completed, but also provides a message to display.
46: *
47: * @param message
48: */
49: void progressMade(ITask task, int ticks, String aMessage);
50:
51: /**
52: * Displays the given notification message to the UI.
53: *
54: * @param message
55: */
56: void setMessage(ITask task, String aMessage);
57:
58: }
|