diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2007-11-18 16:04:33 +0100 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2007-11-18 16:04:33 +0100 |
commit | c075aed46ee0dceb6bf3a3569da67daf0a50bdde (patch) | |
tree | 5bb3376c8c1fb906e833cb6c03cf35862ae83348 /qooxdoo | |
parent | 7bc9f4e73f3893735b96e48bb2664f7c2b5b0a68 (diff) | |
download | smokeping-c075aed46ee0dceb6bf3a3569da67daf0a50bdde.tar.gz smokeping-c075aed46ee0dceb6bf3a3569da67daf0a50bdde.tar.xz |
working version ... schluss fuer den moment
Diffstat (limited to 'qooxdoo')
-rw-r--r-- | qooxdoo/source/class/Smokeping/Application.js | 3 | ||||
-rw-r--r-- | qooxdoo/source/class/Smokeping/ui/Graph.js | 4 | ||||
-rw-r--r-- | qooxdoo/source/class/Smokeping/ui/Navigator.js | 5 | ||||
-rw-r--r-- | qooxdoo/source/class/Smokeping/ui/Zoomer.js | 88 | ||||
-rwxr-xr-x | qooxdoo/source/grapher.cgi | 7 |
5 files changed, 56 insertions, 51 deletions
diff --git a/qooxdoo/source/class/Smokeping/Application.js b/qooxdoo/source/class/Smokeping/Application.js index b980d7e..a84773a 100644 --- a/qooxdoo/source/class/Smokeping/Application.js +++ b/qooxdoo/source/class/Smokeping/Application.js @@ -22,7 +22,8 @@ qx.Class.define( ); // this will provide access to the server side of this app - var rpc = new Smokeping.io.Rpc('http://localhost/~oetiker/smq/'); +// var rpc = new Smokeping.io.Rpc('http://localhost/~oetiker/smq/'); + var rpc = new Smokeping.io.Rpc('http://johan.oetiker.ch/~oetiker/smq/'); var base_url = rpc.getBaseUrl(); diff --git a/qooxdoo/source/class/Smokeping/ui/Graph.js b/qooxdoo/source/class/Smokeping/ui/Graph.js index 955374a..8a55a4f 100644 --- a/qooxdoo/source/class/Smokeping/ui/Graph.js +++ b/qooxdoo/source/class/Smokeping/ui/Graph.js @@ -38,7 +38,7 @@ qx.Class.define('Smokeping.ui.Graph', this.setHeight('auto'); }; this.set({ - border : new qx.ui.core.Border(1,'dotted','transparent'), + border : new qx.ui.core.Border(1,'dotted','#ffffff'), horizontalChildrenAlign: 'center', verticalChildrenAlign: 'middle' }); @@ -97,7 +97,7 @@ qx.Class.define('Smokeping.ui.Graph', _unhighlight: function(e){ this.setBackgroundColor('transparent'); this.getBorder().set({ - color: 'transparent' + color: '#ffffff' }); } } diff --git a/qooxdoo/source/class/Smokeping/ui/Navigator.js b/qooxdoo/source/class/Smokeping/ui/Navigator.js index 0e9f64f..37042e4 100644 --- a/qooxdoo/source/class/Smokeping/ui/Navigator.js +++ b/qooxdoo/source/class/Smokeping/ui/Navigator.js @@ -90,9 +90,10 @@ qx.Class.define('Smokeping.ui.Navigator', qx.io.image.PreloaderManager.getInstance().remove(this._preloader); removeAll(); add(image); - var zoomer = new Smokeping.ui.Zoomer(width,height,10,10); + this.debug('added image'); + var zoomer = new Smokeping.ui.Zoomer(image,this._graph_width,this._graph_height,33,30); add(zoomer); - + this.debug('added zoomer'); } } } diff --git a/qooxdoo/source/class/Smokeping/ui/Zoomer.js b/qooxdoo/source/class/Smokeping/ui/Zoomer.js index fd1a836..e46b0f0 100644 --- a/qooxdoo/source/class/Smokeping/ui/Zoomer.js +++ b/qooxdoo/source/class/Smokeping/ui/Zoomer.js @@ -27,53 +27,58 @@ qx.Class.define('Smokeping.ui.Zoomer', * */ - construct: function (width,height,top,right) { + construct: function (target,width,height,top,right) { + this.debug('hell'); + this._target = target; this._width = width; - this._height = height; + this._height = height+1; // some where the calc is 1 off. this fixes it this._top = top; this._right = right; with(this){ base(arguments); set({ width: '100%', - height: '100%' + height: '100%', + visibility: false }); } var zoomer_defaults = { - visibility: false, - opacity: 0.1, - backgroundColor: 'black', + backgroundColor: 'black', + opacity: 0.1, overflow: 'hidden' // important to make box go to 'zero height' on ie6 }; var dir = ['left','right','top','bottom' ]; + var z = []; + this._zoomer = z; for(var i=0;i<dir.length;i++){ - this._zoomer[dir[i]] = new qx.ui.basic.Terminator(); - this._zoomer[dir[i]].set(zoomer_defaults); - this.add(this._zoomer[dir[i]]); + z[dir[i]] = new qx.ui.basic.Terminator(); + z[dir[i]].set(zoomer_defaults); + this.add(z[dir[i]]); } - - this._zoomer['frame'] = new qx.ui.basic.Terminator(); - this._zoomer['frame'].set(zoomer_defaults); - this._zoomer['frame'].set({ + + z['frame'] = new qx.ui.basic.Terminator(); + z['frame'].set(zoomer_defaults); + z['frame'].set({ opacity: 1, backgroundColor: 'transparent', border: new qx.ui.core.Border(1,'dotted','#808080') }); + + this.add(z['frame']); - this.add(this._zoomer['frame']); - - this.addEventListener("mousedown", this._zoom_start,this); - this.addEventListener("mousemove", this._zoom_move,this); - this.addEventListener("mouseup", this._zoom_stop,this); + this._target.addEventListener("mousedown", this._zoom_start,this); + this._target.addEventListener("mousemove", this._zoom_move,this); + this._target.addEventListener("mouseup", this._zoom_end,this); + this.debug('got zoomer'); }, members: { _init_cache: function(){ - var el = this.getElement(); + var el = this._target.getElement(); this._page_left = qx.html.Location.getPageAreaLeft(el); this._page_top = qx.html.Location.getPageAreaTop(el); - this._image_width = qx.html.Location.getPageAreaWidth(el); - this._image_height = qx.html.Location.getPageAreaHeight(el); + this._image_width = qx.html.Location.getPageAreaRight(el) - this._page_left; + this._image_height = qx.html.Location.getPageAreaBottom(el) - this._page_top ; this._canvas_top = this._top; this._canvas_left = this._image_width-this._width-this._right; this._canvas_right = this._right; @@ -84,7 +89,7 @@ qx.Class.define('Smokeping.ui.Zoomer', var z = this._zoomer; this._init_cache(); var mouse_y = e.getPageY()-this._page_top; - var mouse_x = e.getPageX()-this._page_left; +// var mouse_x = e.getPageX()-this._page_left; if (mouse_y < this._canvas_top) { mouse_y = this._canvas_top; @@ -95,48 +100,49 @@ qx.Class.define('Smokeping.ui.Zoomer', this._selector_start_y = mouse_y; - this.setCapture(true); + this._target.setCapture(true); z['top'].set({ left: this._canvas_left, width: this._width, top: 0, - height: mouse_y, - visibility: true + height: mouse_y }); - + this.debug(mouse_y); + this.debug(z['top'].getWidth()); + this.debug(z['top'].getLeft());; + this.debug(z['top'].getTop());; + this.debug(z['top'].getHeight());; + z['bottom'].set({ left: this._canvas_left, width: this._width, height: this._image_height - mouse_y, - top: mouse_y, - visibility: true + top: mouse_y }); z['left'].set({ width: this._canvas_left, - height: this._image_height, - visibility: true + height: this._image_height }); z['right'].set({ left: this._image_width - this._canvas_right, width: this._canvas_right, - height: this._image_height, - visibility: true + height: this._image_height }); z['frame'].set({ left: this._canvas_left, width: this._width, - top: mouse_y, - visibility: true + top: mouse_y }); - }, + this.setVisibility(true); + }, _zoom_move: function(e){ var z = this._zoomer; - if (plot.getCapture()){ + if (this._target.getCapture()){ var mouse_y = e.getPageY()-this._page_top; var mouse_x = e.getPageX()-this._page_left; @@ -163,13 +169,9 @@ qx.Class.define('Smokeping.ui.Zoomer', }, _zoom_end: function(e){ var z = this._zoomer; - this.setCapture(false); - z['top'].setVisibility(false); - z['left'].setVisibility(false); - z['right'].setVisibility(false); - z['bottom'].setVisibility(false); - z['frame'].setVisibility(false); - + this._target.setCapture(false); + this.setVisibility(false); + if (z['bottom'].getTop() == z['top'].getTop()+z['top'].getHeight()){ this._zoom_factor_top = 0; this._zoom_factor_bottom = 0; diff --git a/qooxdoo/source/grapher.cgi b/qooxdoo/source/grapher.cgi index f3e844e..47ce8db 100755 --- a/qooxdoo/source/grapher.cgi +++ b/qooxdoo/source/grapher.cgi @@ -7,6 +7,7 @@ use Pod::Usage 1.14; #use CGI::Fast; use CGI; use lib qw(/home/oetiker/scratch/rrd-13dev/lib/perl); +use lib qw(/usr/pack/rrdtool-1.2.23-mo/lib/perl/); use RRDs; '$Revision: 3879 $ ' =~ /Revision: (\S*)/; @@ -38,9 +39,9 @@ sub main() # '--zoom' => '0.75', '--width' => $width, '--height' => $height, - '--color' => 'BACK#bfbfbf00', - '--color' => 'SHADEA#bfbfbf00', - '--color' => 'SHADEB#bfbfbf00', + '--color' => 'BACK#ffffff00', + '--color' => 'SHADEA#ffffff00', + '--color' => 'SHADEB#ffffff00', 'DEF:in=lan.rrd:out:AVERAGE', 'CDEF:green=in,100000,LT,in,100000,IF', 'AREA:green#00ff00', |