// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) space 
// Source File Name:   DoubleEditor.java

package lt.ktu.gmj.propertySheet;


// Referenced classes of package lt.ktu.gmj.propertySheet:
//            StringablePropertyEditor, PropertyStringer, PropertyReader, InvalidPropertyException, 
//            PropertyWriter, PropertyNotifier, PropertyProvider

public class DoubleEditor extends StringablePropertyEditor
    implements PropertyStringer
{

    public String getAsString()
    {
        return provider.get().toString();
    }

    public void setAsString(String s)
        throws InvalidPropertyException
    {
        try
        {
            provider.set(new Double(s));
        }
        catch (NumberFormatException numberformatexception)
        {
            throw new InvalidPropertyException("Invalid number format");
        }
    }

    public DoubleEditor(PropertyProvider propertyprovider)
    {
        provider = propertyprovider;
        provider.addObserver(this);
        setStringer(this);
    }

    private PropertyProvider provider;
}
