/***************************************************************\
| |\  /|                                                We Put  |
| | >< Hypercosm            container.js                3d      |
| |/  \|                                                To Work |
|***************************************************************|
|                                                               |
|        This file defines the Javascript behaviors of a        |
|        generalized user interface component.                  |
|                                                               |
|***************************************************************|
|                Copyright (c) 2008 Hypercosm, LLC.             |
\***************************************************************/


//
// "class" constructor
//


function container(element, components, parent) {

  // call superclass method
  //
  component.call(this, element, parent); 
  
  // set attributes
  //
  this.componentGroup = new componentGroup(components);
  
  return this;
}    // container


// inherit prototype from "superclass"
//
container.prototype = new component();



//
// "object" or "instance" methods
//


container.prototype.addComponent = function(component) {
  
  // call superclass method
  //
  this.componentGroup.addComponent(component);

  // add reference from component to its container
  //
  component.parent = this;
}	// addComponent


container.prototype.getComponent = function(index) {
  return this.componentGroup.getComponent(index);
}	// getComponent


container.prototype.getComponents = function() {
  return this.componentGroup.getComponents();
}	// getComponents


//
// batch processing method
//


container.prototype.call = function(methodName, parameters) {
  this.componentGroup.call(methodName, parameters);
}	// call
