This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Don, The problem here is the invocation of updateSelectionTab originates from a complex chain of events with many side effects. It is easy to break something if one is not careful here. Eager updating of the tree may be inappropriate in some situations but not others. The DataTree.createTreeNode method calls treeStructureChanged which seems like overkill (but perhaps not, I don't know) especially in light of the subsequent call to treeStructureChanged at line ~1125 in DataTree.addDataSource. Commenting out the former treeStructureChanged call seems to work at removing the redundant calls, but how do I test this change thoroughly? Complicating things is that DataTree.createTreeNode is called from elsewhere perhaps requiring eager update of the tree. (Indeed why was it put there to begin with?) And then there is the DataControlDialog.setDataChoice method that invokes updateSelectionTab but does a lot of other things too. Is the problem the eager call to updateSelectionTab or to set DataChoice? If the latter, that may simplify the reasoning somewhat. -Julien > R/sir > > Another issue here is that even if the datasource & lastDataSource is > same and datachoice and lastDataChoice is same it still keeps calling > getDataSelectionComponent which should be avoided somehow. > > Ghansham > On 02/26/2013 01:31 AM, Unidata IDV Support wrote: > > Gansham& Don, > > > > I am seeing multiple invocations of updateSelectionTab when loading a file > > via the data chooser. The repeated invocations of updateSelectionTab is > > because of the formation of the JTree in the Field Selector. Any time a > > node is added or the path of the tree changes, an event is fired leading to > > the invocation of updateSelectionTab. See > > > > DataTree.treeStructureChanged > > > > Is this a problem? Should we refactor the code to invoke updateSelectionTab > > only after the JTree is complete? > > > > -IDV Support > > > >> Here is some info on the initDataSelectionComponents/updateSelectionTab > >> calls. > >> > >> > >> -------- Original Message -------- > >> Subject: Re: query related to initDataSelctionComponents (more details) > >> Date: Tue, 01 May 2012 13:59:44 +0530 > >> From: Ghansham Sangar<address@hidden> > >> To: address@hidden > >> > >> On 05/01/2012 01:07 AM, Don Murray wrote: > >>> If you could do a stack trace on where it gets called from each time, > >>> that would help diagnose the problem. > >>> > >>> Don > >>> > >>> On 4/28/12 6:20 AM, Ghansham Sangar wrote: > >>>> hi Sir > >>>> > >>>> Any idea why when open a datasource (I mean a file), > >>>> initDataSelectionComponents in datasource class gets called up more than > >>>> a few times? Why? > >>>> > >>>> regards > >>>> Ghansham > >> These are the more detailed version of stack trace. 'creating image > >> file' is when the initDataSelectionComponents gets called up. > >> > >> at > >> ucar.unidata.idv.ui.DataSelectionWidget.updateSelectionTab(DataSelectionWidget.java:437) > >> at > >> ucar.unidata.idv.ui.DataControlDialog.setDataChoice(DataControlDialog.java:511) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper$5.valueChanged(DataSelector.java:824) > >> at javax.swing.JTree.fireValueChanged(JTree.java:2820) > >> at > >> javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3191) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:629) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1078) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:287) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:170) > >> at javax.swing.JTree.setSelectionPath(JTree.java:1598) > >> at > >> ucar.unidata.idv.ui.DataTree.treeStructureChanged(DataTree.java:864) > >> at > >> ucar.unidata.idv.ui.DataTree.treeStructureChanged(DataTree.java:829) > >> at ucar.unidata.idv.ui.DataTree.addDataSource(DataTree.java:1129) > >> at ucar.unidata.idv.ui.DataTree.setDataSource(DataTree.java:261) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.createDataTree(DataSelector.java:877) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.doMakeContents(DataSelector.java:626) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.<init>(DataSelector.java:584) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:480) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:460) > >> at > >> ucar.unidata.idv.ui.IdvUIManager.addDataSource(IdvUIManager.java:4934) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.loadDataSource(IntegratedDataViewer.java:2133) > >> at > >> ucar.unidata.data.DataManager.addDataSource(DataManager.java:919) > >> at > >> ucar.unidata.idv.IdvPersistenceManager.makeDataSourceFromXml(IdvPersistenceManager.java:3786) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.makeDataSourceFromXml(IntegratedDataViewer.java:1943) > >> at > >> ucar.unidata.idv.DataSourceHistory.process(DataSourceHistory.java:109) > >> at ucar.unidata.idv.ui.IdvUIManager$8$1.run(IdvUIManager.java:2333) > >> at ucar.unidata.util.Misc$3.run(Misc.java:1090) > >> creating image file > >> at > >> ucar.unidata.idv.ui.DataSelectionWidget.updateSelectionTab(DataSelectionWidget.java:437) > >> at > >> ucar.unidata.idv.ui.DataControlDialog.setDataChoice(DataControlDialog.java:511) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.createDataTree(DataSelector.java:881) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.doMakeContents(DataSelector.java:626) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.<init>(DataSelector.java:584) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:480) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:460) > >> at > >> ucar.unidata.idv.ui.IdvUIManager.addDataSource(IdvUIManager.java:4934) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.loadDataSource(IntegratedDataViewer.java:2133) > >> at > >> ucar.unidata.data.DataManager.addDataSource(DataManager.java:919) > >> at > >> ucar.unidata.idv.IdvPersistenceManager.makeDataSourceFromXml(IdvPersistenceManager.java:3786) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.makeDataSourceFromXml(IntegratedDataViewer.java:1943) > >> at > >> ucar.unidata.idv.DataSourceHistory.process(DataSourceHistory.java:109) > >> at ucar.unidata.idv.ui.IdvUIManager$8$1.run(IdvUIManager.java:2333) > >> at ucar.unidata.util.Misc$3.run(Misc.java:1090) > >> creating image file > >> at > >> ucar.unidata.idv.ui.DataSelectionWidget.updateSelectionTab(DataSelectionWidget.java:437) > >> at > >> ucar.unidata.idv.ui.DataControlDialog.setDataChoice(DataControlDialog.java:511) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.doMakeContents(DataSelector.java:643) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.<init>(DataSelector.java:584) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:480) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:460) > >> at > >> ucar.unidata.idv.ui.IdvUIManager.addDataSource(IdvUIManager.java:4934) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.loadDataSource(IntegratedDataViewer.java:2133) > >> at > >> ucar.unidata.data.DataManager.addDataSource(DataManager.java:919) > >> at > >> ucar.unidata.idv.IdvPersistenceManager.makeDataSourceFromXml(IdvPersistenceManager.java:3786) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.makeDataSourceFromXml(IntegratedDataViewer.java:1943) > >> at > >> ucar.unidata.idv.DataSourceHistory.process(DataSourceHistory.java:109) > >> at ucar.unidata.idv.ui.IdvUIManager$8$1.run(IdvUIManager.java:2333) > >> at ucar.unidata.util.Misc$3.run(Misc.java:1090) > >> creating image file > >> at > >> ucar.unidata.idv.ui.DataSelectionWidget.updateSelectionTab(DataSelectionWidget.java:437) > >> at > >> ucar.unidata.idv.ui.DataControlDialog.setDataChoice(DataControlDialog.java:511) > >> at > >> ucar.unidata.idv.ui.DataControlDialog.dataSourceChanged(DataControlDialog.java:235) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.dataSourceChanged(DataSelector.java:757) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.<init>(DataSelector.java:587) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:480) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:460) > >> at > >> ucar.unidata.idv.ui.IdvUIManager.addDataSource(IdvUIManager.java:4934) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.loadDataSource(IntegratedDataViewer.java:2133) > >> at > >> ucar.unidata.data.DataManager.addDataSource(DataManager.java:919) > >> at > >> ucar.unidata.idv.IdvPersistenceManager.makeDataSourceFromXml(IdvPersistenceManager.java:3786) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.makeDataSourceFromXml(IntegratedDataViewer.java:1943) > >> at > >> ucar.unidata.idv.DataSourceHistory.process(DataSourceHistory.java:109) > >> at ucar.unidata.idv.ui.IdvUIManager$8$1.run(IdvUIManager.java:2333) > >> at ucar.unidata.util.Misc$3.run(Misc.java:1090) > >> creating image file > >> at > >> ucar.unidata.idv.ui.DataSelectionWidget.updateSelectionTab(DataSelectionWidget.java:437) > >> at > >> ucar.unidata.idv.ui.DataControlDialog.setDataChoice(DataControlDialog.java:511) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper$5.valueChanged(DataSelector.java:824) > >> at javax.swing.JTree.fireValueChanged(JTree.java:2820) > >> at > >> javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3191) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:629) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1078) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:287) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:170) > >> at javax.swing.JTree.setSelectionPath(JTree.java:1598) > >> at > >> ucar.unidata.idv.ui.DataTree.treeStructureChanged(DataTree.java:864) > >> at > >> ucar.unidata.idv.ui.DataTree.treeStructureChanged(DataTree.java:829) > >> at ucar.unidata.idv.ui.DataTree.addDataSource(DataTree.java:1129) > >> at > >> ucar.unidata.idv.ui.DataTree.dataSourceChanged(DataTree.java:944) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.dataSourceChanged(DataSelector.java:758) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.<init>(DataSelector.java:587) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:480) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:460) > >> at > >> ucar.unidata.idv.ui.IdvUIManager.addDataSource(IdvUIManager.java:4934) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.loadDataSource(IntegratedDataViewer.java:2133) > >> at > >> ucar.unidata.data.DataManager.addDataSource(DataManager.java:919) > >> at > >> ucar.unidata.idv.IdvPersistenceManager.makeDataSourceFromXml(IdvPersistenceManager.java:3786) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.makeDataSourceFromXml(IntegratedDataViewer.java:1943) > >> at > >> ucar.unidata.idv.DataSourceHistory.process(DataSourceHistory.java:109) > >> at ucar.unidata.idv.ui.IdvUIManager$8$1.run(IdvUIManager.java:2333) > >> at ucar.unidata.util.Misc$3.run(Misc.java:1090) > >> creating image file > >> at > >> ucar.unidata.idv.ui.DataSelectionWidget.updateSelectionTab(DataSelectionWidget.java:437) > >> at > >> ucar.unidata.idv.ui.DataControlDialog.setDataChoice(DataControlDialog.java:511) > >> at > >> ucar.unidata.idv.ui.DataControlDialog.dataSourceChanged(DataControlDialog.java:235) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.dataSourceChanged(DataSelector.java:757) > >> at > >> ucar.unidata.idv.ui.DataSelector.dataSourcesChanged(DataSelector.java:405) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:483) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:460) > >> at > >> ucar.unidata.idv.ui.IdvUIManager.addDataSource(IdvUIManager.java:4934) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.loadDataSource(IntegratedDataViewer.java:2133) > >> at > >> ucar.unidata.data.DataManager.addDataSource(DataManager.java:919) > >> at > >> ucar.unidata.idv.IdvPersistenceManager.makeDataSourceFromXml(IdvPersistenceManager.java:3786) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.makeDataSourceFromXml(IntegratedDataViewer.java:1943) > >> at > >> ucar.unidata.idv.DataSourceHistory.process(DataSourceHistory.java:109) > >> at ucar.unidata.idv.ui.IdvUIManager$8$1.run(IdvUIManager.java:2333) > >> at ucar.unidata.util.Misc$3.run(Misc.java:1090) > >> creating image file > >> at > >> ucar.unidata.idv.ui.DataSelectionWidget.updateSelectionTab(DataSelectionWidget.java:437) > >> at > >> ucar.unidata.idv.ui.DataControlDialog.setDataChoice(DataControlDialog.java:511) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper$5.valueChanged(DataSelector.java:824) > >> at javax.swing.JTree.fireValueChanged(JTree.java:2820) > >> at > >> javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3191) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:629) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1078) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:287) > >> at > >> javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:170) > >> at javax.swing.JTree.setSelectionPath(JTree.java:1598) > >> at > >> ucar.unidata.idv.ui.DataTree.treeStructureChanged(DataTree.java:864) > >> at > >> ucar.unidata.idv.ui.DataTree.treeStructureChanged(DataTree.java:829) > >> at ucar.unidata.idv.ui.DataTree.addDataSource(DataTree.java:1129) > >> at > >> ucar.unidata.idv.ui.DataTree.dataSourceChanged(DataTree.java:944) > >> at > >> ucar.unidata.idv.ui.DataSelector$DataSourceWrapper.dataSourceChanged(DataSelector.java:758) > >> at > >> ucar.unidata.idv.ui.DataSelector.dataSourcesChanged(DataSelector.java:405) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:483) > >> at > >> ucar.unidata.idv.ui.DataSelector.addDataSource(DataSelector.java:460) > >> at > >> ucar.unidata.idv.ui.IdvUIManager.addDataSource(IdvUIManager.java:4934) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.loadDataSource(IntegratedDataViewer.java:2133) > >> at > >> ucar.unidata.data.DataManager.addDataSource(DataManager.java:919) > >> at > >> ucar.unidata.idv.IdvPersistenceManager.makeDataSourceFromXml(IdvPersistenceManager.java:3786) > >> at > >> ucar.unidata.idv.IntegratedDataViewer.makeDataSourceFromXml(IntegratedDataViewer.java:1943) > >> at > >> ucar.unidata.idv.DataSourceHistory.process(DataSourceHistory.java:109) > >> at ucar.unidata.idv.ui.IdvUIManager$8$1.run(IdvUIManager.java:2333) > >> at ucar.unidata.util.Misc$3.run(Misc.java:1090) > >> creating image file > >> > >> > >> > >> > > > > Ticket Details > > =================== > > Ticket ID: XES-933915 > > Department: Support IDV > > Priority: Critical > > Status: Open > > > > Ticket Details =================== Ticket ID: XES-933915 Department: Support IDV Priority: Critical Status: Open