// Decompiled by DJ v2.6.6.51 Copyright 2000 Atanas Neshkov  Date: 6/15/2001 17:42:01
// 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/Matrix

package com.macromedia.generator.api;

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

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

public class Matrix extends GenObject
{

    public Matrix()
        throws GeneratorApiException
    {
        peer = MatrixPeer.New();
        if(peer == 0)
            throw new GeneratorApiException("unable to create peer");
        else
            return;
    }

    protected Matrix(int i)
        throws GeneratorApiException
    {
        peer = i;
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        else
            return;
    }

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

    public float getAngle()
        throws GeneratorApiException
    {
        float af[] = new float[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetAngle(peer, af);
        if(i == 0)
            throw new GeneratorApiException("error getting angle");
        else
            return af[0];
    }

    public int getBlueOffset()
        throws GeneratorApiException
    {
        int ai[] = new int[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetBlueOffset(peer, ai);
        if(i == 0)
            throw new GeneratorApiException("error getting blue offset");
        else
            return ai[0];
    }

    public float getBlueScale()
        throws GeneratorApiException
    {
        float af[] = new float[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetBlueScale(peer, af);
        if(i == 0)
            throw new GeneratorApiException("error getting blue scale");
        else
            return af[0];
    }

    public int getGreenOffset()
        throws GeneratorApiException
    {
        int ai[] = new int[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetGreenOffset(peer, ai);
        if(i == 0)
            throw new GeneratorApiException("error getting green offset");
        else
            return ai[0];
    }

    public float getGreenScale()
        throws GeneratorApiException
    {
        float af[] = new float[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetGreenScale(peer, af);
        if(i == 0)
            throw new GeneratorApiException("error getting green scale");
        else
            return af[0];
    }

    public int getRedOffset()
        throws GeneratorApiException
    {
        int ai[] = new int[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetRedOffset(peer, ai);
        if(i == 0)
            throw new GeneratorApiException("error getting red offset");
        else
            return ai[0];
    }

    public float getRedScale()
        throws GeneratorApiException
    {
        float af[] = new float[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetRedScale(peer, af);
        if(i == 0)
            throw new GeneratorApiException("error getting red scale");
        else
            return af[0];
    }

    public int getXOffset()
        throws GeneratorApiException
    {
        int ai[] = new int[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetXOffset(peer, ai);
        if(i == 0)
            throw new GeneratorApiException("error getting x offset");
        else
            return ai[0];
    }

    public float getXScale()
        throws GeneratorApiException
    {
        float af[] = new float[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetXScale(peer, af);
        if(i == 0)
            throw new GeneratorApiException("error getting x scale");
        else
            return af[0];
    }

    public int getYOffset()
        throws GeneratorApiException
    {
        int ai[] = new int[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetYOffset(peer, ai);
        if(i == 0)
            throw new GeneratorApiException("error getting y offset");
        else
            return ai[0];
    }

    public float getYScale()
        throws GeneratorApiException
    {
        float af[] = new float[1];
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.GetYScale(peer, af);
        if(i == 0)
            throw new GeneratorApiException("error getting y scale");
        else
            return af[0];
    }

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

    public void setAngle(float f)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.SetAngle(peer, f);
        if(i == 0)
            throw new GeneratorApiException("error setting angle");
        else
            return;
    }

    public void setBlueOffset(int i)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int j = MatrixPeer.SetBlueOffset(peer, i);
        if(j == 0)
            throw new GeneratorApiException("error setting blue offset");
        else
            return;
    }

    public void setBlueScale(float f)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.SetBlueScale(peer, f);
        if(i == 0)
            throw new GeneratorApiException("error setting blue scale");
        else
            return;
    }

    public void setBrightness(float f)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.SetBrightness(peer, f);
        if(i == 0)
            throw new GeneratorApiException("error setting brightness");
        else
            return;
    }

    public void setColorTint(Color color, float f)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.SetColorTint(peer, color.peer, f);
        if(i == 0)
            throw new GeneratorApiException("error setting color tint");
        else
            return;
    }

    public void setGreenOffset(int i)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int j = MatrixPeer.SetGreenOffset(peer, i);
        if(j == 0)
            throw new GeneratorApiException("error setting green offset");
        else
            return;
    }

    public void setGreenScale(float f)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.SetGreenScale(peer, f);
        if(i == 0)
            throw new GeneratorApiException("error setting green scale");
        else
            return;
    }

    public void setRedOffset(int i)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int j = MatrixPeer.SetRedOffset(peer, i);
        if(j == 0)
            throw new GeneratorApiException("error setting red offset");
        else
            return;
    }

    public void setRedScale(float f)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.SetRedScale(peer, f);
        if(i == 0)
            throw new GeneratorApiException("error setting red scale");
        else
            return;
    }

    public void setRgbTint(int i, float f)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int j = MatrixPeer.SetRgbTint(peer, i, f);
        if(j == 0)
            throw new GeneratorApiException("error setting rgb tint");
        else
            return;
    }

    public void setXOffset(int i)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int j = MatrixPeer.SetXOffset(peer, i);
        if(j == 0)
            throw new GeneratorApiException("error setting x offset");
        else
            return;
    }

    public void setXScale(float f)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.SetXScale(peer, f);
        if(i == 0)
            throw new GeneratorApiException("error setting x scale");
        else
            return;
    }

    public void setYOffset(int i)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int j = MatrixPeer.SetYOffset(peer, i);
        if(j == 0)
            throw new GeneratorApiException("error setting y offset");
        else
            return;
    }

    public void setYScale(float f)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = MatrixPeer.SetYScale(peer, f);
        if(i == 0)
            throw new GeneratorApiException("error setting y scale");
        else
            return;
    }
}