~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to lib/helioviewer/TileLayerAccordion.js

  • Committer: V. Keith Hughitt
  • Date: 2009-01-29 21:30:16 UTC
  • Revision ID: hughitt1@kore-20090129213016-ecqgjwaj89lt9vn0
nightly build 01-29-2009: Added jsdoc-toolkit generated code documentation. See /docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * @fileoverview Contains the class definition for an TileLayerAccordion class.
3
 
 */
4
 
/**
 
2
 * @fileOverview Contains the class definition for an TileLayerAccordion class.
5
3
 * @author <a href="mailto:keith.hughitt@gmail.com">Keith Hughitt</a>
6
 
 * @class TileLayerAccordion
7
 
 *
8
 
 * syntax: jQuery, Prototype
9
 
 *
10
 
 * @see LayerManager
 
4
 * @see LayerManager, TileLayer
11
5
 * @requires ui.dynaccordion.js
 
6
 * Syntax: jQuery, Prototype
12
7
 */
13
 
var TileLayerAccordion = Class.create(Layer, {
 
8
var TileLayerAccordion = Class.create(Layer,
 
9
        /** @lends TileLayerAccordion.prototype */
 
10
        {
14
11
        /**
15
 
         * @constructor
16
 
         * @param {LayerManager} Reference to the layerManager.
17
 
     * @param {Dom-node} The outermost continer where the layer  manager user interface should be constructed.
 
12
         * @constructs
 
13
         * @description Creates a new TileLayerAccordion
 
14
         * @param {Object} layerManager Reference to the application layer manager
 
15
     * @param {String} containerId ID for the outermost continer where the layer  manager user interface should be constructed
18
16
         */
19
17
        initialize: function (layerManager, containerId) {
20
18
                this.layerManager = layerManager;
35
33
        },
36
34
 
37
35
        /**
38
 
         * @function
39
36
         * @description Adds a new entry to the tile layer accordion
 
37
         * @param {Object} layer The new layer to add
40
38
         */
41
39
        addLayer: function (layer) {
42
40
                // Determine what measurements to display
118
116
        },
119
117
 
120
118
        /**
121
 
         * @function
122
 
         * @description Checks to see if the given layer is listed in the accordion 
 
119
         * @description Checks to see if the given layer is listed in the accordion
 
120
         * @param {String} id ID of the layer being checked 
123
121
         */
124
122
        hasId: function (id) {
125
123
                return (this.layerSettings.keys().grep(id).length > 0 ? true : false);
126
124
        },
127
125
        
128
126
        /**
129
 
         * @function
130
 
         * 
131
 
         * Note: width and height must be hardcoded for slider to function properly. 
132
 
         * See http://groups.google.com/group/Prototypejs/browse_thread/thread/60a2676a0d62cf4f for explanation.
 
127
         * @description Builds the body section of a single TileLayerAccordion entry. NOTE: width and height must be hardcoded for slider to function properly.
 
128
         * @param {Object} layer The new layer to add
 
129
         * @see <a href="http://groups.google.com/group/Prototypejs/browse_thread/thread/60a2676a0d62cf4f">This discussion thread</a> for explanation.
133
130
         */
134
131
        _buildEntryBody: function (layer) {
135
132
                var id = layer.id;
194
191
                return (opacitySlide + obs + inst + det + meas + fits);
195
192
        },
196
193
        
197
 
        _addOpacitySlider: function (layer) {
198
 
                
199
 
        },
 
194
        //_addOpacitySlider: function (layer) {
 
195
        //      
 
196
        //},
200
197
        
201
198
        /**
202
 
         * @param {Object} id
203
 
         * @param {Object} opacity
204
 
         * @description Makes sure the slider is set to the right value.
 
199
         * @description Makes sure the slider is set to the right value
 
200
         * @param {Object} id ID of the TileLayer whose opacity should be adjusted
 
201
         * @param {Object} opacity The new opacity value
205
202
         */
206
203
        updateOpacitySlider: function (id, opacity) {
207
204
                this.layerSettings.get(id).opacitySlider.setValue(opacity);
208
205
        },
209
206
 
210
207
        /**
211
 
         * @function _setupUI
212
 
         * This method handles setting up an empty tile layer accordion.
 
208
         * @description Handles setting up an empty tile layer accordion.
213
209
         */
214
210
        _setupUI: function () {
215
211
                // Create a top-level header and an "add layer" button
228
224
        },
229
225
 
230
226
        /**
231
 
         * @function
232
 
         * @description
 
227
         * @description Sets up event-handlers for a TileLayerAccordion entry
 
228
         * @param {Object} layer The layer being added
233
229
         */
234
230
        _setupEventHandlers: function (layer) {
235
231
                visibilityBtn = jQuery("#visibilityBtn-" + layer.id);
338
334
        },
339
335
        
340
336
        /**
341
 
         * @function
342
 
         * @param {TileLayer} layer 
343
 
         * @param {String} changed
344
 
         * @description Check to make sure the new layer settings are valid. If the new combination of
 
337
         * @description Checks to make sure the new layer settings are valid. If the new combination of
345
338
         * choices are not compatable, change values to right of most-recently changed parameter to valid
346
339
         * settings. Once the combination is acceptable, reload the tile layer.
 
340
         * @param {TileLayer} layer The layer to which the changes have been made
 
341
         * @param {String} changed The field altered
 
342
         * @param {String} The new value chosen
347
343
         */
348
344
        _onLayerSelectChange: function (layer, changed, value) {
349
345
                // Ajax callback function
444
440
        },
445
441
        
446
442
        /**
447
 
         * @function
448
443
         * @description Updates options for a single SELECT element.
449
 
         * @param {String} id
450
 
         * @param {String} field
451
 
         * @param {Array} newOptions
 
444
         * @param {String} id The ID of the layer whose parameters were adjusted 
 
445
         * @param {String} field The field to adjust
 
446
         * @param {Array} newOptions updated choices
452
447
         */
453
448
        _updateOptions: function (id, field, newOptions) {
454
449
                //Remove old options
468
463
        },
469
464
    
470
465
    /**
471
 
     * @method updateTimeStamp
472
 
     * @param {SunImage}
473
 
     * @param {Int}
 
466
     * @description Updates the displayed timestamp for a given tile layer
 
467
     * @param {Object} layer The layer being updated
474
468
     */
475
469
    updateTimeStamp: function (layer) {
476
470
        //Grab timestamp dom-node
515
509
    },
516
510
        
517
511
        /**
518
 
         * 
 
512
         * @description Updates the description for a given tile layer
519
513
         * @param {String} id Layer id
520
514
         * @param {String} desc New description to use 
521
515
         */
522
516
        updateLayerDesc: function (id, desc) {
523
517
                $(id).select("span.tile-accordion-header-left").first().update(desc);
524
 
        }
525
 
    
 
518
        }    
526
519
});
527
520