Author:   Lars Michelsen <[email protected]>
Date:     Fri Mar 23 15:15:00 2012 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Fri Mar 23 15:15:00 2012 +0100

Further zoomed map editing tests / fixes

---

 TODO                                               |   30 ++++++--------------
 share/frontend/nagvis-js/js/NagVisObject.js        |   22 +++++++-------
 .../frontend/nagvis-js/js/NagVisStatefulObject.js  |   14 ++++----
 3 files changed, 27 insertions(+), 39 deletions(-)

diff --git a/TODO b/TODO
index 55b9113..2f28b1e 100644
--- a/TODO
+++ b/TODO
@@ -144,27 +144,6 @@ Implementierungsdetails:
 
 Offene Fragen:
 
-- Wenn der Zoom Faktor pro Nutzer gespeichert wird, wird dieser dann pro Map 
-  oder für alle Maps festgelegt?
-  -> Kunden Fragen
-- Wie soll die GUI (Hover, Context, Header Menu skalieren?) -> Gar nicht?
-  -> Kunden Fragen
-- Wie die "global" Option bekommen? Eventuell generell für alle View 
Parameter lösen.
-  - Es gibt normale Parameter die ihre Werte aus Global-Sektion -> 
URL-Parameter ziehen
-  - Dann gibt es aber noch die *_menu Variablen, die auch die Werte der 
Objekte selbst
-    berücksichtigen müssen
-    -> Man soll per View Parameter die Menus deaktivieren können
-  - Der "View Params" Dialog holt seine Parameter wie folgt:
-    0. Type Defaults holen
-       $typeDefaults = $this->MAPCFG->getTypeDefaults($type);
-    1. Alle Source Params holen:
-       $source_params = $this->MAPCFG->getSourceParams();
-    2. Die Default Werte holen
-       $typeDef = 
$this->MAPCFG->getSourceParamDefs(array_keys($source_params));
-    3. Ersten gesetzten Wert nehmen
-       1. URL value
-       2. $MAPCFG->getSourceParam()
-  - Oder reicht: getSourceParams($only_user_supplied = false, $only_customized 
= false)?
 - Maße der Objekte werden verändert
   - Dementsprechend müssen auch die Objekte anders positioniert werden.
     nheight = (height * zoom / 100)
@@ -176,6 +155,15 @@ Offene Fragen:
     nicht mehr bekannt
   -> Nachdenken
 
+- Wenn der Zoom Faktor pro Nutzer gespeichert wird, wird dieser dann pro Map 
+  oder für alle Maps festgelegt?
+  -> Kunden Fragen
+
+- View Parameter pro Nutzer & pro Map speichern
+
+- Wie soll die GUI (Hover, Context, Header Menu skalieren?) -> Gar nicht?
+  -> Kunden Fragen
+
 *** Icon Koordinaten zentrieren ***
 
 Die Icon Koordinaten beziehen sich momentan auf die linke obere Ecke der Icons.
diff --git a/share/frontend/nagvis-js/js/NagVisObject.js 
b/share/frontend/nagvis-js/js/NagVisObject.js
index 88fce0c..6654e0c 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -550,7 +550,7 @@ var NagVisObject = Base.extend({
                 var offset    = parts[1];
                 var refObj    = getMapObjByDomObjId(objectId);
                 if(refObj)
-                    coord = parseFloat(refObj.parseCoord(refObj.conf[dir], 
dir)) + parseFloat(offset);
+                    coord = parseFloat(refObj.parseCoord(refObj.conf[dir], 
dir, false)) + parseFloat(offset);
             } else {
                 // Only an object id. Get the coordinate and return it
                 var refObj = getMapObjByDomObjId(val);
@@ -559,7 +559,7 @@ var NagVisObject = Base.extend({
             }
         }
 
-        if(addZoom === undefined || addZoom === false)
+        if(addZoom === undefined || addZoom === true)
             return addZoomFactor(coord);
         else
             return coord;
@@ -621,15 +621,15 @@ var NagVisObject = Base.extend({
         //        But it is not coded to attach relative objects to lines. So 
it is no big
         //        deal to leave this as it is.
         if(num === -1) {
-            this.conf.x = this.parseCoord(x, 'x');
-            this.conf.y = this.parseCoord(y, 'y');
+            this.conf.x = this.parseCoord(x, 'x', false);
+            this.conf.y = this.parseCoord(y, 'y', false);
         } else {
             var old  = this.conf.x.split(',');
-            old[num] = this.parseCoord(x, 'x');
+            old[num] = this.parseCoord(x, 'x', false);
             this.conf.x = old.join(',');
 
             old  = this.conf.y.split(',');
-            old[num] = this.parseCoord(y, 'y');
+            old[num] = this.parseCoord(y, 'y', false);
             this.conf.y = old.join(',');
             old = null;
         }
@@ -674,11 +674,11 @@ var NagVisObject = Base.extend({
         //        But it is not coded to attach relative objects to lines. So 
it is no big
         //        deal to leave this as it is.
         if(num === -1) {
-            this.conf.x = this.getRelCoords(oParent, 
this.parseCoord(this.conf.x, 'x'), 'x', -1);
-            this.conf.y = this.getRelCoords(oParent, 
this.parseCoord(this.conf.y, 'y'), 'y', -1);
+            this.conf.x = this.getRelCoords(oParent, 
this.parseCoord(this.conf.x, 'x', false), 'x', -1);
+            this.conf.y = this.getRelCoords(oParent, 
this.parseCoord(this.conf.y, 'y', false), 'y', -1);
         } else {
-            var newX = this.getRelCoords(oParent, 
this.parseCoords(this.conf.x, 'x')[num], 'x', -1);
-            var newY = this.getRelCoords(oParent, 
this.parseCoords(this.conf.y, 'y')[num], 'y', -1);
+            var newX = this.getRelCoords(oParent, 
this.parseCoords(this.conf.x, 'x', false)[num], 'x', -1);
+            var newY = this.getRelCoords(oParent, 
this.parseCoords(this.conf.y, 'y', false)[num], 'y', -1);
 
             var old  = this.conf.x.split(',');
             old[num] = newX;
@@ -700,7 +700,7 @@ var NagVisObject = Base.extend({
 
     getRelCoords: function(refObj, val, dir, num) {
         var refPos = num === -1 ? refObj.conf[dir] : 
refObj.conf[dir].split(',')[num];
-        var offset = parseInt(val) - parseInt(refObj.parseCoord(refPos, dir));
+        var offset = parseInt(val) - parseInt(refObj.parseCoord(refPos, dir, 
false));
         var pre    = offset >= 0 ? '+' : '';
         val        = refObj.conf.object_id + '%' + pre + offset;
         refObj     = null;
diff --git a/share/frontend/nagvis-js/js/NagVisStatefulObject.js 
b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
index 0e3bfe0..2026c2b 100644
--- a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
@@ -786,8 +786,8 @@ var NagVisStatefulObject = NagVisObject.extend({
 
         var jsObj = getMapObjByDomObjId(objId);
 
-        jsObj.conf.label_x = jsObj.calcNewLabelCoord(jsObj.conf.label_x, 
jsObj.conf.x, obj.x);
-        jsObj.conf.label_y = jsObj.calcNewLabelCoord(jsObj.conf.label_y, 
jsObj.conf.y, obj.y);
+        jsObj.conf.label_x = jsObj.calcNewLabelCoord(jsObj.conf.label_x, 
jsObj.parseCoord(jsObj.conf.x, 'x', false), obj.x);
+        jsObj.conf.label_y = jsObj.calcNewLabelCoord(jsObj.conf.label_y, 
jsObj.parseCoord(jsObj.conf.y, 'y', false), obj.y);
 
         jsObj      = null;
         objId      = null;
@@ -834,17 +834,17 @@ var NagVisStatefulObject = NagVisObject.extend({
 
         // If there is a presign it should be relative to the objects x/y
         if(this.conf.label_x && 
this.conf.label_x.toString().match(/^(?:\+|\-)/))
-            x = this.parseCoord(this.parseLabelCoord(this.conf.x), 'x') + 
parseFloat(this.conf.label_x);
+            x = this.parseCoord(this.parseLabelCoord(this.conf.x), 'x', false) 
+ parseFloat(this.conf.label_x);
         if(this.conf.label_y && 
this.conf.label_y.toString().match(/^(?:\+|\-)/))
-            y = this.parseCoord(this.parseLabelCoord(this.conf.y), 'y') + 
parseFloat(this.conf.label_y);
+            y = this.parseCoord(this.parseLabelCoord(this.conf.y), 'y', false) 
+ parseFloat(this.conf.label_y);
 
         // If no x/y coords set, fallback to object x/y
         if(!this.conf.label_x || this.conf.label_x === '' || this.conf.label_x 
=== '0')
-            x = this.parseCoord(this.parseLabelCoord(this.conf.x), 'x');
+            x = this.parseCoord(this.parseLabelCoord(this.conf.x), 'x', false);
         if(!this.conf.label_y || this.conf.label_y === '' || this.conf.label_y 
=== '0')
-            y = this.parseCoord(this.parseLabelCoord(this.conf.y), 'y');
+            y = this.parseCoord(this.parseLabelCoord(this.conf.y), 'y', false);
 
-        return [ x, y ];
+        return [ addZoomFactor(x), addZoomFactor(y) ];
     },
 
     parseLabelCoord: function (val) {


------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to