package com.uvigo.mhp.ui;

import java.awt.*;
import java.awt.event.*;
import java.net.*;
import org.havi.ui.*;
import org.havi.ui.event.*;
import com.uvigo.mhp.looks.*;

public class HLabel extends HStaticText
{
     public static final int TIME_ALWAYS = 0;
    public static final int TIME_OK = 1;
    public static final int TIME_WRONG = 2;
    public static final int TIME_DELAYED = 4;
    public static final int TIME_LIMITED = 6;
    
    private String label;
    private int delayedTimeMode;
    private int delayedTime;
    
    public HLabel()
    {
        super();
        label="HLabel";
        delayedTimeMode=TIME_ALWAYS;
        delayedTime=0;
        setTextContent(label, HState.ALL_STATES);
        try
        {
            setLook(new HTextLook1());
        }
        catch (Exception ex)
        {}
    }
     public int getDelayedTimeMode() {
        return delayedTimeMode;
    }

    public void setDelayedTimeMode(int i) {

        int old = delayedTimeMode;
        if (i != old) {
            delayedTimeMode = i;
            repaint();
            firePropertyChange("delayedTimeMode", new Integer(old), new Integer(i));

        }
    }
    public int getDelayedTime() {
        return delayedTime;
    }

    public void setDelayedTime(int m) {
        int old = delayedTime;
        if (m != old) {
            delayedTime = m;
            firePropertyChange("delayedTime", new Integer(old), new Integer(m));
        }
    }
    
    public String getLabel()
    {
        return label;
    }
    
    public void setLabel(String s)
    {
        String old=label;
        label=s;
        setTextContent(label, HState.ALL_STATES);
        firePropertyChange("label", old, label);
    }
}
