diff --git a/js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js b/js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js index db3ffe8..ca08de3 100644 --- a/js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js +++ b/js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js @@ -1,16 +1,25 @@ Ext.define('amdaPlotComp.intervalSelection.PlotFunctionIntervalSelection', { - extend: 'amdaPlotComp.intervalSelection.IntervalSelection', - requires: ['amdaPlotComp.plotFunction.FunctionType'], + extend: 'amdaPlotComp.intervalSelection.IntervalSelection', // This class extends from amdaPlotComp.intervalSelection.IntervalSelection + requires: ['amdaPlotComp.plotFunction.FunctionType'], // This class requires the FunctionType class from amdaPlotComp.plotFunction - title: "Plot Function", - plotFunctionType: null, + title: "Plot Function", // The title of this interval selection + plotFunctionType: null, // An instance of the FunctionType class, initially set to null + /** + * Initializes the component. + * It calls the parent's initComponent method, then creates a new instance of FunctionType and adds it to the form. + */ initComponent: function () { this.callParent(arguments); this.plotFunctionType = new amdaPlotComp.plotFunction.FunctionType(); this.form.add(this.plotFunctionType); }, + /** + * Applies the plot function based on the values of the fields. + * If the values are not valid, it shows a warning message. + * Otherwise, it calls the interactive plot with the plotFunction action and resets the host component selection. + */ _apply: function () { if (this._notValidValues()) { myDesktopApp.warningMsg('Please note that either the Start Time or the Stop Time has not been defined. To proceed, ensure both times are properly set.'); -- libgit2 0.21.2