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

package com.macromedia.generator.commands;

import com.macromedia.generator.api.*;
import com.macromedia.generator.app.*;
import java.util.Properties;

public class SetScaleCommand extends GenericCommand
{

    public SetScaleCommand()
    {
    }

    public void doCommand(FlashEnvironment flashenvironment, Script script, Context context, int i, Properties properties)
        throws FlashCommandException
    {
        float f = 1.0F;
        float f1 = 1.0F;
        float f2 = 0.0F;
        int j = 0;
        int k = 0;
        _fld0109 = new GenVector(16);
        Script script1 = (Script)_fld0109.add(script.getCommandScript(i));
        flashenvironment.processScript(script1, context);
        try
        {
            j = Float.valueOf(context.apply(properties.getProperty("xoffset", ""))).intValue();
        }
        catch(NumberFormatException _ex)
        {
            j = 0;
            logError(flashenvironment, "InvXOff", null);
        }
        try
        {
            k = Float.valueOf(context.apply(properties.getProperty("yoffset", ""))).intValue();
        }
        catch(NumberFormatException _ex)
        {
            k = 0;
            logError(flashenvironment, "InvYOff", null);
        }
        try
        {
            f = Float.valueOf(context.apply(properties.getProperty("xscale", ""))).floatValue();
        }
        catch(NumberFormatException _ex)
        {
            f = 1.0F;
            logError(flashenvironment, "InvalXScale", null);
        }
        try
        {
            f1 = Float.valueOf(context.apply(properties.getProperty("yscale", ""))).floatValue();
        }
        catch(NumberFormatException _ex)
        {
            f1 = 1.0F;
            logError(flashenvironment, "InvalYScale", null);
        }
        try
        {
            f2 = Float.valueOf(context.apply(properties.getProperty("rotate", ""))).floatValue();
        }
        catch(NumberFormatException _ex)
        {
            f2 = 0.0F;
            logError(flashenvironment, "InvalRotate", null);
        }
        j *= 20;
        k *= 20;
        try
        {
            Matrix matrix = (Matrix)_fld0109.add(new Matrix());
            matrix.setXScale(f);
            matrix.setYScale(f1);
            matrix.setAngle(f2);
            matrix.setXOffset(j);
            matrix.setYOffset(k);
            script.setCommandMatrix(i, matrix);
        }
        catch(GeneratorApiException _ex)
        {
            logError(flashenvironment, "ErrorSettingScale", null);
        }
        catch(GeneratorApiRuntimeException _ex)
        {
            logError(flashenvironment, "ErrorSettingScale", null);
        }
        _fld0109.release();
    }

    GenVector _fld0109;
}