// 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/ProjectorBuilder

package com.macromedia.generator.api;

import com.macromedia.generator.api.peer.ProjectorBuilderPeer;
import com.macromedia.generator.platform.Mac;

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

public class ProjectorBuilder extends GenObject
{

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

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

    public void build(Buffer buffer, Buffer buffer1)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        if(buffer.peer == 0 || buffer1.peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = ProjectorBuilderPeer.Build(peer, buffer.peer, buffer1.peer);
        if(i == 0)
            throw new GeneratorApiException("error building the Proj buffer");
        else
            return;
    }

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

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

    public void setOS(int i)
    {
        if(peer != 0)
            ProjectorBuilderPeer.SetOS(peer, i);
    }

    public void setPlayerFile(String s)
    {
        Mac mac = Mac.getMac();
        if(mac != null)
        {
            String s1 = mac.makeSystemPretty(s);
            if(peer != 0)
                ProjectorBuilderPeer.SetPlayerFile(peer, s1);
        } else
        if(peer != 0)
            ProjectorBuilderPeer.SetPlayerFile(peer, s);
    }
}