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

package com.macromedia.generator.api;

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

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

public class FillStyle extends GenObject
{

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

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

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

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

    public void setClippedBitmap(Bitmap bitmap)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = FillStylePeer.SetClippedBitmap(peer, bitmap.peer);
        if(i == 0)
            throw new GeneratorApiException("error setting clipped bitmap");
        else
            return;
    }

    public void setColor(Color color)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = FillStylePeer.SetColor(peer, color.peer);
        if(i == 0)
            throw new GeneratorApiException("error setting color");
        else
            return;
    }

    public void setLinearGradient(Gradient gradient)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = FillStylePeer.SetLinearGradient(peer, gradient.peer);
        if(i == 0)
            throw new GeneratorApiException("error setting linear gradient");
        else
            return;
    }

    public void setMatrix(Matrix matrix)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = FillStylePeer.SetMatrix(peer, matrix.peer);
        if(i == 0)
            throw new GeneratorApiException("error setting matrix");
        else
            return;
    }

    public void setRadialGradient(Gradient gradient)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = FillStylePeer.SetRadialGradient(peer, gradient.peer);
        if(i == 0)
            throw new GeneratorApiException("error setting radial gradient");
        else
            return;
    }

    public void setRgb(int i)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int j = FillStylePeer.SetRgb(peer, i);
        if(j == 0)
            throw new GeneratorApiException("error setting rgb");
        else
            return;
    }

    public void setTiledBitmap(Bitmap bitmap)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = FillStylePeer.SetTiledBitmap(peer, bitmap.peer);
        if(i == 0)
            throw new GeneratorApiException("error setting tiled bitmap");
        else
            return;
    }
}