Revision: 6038 http://sourceforge.net/p/jump-pilot/code/6038 Author: edso Date: 2018-12-27 13:51:06 +0000 (Thu, 27 Dec 2018) Log Message: ----------- speedup OpenFilePlugIn by delaying gui init and prevent double init [INFO] 14:28:56.280 [...].OpenFilePlugIn took 0.62s to [INFO] 14:42:54.347 [...].OpenFilePlugIn took 0.03s
Modified Paths: -------------- core/trunk/ChangeLog core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenFileWizard.java Modified: core/trunk/ChangeLog =================================================================== --- core/trunk/ChangeLog 2018-12-27 13:03:59 UTC (rev 6037) +++ core/trunk/ChangeLog 2018-12-27 13:51:06 UTC (rev 6038) @@ -15,6 +15,10 @@ [INFO] 13:59:36.400 Loading Plugin [...].SaveToPostGISPlugIn took 0.43s to [INFO] 14:00:26.666 Loading Plugin [...].SaveToPostGISPlugIn took 0.01s + * speedup OpenFilePlugIn by delaying gui init and prevent double init + [INFO] 14:28:56.280 [...].OpenFilePlugIn took 0.62s + to + [INFO] 14:42:54.347 [...].OpenFilePlugIn took 0.03s 2018-12-22 Giuseppe Aruta. * Updated OpenKLEM to ver 20181222, correct some bugs Modified: core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenFileWizard.java =================================================================== --- core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenFileWizard.java 2018-12-27 13:03:59 UTC (rev 6037) +++ core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenFileWizard.java 2018-12-27 13:51:06 UTC (rev 6038) @@ -31,6 +31,9 @@ /** The workbench context. */ private WorkbenchContext workbenchContext; + // prevent double init + private boolean initialized = false; + private File[] files; private Class loaderFilter = null; @@ -62,7 +65,6 @@ public OpenFileWizard(final WorkbenchContext workbenchContext) { super(I18N.get(KEY), IconLoader.icon("folder_page.png"), SelectFilesPanel.KEY); - initPanels(workbenchContext); } public OpenFileWizard(final WorkbenchContext workbenchContext, @@ -73,11 +75,13 @@ public OpenFileWizard(final WorkbenchContext workbenchContext, final Class loaderFilter) { this.loaderFilter = loaderFilter; - initPanels(workbenchContext); } public void initialize(final WorkbenchContext workbenchContext, WizardDialog dialog) { + // init only once + if (initialized) return; + this.workbenchContext = workbenchContext; initPanels(workbenchContext); state = new OpenFileWizardState(workbenchContext.getErrorHandler()); @@ -97,6 +101,8 @@ if (files != null) { state.setupFileLoaders(files, null); } + + initialized = true; } protected void initPanels(final WorkbenchContext workbenchContext) { _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel