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

Author: Andriy Skuratov <[email protected]>
Date:   Mon Aug  3 16:57:00 2009 +0300

Some code changes due to new structure

---

 uifx/src/modules/gmap/GMapModule.as                |   33 +++++++++++++++++---
 uifx/src/modules/gmap/LocationsCollection.as       |    2 +
 uifx/src/modules/gmap/LocationsView.as             |    3 ++
 uifx/src/modules/gmap/domain/Location.as           |    4 ++-
 .../src/modules/gmap/{ => events}/LocationEvent.as |    6 ++-
 .../gmap/{ => events}/LocationsViewEvent.as        |    6 ++-
 uifx/src/modules/gmap/view/DialogLocation.mxml     |    5 +++
 7 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/uifx/src/modules/gmap/GMapModule.as 
b/uifx/src/modules/gmap/GMapModule.as
index a0e2a6b..9a2846a 100644
--- a/uifx/src/modules/gmap/GMapModule.as
+++ b/uifx/src/modules/gmap/GMapModule.as
@@ -30,12 +30,17 @@ import flash.events.IOErrorEvent;
 import flash.net.URLLoader;
 import flash.system.Security;
 
-import modules.gmap.Link;
-import modules.gmap.Location;
 import modules.gmap.LocationsCollection;
 import modules.gmap.LocationsView;
-import modules.gmap.LocationsViewEvent;
-import modules.gmap.Viewpoint;
+import modules.gmap.domain.Link;
+import modules.gmap.domain.Location;
+import modules.gmap.domain.Viewpoint;
+import modules.gmap.domain.nagios.Host;
+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;
@@ -116,12 +121,14 @@ private function onMapReady(event : Event) : void
        foundLocationsView = new FoundLocationsView(map, foundLocations);
        foundLocationsView.addEventListener(LocationsViewEvent.SELECT_LOCATION, 
onSelectFoundLocation);
 
+       /* TODO: reenable
        rDatabase.getHosts();
        rDatabase.getServices();
        rDatabase.getHostGroups();
        rDatabase.getServiceGroups();
        rViewpoints.getAll();
-       rLocations.getAll();
+       rLocations.getAll(); 
+       */
        // Note: rLinks.getAll() is called at the end of getLocations_handler
        //       due to asynchronous nature of remote calls
 }
@@ -172,7 +179,9 @@ private function getLocations_handler(event : ResultEvent) 
: void
 
        locationsView.showLocations();
 
+       /* TODO: reenable
        rLinks.getAll();
+       */
 }
 
 private function addLocation_handler(event : ResultEvent) : void
@@ -337,7 +346,9 @@ private function showLinks() : void
 private function onLocateAddress(address : String) : void
 {
        locationsView.hideLocations();
+       /*
        rLocations.find(address);
+       */
 }
 
 private function onHideSearchBox() : void
@@ -407,23 +418,29 @@ private function onSaveLocation() : void
 {
        if (locationBox.locID != "")
        {
+               /* TODO: reenable
                rLocations.edit(locationBox.locID,
                        (new LatLng(parseFloat(locationBox.locLat.text), 
parseFloat(locationBox.locLng.text)).toUrlValue(16)),
                        locationBox.locName.text, locationBox.locAddress.text, 
locationBox.locDescription.text,
                        locationBox.locNObject.selectedItem);
+               */
        }
        else
        {
+               /* TODO: reenable
                rLocations.add((new LatLng(parseFloat(locationBox.locLat.text), 
parseFloat(locationBox.locLng.text)).toUrlValue(16)),
                        locationBox.locName.text, locationBox.locAddress.text, 
locationBox.locDescription.text,
                        locationBox.locNObject.selectedItem);
+               */
        }
 }
 
 private function onDeleteLocation() : void
 {
+       /* TODO: reenable
        if (locationBox.locID != "")
                rLocations.remove(locationBox.locID);
+       */
 }
 
 /*********************************************/
@@ -475,7 +492,11 @@ private function onLink() : void
        }
 
        if (!exists)
+       {
+               /* TODO: reenable
                rLinks.add(location1.id, location2.id);
+               */
+       }
        else
        {
                Alert.show("The link between selected locations already 
exists", "Error");
@@ -489,7 +510,9 @@ private function onLink() : void
 
 private function onSaveViewpoint(name : String) : void
 {
+       /* TODO: reenable
        rViewpoints.add(name, map.getCenter().toUrlValue(16), map.getZoom());
+       */
 }
 
 private function onSelectViewpoint(event : ListEvent) : void
diff --git a/uifx/src/modules/gmap/LocationsCollection.as 
b/uifx/src/modules/gmap/LocationsCollection.as
index 868f392..b0e112b 100644
--- a/uifx/src/modules/gmap/LocationsCollection.as
+++ b/uifx/src/modules/gmap/LocationsCollection.as
@@ -23,6 +23,8 @@ package modules.gmap
 {
        import com.google.maps.LatLng;
        
+       import modules.gmap.domain.Location;
+       
        import mx.collections.ArrayCollection;
 
        public class LocationsCollection extends ArrayCollection
diff --git a/uifx/src/modules/gmap/LocationsView.as 
b/uifx/src/modules/gmap/LocationsView.as
index 2f1a7af..3c067b4 100644
--- a/uifx/src/modules/gmap/LocationsView.as
+++ b/uifx/src/modules/gmap/LocationsView.as
@@ -29,6 +29,9 @@ package modules.gmap
        
        import flash.events.EventDispatcher;
        
+       import modules.gmap.domain.Location;
+       import modules.gmap.events.LocationsViewEvent;
+       
        import mx.events.CollectionEvent;
        import mx.events.CollectionEventKind;
 
diff --git a/uifx/src/modules/gmap/domain/Location.as 
b/uifx/src/modules/gmap/domain/Location.as
index 179abf0..fda6274 100644
--- a/uifx/src/modules/gmap/domain/Location.as
+++ b/uifx/src/modules/gmap/domain/Location.as
@@ -20,7 +20,9 @@
  *****************************************************************************/
 
 package modules.gmap.domain
-{
+{

+       import modules.gmap.events.LocationEvent;

+       
        [Bindable]
        [RemoteClass(alias="Location")]
        [Event(name="change", type="modules.gmap.LocationEvent")]
diff --git a/uifx/src/modules/gmap/LocationEvent.as 
b/uifx/src/modules/gmap/events/LocationEvent.as
similarity index 94%
rename from uifx/src/modules/gmap/LocationEvent.as
rename to uifx/src/modules/gmap/events/LocationEvent.as
index 19a95c6..a00defe 100644
--- a/uifx/src/modules/gmap/LocationEvent.as
+++ b/uifx/src/modules/gmap/events/LocationEvent.as
@@ -19,9 +19,11 @@
  *
  *****************************************************************************/
 
-package modules.gmap
+package modules.gmap.events
 {
-       import flash.events.Event;
+       import flash.events.Event;

+       

+       import modules.gmap.domain.Location;
 
        public class LocationEvent extends Event
        {
diff --git a/uifx/src/modules/gmap/LocationsViewEvent.as 
b/uifx/src/modules/gmap/events/LocationsViewEvent.as
similarity index 94%
rename from uifx/src/modules/gmap/LocationsViewEvent.as
rename to uifx/src/modules/gmap/events/LocationsViewEvent.as
index 36cad9c..57eb404 100644
--- a/uifx/src/modules/gmap/LocationsViewEvent.as
+++ b/uifx/src/modules/gmap/events/LocationsViewEvent.as
@@ -19,9 +19,11 @@
  *
  *****************************************************************************/
 
-package modules.gmap
+package modules.gmap.events
 {
-       import flash.events.Event;
+       import flash.events.Event;

+       

+       import modules.gmap.domain.Location;
 
        public class LocationsViewEvent extends Event
        {
diff --git a/uifx/src/modules/gmap/view/DialogLocation.mxml 
b/uifx/src/modules/gmap/view/DialogLocation.mxml
index 2645c40..977737e 100644
--- a/uifx/src/modules/gmap/view/DialogLocation.mxml
+++ b/uifx/src/modules/gmap/view/DialogLocation.mxml
@@ -30,6 +30,11 @@
     </mx:Metadata>
        <mx:Script>
                <![CDATA[
+                       import modules.gmap.domain.nagios.ServiceGroup;
+                       import modules.gmap.domain.nagios.HostGroup;
+                       import modules.gmap.domain.nagios.Service;
+                       import modules.gmap.domain.nagios.Host;
+                       import modules.gmap.domain.Location;
                        import mx.controls.Alert;
                        import com.google.maps.LatLng;
 


------------------------------------------------------------------------------
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