cage.ui
Class Overlay

java.lang.Object
  extended by cage.ui.Overlay

public class Overlay
extends java.lang.Object

An overlay is simply a grouping of standard Java gui components which can be added over a scene rendered in CAGE. Overlays are stored as a resource an can be associated with a scene.

Author:
Seth Marinello

Nested Class Summary
static class Overlay.NamedPanel
          A wrapper for AWT Panel which has a name associated with it.
 
Constructor Summary
Overlay(java.lang.String name)
          Creates a new overlay with the specified name.
 
Method Summary
 void addComponent(Overlay.NamedPanel c)
          Adds a given Component to those associated with the overlay.
 Overlay.NamedPanel getComponent(java.lang.String name)
          This allows access to a particular component of an overly by name.
 java.util.LinkedList<Overlay.NamedPanel> getComponents()
          Returns all of the components to be displayed when this overlay is used.
 java.lang.String getName()
          Gets the name of the overlay
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Overlay

public Overlay(java.lang.String name)
Creates a new overlay with the specified name.

Parameters:
name - name of the overlay
Method Detail

getName

public java.lang.String getName()
Gets the name of the overlay

Returns:
the name

getComponents

public java.util.LinkedList<Overlay.NamedPanel> getComponents()
Returns all of the components to be displayed when this overlay is used.

Returns:
linked list of all components of the overlay

addComponent

public void addComponent(Overlay.NamedPanel c)
Adds a given Component to those associated with the overlay.

Parameters:
c - the component to add.

getComponent

public Overlay.NamedPanel getComponent(java.lang.String name)
This allows access to a particular component of an overly by name. This is useful for setting the text displayed in the component.

Parameters:
name - the name of the component to search for
Returns:
the component named if found or null.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object