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

package com.macromedia.generator.api;

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

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

public class LineStyle extends GenObject
{

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

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

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

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

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

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

    public void setWidth(int i)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        int j = LineStylePeer.SetWidth(peer, i);
        if(j == 0)
            throw new GeneratorApiException("error setting width");
        else
            return;
    }
}