Alter the remaining Application.application occurancies
authorAndy Allan <andy@gravitystorm.co.uk>
Wed, 29 Jun 2011 17:56:52 +0000 (18:56 +0100)
committerAndy Allan <andy@gravitystorm.co.uk>
Wed, 29 Jun 2011 17:56:52 +0000 (18:56 +0100)
12 files changed:
net/systemeD/potlatch2/BackgroundDialog.mxml
net/systemeD/potlatch2/BackgroundSelector.mxml
net/systemeD/potlatch2/RelationSelectPanel.mxml
net/systemeD/potlatch2/StyleSelector.mxml
net/systemeD/potlatch2/VectorSourceDialog.mxml
net/systemeD/potlatch2/find/FindDialog.mxml
net/systemeD/potlatch2/help/HelpDialog.mxml
net/systemeD/potlatch2/mapfeatures/editors/TurnRestrictionIcon.mxml
net/systemeD/potlatch2/mygpx/MyGpxDialog.mxml
net/systemeD/potlatch2/options/OptionsDialog.mxml
net/systemeD/potlatch2/save/SaveDialog.mxml
potlatch2.mxml

index 580a090..6b35c7f 100644 (file)
@@ -41,6 +41,7 @@
     import mx.managers.PopUpManager;
     import mx.events.CloseEvent;
     import mx.core.Application;
+    import mx.core.FlexGlobals;
        import mx.collections.ArrayCollection;
        import mx.controls.List;
        import net.systemeD.potlatch2.FunctionKeyManager;
@@ -54,7 +55,7 @@
                this.menu=menu;
                collection=source;
                dataCollection=new ArrayCollection(source.collection);
-        PopUpManager.addPopUp(this, Application(Application.application), true);
+        PopUpManager.addPopUp(this, Application(FlexGlobals.topLevelApplication), true);
         PopUpManager.centerPopUp(this);
         this.addEventListener(CloseEvent.CLOSE, backgroundDialog_close);
                dataGrid.dataProvider=dataCollection;
index 2c48339..cc4c116 100644 (file)
@@ -6,19 +6,19 @@
        
        <mx:List width="100%" height="100%" id="background"
                        labelField="name"
-                       change="Application.application.bgButton.close(); Imagery.instance().setBackground(background.selectedItem);"
+                       change="FlexGlobals.topLevelApplication.bgButton.close(); Imagery.instance().setBackground(background.selectedItem);"
                dataProvider="{Imagery.instance().getAvailableImagery()}"
                rowCount="{Imagery.instance().getAvailableImagery().length}"/>
        <mx:HBox>
-       <mx:CheckBox width="100%" label="Dim" selected="{Application.application.theMap.getDimming()}" id="dim"
+       <mx:CheckBox width="100%" label="Dim" selected="{FlexGlobals.topLevelApplication.theMap.getDimming()}" id="dim"
            change="setDimming(dim.selected)" />
-       <mx:CheckBox width="100%" label="Sharpen" selected="{Application.application.theMap.getSharpen()}" id="sharpen"
+       <mx:CheckBox width="100%" label="Sharpen" selected="{FlexGlobals.topLevelApplication.theMap.getSharpen()}" id="sharpen"
            change="setSharpen(sharpen.selected)" />
        </mx:HBox>
 
        <mx:HBox>
-       <mx:Button label="Edit..." click="Application.application.bgButton.close(); new BackgroundDialog().init('Background imagery',background,Imagery.instance());" />
-       <mx:Button label="Vector file..." click="Application.application.bgButton.close(); new VectorSourceDialog().init();" />
+       <mx:Button label="Edit..." click="FlexGlobals.topLevelApplication.bgButton.close(); new BackgroundDialog().init('Background imagery',background,Imagery.instance());" />
+       <mx:Button label="Vector file..." click="FlexGlobals.topLevelApplication.bgButton.close(); new VectorSourceDialog().init();" />
        </mx:HBox>
 
        <mx:Script><![CDATA[
                import mx.managers.PopUpManager;
 
                public function setDimming(v:Boolean):void {
-                       Application.application.theMap.setDimming(dim.selected);
-                       Application.application.yahoo.alpha = dim.selected ? 0.5 : 1;
+                       FlexGlobals.topLevelApplication.theMap.setDimming(dim.selected);
+                       FlexGlobals.topLevelApplication.yahoo.alpha = dim.selected ? 0.5 : 1;
                        var obj:SharedObject=SharedObject.getLocal("user_state");
                        obj.setProperty('background_dim',v);
                        obj.flush();
                }
                public function setSharpen(v:Boolean):void {
-                       Application.application.theMap.setSharpen(sharpen.selected);
+                       FlexGlobals.topLevelApplication.theMap.setSharpen(sharpen.selected);
                        var obj:SharedObject=SharedObject.getLocal("user_state");
                        obj.setProperty('background_sharpen',v);
                        obj.flush();
index f10440d..a3af4dc 100644 (file)
@@ -11,6 +11,7 @@
         import net.systemeD.potlatch2.*;
         import mx.managers.PopUpManager;
         import mx.core.Application;
+        import mx.core.FlexGlobals;
 
         private var conn:Connection;
         private var relationList:Array;
@@ -29,7 +30,7 @@
             //tagmatches[k]=t[k];// deep copy match pattern tags
             defaulttags[k]=t[k][0];  // route=[hiking,foot] -> route=hiking
           }    
-          PopUpManager.addPopUp(this, Application(Application.application), true);
+          PopUpManager.addPopUp(this, Application(FlexGlobals.topLevelApplication), true);
           PopUpManager.centerPopUp(this);
     
           var titles:Array = [];
@@ -76,7 +77,7 @@
 
                        PopUpManager.removePopUp(this);
                        var panel:RelationEditorPanel = RelationEditorPanel(
-                           PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
+                           PopUpManager.createPopUp(Application(FlexGlobals.topLevelApplication), RelationEditorPanel, true));
                        panel.setRelation(relation);
                        PopUpManager.centerPopUp(panel);
         }
@@ -84,7 +85,7 @@
                public function closeAndLoadRelation():void {
                        PopUpManager.removePopUp(this);
                        var panel:RelationLoaderPanel = RelationLoaderPanel(
-                           PopUpManager.createPopUp(Application(Application.application), RelationLoaderPanel, true));
+                           PopUpManager.createPopUp(Application(FlexGlobals.topLevelApplication), RelationLoaderPanel, true));
                        panel.setEntity(entity);
                        PopUpManager.centerPopUp(panel);
                }
index d839ad7..6d5b0d2 100644 (file)
@@ -6,11 +6,11 @@
        
        <mx:List width="100%" height="100%" id="mapStyle" 
                labelField="name"
-               change="Application.application.styleButton.close(); Stylesheets.instance().setStylesheet(mapStyle.selectedItem.name, mapStyle.selectedItem.url);"
+               change="FlexGlobals.topLevelApplication.styleButton.close(); Stylesheets.instance().setStylesheet(mapStyle.selectedItem.name, mapStyle.selectedItem.url);"
                dataProvider="{Stylesheets.instance().getCollection()}"
                rowCount="{Stylesheets.instance().getCollection().length}" />
 
-       <mx:Button label="Edit..." click="Application.application.styleButton.close(); new BackgroundDialog().init('Map style',mapStyle,Stylesheets.instance());" />
+       <mx:Button label="Edit..." click="FlexGlobals.topLevelApplication.styleButton.close(); new BackgroundDialog().init('Map style',mapStyle,Stylesheets.instance());" />
 
        <mx:Script><![CDATA[
                import net.systemeD.halcyon.*;
index e17c883..046bc94 100644 (file)
@@ -91,6 +91,7 @@
     import mx.events.DataGridEvent;
     import mx.events.CloseEvent;
     import mx.core.Application;
+    import mx.core.FlexGlobals;
        import mx.collections.ArrayCollection;
        import mx.controls.Alert;
 
 
 
     public function init():void {
-        PopUpManager.addPopUp(this, Application(Application.application), true);
+        PopUpManager.addPopUp(this, Application(FlexGlobals.topLevelApplication), true);
         PopUpManager.centerPopUp(this);
         this.addEventListener(CloseEvent.CLOSE, vectorDialog_close);
                dataGrid.addEventListener("visibility_changed", toggleVisibility);
index a64c90e..c19ff64 100644 (file)
@@ -7,6 +7,7 @@
        <mx:Script><![CDATA[
         import flash.events.Event;
                import mx.core.Application;
+               import mx.core.FlexGlobals;
                import mx.events.CloseEvent;
                import mx.events.FlexEvent;
                import mx.managers.PopUpManager;
@@ -27,7 +28,7 @@
                                
                
                public function init():void {
-                       PopUpManager.addPopUp(this, Application(Application.application), true);
+                       PopUpManager.addPopUp(this, Application(FlexGlobals.topLevelApplication), true);
                        PopUpManager.centerPopUp(this);
                        this.addEventListener(CloseEvent.CLOSE, findDialog_close);
                        
@@ -74,9 +75,9 @@
         }
         
         private function goToSelected():void {
-            Application.application.theMap.updateCoordsFromLatLon(selectedResult.lat, selectedResult.lon);
-            Application.application.theMap.download();
-            //Application.application.theMap.redraw();            
+            FlexGlobals.topLevelApplication.theMap.updateCoordsFromLatLon(selectedResult.lat, selectedResult.lon);
+            FlexGlobals.topLevelApplication.theMap.download();
+            //FlexGlobals.topLevelApplication.theMap.redraw();
             PopUpManager.removePopUp(this);
         }
         
index 30daaea..02c4665 100644 (file)
     import mx.managers.PopUpManager;
     import mx.events.CloseEvent;
     import mx.core.Application;
+    import mx.core.FlexGlobals;
 
     /** Pops up a multi-tabbed help window in the middle of the screen, then remembers that the user has seen it. */
     public function init():void {
-        PopUpManager.addPopUp(this, Application(Application.application), true);
+        PopUpManager.addPopUp(this, Application(FlexGlobals.topLevelApplication), true);
         PopUpManager.centerPopUp(this);
         this.addEventListener(CloseEvent.CLOSE, helpDialog_close);
 
   </mx:TabNavigator>
 
   <mx:ControlBar>
-    <mx:Label text="Version: {Application.application.version} Build: {Application.application.build_number}" />
+    <mx:Label text="Version: {FlexGlobals.topLevelApplication.version} Build: {FlexGlobals.topLevelApplication.build_number}" />
     <mx:Spacer width="100%"/>
     <mx:Button label="Ok" click="PopUpManager.removePopUp(this);" styleName="titleWindowButton" />
   </mx:ControlBar>
index 11465a4..6e6b713 100644 (file)
@@ -69,6 +69,7 @@
     import mx.collections.ArrayCollection;
        import mx.utils.ObjectProxy;
        import mx.core.Application;
+       import mx.core.FlexGlobals;
        import mx.managers.PopUpManager;
 
     private var _turn:Object;
        public function openAdvanced():void {
                var rel:Relation=Relation(_turn.relation);
                var panel:RelationEditorPanel = RelationEditorPanel(
-                       PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
+                       PopUpManager.createPopUp(Application(FlexGlobals.topLevelApplication), RelationEditorPanel, true));
                panel.setRelation(rel);
                PopUpManager.centerPopUp(panel);
        }
index 429b62c..aef8e62 100644 (file)
@@ -9,6 +9,7 @@
     import mx.managers.PopUpManager;
     import mx.events.CloseEvent;
     import mx.core.Application;
+    import mx.core.FlexGlobals;
 
     import net.systemeD.halcyon.connection.*;
     import net.systemeD.potlatch2.save.*;
@@ -22,7 +23,7 @@
     private var conn:Connection;
 
     public function init():void {
-        PopUpManager.addPopUp(this, Application(Application.application), true);
+        PopUpManager.addPopUp(this, Application(FlexGlobals.topLevelApplication), true);
         PopUpManager.centerPopUp(this);
         this.addEventListener(CloseEvent.CLOSE, myGpxDialog_close);
 
index c98cab8..62233a4 100644 (file)
@@ -8,22 +8,23 @@
     import mx.managers.PopUpManager;
     import mx.events.CloseEvent;
     import mx.core.Application;
+    import mx.core.FlexGlobals;
     import net.systemeD.halcyon.Globals;
     import net.systemeD.halcyon.Map;
     import net.systemeD.halcyon.connection.Connection;
     import net.systemeD.halcyon.connection.StatusFetcher;
     
     public function init():void {
-        PopUpManager.addPopUp(this, Application(Application.application), true);
+        PopUpManager.addPopUp(this, Application(FlexGlobals.topLevelApplication), true);
         PopUpManager.centerPopUp(this);
         this.addEventListener(CloseEvent.CLOSE, optionsDialog_close);
 
         var obj:SharedObject = SharedObject.getLocal("user_state");
 
-        tbcheck.selected = Application.application.toolbox.visible;
-        cursorcheck.selected = Application.application.theController.cursorsEnabled;
+        tbcheck.selected = FlexGlobals.topLevelApplication.toolbox.visible;
+        cursorcheck.selected = FlexGlobals.topLevelApplication.theController.cursorsEnabled;
         tigercheck.selected = obj.data['tiger_highlighted'];
-        latlongcheck.selected = Application.application.coordsbox.visible;
+        latlongcheck.selected = FlexGlobals.topLevelApplication.coordsbox.visible;
                licencecheck.selected = Map(Globals.vars.root).editableLayer.connection.statusFetcher!=null;
     }
     
@@ -33,7 +34,7 @@
 
     private function tigerToggle():void {
         Globals.vars.highlightTiger = tigercheck.selected;
-        Application.application.theMap.redraw();
+        FlexGlobals.topLevelApplication.theMap.redraw();
 
         var obj:SharedObject = SharedObject.getLocal("user_state");
         obj.setProperty("tiger_highlighted",tigercheck.selected);
               ]]>
   </mx:Script>
        <mx:CheckBox width="100%" label="Show toolbox" selected="true" id="tbcheck"
-           change="Application.application.toolbox.toggle()" />
+           change="FlexGlobals.topLevelApplication.toolbox.toggle()" />
 
        <mx:CheckBox width="100%" label="Use custom cursors" selected="true" id="cursorcheck"
-           change="Application.application.theController.cursorsEnabled=cursorcheck.selected" />
+           change="FlexGlobals.topLevelApplication.theController.cursorsEnabled=cursorcheck.selected" />
 
     <mx:CheckBox width="100%" label="Highlight unedited TIGER (US roads)" selected="false" id="tigercheck"
         change="tigerToggle()" />
 
        <mx:CheckBox width="100%" label="Show mouse latitude/longitude" selected="false" id="latlongcheck" 
-               change="Application.application.coordsbox.visible=latlongcheck.selected" />
+               change="FlexGlobals.topLevelApplication.coordsbox.visible=latlongcheck.selected" />
 
     <mx:CheckBox width="100%" label="Show licence status" selected="false" id="licencecheck"
         change="licenceToggle()" />
index 676c446..cac5ab6 100644 (file)
@@ -82,6 +82,7 @@
     import mx.controls.*;
     import mx.managers.PopUpManager;
        import mx.core.Application;
+       import mx.core.FlexGlobals;
     import mx.events.DataGridEvent;
     import mx.events.DataGridEventReason;
     
index 0c3e996..2b1b524 100644 (file)
                import mx.core.IChildList;
         import mx.containers.Canvas;
                import mx.core.Application;
+               import mx.core.FlexGlobals;
         import mx.events.DragEvent;
         import mx.events.CloseEvent;
         import mx.managers.DragManager;
                        if (entity is Relation) {
                                // If it's a relation, just bring up the editor panel
                                var panel:RelationEditorPanel = RelationEditorPanel(
-                                       PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
+                                       PopUpManager.createPopUp(Application(FlexGlobals.topLevelApplication), RelationEditorPanel, true));
                                panel.setRelation(entity as Relation);
                                PopUpManager.centerPopUp(panel);
                                return;