source: trunk/src/org/expeditee/agents/Agent.java@ 179

Last change on this file since 179 was 179, checked in by ra33, 16 years ago

Made a few minor changes...

Also

For interactive widgets the border will not be selected if the user is inside the enclosed area

File size: 1.8 KB
Line 
1package org.expeditee.agents;
2
3import org.expeditee.gui.Frame;
4import org.expeditee.items.Item;
5
6/**
7 * The Interface that all Agents must implement. This interface allows the JAG
8 * classes\ to be loaded dynamically at run-time.
9 *
10 * @author jdm18
11 *
12 */
13public interface Agent extends Runnable {
14
15 /**
16 * This method should always be called before calling process(). The Frame
17 * passed in should be scanned for any paramters that should be set before
18 * process() is called. If this method returns false then process() should
19 * not be called.
20 *
21 * @param toInit
22 * The Frame that has any parameters that need to be set before
23 * processing begins. It is also the first frame for the agent.
24 * @param launcher
25 * The item that was clicked on to launch this agent.
26 * @return True if the initialisation executed correctly, False if an error
27 * occured.
28 */
29 public boolean initialise(Frame toInit, Item launcher);
30
31 /**
32 * Specifies whether this Agents produces a Frame of results to be shown to
33 * the user after execution has completed, or if the program should return
34 * to the Frame the user was on when they invoked this Agent.
35 *
36 * @return True if this Agent produces a results Frame, false otherwise.
37 */
38 public boolean hasResultFrame();
39
40 public boolean hasResultString();
41
42 /**
43 * Returns the results Frame produced by this Agent. This method is only
44 * called if hasResultFrame() returns true. If hasResultFrame() returns
45 * false, it is expected that this method returns null.
46 *
47 * @return The result Frame produced by this Agent if there is one, or null
48 * otherwise.
49 */
50 public Frame getResultFrame();
51
52 public abstract boolean isRunning();
53
54 public abstract void stop();
55
56 public abstract void interrupt();
57}
Note: See TracBrowser for help on using the repository browser.