// (c) MIT 2003.  All rights reserved.

// $Id: SurfaceRegistry.java,v 1.16 2003/03/06 00:40:39 moltmans Exp $
// Time-stamp: <2000-03-11 18:59:36 moltmans>
package rec.sys;


import java.util.*;
import java.awt.*;
import rec.util.*;

public class SurfaceRegistry extends WidgetPool implements Displayable
{

  
  public SurfaceRegistry()
  {
  }


  // widgets on the surface must be visible ones
  public void display( Graphics g )
  {
    Iterator e = iterator();

    while( e.hasNext() ) {
      VisibleWidget vw = (VisibleWidget)e.next();
      //      Console.writeln( "drawing " + vw );
      vw.display( g );
    }
  }


  /**
   * For drawing order--this is probably not the way to do this.
   */
  public void shuffleToTop( Widget w )
  {
    Assert.error( "not re-implemented" );

    remove( w );
    add( w );
  }

  /**
   * For drawing order--this is probably not the way to do this.
   */
  public void shuffleToBottom( Widget w )
  {
    Assert.error( "not re-implemented" );
    
    remove( w );

    super.add( w );
  }

}


