/*************************************************
 * Author: 	Evelyn Lai-Tee Cheok
 *			Department of Electrical Engineering
 *			Center for Telecommunications Research
 *			Schapiro Research Building
 *			Columbia University
 *
 * Email: 	laitee@ctr.columbia.edu
 *
 **************************************************/
import java.lang.*;
import java.awt.*;

/** UserStatisticsDlg class simply implements the Statistics window for **/
/** displaying information of other users received via the receiver **/
/** multicast socket. **/
 
class UserStatisticsDlg extends Frame {
    public UserStatisticsDlg(String title, MenuWindow main_parent,
                                        UserInfo selectedUserInfo) {
        super(title);
        GridBagLayout gridbag = new GridBagLayout();
        setLayout(gridbag);
        add(new MyLabel(gridbag, "Name",
                  Label.LEFT, "RELATIVE", 20, 20, 5, 5));
        add(new MyLabel(gridbag, selectedUserInfo.name,
                  Label.LEFT, "REMAINDER", 20, 5, 5, 20));
        add(new MyLabel(gridbag, "Email Address",
                  Label.LEFT, "1", 5, 20, 10, 5));
        add(new MyLabel(gridbag, selectedUserInfo.email,
                  Label.LEFT, "REMAINDER", 0, 0, 0, 0));
        add(new MyButton(gridbag, "OK", "REMAINDER", 10, 40, 20, 40));
    }
 
    /** Action to handle the ACTION EVENT on the OK button to simply **/
    /** close the Statistics window **/
 
    public boolean action(Event e, Object what) {
        if (e.target instanceof MyButton) {
            String label = ((MyButton) e.target).getLabel();
            if (label.equals("OK")) {
                this.hide();
                removeAll();
            }
            return true;
        }
         return false;
    }

	public Dimension preferredSize() {
		return minimumSize();
	}

	public Dimension minimumSize() {
		return (new Dimension(300, 200));
	}
 
}

