Project

General

Profile

1
/*
2
Author:       Mike Adair mike.adairATccrs.nrcan.gc.ca
3
License:      LGPL as per: http://www.gnu.org/copyleft/lesser.html
4

    
5
$Id: SelectTimeFrame.js 2511 2007-01-05 11:55:23Z gjvoosten $
6
*/
7

    
8
// Ensure this object's dependancies are loaded.
9
mapbuilder.loadScript(baseDir+"/widget/WidgetBaseXSL.js");
10

    
11
/**
12
 * Widget to specify the start and stop frames for a time series context
13
 *
14
 * @constructor
15
 * @base WidgetBaseXSL
16
 * @param widgetNode This widget's object node from the configuration document.
17
 * @param model The model that this widget is a view of.
18
 */
19

    
20
function SelectTimeFrame(widgetNode, model) {
21
  WidgetBaseXSL.apply(this,new Array(widgetNode, model));
22

    
23
  /**
24
   * Sets the frame index for the time series to start
25
   * @param index the array index for the first frame
26
   */
27
  this.setFirstFrame = function(index) {
28
    this.model.setParam("stopLoop");
29
    this.model.setParam("firstFrame",index);
30
  }
31

    
32
  /**
33
   * Sets the frame index for the time series end
34
   * @param index the array index for the first frame
35
   */
36
  this.setLastFrame = function(index) {
37
    var timestampList = this.model.timestampList;
38
    if (index > timestampList.firstFrame) {
39
      timestampList.lastFrame = index;
40
    } else {
41
      alert(mbGetMessage("lastFrameAfterFirst"));
42
    }
43
    this.model.setParam("stopLoop");
44
  }
45

    
46
}
47

    
(111-111/145)