// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   PlayerComponent.java

import java.awt.*;

public class PlayerComponent extends RoundedLedComponent
{

    PlayerComponent(int i, int j, int k, int l)
    {
        super(j, k, 512, cHeight, l);
        num = i;
        lName = new Label();
        lName.setBackground(currentColor);
        lName.reshape(ofs, 0, wName, cHeight);
        add(lName);
        lTime = new Label();
        lTime.setBackground(currentColor);
        lTime.reshape(ofs + wName + wSpace, 0, wTime, cHeight);
        lTime.setAlignment(1);
        add(lTime);
        lPoints = new Label();
        lPoints.setBackground(currentColor);
        lPoints.reshape(ofs + wName + 2 * wSpace + wTime, 0, wPoints, cHeight);
        lPoints.setAlignment(1);
        add(lPoints);
    }

    void clearLabels()
    {
        lName.setText("");
        lPoints.setText("");
        lTime.setText("");
    }

    String getPlayerName()
    {
        return lName.getText().substring(3);
    }

    void init(String s, int i, int j, int k)
    {
        super.setColor(k);
        lPoints.setBackground(currentColor);
        setPoints(i);
        lTime.setBackground(currentColor);
        setTime(j);
        lName.setBackground(currentColor);
        setPlayerName(s);
    }

    void setPlayerName(String s)
    {
        lName.setText(num + ". " + s);
    }

    void setPoints(int i)
    {
        lPoints.setText(String.valueOf(i));
    }

    void setTime(int i)
    {
        lTime.setText(i / 60 / 10 + "" + (i / 60) % 10 + ":" + (i % 60) / 10 + i % 60 % 10);
    }

    static int ofs = 23;
    static int wName = 110;
    static int wPoints = 40;
    static int wTime = 40;
    static int wSpace = 2;
    static int cHeight = 22;
    Label lName;
    Label lPoints;
    Label lTime;
    int num;

}
