public class ComponentManager extends java.lang.Object implements ConnectionManagerListener, GUIComponent
| Constructor and Description |
|---|
ComponentManager(Kernel kernel,
WorldModel<? extends Entity> world,
Config config,
Scenario scenario)
Create a ComponentManager.
|
| Modifier and Type | Method and Description |
|---|---|
javax.swing.JComponent |
getGUIComponent()
Get a JComponent that should be added to the GUI.
|
java.lang.String |
getGUIComponentName()
Get the name of this part of the GUI.
|
void |
newConnection(Connection c)
Notification that a new connection has been made.
|
void |
registerAgentControlledEntity(Entity entity,
java.util.Collection<? extends Entity> visibleOnStartup,
Config agentConfig)
Register an agent-controlled entity.
|
void |
waitForAllAgents()
Wait for all agents to connect.
|
void |
waitForAllSimulators()
Wait until all simulators have acknowledged.
|
void |
waitForAllViewers()
Wait until all viewers have acknowledged.
|
public ComponentManager(Kernel kernel, WorldModel<? extends Entity> world, Config config, Scenario scenario)
kernel - The kernel.world - The world model.config - The kernel configuration.public void registerAgentControlledEntity(Entity entity, java.util.Collection<? extends Entity> visibleOnStartup, Config agentConfig)
entity - The entity that is agent-controlled.visibleOnStartup - The set of entities that the agent should be sent on startup.
If this is null then all entities will be sent.agentConfig - A view of the system configuration that should be shared with
the agent.public void waitForAllAgents()
throws java.lang.InterruptedException
java.lang.InterruptedException - If the thread is interrupted.public void waitForAllSimulators()
throws java.lang.InterruptedException
java.lang.InterruptedException - If the thread is interrupted.public void waitForAllViewers()
throws java.lang.InterruptedException
java.lang.InterruptedException - If the thread is interrupted.public void newConnection(Connection c)
ConnectionManagerListenernewConnection in interface ConnectionManagerListenerc - The new connection.public javax.swing.JComponent getGUIComponent()
GUIComponentgetGUIComponent in interface GUIComponentpublic java.lang.String getGUIComponentName()
GUIComponentgetGUIComponentName in interface GUIComponent