Module: nagvis
Branch: master
Commit: c075bdad9288bd558ee6aa5f9315ab6da4c5894a
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=c075bdad9288bd558ee6aa5f9315ab6da4c5894a

Author: Andriy Skuratov <[email protected]>
Date:   Thu Aug  6 14:39:54 2009 +0300

Some code cleanup.

---

 uifx/src/modules/gmap/GMapModule.as                |   37 ++++++++++-------
 uifx/src/modules/gmap/events/LocationsViewEvent.as |   45 --------------------
 uifx/src/modules/gmap/view/FoundLocationsView.as   |    2 +-
 uifx/src/modules/gmap/view/LocationsView.as        |    2 +-
 uifx/src/modules/gmap/view/MainView.mxml           |    1 -
 .../gmap/view/controls/GMapLocationsControl.as     |    2 +
 6 files changed, 26 insertions(+), 63 deletions(-)

diff --git a/uifx/src/modules/gmap/GMapModule.as 
b/uifx/src/modules/gmap/GMapModule.as
index 7135d3a..4f9d92f 100644
--- a/uifx/src/modules/gmap/GMapModule.as
+++ b/uifx/src/modules/gmap/GMapModule.as
@@ -39,7 +39,6 @@ import modules.gmap.domain.nagios.HostGroup;
 import modules.gmap.domain.nagios.Service;
 import modules.gmap.domain.nagios.ServiceGroup;
 import modules.gmap.events.LocationEvent;
-import modules.gmap.events.LocationsViewEvent;
 
 import mx.collections.ArrayCollection;
 import mx.controls.Alert;
@@ -124,11 +123,13 @@ private function onMapReady(event : Event) : void
        
        /* Done
        locationsView = new LocationsView(map, locations);
-       */
        locationsView.addEventListener(LocationsViewEvent.SELECT_LOCATION, 
onSelectLocation);
+       */
 
        foundLocationsView = new FoundLocationsView(map, foundLocations);
+       /* Reenable
        foundLocationsView.addEventListener(LocationsViewEvent.SELECT_LOCATION, 
onSelectFoundLocation);
+       */
 
        /* TODO: reenable
        rDatabase.getHosts();
@@ -179,6 +180,7 @@ private function addViewpoint_handler(event : ResultEvent) 
: void
 
 */
 
+/* Done
 private function getLocations_handler(event : ResultEvent) : void
 {
        var result : ArrayCollection = new ArrayCollection(event.result as 
Array);
@@ -195,10 +197,9 @@ private function getLocations_handler(event : ResultEvent) 
: void
 
        locationsView.showLocations();
 
-       /* TODO: reenable
        rLinks.getAll();
-       */
 }
+*/
 
 private function addLocation_handler(event : ResultEvent) : void
 {
@@ -383,33 +384,38 @@ private function onHideSearchBox() : void
 /* Location dialog box
 /*********************************************/
 
+/* Done
 private function onSelectLocation(event : LocationsViewEvent) : void
 {
        if (locationBox.status == "contracted")
                locationBox.setCurrentState("right-expanded");
 }
+*/
 
+/* We be done automagically :) 
 private function onSelectFoundLocation(event : LocationsViewEvent) : void
 {
        locationBox.setCurrentState("right-expanded");
 }
+*/
 
+/* Done
 private function onShowLocationBox() : void
 {
        if (searchBox.status == "expanded")
                searchBox.setCurrentState("right-contracted");
 
-       /*
-       for each (var host : Host in hosts)
-next_host:
-               for each (var location : Location in locations)
-                       for each (var locationhost : Array in location.hosts)
-                               if (locationhost.id == host.id)
-                               {
-                                       host.selected = true;
-                                       break next_host;
-                               }
-       */
+       
+//     for each (var host : Host in hosts)
+//next_host:
+//             for each (var location : Location in locations)
+//                     for each (var locationhost : Array in location.hosts)
+//                             if (locationhost.id == host.id)
+//                             {
+//                                     host.selected = true;
+//                                     break next_host;
+//                             }
+       
 
        if (locationsView && locationsView.selectedLocation)
                locationBox.update(locationsView.selectedLocation);
@@ -418,6 +424,7 @@ next_host:
        else
                locationBox.update(null);
 }
+*/
 
 private function onHideLocationBox() : void
 {
diff --git a/uifx/src/modules/gmap/events/LocationsViewEvent.as 
b/uifx/src/modules/gmap/events/LocationsViewEvent.as
deleted file mode 100644
index 57eb404..0000000
--- a/uifx/src/modules/gmap/events/LocationsViewEvent.as
+++ /dev/null
@@ -1,45 +0,0 @@
-/*****************************************************************************
- *
- * Copyright (C) 2009 NagVis Project
- *
- * License:
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *****************************************************************************/
-
-package modules.gmap.events
-{
-       import flash.events.Event;

-       

-       import modules.gmap.domain.Location;
-
-       public class LocationsViewEvent extends Event
-       {
-               public static const SELECT_LOCATION : String = "selectLocation";
-               public var location : Location;
-
-               public function LocationsViewEvent(type : String, location : 
Location = null)
-               {
-                       super(type);
-
-                       this.location = location;
-               }
-
-        override public function clone() : Event
-        {
-                       return new LocationsViewEvent(type, this.location);
-        }
-       }
-}
diff --git a/uifx/src/modules/gmap/view/FoundLocationsView.as 
b/uifx/src/modules/gmap/view/FoundLocationsView.as
index 2f04433..9a4826f 100644
--- a/uifx/src/modules/gmap/view/FoundLocationsView.as
+++ b/uifx/src/modules/gmap/view/FoundLocationsView.as
@@ -93,7 +93,7 @@ package modules.gmap.view
                        }
 
                        this.selectedLocation = this.locations.getItemAt(0) as 
Location;
-                       dispatchEvent(new LocationsViewEvent('selectLocation', 
this.selectedLocation));
+                       //dispatchEvent(new 
LocationsViewEvent('selectLocation', this.selectedLocation));
                }
 
                public function clearLocations() : void
diff --git a/uifx/src/modules/gmap/view/LocationsView.as 
b/uifx/src/modules/gmap/view/LocationsView.as
index 8e4a21e..0672cbc 100644
--- a/uifx/src/modules/gmap/view/LocationsView.as
+++ b/uifx/src/modules/gmap/view/LocationsView.as
@@ -155,7 +155,7 @@ package modules.gmap.view
                        if (location)
                        {
                                this.selectedLocation = location;
-                               dispatchEvent(new 
LocationsViewEvent('selectLocation', this.selectedLocation));
+                               //dispatchEvent(new 
LocationsViewEvent('selectLocation', this.selectedLocation));
                        }
                }
        }
diff --git a/uifx/src/modules/gmap/view/MainView.mxml 
b/uifx/src/modules/gmap/view/MainView.mxml
index 89a15cf..b88af17 100644
--- a/uifx/src/modules/gmap/view/MainView.mxml
+++ b/uifx/src/modules/gmap/view/MainView.mxml
@@ -92,7 +92,6 @@
                save="onSaveLocation()"

                remove="onDeleteLocation()"

                contracted="onHideLocationBox()"

-               expanded="onShowLocationBox()"

        />

        <view:DialogSearch id="searchBox" group="{ebg}"

                logo="{searchImage}"

diff --git a/uifx/src/modules/gmap/view/controls/GMapLocationsControl.as 
b/uifx/src/modules/gmap/view/controls/GMapLocationsControl.as
index 9baa1cd..04709d2 100644
--- a/uifx/src/modules/gmap/view/controls/GMapLocationsControl.as
+++ b/uifx/src/modules/gmap/view/controls/GMapLocationsControl.as
@@ -27,6 +27,8 @@ package modules.gmap.view.controls
                        return _map;

                }

                

+               //Already initialized map has to be set here

+               //TODO: support uninitialized map

                public function set map(value : Map):void

                {

                        if(_map !== value)



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to