repast.simphony.engine.environment
Interface GUIRegistry

All Known Implementing Classes:
DefaultGUIRegistry

public interface GUIRegistry

This interface represents an object that contains GUI elements generated for a simulation and that are to be displayed to the user.

Version:
$Revision: 1.1 $ $Date: 2005/12/21 22:25:34 $
Author:
Jerry Vos

Method Summary
 void addComponent(JComponent component, GUIRegistryType type, String name)
          Adds a component with the given type and name.
 void addDisplay(String name, GUIRegistryType type, IDisplay display)
          Adds an IDisplay to this GUIRegistry.
 IDisplay getDisplayForComponent(JComponent comp)
          Gets the display associated with the specified component.
 List<IDisplay> getDisplays()
          Gets the list of IDisplay-s registered with this GUIRegistry.
 String getName(JComponent component)
          Retrieves the name of a given component.
 Collection<Pair<GUIRegistryType,Collection<JComponent>>> getTypesAndComponents()
          Retrieves the (type, components) pairs that were registered with this registry.
 boolean removeComponent(JComponent component)
          Removes a component from the registry.
 

Method Detail

addComponent

void addComponent(JComponent component,
                  GUIRegistryType type,
                  String name)
Adds a component with the given type and name. The type is not meant to be "JPanel" or "JTable," but to be along the lines of "Graph" or "Display." The name can be null.

Parameters:
component - the component to add
type - the type of the component
name - the name of the component (can be null)

removeComponent

boolean removeComponent(JComponent component)
Removes a component from the registry.

Parameters:
component - the component to remove
Returns:
true if something was removed (false if this didn't contain the component

getName

String getName(JComponent component)
Retrieves the name of a given component. This may return null if the name was null or if the component does not exist in the registry.

Parameters:
component - the component who's name to retrieve
Returns:
the specified component's name

getTypesAndComponents

Collection<Pair<GUIRegistryType,Collection<JComponent>>> getTypesAndComponents()
Retrieves the (type, components) pairs that were registered with this registry.

Returns:
a collection of (type, components) pairs

addDisplay

void addDisplay(String name,
                GUIRegistryType type,
                IDisplay display)
Adds an IDisplay to this GUIRegistry. If the display is added, there is NO need to add the compoment associated with the IDisplay as well.

Parameters:
display - the renderer to add

getDisplays

List<IDisplay> getDisplays()
Gets the list of IDisplay-s registered with this GUIRegistry.

Returns:
the list of IDisplays-s registered with this GUIRegistry.

getDisplayForComponent

IDisplay getDisplayForComponent(JComponent comp)
Gets the display associated with the specified component.

Parameters:
comp - the component whose display we want
Returns:
the associated display