import netscape_beta.application.*;
import netscape_beta.util.*;

/**
 * A class that provides a scrolling view of a DemClassView
 *
 * @version        1.0 12 Dec 1996
 * @author         Andrew Miller
 */
public class DemScrollClassView extends ScrollGroup
{
  private DemClassView m_viewClass  = null;
  protected DemDoc m_doc            = null;

    /**
     * Construct a DemScrollClassView with the given bounds in 
     * the specified parent displaying the class dictionary of the 
     * specified doc.
     * @param rcView            The window's bounds.
     * @param parent            The window's parent
     * @param doc               Document to display.
     */
  public DemScrollClassView(Rect rcView, View parent, DemDoc doc)
  {
       super(rcView);

       Rect rcContent = new Rect(0,0,rcView.width, rcView.height);

       m_viewClass = new DemClassView(rcContent, this);

       setContentView(m_viewClass);
       setHasVertScrollBar(true);
       setHasHorizScrollBar(true);
       setBackgroundColor(Color.white);
	
       parent.addSubview(this);
  }

    /**
     * Provides access to the DemClassView
     * @return           The DemClassView being scrolled.
     */
  public DemClassView getClassView()
  {
     return m_viewClass;
  }

    /**
     * Inform the DemScrollClassView that it's contents
     * have been resized.
     */
  public void updateScrolls()
  {
     scrollView().subviewDidResize(contentView());
  }

}

