Class agent.Launcher.AgentLauncher
All Packages Class Hierarchy This Package Previous Next Index
Class agent.Launcher.AgentLauncher
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----agent.Launcher.AgentLauncher
- public final class AgentLauncher
- extends Applet
- implements Runnable
An applet that allows users to launch Agents out into the
Agent system network. Gives the user a list of Agents to
choose from, then allows him to launch it, view the results,
and/or kill the dispatched Agent.
-
AGENT_DISPATCHED
-
-
AGENT_PICKED
-
-
AGENT_STOPPED
-
-
ALVector
-
-
ANIMATED
-
-
ANIMATED_STRING
-
-
DISABLE_ALL
-
-
DISPATCH_STRING
-
-
HIGHPRIORITY
-
-
KILL_STRING
-
-
LOWPRIORITY
-
-
MAX_ANIMATOR_THREADS
-
-
MEDIUMPRIORITY
-
-
NO_AGENT
-
-
PICK_STRING
-
-
RESULT_STRING
-
-
STOP_STRING
-
-
TEXT_ONLY
-
-
TEXT_ONLY_STRING
-
-
bImageLoadingError
-
-
dispatchedImages
-
-
inpipeStream
-
-
noResultImages
-
-
notStartedImages
-
-
outpipeStream
-
-
resultFile
-
-
resultImages
-
-
runningImages
-
-
sBadImage
-
-
AddToState(String)
-
-
Dispatch()
- Dispatch the current Agent.
-
LoadAgentClass(Frame, String)
-
-
LoadAnimationImages()
- Load all the images this applet needs for its animation
sequences.
-
LoadTest()
-
-
MessageBox(String)
-
-
StopAgent(String)
-
-
addAgentDisplay(String)
- The original addAgentDisplay method.
-
addAgentDisplay1(String)
- The new addAgentDisplay method.
-
addAgentFace(String)
-
-
addAnimation()
-
-
clicked(int, int)
-
-
endDispatch()
- endDispatch - Called when the user has decided to call off this
search.
-
getFrame()
- Get the Frame window that is the parent of all the windows
currently on the screen.
-
handleEvent(Event)
-
-
imageUpdate(Image, int, int, int, int, int)
- Override of Component.imageUpdate, an implementation of
ImageObserver.imageUpdate.
-
init()
- Initialize the applet.
-
mouseUp(Event, int, int)
-
-
paintBorder(Graphics)
- Paint the border surrounding the entire game.
-
reportResult(String, String)
- A method called by the message processing code
(AgentDispatcher) to change an agents state from running to
finished with or without results.
-
reportResults(Result)
- reportResults - When an Agent sends the result of a search to the
AgentConnectionHandler, the handler calls this to place the results
pointer into the results HTML doc and to visually notify the user that
this server has finished with whatever results.
-
run()
- The main loop for the main thread.
-
setAgentURL(String)
-
-
setRunning(int)
-
-
showNoResults(String)
- showNoResults -
-
showProperties()
-
-
showResults(String, String)
- showResults -
-
start()
- start - Whenever a user visits our page, Applet calls this.
-
startDispatch()
- startDispatch - Called when the user has chosen to dispatch an
Agent.
-
stop()
- Stop this thread.
-
update(Graphics)
- Update the window, erasing things from their old positions and
painting them anew at their current positions.
bImageLoadingError
public boolean bImageLoadingError
ALVector
public Vector ALVector
sBadImage
public String sBadImage
inpipeStream
public PipedInputStream inpipeStream
outpipeStream
public PipedOutputStream outpipeStream
TEXT_ONLY
public final int TEXT_ONLY
ANIMATED
public final int ANIMATED
resultFile
public ResultFile resultFile
LOWPRIORITY
public final int LOWPRIORITY
MEDIUMPRIORITY
public final int MEDIUMPRIORITY
HIGHPRIORITY
public final int HIGHPRIORITY
notStartedImages
public AgentImage notStartedImages[]
runningImages
public AgentImage runningImages[]
resultImages
public AgentImage resultImages[]
noResultImages
public AgentImage noResultImages[]
dispatchedImages
public AgentImage dispatchedImages[]
MAX_ANIMATOR_THREADS
public final int MAX_ANIMATOR_THREADS
DISABLE_ALL
public final static int DISABLE_ALL
NO_AGENT
public final static int NO_AGENT
AGENT_PICKED
public final static int AGENT_PICKED
AGENT_DISPATCHED
public final static int AGENT_DISPATCHED
AGENT_STOPPED
public final static int AGENT_STOPPED
TEXT_ONLY_STRING
public final static String TEXT_ONLY_STRING
ANIMATED_STRING
public final static String ANIMATED_STRING
DISPATCH_STRING
public final static String DISPATCH_STRING
STOP_STRING
public final static String STOP_STRING
PICK_STRING
public final static String PICK_STRING
RESULT_STRING
public final static String RESULT_STRING
KILL_STRING
public final static String KILL_STRING
imageUpdate
public synchronized boolean imageUpdate(Image img,
int infoflags,
int x,
int y,
int width,
int height)
- Override of Component.imageUpdate, an implementation of
ImageObserver.imageUpdate. Called by an image producer every
time an interesting point in image loading occurs.
- Parameters:
- img - The image that we're talking about.
- infoflags - The state of the image-load - a constant from
ImageObservers public variable set.
- Overrides:
- imageUpdate in class Component
start
public void start()
- start - Whenever a user visits our page, Applet calls this. This is
an override of an Applet method. Creates a thread and passes this
AgentLauncher into it. Works because we implement the Runnable method.
- Overrides:
- start in class Applet
showProperties
public void showProperties()
Dispatch
public void Dispatch()
- Dispatch the current Agent. currentAgent is an instance of
the Agent we wish to dispatch, and he has already configured
himself via Agent.configure. We need to get his arguments as a
Vector of Strings, create a dispatcher, then tell the
dispatcher to dispatch using the currentAgent with those
arguments.
- See Also:
- Agent, AgentDispatcher
LoadAgentClass
public static void LoadAgentClass(Frame f,
String selected)
StopAgent
public void StopAgent(String cid)
LoadTest
public void LoadTest()
getFrame
public Frame getFrame()
- Get the Frame window that is the parent of all the windows
currently on the screen. Every application has ONE Frame that
can be found by trolling through the tree of Containers that
makes up the hierarchy of windows in a Java application.
- Returns:
- The Frame that is the ultimate parent of the current
Component.
addAnimation
public void addAnimation()
addAgentFace
public void addAgentFace(String server)
reportResult
public void reportResult(String server,
String url)
- A method called by the message processing code
(AgentDispatcher) to change an agents state from running to
finished with or without results.
- Parameters:
- url - The URL of the results file. If null, there were
no results.
- server - The name of the server. We find the AgentFace
we need to change by searching on this name.
setRunning
public void setRunning(int index)
stop
public void stop()
- Stop this thread.
- Overrides:
- stop in class Applet
run
public void run()
- The main loop for the main thread.
clicked
public boolean clicked(int x,
int y)
handleEvent
public boolean handleEvent(Event e)
- Overrides:
- handleEvent in class Component
init
public void init()
- Initialize the applet. Resize and load images.
- Overrides:
- init in class Applet
startDispatch
public void startDispatch()
- startDispatch - Called when the user has chosen to dispatch an
Agent. Sends the Agent to our ServerList and opens the ResultFile.
endDispatch
public void endDispatch()
- endDispatch - Called when the user has decided to call off this
search. Closes the results file and notifies the connectionHandler to
kill off any Agents that report in after this point.
addAgentDisplay
public void addAgentDisplay(String server)
- The original addAgentDisplay method. Runs through array looking for
a spot to place the new AgentFace.
- Parameters:
- server - The name of the server that's running this Agent.
addAgentDisplay1
public void addAgentDisplay1(String server)
- The new addAgentDisplay method. Runs through array
looking for a spot to place the new AgentFace, letting us
throw exception if we overrun array.
- Parameters:
- server - The name of the server that's running this Agent.
MessageBox
public void MessageBox(String s)
showResults
public void showResults(String s,
String urls)
- showResults -
showNoResults
public void showNoResults(String s)
- showNoResults -
reportResults
public void reportResults(Result r)
- reportResults - When an Agent sends the result of a search to the
AgentConnectionHandler, the handler calls this to place the results
pointer into the results HTML doc and to visually notify the user that
this server has finished with whatever results.
LoadAnimationImages
public synchronized void LoadAnimationImages()
- Load all the images this applet needs for its animation
sequences. Blocks until all the images have been loaded over
the net OR one of the images reports a load error.
paintBorder
public void paintBorder(Graphics g)
- Paint the border surrounding the entire game. There is no border
around the board itself.
update
public void update(Graphics g)
- Update the window, erasing things from their old positions and
painting them anew at their current positions.
- Overrides:
- update in class Component
AddToState
public void AddToState(String inputLine)
setAgentURL
public void setAgentURL(String s)
mouseUp
public boolean mouseUp(Event evt,
int x,
int y)
- Overrides:
- mouseUp in class Component
All Packages Class Hierarchy This Package Previous Next Index