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

package com.macromedia.generator.commands;

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

public class ChartCommand extends GenericCommand
{

    public ChartCommand()
    {
        _fld010A = 50;
        _fld010B = 100;
        _fld010C = 20;
        _fld010D = -1;
        _fld0112 = false;
        _fld0114 = null;
        _fld0115 = null;
        _fld0116 = null;
        _fld0117 = null;
        _fld0118 = null;
        _fld011A = 0;
        _fld011B = null;
        _fld011C = null;
        _fld011D = 0.0F;
        _fld011E = 0.0F;
        _fld011F = 0.0F;
        _fld0120 = 0.0F;
        _fld0121 = true;
        _fld0122 = false;
        _fld0123 = true;
        _fld0124 = true;
        _fld0125 = 0.0F;
        _fld0126 = 0.0F;
        _fld0127 = 0.0F;
        _fld0128 = 0.0F;
        _fld012B = true;
        _fld012C = 5;
        _fld012D = 2;
        _fld012E = true;
        _fld012F = 1;
        _fld0130 = true;
        _fld0131 = 0.0F;
        _fld0132 = 0.0F;
        _fld0133 = -1;
        _fld0134 = 2;
        _fld0135 = 1;
        _fld0136 = 1.0F;
        _fld0137 = 0;
        _fld0138 = 2;
        _fld0139 = 1.0F;
        _fld013A = 30;
        _fld013B = 7;
        _fld013C = 0;
        _fld013D = 0;
        _fld013E = 20;
        _fld013F = 0.0F;
        _fld0140 = false;
        _fld0141 = false;
        _fld0142 = null;
    }

    private void _mth010A(int i, int j, int k, int ai[])
    {
        if(j != -1 && _fld0117 != null)
        {
            Context context = (Context)_fld0109.add(new Context());
            context.setParent(_fld0119);
            context.setValue("label", _fld0113[i][j]);
            _mth0112(context, i, ai);
            Script script = (Script)_fld0109.add(_fld0117.copyScript());
            _fld0115.processScript(script, context);
            _fld0114.addHorizontalLabelScript(k, script);
            _fld0109.release(context);
        }
    }

    boolean _mth010B(FlashEnvironment flashenvironment)
    {
        int i = findColumn(_fld0113, "value");
        if(i < 0)
        {
            i = findColumn(_fld0113, "val");
            if(i < 0)
            {
                logError(_fld0115, "ValueColumnNotFound", _fld010E);
                return false;
            }
        }
        int j = findColumn(_fld0113, "color");
        if(j < 0)
            logWarning(_fld0115, "ColorColumnNotFound", _fld010E);
        int k = findColumn(_fld0113, "url");
        int l = findColumn(_fld0113, "window");
        int i1 = findColumn(_fld0113, "goto");
        int j1 = findColumn(_fld0113, "gotolabel");
        int k1 = findColumn(_fld0113, "hlabel");
        int ai[] = {
            i, j, k, l, i1, j1, k1
        };
        boolean flag = _fld0134 != 0 && _fld0116 != null;
        int l1 = _fld0113.length - 1;
        _fld0114.setDataCount(l1);
        boolean flag1 = true;
        int i2 = 0;
        for(int j2 = flag1; j2 < _fld0113.length; j2++)
        {
            float f;
            try
            {
                f = Float.valueOf(_fld0113[j2][i]).floatValue();
            }
            catch(NumberFormatException _ex)
            {
                f = 0.0F;
                logWarning(_fld0115, "invalidDataValue", _fld0113[j2][i]);
            }
            int k2;
            try
            {
                if(j != -1)
                    k2 = Color.getRGBValue(_fld0113[j2][j]);
                else
                    k2 = Color.getRGBValue(_fld010F);
            }
            catch(GeneratorApiException _ex)
            {
                k2 = _fld013C;
            }
            _fld0114.setDataValue(i2, f, k2);
            _mth0117(i2, j2, k, l, i1, j1);
            _mth010A(j2, k1, i2, ai);
            if(flag)
            {
                Context context = (Context)_fld0109.add(new Context());
                context.setParent(_fld0119);
                String s = _fld0114.MakeFloatLabel(f);
                context.setValue("value", s);
                _mth0112(context, j2, ai);
                Script script = (Script)_fld0109.add(_fld0116.copyScript());
                _fld0115.processScript(script, context);
                _fld0114.addValueScript(i2, script);
                _fld0109.release(context);
            }
            i2++;
        }

        _fld0114.computeChartSize();
        if(_fld0130)
            _fld0114.RenderLabels(_fld0115, _fld0109, _fld0117);
        try
        {
            _fld0114.process();
        }
        catch(GeneratorApiException _ex) { }
        return true;
    }

    private String _mth010C(String s)
    {
        String s1 = "";
        int i = s.length();
        for(int j = 0; j < i; j++)
            if(s.startsWith("/n/r", j))
            {
                s1 = s1 + ';';
                j += 3;
            } else
            {
                s1 = s1 + s.charAt(j);
            }

        return s1;
    }

    private Script _mth010D(int i, int j, Script script)
    {
        Script script1 = null;
        if(j >= 0)
        {
            script1 = (Script)_fld0109.add(_fld0115.getTemplate().findScript(_fld0113[i][j]));
            if(script1 == null)
                logWarning(_fld0115, "symbolNotFound", null);
        }
        if(script1 == null)
            script1 = script;
        return script1;
    }

    boolean _mth010E(FlashEnvironment flashenvironment, boolean flag)
    {
        try
        {
            _fld0114.setAreaFill(flag);
        }
        catch(GeneratorApiException _ex) { }
        int i = 0;
        for(boolean flag1 = false; !flag1;)
        {
            i++;
            int j = findColumn(_fld0113, "value");
            if(j < 0)
            {
                j = findColumn(_fld0113, "val");
                if(j < 0)
                {
                    logError(_fld0115, "ValueColumnNotFound", _fld010E);
                    return false;
                }
            }
            int k = findColumn(_fld0113, "color");
            int l = findColumn(_fld0113, "hlabel");
            int ai[] = {
                j, l, k
            };
            try
            {
                _fld0114.setValueDisplay(0, 1, 1.0F);
            }
            catch(GeneratorApiException _ex) { }
            int i1 = _fld013C;
            int k1 = _fld0113.length - 1;
            _fld0114.setDataCount(k1);
            boolean flag2 = true;
            int l1 = 0;
            for(int i2 = flag2; i2 < _fld0113.length; i2++)
            {
                float f;
                try
                {
                    f = Float.valueOf(_fld0113[i2][j]).floatValue();
                }
                catch(NumberFormatException _ex)
                {
                    f = 0.0F;
                    logWarning(_fld0115, "invalidDataValue", _fld0113[i2][j]);
                }
                _fld0114.setDataValue(l1, f);
                int j1;
                try
                {
                    if(k != -1)
                        j1 = Color.getRGBValue(_fld0113[i2][k]);
                    else
                        j1 = _fld013C;
                }
                catch(GeneratorApiException _ex)
                {
                    j1 = _fld013C;
                }
                _fld0114.setDataValue(l1, f, j1);
                _mth010A(i2, l, l1, ai);
                l1++;
            }

            String s = null;
            if(!_fld0141)
                s = _fld0142.nextToken();
            if(s != null && s != "")
                try
                {
                    UrlDataSource urldatasource = new UrlDataSource();
                    urldatasource.setEnvironment(_fld0115);
                    _fld0113 = urldatasource.getData(s);
                    _fld0114.pushDataSet();
                }
                catch(Exception _ex)
                {
                    logError(flashenvironment, "DataLoadError", s);
                    flag1 = true;
                }
            else
                flag1 = true;
        }

        if(i > 1)
        {
            if(flag)
            {
                logWarning(_fld0115, "noFillMultiple", "");
                flag = false;
            }
            if(_fld0140)
            {
                logWarning(_fld0115, "no3DMultiple", "");
                _fld0114.setEffect3D(false);
            }
        }
        try
        {
            _fld0114.setAreaFill(flag);
        }
        catch(GeneratorApiException _ex) { }
        _fld0114.computeChartSize();
        if(_fld0130)
            _fld0114.RenderLabels(_fld0115, _fld0109, _fld0117);
        try
        {
            _fld0114.processLines();
        }
        catch(GeneratorApiException _ex) { }
        return true;
    }

    boolean _mth010F(FlashEnvironment flashenvironment, Script script, Context context, int i, Properties properties, boolean flag)
    {
        String s = properties.getProperty("symbol", "");
        s = context.apply(s);
        _fld0140 = false;
        _fld0114.setEffect3D(_fld0140);
        Script script1 = (Script)_fld0109.add(flashenvironment.getTemplate().findScript(s));
        try
        {
            for(boolean flag1 = false; !flag1;)
            {
                int j = findColumn(_fld0113, "x");
                if(j < 0)
                {
                    logError(flashenvironment, "XColumnNotFound", _fld010E);
                    return false;
                }
                int k = findColumn(_fld0113, "y");
                if(j < 0)
                {
                    logError(flashenvironment, "YColumnNotFound", _fld010E);
                    return false;
                }
                int l = findColumn(_fld0113, "symbol");
                if(l < 0)
                    l = -1;
                int i1 = findColumn(_fld0113, "color");
                if(i1 < 0)
                    i1 = -1;
                int j1 = findColumn(_fld0113, "url");
                int k1 = findColumn(_fld0113, "window");
                int l1 = findColumn(_fld0113, "goto");
                int i2 = findColumn(_fld0113, "gotolabel");
                int j2 = findColumn(_fld0113, "hlabel");
                int ai[] = {
                    j, k, l, i1, j1, k1, l1, i2, j2
                };
                Color color = (Color)_fld0109.add(new Color());
                color.setRgb(255);
                int k2 = _fld0113.length - 1;
                if(_fld0133 == -1)
                    _fld0133 = k2;
                if(k2 > _fld0133)
                    k2 = _fld0133;
                _fld0114.setMultiDimenDataCount(k2, 2);
                int l2 = _fld0113.length - k2;
                int i3 = 0;
                boolean flag2 = _fld0134 != 0 && _fld0118 != null;
                for(int j3 = l2; j3 < _fld0113.length; j3++)
                {
                    int k3 = 0;
                    if(i1 != -1)
                    {
                        try
                        {
                            color.setRGBValue(_fld0113[j3][i1]);
                            k3 = Color.getRGBValue(_fld0113[j3][i1]);
                        }
                        catch(GeneratorApiException _ex)
                        {
                            color.setRGBValue(_fld010F);
                            k3 = Color.getRGBValue(_fld010F);
                        }
                    } else
                    {
                        color.setRGBValue(_fld010F);
                        k3 = Color.getRGBValue(_fld010F);
                    }
                    float f;
                    float f1;
                    try
                    {
                        f = Float.valueOf(_fld0113[j3][j]).floatValue();
                        f1 = Float.valueOf(_fld0113[j3][k]).floatValue();
                    }
                    catch(NumberFormatException _ex)
                    {
                        f = 0.0F;
                        f1 = 0.0F;
                    }
                    _mth010A(j3, j2, i3, ai);
                    Script script2 = null;
                    Script script3 = _mth010D(j3, l, script1);
                    Context context1 = null;
                    if(script3 != null)
                    {
                        context1 = (Context)_fld0109.add(new Context());
                        context1.setParent(_fld0119);
                        for(int l3 = 0; l3 < _fld0113[j3].length; l3++)
                            context1.setValue(_fld0113[0][l3], _fld0113[j3][l3]);

                        script2 = (Script)_fld0109.add(script3.copyScript());
                        _fld0115.processScript(script2, context1);
                    }
                    _fld0114.set2DData(i3, f, f1, script2);
                    _fld0114.setDataColor(i3, k3);
                    _mth0117(i3, j3, j1, k1, l1, i2);
                    if(flag2)
                    {
                        Context context2 = null;
                        context2 = (Context)_fld0109.add(new Context());
                        context2.setParent(_fld0119);
                        String s2 = Float.toString(f);
                        context2.setValue("x", s2);
                        s2 = Float.toString(f1);
                        context2.setValue("y", s2);
                        Script script4 = (Script)_fld0109.add(_fld0118.copyScript());
                        _fld0115.processScript(script4, context2);
                        _mth0112(context2, j3, ai);
                        _fld0114.addValueScript(i3, script4);
                        _fld0109.release(context2);
                    }
                    _fld0109.release(context1);
                    i3++;
                }

                _fld0114.drawScatterLines(flag);
                _fld0109.release(color);
                String s1 = null;
                if(!_fld0141)
                    s1 = _fld0142.nextToken();
                if(s1 != null && s1 != "")
                    try
                    {
                        UrlDataSource urldatasource = new UrlDataSource();
                        urldatasource.setEnvironment(_fld0115);
                        _fld0113 = urldatasource.getData(s1);
                        _fld0114.pushDataSet();
                    }
                    catch(Exception _ex)
                    {
                        logError(flashenvironment, "DataLoadError", s1);
                        flag1 = true;
                    }
                else
                    flag1 = true;
            }

        }
        catch(GeneratorApiException _ex)
        {
            logError(flashenvironment, "buildchartobject", _fld010E);
            return false;
        }
        _fld0114.computeChartSize();
        if(_fld0130)
            _fld0114.RenderLabels(_fld0115, _fld0109, _fld0117);
        try
        {
            _fld0114.process();
        }
        catch(GeneratorApiException _ex) { }
        return true;
    }

    boolean _mth0110(FlashEnvironment flashenvironment)
    {
        int i = findColumn(_fld0113, "color");
        if(i < 0)
        {
            logError(_fld0115, "noStackColor", "");
            return false;
        }
        int j = _fld0113.length - 1;
        int k = _fld0113[0].length - 1;
        _fld0114.setStackCount(k, j);
        for(int l = 1; l < _fld0113.length; l++)
        {
            int i1;
            try
            {
                i1 = Color.getRGBValue(_fld0113[l][i]);
            }
            catch(GeneratorApiException _ex)
            {
                i1 = _fld013C;
            }
            _fld0114.setStackColor(l - 1, i1);
        }

        int j1 = 0;
        boolean flag = _fld0134 != 0 && _fld0116 != null;
        for(int k1 = 0; k1 < _fld0113[0].length; k1++)
            if(j1 < k && k1 != i)
            {
                for(int l1 = 1; l1 < _fld0113.length; l1++)
                {
                    float f;
                    try
                    {
                        f = Float.valueOf(_fld0113[l1][k1]).floatValue();
                    }
                    catch(NumberFormatException _ex)
                    {
                        f = 0.0F;
                        logWarning(_fld0115, "invalidDataValue", _fld0113[l1][k1]);
                    }
                    _fld0114.setStackValue(j1, l1 - 1, f);
                    if(flag)
                    {
                        Context context = (Context)_fld0109.add(new Context());
                        context.setParent(_fld0119);
                        String s = _fld0114.MakeFloatLabel(f);
                        context.setValue("value", s);
                        Script script = (Script)_fld0109.add(_fld0116.copyScript());
                        _fld0115.processScript(script, context);
                        _fld0114.addStackValueScript(j1, l1 - 1, script);
                        _fld0109.release(context);
                    }
                }

                j1++;
            }

        _fld0114.computeChartSize();
        if(_fld0130)
            _fld0114.RenderLabels(_fld0115, _fld0109, _fld0117);
        boolean flag1 = true;
        try
        {
            _fld0114.process();
        }
        catch(GeneratorApiException _ex)
        {
            flag1 = false;
        }
        return flag1;
    }

    boolean _mth0111(FlashEnvironment flashenvironment, boolean flag)
    {
        int i = findColumn(_fld0113, "color");
        if(i < 0)
        {
            logError(_fld0115, "noStackColor", "");
            return false;
        }
        _fld0114.setEffect3D(_fld0140);
        _fld0114.setDepth3D(_fld013F);
        try
        {
            _fld0114.setAreaFill(flag);
        }
        catch(GeneratorApiException _ex) { }
        int j = _fld0113.length - 1;
        _fld0114.setDataCount(j);
        boolean flag1 = true;
        int k = 0;
        int i1 = _fld0113[0].length - 1;
        _fld0114.setStackCount(i1, j);
        for(int j1 = flag1; j1 < _fld0113.length; j1++)
        {
            int k1;
            try
            {
                k1 = Color.getRGBValue(_fld0113[j1][i]);
            }
            catch(GeneratorApiException _ex)
            {
                k1 = _fld013C;
            }
            _fld0114.setStackColor(k, k1);
            k++;
        }

        int l1 = 0;
        for(int i2 = 0; i2 < _fld0113[0].length; i2++)
            if(l1 < i1 && i2 != i)
            {
                int l = 0;
                for(int j2 = flag1; j2 < _fld0113.length; j2++)
                {
                    float f;
                    try
                    {
                        f = Float.valueOf(_fld0113[j2][i2]).floatValue();
                    }
                    catch(NumberFormatException _ex)
                    {
                        f = 0.0F;
                        logWarning(_fld0115, "invalidDataValue", _fld0113[j2][i2]);
                    }
                    _fld0114.setStackValue(l1, l, f);
                    l++;
                }

                l1++;
            }

        _fld0114.computeChartSize();
        if(_fld0130)
            _fld0114.RenderLabels(_fld0115, _fld0109, _fld0117);
        boolean flag2 = true;
        try
        {
            _fld0114.processLines();
        }
        catch(GeneratorApiException _ex)
        {
            flag2 = false;
        }
        return flag2;
    }

    private void _mth0112(Context context, int i, int ai[])
    {
        if(_fld0113 == null)
            return;
        int j = _fld0113[i].length;
        for(int k = 0; k < j; k++)
            if(!_mth0115(k, ai))
                context.setValue(_fld0113[0][k], _fld0113[i][k]);

    }

    public void doCommand(FlashEnvironment flashenvironment, Script script, Context context, int i, Properties properties)
        throws FlashCommandException
    {
        _fld0109 = new GenVector(16);
        _fld0119 = context;
        _fld0115 = flashenvironment;
        _fld011B = script;
        _fld0110 = (Script)_fld0109.add(script.getCommandScript(i));
        _fld011C = _fld0110;
        _fld011A = script.getCommandFrameCount(i);
        if(_fld0110 == null)
            throw new FlashCommandException("movie clip missing");
        String s = null;
        _fld010E = properties.getProperty("datasource", "");
        _fld010E = _fld0119.apply(_fld010E);
        _fld0141 = _fld010E.startsWith("#");
        if(!_fld0141)
        {
            _fld010E = _mth010C(_fld010E);
            _fld0142 = new Tokenizer(_fld010E);
            _fld0142.setDelimiter(';');
            _fld0142.setEscape('\0');
            _fld0142.cullEmptyTokens(true);
            s = _fld0142.nextToken();
        } else
        {
            s = _fld010E;
            _fld0142 = null;
        }
        _fld0111 = properties.getProperty("type", "Bar");
        _fld0111 = _fld0119.apply(_fld0111);
        _fld010F = properties.getProperty("color", "black");
        PropertyParser propertyparser = new PropertyParser(getClass().getName(), flashenvironment, _fld0119, properties);
        String s1 = properties.getProperty("instancename", null);
        try
        {
            if(s1 != null)
                script.setCommandLabel(i, s1);
        }
        catch(GeneratorApiException _ex)
        {
            logError(flashenvironment, "UnableToSetInstanceName", s1);
        }
        _fld012B = true;
        if(propertyparser.HasParam("gridscale"))
        {
            _fld012B = propertyparser.ParamEquals("gridscale", "auto");
            if(!_fld012B && !propertyparser.ParamEquals("gridscale", "manual"))
            {
                logError(_fld0115, "gridScaleErr", properties.getProperty("gridscale"));
                _fld012B = true;
            }
        }
        _fld012C = 1;
        if(propertyparser.HasParam("majorlines"))
        {
            _fld012C = propertyparser.GetIntParam("majorlines", 1);
            if(!propertyparser.Suceeded())
                logError(flashenvironment, "majorDivErr", propertyparser.GetStringParam("majordiv"));
        }
        _fld012D = 1;
        if(propertyparser.HasParam("minorlines"))
        {
            _fld012D = propertyparser.GetIntParam("minorlines", 1);
            if(!propertyparser.Suceeded())
                logError(flashenvironment, "minorDivErr", propertyparser.GetStringParam("minordiv"));
        }
        if(_fld012C <= 0)
        {
            logWarning(flashenvironment, "invaliddivisions", "");
            _fld012C = 1;
        }
        if(_fld012D < 0)
        {
            logWarning(flashenvironment, "invaliddivisions", "");
            _fld012D = 1;
        }
        _fld0122 = false;
        if(propertyparser.HasParam("minytype"))
        {
            _fld0122 = propertyparser.ParamEquals("minytype", "relative");
            if(!_fld0122 && !propertyparser.ParamEquals("minytype", "Absolute"))
            {
                logError(flashenvironment, "minTypeErr", propertyparser.GetStringParam("minytype"));
                _fld0122 = false;
            }
        }
        _fld0121 = false;
        if(propertyparser.HasParam("maxytype"))
        {
            _fld0121 = propertyparser.ParamEquals("maxytype", "relative");
            if(!_fld0121 && !propertyparser.ParamEquals("maxytype", "Absolute"))
            {
                logError(flashenvironment, "maxTypeErr", propertyparser.GetStringParam("maxytype"));
                _fld0121 = false;
            }
        }
        _fld0125 = propertyparser.GetFloatParam("ymin", 0.0F);
        if(!propertyparser.Suceeded() && propertyparser.HasParam("ymin"))
            logWarning(flashenvironment, "MinMaxMustBeNumbers", propertyparser.GetStringParam("ymin"));
        _fld0126 = propertyparser.GetFloatParam("ymax", 0.0F);
        if(!propertyparser.Suceeded() && propertyparser.HasParam("ymax"))
            logWarning(flashenvironment, "MinMaxMustBeNumbers", propertyparser.GetStringParam("ymax"));
        _fld0132 = propertyparser.GetFloatParam("origin", 0.0F);
        if(!propertyparser.Suceeded() && propertyparser.HasParam("origin"))
            logWarning(flashenvironment, "originMustBeNumber", propertyparser.GetStringParam("origin"));
        if(!_fld0122 && !_fld0121 && _fld0125 > _fld0126)
        {
            logError(flashenvironment, "YMinGreaterThanYMax", "");
            return;
        }
        _fld0123 = true;
        if(propertyparser.HasParam("minxtype"))
        {
            _fld0123 = propertyparser.ParamEquals("minxtype", "relative");
            if(!_fld0122 && !propertyparser.ParamEquals("minxtype", "Absolute"))
                logError(flashenvironment, "minTypeErr", propertyparser.GetStringParam("minxtype"));
        }
        _fld0124 = true;
        if(propertyparser.HasParam("maxxtype"))
        {
            _fld0124 = propertyparser.ParamEquals("maxxtype", "relative");
            if(!_fld0121 && !propertyparser.ParamEquals("maxytype", "Absolute"))
                logError(flashenvironment, "maxTypeErr", propertyparser.GetStringParam("maxxtype"));
        }
        _fld0127 = 0.0F;
        if(propertyparser.HasParam("minx"))
        {
            _fld0127 = propertyparser.GetFloatParam("minx", 0.0F);
            if(!propertyparser.Suceeded())
                logWarning(flashenvironment, "MinMaxMustBeNumbers", propertyparser.GetStringParam("xmin"));
        }
        _fld0128 = 0.0F;
        if(propertyparser.HasParam("maxx"))
        {
            _fld0128 = propertyparser.GetFloatParam("maxx", 0.0F);
            if(!propertyparser.Suceeded())
                logWarning(flashenvironment, "MinMaxMustBeNumbers", propertyparser.GetStringParam("xmax"));
        }
        if(!_fld0123 && !_fld0124 && _fld0127 > _fld0128)
        {
            logError(flashenvironment, "XMinGreaterThanXMax", "");
            return;
        }
        _fld0130 = true;
        if(propertyparser.HasParam("labels"))
        {
            _fld0130 = propertyparser.ParamEquals("labels", "on");
            if(!_fld0130 && !propertyparser.ParamEquals("labels", "off"))
            {
                logError(_fld0115, "labelParamErr", propertyparser.GetStringParam("labels"));
                _fld0130 = true;
            }
        }
        _fld012F = 1;
        if(propertyparser.HasParam("gridlines"))
            if(propertyparser.ParamEquals("gridlines", "on"))
                _fld012F = 1;
            else
            if(propertyparser.ParamEquals("gridlines", "off"))
                _fld012F = 0;
            else
            if(propertyparser.ParamEquals("gridlines", "tick") || propertyparser.ParamEquals("gridlines", "tic"))
            {
                _fld012F = 2;
            } else
            {
                logError(_fld0115, "gridlinesParamErr", propertyparser.GetStringParam("gridlines"));
                _fld012F = 1;
            }
        _fld0134 = 2;
        if(propertyparser.ParamEquals("valuedisplay", "never"))
            _fld0134 = 0;
        else
        if(propertyparser.ParamEquals("valuedisplay", "always"))
            _fld0134 = 1;
        else
        if(propertyparser.ParamEquals("valuedisplay", "rollover"))
            _fld0134 = 2;
        else
        if(propertyparser.HasParam("valuedisplay"))
            logError(_fld0115, "valueDisplayErr", properties.getProperty("valuedisplay"));
        _fld0137 = 0;
        if(propertyparser.HasParam("hlabelorient"))
            if(propertyparser.ParamEquals("hlabelorient", "horizontal"))
                _fld0137 = 1;
            else
            if(propertyparser.ParamEquals("hlabelorient", "vertical"))
                _fld0137 = 0;
            else
                logError(_fld0115, "hlabelorientErr", propertyparser.GetStringParam("hlabelorient"));
        _fld0138 = 2;
        _fld0139 = 1.0F;
        if(propertyparser.HasParam("hlabelscale"))
            if(propertyparser.ParamEquals("hlabelscale", "scaleToFit"))
                _fld0138 = 1;
            else
            if(propertyparser.ParamEquals("hlabelscale", "fixed"))
            {
                _fld0138 = 2;
                _fld0139 = 1.0F;
            } else
            if(propertyparser.ParamEquals("hlabelscale", "double"))
            {
                _fld0138 = 3;
                _fld0139 = 2.0F;
            } else
            if(propertyparser.ParamEquals("hlabelscale", "half"))
            {
                _fld0138 = 3;
                _fld0139 = 0.5F;
            } else
            {
                _fld0139 = propertyparser.GetFloatParam("hlabelscale", 1.0F);
                _fld0138 = 3;
                if(!propertyparser.Suceeded())
                {
                    logError(_fld0115, "hlabelScaleErr", propertyparser.GetStringParam("hlabelscale"));
                    _fld0138 = 2;
                }
            }
        _fld0135 = 1;
        _fld0136 = 1.0F;
        if(propertyparser.HasParam("valuescale") && !propertyparser.ParamEquals("valuescale", "scaleToFit"))
            if(propertyparser.ParamEquals("valuescale", "fixed"))
            {
                _fld0135 = 2;
                _fld0136 = 1.0F;
            } else
            if(propertyparser.ParamEquals("valuescale", "double"))
            {
                _fld0135 = 3;
                _fld0136 = 2.0F;
            } else
            if(propertyparser.ParamEquals("valuescale", "half"))
            {
                _fld0135 = 3;
                _fld0136 = 0.5F;
            } else
            {
                _fld0136 = propertyparser.GetFloatParam("valuescale", 1.0F);
                _fld0135 = 3;
                if(!propertyparser.Suceeded() && propertyparser.HasParam("valuescale"))
                {
                    logError(_fld0115, "valueScaleParamErr", propertyparser.GetStringParam("valuescale"));
                    _fld0135 = 1;
                }
            }
        _fld013E = 20;
        if(propertyparser.HasParam("linethickness"))
        {
            _fld013E = propertyparser.GetIntParam("linethickness", 20);
            if(!propertyparser.Suceeded())
                logError(_fld0115, "chartLineSizeErr", propertyparser.GetStringParam("linethickness"));
        }
        if(_fld013E < 1)
            _fld013E = 1;
        _fld013A = 20;
        if(propertyparser.HasParam("borderthickness"))
        {
            _fld013A = propertyparser.GetIntParam("borderthickness", 20);
            if(!propertyparser.Suceeded())
                logError(_fld0115, "lineSizeErr", propertyparser.GetStringParam("borderthickness"));
        }
        if(_fld013A < 1)
            _fld013A = 1;
        _fld013B = _fld013A / 4;
        if(_fld013B < 1)
            _fld013B = 1;
        try
        {
            _fld013C = Color.getRGBValue(propertyparser.GetStringParam("color", "black"));
        }
        catch(GeneratorApiException _ex)
        {
            logWarning(_fld0115, "UseDefColor", propertyparser.GetStringParam("color"));
        }
        _fld013D = (_fld013C | 0x1010101) >> 1;
        _fld013F = propertyparser.GetFloatParam("depth", 0.0F);
        if(_fld013F < 0.0F || !propertyparser.Suceeded())
        {
            if(propertyparser.HasParam("depth"))
                logError(_fld0115, "depthParamErr", propertyparser.GetStringParam("depth"));
            _fld013F = 0.0F;
        }
        _fld0140 = _fld013F > 1E-005F;
        _fld012E = true;
        if(propertyparser.HasParam("border"))
        {
            _fld012E = propertyparser.ParamEquals("border", "true");
            if(!_fld012E && !propertyparser.ParamEquals("border", "false"))
            {
                logError(_fld0115, "borderParamErr", properties.getProperty("border"));
                _fld012E = true;
            }
        }
        _fld0133 = -1;
        if(propertyparser.HasParam("maxentries"))
            if(propertyparser.ParamEquals("maxentries", "default"))
            {
                _fld0133 = -1;
            } else
            {
                _fld0133 = propertyparser.GetIntParam("maxentries", -1);
                if(!propertyparser.Suceeded())
                    logWarning(_fld0115, "maxEntriesErr", "");
            }
        int j = propertyparser.GetIntParam("gap", 0);
        if(!propertyparser.Suceeded() || j < 0)
        {
            if(propertyparser.HasParam("gap"))
                logWarning(_fld0115, "gapErr", "");
            j = 0;
        }
        byte byte0 = 0;
        if(propertyparser.ParamEquals("valueplace", "onbar"))
            byte0 = 0;
        else
        if(propertyparser.ParamEquals("valueplace", "overbar"))
            byte0 = 1;
        else
        if(propertyparser.ParamEquals("valueplace", "overchart"))
            byte0 = 2;
        else
        if(propertyparser.ParamEquals("valueplace", "underchart"))
            byte0 = 3;
        else
        if(propertyparser.HasParam("valueplace"))
            logError(_fld0115, "valuePlaceParamErr", properties.getProperty("valueplace"));
        try
        {
            _fld0114 = (Chart)_fld0109.add(new Chart(getClass().getName(), _fld0115, _fld0119, _fld0110));
            _fld0114.setLabels(_fld0130);
            _fld0114.setBorder(_fld012E);
            if(_fld012F == 2 && (_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strScatter")) || _fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strLineScatter"))))
            {
                logWarning(flashenvironment, "invalidtick", "");
                _fld0114.setGridLines(0);
            } else
            {
                _fld0114.setGridLines(_fld012F);
            }
            _fld0114.setUserLimits(_fld0125, _fld0122, _fld0126, _fld0121);
            _fld0114.setUserXLimits(_fld0127, _fld0123, _fld0128, _fld0124);
            _fld0114.setDivisions(_fld012D + 1, _fld012C - 1);
            _fld0114.setOrigin(_fld0132);
            _fld0114.setValueDisplay(_fld0134, _fld0135, _fld0136);
            _fld0114.setHorizontalLabelDisplay(_fld0137, _fld0138, _fld0139);
            _fld0114.setClip(_fld011C, _fld011A);
            _fld0114.setAutoScale(_fld012B);
            _fld0114.setLineStyle(_fld013A, _fld013C, _fld013B, _fld013D);
            _fld0114.setChartLineThickness(_fld013E);
            _fld0114.setEffect3D(_fld0140);
            _fld0114.setDepth3D(_fld013F);
            _fld0114.setSpacing(0, j);
            _fld0114.setValuePlacement(byte0);
            _fld0114.setMaxDataEntries(_fld0133);
            String s2 = propertyparser.GetStringParam("symbolfile");
            Script script1 = (Script)_fld0109.add(_fld0114.getSymbolScript(s2));
            if(script1 != null)
            {
                _fld0116 = (Script)_fld0109.add(_fld0114.getValueScript(script1, propertyparser));
                _fld0117 = (Script)_fld0109.add(_fld0114.getLabelScript(script1, propertyparser));
                _fld0118 = (Script)_fld0109.add(_fld0114.getScatterValueScript(script1, propertyparser));
            }
        }
        catch(GeneratorApiException _ex)
        {
            logError(_fld0115, "chartclasserror", "");
            return;
        }
        try
        {
            j = Float.valueOf(_fld0119.apply(properties.getProperty("gap", "0"))).intValue();
        }
        catch(NumberFormatException _ex)
        {
            j = 0;
        }
        try
        {
            _fld010B = Float.valueOf(_fld0119.apply(properties.getProperty("depth", "100"))).intValue();
        }
        catch(NumberFormatException _ex)
        {
            _fld010B = 100;
        }
        try
        {
            _fld010C = Float.valueOf(_fld0119.apply(properties.getProperty("lineSize", "20"))).intValue();
        }
        catch(NumberFormatException _ex)
        {
            _fld010C = 20;
        }
        try
        {
            _fld010D = Float.valueOf(_fld0119.apply(properties.getProperty("itemcount", "-1"))).intValue();
        }
        catch(NumberFormatException _ex)
        {
            _fld010D = -1;
        }
        _fld010F = _fld0119.apply(_fld010F);
        try
        {
            Color color = (Color)_fld0109.add(new Color());
            color.setRGBValue(_fld010F);
        }
        catch(GeneratorApiException _ex)
        {
            logError(flashenvironment, "UseDefColor", null);
            _fld010F = "black";
        }
        try
        {
            UrlDataSource urldatasource = new UrlDataSource();
            urldatasource.setEnvironment(flashenvironment);
            try
            {
                _fld0113 = urldatasource.getData(s);
            }
            catch(Exception _ex)
            {
                logError(flashenvironment, "DataLoadError", _fld010E);
                return;
            }
            if(_fld0113 == null)
            {
                logError(flashenvironment, "DataSourceError", _fld010E);
                return;
            }
            if(_fld0113.length <= 1)
            {
                logError(flashenvironment, "invalidrows", _fld010E);
                return;
            }
            Rect rect = (Rect)_fld0109.add(script.getCommandRect(i));
            _fld0114.setChartRect(rect);
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strBar")))
            {
                if(!_mth010B(flashenvironment))
                    logError(flashenvironment, "createBarChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "str3DBar")))
            {
                _fld0112 = true;
                if(!_mth010B(flashenvironment))
                    logError(flashenvironment, "createBarChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strStackedBar")))
            {
                if(!_mth0110(flashenvironment))
                    logError(flashenvironment, "createSBarChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "str3DStackedBar")))
            {
                _fld0112 = true;
                if(!_mth0110(flashenvironment))
                    logError(flashenvironment, "createSBarChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strLine")))
            {
                if(!_mth010E(flashenvironment, false))
                    logError(flashenvironment, "createLineChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "str3DLine")))
            {
                _fld0112 = true;
                if(!_mth010E(flashenvironment, false))
                    logError(flashenvironment, "createLineChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strStackedLine")))
            {
                if(!_mth0111(flashenvironment, false))
                    logError(flashenvironment, "createLineChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "str3DStackedLine")))
            {
                _fld0112 = true;
                if(!_mth0111(flashenvironment, false))
                    logError(flashenvironment, "createLineChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strArea")))
            {
                if(!_mth010E(flashenvironment, true))
                    logError(flashenvironment, "createAreaChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "str3DArea")))
            {
                _fld0112 = true;
                if(!_mth010E(flashenvironment, true))
                    logError(flashenvironment, "createAreaChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strStackedArea")))
            {
                if(!_mth0111(flashenvironment, true))
                    logError(flashenvironment, "createSAreaChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "str3DStackedArea")))
            {
                _fld0112 = true;
                if(!_mth0111(flashenvironment, true))
                    logError(flashenvironment, "createSAreaChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strScatter")))
            {
                if(!_mth010F(flashenvironment, script, _fld0119, i, properties, false))
                    logError(flashenvironment, "createScatterChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strLineScatter")))
            {
                if(!_mth010F(flashenvironment, script, _fld0119, i, properties, true))
                    logError(flashenvironment, "createLineScatterChart", null);
            } else
            if(_fld0111.equalsIgnoreCase(getResourceString(flashenvironment, "strXYLine")))
            {
                if(!_mth010F(flashenvironment, script, _fld0119, i, properties, true))
                    logError(flashenvironment, "createLineScatterChart", null);
            } else
            {
                logError(flashenvironment, "invalidtype", _fld0111);
            }
        }
        catch(GeneratorApiException _ex)
        {
            logError(flashenvironment, "UnableToOpenFile", _fld010E);
        }
        _fld0109.release();
    }

    private int _mth0113(int i, int j)
    {
        if(j == -1)
            return -1;
        int k = -1;
        try
        {
            k = Integer.valueOf(_fld0113[i][j]).intValue();
        }
        catch(NumberFormatException _ex) { }
        return k;
    }

    private String _mth0114(int i, int j)
    {
        if(j == -1)
            return null;
        else
            return _fld0113[i][j];
    }

    private boolean _mth0115(int i, int ai[])
    {
        if(ai == null)
            return false;
        for(int j = 0; j < ai.length; j++)
            if(i == ai[j])
                return true;

        return false;
    }

    private boolean _mth0116(int i, int j)
    {
        if(j == -1)
            return false;
        return _fld0113[i][j] != null && _fld0113[i][j] != "";
    }

    private void _mth0117(int i, int j, int k, int l, int i1, int j1)
    {
        if(_mth0116(j, k))
        {
            try
            {
                String s = null;
                if(l != -1)
                    s = _fld0113[j][l];
                if(s == null || s.length() == 0)
                    s = "_self";
                _fld0114.setURL(i, _fld0113[j][k], s);
            }
            catch(GeneratorApiException _ex) { }
        } else
        {
            int k1 = _mth0113(j, i1);
            if(k1 == -1 && i1 != -1)
                logWarning(_fld0115, "invalidgoto", "");
            if(k1 != -1)
            {
                try
                {
                    _fld0114.setGoTo(i, k1, "../");
                }
                catch(GeneratorApiException _ex)
                {
                    logWarning(_fld0115, "invalidgoto", "");
                }
            } else
            {
                String s1 = _mth0114(j, j1);
                if(s1 != null && s1 != "")
                    try
                    {
                        _fld0114.setGoToLabel(i, "../", s1);
                    }
                    catch(GeneratorApiException _ex)
                    {
                        logWarning(_fld0115, "invalidgotolabel", "");
                    }
            }
        }
    }

    int _fld010A;
    int _fld010B;
    int _fld010C;
    int _fld010D;
    String _fld010E;
    String _fld010F;
    Script _fld0110;
    String _fld0111;
    boolean _fld0112;
    String _fld0113[][];
    GenVector _fld0109;
    private Chart _fld0114;
    private FlashEnvironment _fld0115;
    private Script _fld0116;
    private Script _fld0117;
    private Script _fld0118;
    private Context _fld0119;
    private int _fld011A;
    private Script _fld011B;
    private Script _fld011C;
    private float _fld011D;
    private float _fld011E;
    private float _fld011F;
    private float _fld0120;
    private boolean _fld0121;
    private boolean _fld0122;
    private boolean _fld0123;
    private boolean _fld0124;
    private float _fld0125;
    private float _fld0126;
    private float _fld0127;
    private float _fld0128;
    private final float _fld0129 = 1E-005F;
    private final int _fld012A = 75;
    private boolean _fld012B;
    private int _fld012C;
    private int _fld012D;
    private boolean _fld012E;
    private int _fld012F;
    private boolean _fld0130;
    private float _fld0131;
    private float _fld0132;
    private int _fld0133;
    private int _fld0134;
    private int _fld0135;
    private float _fld0136;
    private int _fld0137;
    private int _fld0138;
    private float _fld0139;
    int _fld013A;
    int _fld013B;
    int _fld013C;
    int _fld013D;
    int _fld013E;
    float _fld013F;
    boolean _fld0140;
    private boolean _fld0141;
    private Tokenizer _fld0142;
}