// 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:   DoubleRangeProvider.java

package lt.ktu.gmj.propertySheet;


// Referenced classes of package lt.ktu.gmj.propertySheet:
//            KeyedPropertyProvider, SimplePropertyProvider, PropertyProvider, PropertyReader, 
//            InvalidPropertyException, PropertyWriter, PropertyNotifier, PropertyKeyer, 
//            PropertyObserver

public class DoubleRangeProvider
    implements KeyedPropertyProvider
{

    public void addObserver(PropertyObserver propertyobserver)
    {
    }

    public void refresh()
    {
        minKeyer.refreshed();
        maxKeyer.refreshed();
    }

    public void refreshed()
    {
        refresh();
    }

    public Object get(Object obj)
    {
        return ((PropertyProvider)obj).get();
    }

    public void set(Object obj, Object obj1)
        throws InvalidPropertyException
    {
        double d = ((Double)min.get()).doubleValue();
        double d1 = ((Double)max.get()).doubleValue();
        double d2 = ((Double)obj1).doubleValue();
        if (obj == min)
        {
            min.set(obj1);
            if (d2 > d1)
            {
                max.set(obj1);
                maxKeyer.refreshed();
            }
        }
        if (obj == max)
        {
            max.set(obj1);
            if (d2 < d)
            {
                min.set(obj1);
                minKeyer.refreshed();
            }
        }
    }

    public DoubleRangeProvider(PropertyProvider propertyprovider, PropertyProvider propertyprovider1)
    {
        min = propertyprovider;
        max = propertyprovider1;
        min.addObserver(this);
        max.addObserver(this);
        minKeyer = new PropertyKeyer(this, min);
        maxKeyer = new PropertyKeyer(this, max);
    }

    protected PropertyProvider min;
    protected PropertyProvider max;
    public PropertyKeyer minKeyer;
    public PropertyKeyer maxKeyer;
}
