summaryrefslogtreecommitdiffstats
path: root/qooxdoo/source/class/Smokeping/ui
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-11-22 00:41:39 +0100
committerTobi Oetiker <tobi@oetiker.ch>2007-11-22 00:41:39 +0100
commit610bab43a1ddd085a1c272c5cf6aaf4a85ed8fee (patch)
tree21ec8be89bdc998cbff52395f7ae8475832f443e /qooxdoo/source/class/Smokeping/ui
parent6dbc90c295cb0fbf895ac259dabf9dfa22cbe803 (diff)
downloadsmokeping-610bab43a1ddd085a1c272c5cf6aaf4a85ed8fee.tar.gz
smokeping-610bab43a1ddd085a1c272c5cf6aaf4a85ed8fee.tar.xz
introduction of Shadow graph causes step back ...
Diffstat (limited to 'qooxdoo/source/class/Smokeping/ui')
-rw-r--r--qooxdoo/source/class/Smokeping/ui/Graph.js12
-rw-r--r--qooxdoo/source/class/Smokeping/ui/GraphList.js13
-rw-r--r--qooxdoo/source/class/Smokeping/ui/Navigator.js18
3 files changed, 25 insertions, 18 deletions
diff --git a/qooxdoo/source/class/Smokeping/ui/Graph.js b/qooxdoo/source/class/Smokeping/ui/Graph.js
index 5bfc225..1d12cdf 100644
--- a/qooxdoo/source/class/Smokeping/ui/Graph.js
+++ b/qooxdoo/source/class/Smokeping/ui/Graph.js
@@ -20,15 +20,13 @@ qx.Class.define('Smokeping.ui.Graph',
*/
/**
- * @param base_url {String} Path to the location of the image generator
+ * @param object {GraphShadow} What happens when the SNCF conductors tamazing.
*
*/
- construct: function (src,width,height) {
+ construct: function (graph) {
this.base(arguments);
- this._src=src;
- this._width=width;
- this._height=height;
+ this._graph=graph;
if ( Smokeping_ui_Graph_default_width){
this.setWidth( Smokeping_ui_Graph_default_width)
this.setHeight( Smokeping_ui_Graph_default_height);
@@ -45,7 +43,7 @@ qx.Class.define('Smokeping.ui.Graph',
this._highlight();
var loader = new Smokeping.ui.LoadingAnimation();
this.add(loader);
- this._preloader = qx.io.image.PreloaderManager.getInstance().create(this._src+';w='+this._width+';h='+this._height);
+ this._preloader = qx.io.image.PreloaderManager.getInstance().create(this._graph.getSrc());
if (this._preloader.isLoaded()){
qx.client.Timer.once(this._image_loader,this,0);
} else {
@@ -73,7 +71,7 @@ qx.Class.define('Smokeping.ui.Graph',
with(this){
setEnabled(false);
_unhighlight();
- this._window = new Smokeping.ui.Navigator(this._src,this._width*2,this._height*2);
+ this._window = new Smokeping.ui.Navigator(this._graph);
_window.addToDocument();
_window.positionRelativeTo(getElement(),2,-4);
addEventListener('beforeDisappear',_kill_window,this);
diff --git a/qooxdoo/source/class/Smokeping/ui/GraphList.js b/qooxdoo/source/class/Smokeping/ui/GraphList.js
index 66420f7..5d9bc58 100644
--- a/qooxdoo/source/class/Smokeping/ui/GraphList.js
+++ b/qooxdoo/source/class/Smokeping/ui/GraphList.js
@@ -45,7 +45,18 @@ qx.Class.define('Smokeping.ui.GraphList',
var files = m.getData()
this.removeAll();
for(var i=0;i<files.length;i++){
- var image = new Smokeping.ui.Graph(this._url + 'grapher.cgi?g=' + files[i],150,75);
+ var shadow = new Smokeping.GraphShadow();
+ shadow.set({
+ width: 150,
+ height: 75,
+ start: Math.round((new Date()).getTime()/1000)-(3600*24*3),
+ end: Math.round((new Date()).getTime()/1000),
+ top: 1000000,
+ bottom: 0,
+ cgi: this._url + 'grapher.cgi',
+ data: files[i]
+ });
+ var image = new Smokeping.ui.Graph(shadow);
this.add(image);
}
}
diff --git a/qooxdoo/source/class/Smokeping/ui/Navigator.js b/qooxdoo/source/class/Smokeping/ui/Navigator.js
index d568e68..dc28d3e 100644
--- a/qooxdoo/source/class/Smokeping/ui/Navigator.js
+++ b/qooxdoo/source/class/Smokeping/ui/Navigator.js
@@ -21,17 +21,16 @@ qx.Class.define('Smokeping.ui.Navigator',
*
*/
- construct: function (src,width,height) {
- this._graph_src = src;
- this._graph_width = width;
- this._graph_height = height;
+ construct: function (graph) {
+ this._graph = graph;
+
with(this){
base(arguments,tr("Smokeping Graph Navigator"));
set({
showMaximize: false,
showMinimize: false,
- width: width,
- height: height,
+ width: graph.getWidth(),
+ height: graph.getHeight(),
minWidth: 120,
minHeight: 80,
backgroundColor: '#f0f0f0'
@@ -64,8 +63,7 @@ qx.Class.define('Smokeping.ui.Navigator',
_update_image: function(){
var now = (new Date()).getTime();
if (this._lastrun + 1000 < now) {
- this._preloader = qx.io.image.PreloaderManager.getInstance().create(
- this._graph_src+';w='+this._graph_width+';h='+this._graph_height);
+ this._preloader = qx.io.image.PreloaderManager.getInstance().create(this._graph.getSrc());
if (this._preloader.isLoaded()){
qx.client.Timer.once(this._show_image,this,0);
} else {
@@ -88,9 +86,9 @@ qx.Class.define('Smokeping.ui.Navigator',
qx.io.image.PreloaderManager.getInstance().remove(this._preloader);
removeAll();
add(image);
- var zoomer = new Smokeping.ui.Zoomer(image,this._graph_width,this._graph_height,33,30);
+ var zoomer = new Smokeping.ui.Zoomer(image,this._graph,33,30);
add(zoomer);
- var mover = new Smokeping.ui.Mover(image,this._graph_src,this._graph_width,this._graph_height,33,30);
+ var mover = new Smokeping.ui.Mover(image,this._graph,33,30);
add(mover);
}
}