// Copyright 1996, Marimba Inc. All Rights Reserved.
// @(#)HighScoreListFrame.java, 1.3, 11/11/96

package samegame;

import java.io.*;
import java.net.*;
import java.awt.*;
import java.util.*;

import marimba.io.*;
import marimba.gui.*;
import marimba.persist.*;

/**
 * Tell the user that there are no more moves available
 *
 * @author      Carl W. Haynes III
 * @version     1.3, 11/11/96
 */
public class HighScoreListFrame extends PlayerFrame {
    
    HighScoreManager hsm = null;
    
    /**
     * Constructor
     */
    public HighScoreListFrame(URL gui, HighScoreManager hsm, HighScore high) {
	 super(gui);
	 this.hsm = hsm;

	 Vector loc = hsm.getLocalTopTen();
	 Vector glob = hsm.getGlobalTopTen();
	 
	 ListWidget localList = (ListWidget)player.getPresentation().getWidget("folder.localpage.list");
	 ListWidget globalList = (ListWidget)player.getPresentation().getWidget("folder.globalpage.list");

	 for (int i = 0 ; i < HighScoreManager.MAXHIGHSCORES ; i++) { 
	     // local high score page
	     HighScore hs = (HighScore)loc.elementAt(i);
	     localList.getContent().add(hs);

	     // global high score page
	     hs = (HighScore)glob.elementAt(i);
	     globalList.getContent().add(hs);
	 }
     }

    /**
     * Handle events.
     */
    public boolean handleEvent(Event evt) {
	return super.handleEvent(evt);
    }
}
