// Decompiled by DJ v2.6.6.51 Copyright 2000 Atanas Neshkov  Date: 6/15/2001 17:42:02
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   com/macromedia/generator/api/Rect

package com.macromedia.generator.api;

import com.macromedia.generator.api.peer.RectPeer;

// Referenced classes of package com.macromedia.generator.api:
//            GenObject, GeneratorApiRuntimeException

public class Rect extends GenObject
{

    public Rect()
    {
        peer = RectPeer.New();
        if(peer == 0)
            throw new GeneratorApiRuntimeException("unable to create peer");
        else
            return;
    }

    protected Rect(int i)
    {
        peer = i;
        if(peer == 0)
            throw new GeneratorApiRuntimeException("invalid peer");
        else
            return;
    }

    protected void finalize()
        throws Throwable
    {
        if(peer != 0)
            RectPeer.Release(peer);
        peer = 0;
    }

    public int getXMax()
    {
        int ai[] = new int[1];
        if(peer == 0)
            throw new GeneratorApiRuntimeException("invalid peer");
        int i = RectPeer.GetXMax(peer, ai);
        if(i == 0)
            throw new GeneratorApiRuntimeException("error getting maximum x value");
        else
            return ai[0];
    }

    public int getXMin()
    {
        int ai[] = new int[1];
        if(peer == 0)
            throw new GeneratorApiRuntimeException("invalid peer");
        int i = RectPeer.GetXMin(peer, ai);
        if(i == 0)
            throw new GeneratorApiRuntimeException("error getting minimum x value");
        else
            return ai[0];
    }

    public int getYMax()
    {
        int ai[] = new int[1];
        if(peer == 0)
            throw new GeneratorApiRuntimeException("invalid peer");
        int i = RectPeer.GetYMax(peer, ai);
        if(i == 0)
            throw new GeneratorApiRuntimeException("error getting maximum y value");
        else
            return ai[0];
    }

    public int getYMin()
    {
        int ai[] = new int[1];
        if(peer == 0)
            throw new GeneratorApiRuntimeException("invalid peer");
        int i = RectPeer.GetYMin(peer, ai);
        if(i == 0)
            throw new GeneratorApiRuntimeException("error getting minimum y value");
        else
            return ai[0];
    }

    public void release()
    {
        if(peer != 0)
            RectPeer.Release(peer);
        peer = 0;
    }

    public void setXMax(int i)
    {
        if(peer == 0)
            throw new GeneratorApiRuntimeException("invalid peer");
        int j = RectPeer.SetXMax(peer, i);
        if(j == 0)
            throw new GeneratorApiRuntimeException("error setting maximum x value");
        else
            return;
    }

    public void setXMin(int i)
    {
        if(peer == 0)
            throw new GeneratorApiRuntimeException("invalid peer");
        int j = RectPeer.SetXMin(peer, i);
        if(j == 0)
            throw new GeneratorApiRuntimeException("error setting minimum x value");
        else
            return;
    }

    public void setYMax(int i)
    {
        if(peer == 0)
            throw new GeneratorApiRuntimeException("invalid peer");
        int j = RectPeer.SetYMax(peer, i);
        if(j == 0)
            throw new GeneratorApiRuntimeException("error setting maximum x value");
        else
            return;
    }

    public void setYMin(int i)
    {
        if(peer == 0)
            throw new GeneratorApiRuntimeException("invalid peer");
        int j = RectPeer.SetYMin(peer, i);
        if(j == 0)
            throw new GeneratorApiRuntimeException("error setting minimum y value");
        else
            return;
    }
}