<commit_before><?xml version="1.0" encoding="utf-8"?>
<!--
///////////////////////////////////////////////////////////////////////////
// Copyright (c) 2010-2011 Esri. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
-->
<!---
    Main application container.
-->
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         width="100%" height="100%"
         creationComplete="creationCompleteHandler(event)"
         initialize="initializeHandler(event)">
    <fx:Script>
        <![CDATA[
            import com.esri.ags.components.IdentityManager;
            import com.esri.viewer.components.ErrorWindow;
            import com.esri.viewer.managers.ConfigManager;
            import com.esri.viewer.managers.DataManager;
            import com.esri.viewer.managers.EventBus;
            import com.esri.viewer.managers.MapManager;
            import com.esri.viewer.managers.ScriptingManager;
            import com.esri.viewer.managers.SecurityManager;
            import com.esri.viewer.managers.UIManager;
            import com.esri.viewer.managers.WidgetManager;
            import com.esri.viewer.utils.LocalizationUtil;

            import mx.core.FlexGlobals;
            import mx.core.IVisualElement;
            import mx.events.FlexEvent;
            import mx.events.ModuleEvent;
            import mx.logging.Log;
            import mx.logging.LogEventLevel;
            import mx.logging.targets.TraceTarget;
            import mx.managers.PopUpManager;
            import mx.modules.IModuleInfo;
            import mx.modules.ModuleManager;

            //==============================================
            // Viewer default values
            //==============================================
            public static const VERSION:String = "ArcGIS Viewer for Flex";

            // name of default configuration file
            public static const DEFAULT_CONFIG_FILE:String = "config.xml";

            public static const DEFAULT_WIDGET_CONTAINER_WIDGET:String = "widgets/WidgetContainer/WidgetContainerWidget.swf";

            public static const DEFAULT_WIDGET_LAYOUT:String = "horizontal";

            public static const DEFAULT_WIDGET_ICON:String = "assets/images/i_widget.png";

            public static const DEFAULT_WIDGET_GROUP_ICON:String = "assets/images/i_folder.png";

            public static const CONTAINER_INITIALIZED:String = "containerInitilized";

            public static const NAVIGATION_ZOOM_FULL:String = "zoomfull";

            public static const NAVIGATION_ZOOM_PREVIOUS:String = "zoomprevious";

            public static const NAVIGATION_ZOOM_NEXT:String = "zoomnext";

            private static const VIEWER_CONTAINER:String = "ViewerContainer";

            public static var configFile:String = ViewerContainer.DEFAULT_CONFIG_FILE;

            public static var urlConfigParams:Object = {}; // holds url parameters as key/value pairs

            private static var m_instance:ViewerContainer;

            public var mapManager:MapManager;

            public var uiManager:UIManager;

            public var widgetManager:WidgetManager;

            public var dataManager:DataManager;

            public var configManager:ConfigManager;

            public var configData:ConfigData;

            public var securityManager:SecurityManager;

            public var scriptingManager:ScriptingManager;

            ForcedImports; // make sure these classes are defined in the root application

            public static function getInstance():ViewerContainer
            {
                return m_instance;
            }

            private function initializeHandler(event:FlexEvent):void
            {
                IdentityManager.instance.enabled = true;
            }

            private function creationCompleteHandler(event:FlexEvent):void
            {
                m_instance = this;

                initLogging();

                //prepare to show error message
                AppEvent.addListener(AppEvent.APP_ERROR, errorHandler);

                setUrlConfigParams();

                setConfigFile();

                startLocalConnection();

                AppEvent.addListener(AppEvent.CONFIG_LOADED, configLoadedHandler);

                //tell the modules it's on business.
                AppEvent.dispatch(ViewerContainer.CONTAINER_INITIALIZED);
            }

            private function setUrlConfigParams():void
            {
                if (!ExternalInterface.available)
                {
                    return;
                }<commit_msg>Set focus on the map on creationComplete.<commit_after><?xml version="1.0" encoding="utf-8"?>
<!--
///////////////////////////////////////////////////////////////////////////
// Copyright (c) 2010-2011 Esri. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
-->
<!---
    Main application container.
-->
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         width="100%" height="100%"
         creationComplete="creationCompleteHandler(event)"
         initialize="initializeHandler(event)">
    <fx:Script>
        <![CDATA[
            import com.esri.ags.components.IdentityManager;
            import com.esri.viewer.components.ErrorWindow;
            import com.esri.viewer.managers.ConfigManager;
            import com.esri.viewer.managers.DataManager;
            import com.esri.viewer.managers.EventBus;
            import com.esri.viewer.managers.MapManager;
            import com.esri.viewer.managers.ScriptingManager;
            import com.esri.viewer.managers.SecurityManager;
            import com.esri.viewer.managers.UIManager;
            import com.esri.viewer.managers.WidgetManager;
            import com.esri.viewer.utils.LocalizationUtil;

            import mx.core.FlexGlobals;
            import mx.core.IVisualElement;
            import mx.events.FlexEvent;
            import mx.events.ModuleEvent;
            import mx.logging.Log;
            import mx.logging.LogEventLevel;
            import mx.logging.targets.TraceTarget;
            import mx.managers.PopUpManager;
            import mx.modules.IModuleInfo;
            import mx.modules.ModuleManager;

            //==============================================
            // Viewer default values
            //==============================================
            public static const VERSION:String = "ArcGIS Viewer for Flex";

            // name of default configuration file
            public static const DEFAULT_CONFIG_FILE:String = "config.xml";

            public static const DEFAULT_WIDGET_CONTAINER_WIDGET:String = "widgets/WidgetContainer/WidgetContainerWidget.swf";

            public static const DEFAULT_WIDGET_LAYOUT:String = "horizontal";

            public static const DEFAULT_WIDGET_ICON:String = "assets/images/i_widget.png";

            public static const DEFAULT_WIDGET_GROUP_ICON:String = "assets/images/i_folder.png";

            public static const CONTAINER_INITIALIZED:String = "containerInitilized";

            public static const NAVIGATION_ZOOM_FULL:String = "zoomfull";

            public static const NAVIGATION_ZOOM_PREVIOUS:String = "zoomprevious";

            public static const NAVIGATION_ZOOM_NEXT:String = "zoomnext";

            private static const VIEWER_CONTAINER:String = "ViewerContainer";

            public static var configFile:String = ViewerContainer.DEFAULT_CONFIG_FILE;

            public static var urlConfigParams:Object = {}; // holds url parameters as key/value pairs

            private static var m_instance:ViewerContainer;

            public var mapManager:MapManager;

            public var uiManager:UIManager;

            public var widgetManager:WidgetManager;

            public var dataManager:DataManager;

            public var configManager:ConfigManager;

            public var configData:ConfigData;

            public var securityManager:SecurityManager;

            public var scriptingManager:ScriptingManager;

            ForcedImports; // make sure these classes are defined in the root application

            public static function getInstance():ViewerContainer
            {
                return m_instance;
            }

            private function initializeHandler(event:FlexEvent):void
            {
                IdentityManager.instance.enabled = true;
            }

            private function creationCompleteHandler(event:FlexEvent):void
            {
                m_instance = this;

                initLogging();

                //prepare to show error message
                AppEvent.addListener(AppEvent.APP_ERROR, errorHandler);

                setUrlConfigParams();

                setConfigFile();

                startLocalConnection();

                AppEvent.addListener(AppEvent.CONFIG_LOADED, configLoadedHandler);

                if (mapManager.map)
                {
                    mapManager.map.setFocus();
                }

                AppEvent.dispatch(ViewerContainer.CONTAINER_INITIALIZED);
            }

            private function setUrlConfigParams():void
            {
                if (!ExternalInterface.available)
                {
                    return;
                }
{'fraction_non_alphanumeric': 0.12209467792429561, 'fraction_numerical': 0.004743382980741865, 'mean_word_length': 1.9965889710062537, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 2, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6122240', 'n_tokens_mistral': 2636, 'n_tokens_neox': 2474, 'n_words': 611}