Revision 2619

tmp/org.txm.core/src/java/org/txm/core/engines/ImportEngine.java (revision 2619)
4 4
import org.eclipse.core.runtime.IStatus;
5 5
import org.txm.core.results.TXMResult;
6 6
import org.txm.objects.Project;
7
import org.txm.utils.TXMProgressMonitor;
7 8

  
8 9
public abstract class ImportEngine implements Engine {
9

  
10
	
10 11
	public static final String EXTENSION_POINT_ID = ImportEngine.class.getCanonicalName();
11 12
	
12 13
	@Override
13 14
	public abstract String getName();
14
		
15
	
15 16
	/**
16 17
	 * Regenerate all project results
17
	 *  
18
	 * 
18 19
	 * @param project
19 20
	 * @param monitor
20 21
	 * @return true if the build was successful
21 22
	 */
22 23
	public abstract IStatus build(Project project, IProgressMonitor monitor);
23 24
	
25
	@Override
24 26
	public void notify(TXMResult r, String state) {
25
		//nothing to do
27
		// nothing to do
26 28
	}
27 29
	
30
	@Override
28 31
	public String getDetails() {
29
		return this.getClass()+ " "+this.toString();
32
		return this.getClass() + " " + this.toString();
30 33
	}
31 34
}
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 2619)
33 33
import org.txm.objects.Project;
34 34
import org.txm.objects.Workspace;
35 35
import org.txm.utils.LogMonitor;
36
import org.txm.utils.TXMProgressMonitor;
36 37
import org.txm.utils.io.IOUtils;
37 38
import org.txm.utils.logger.Log;
38 39

  
......
130 131
	 */
131 132
	protected String parametersNodePath;
132 133
	
133
	/**
134
	 * If set, allows the command to notify its progress.
135
	 */
136
	private SubMonitor monitor;
137 134
	
138 135
	/**
139 136
	 * Thread used when calling compute().
......
1981 1978
		// else {
1982 1979
		// return this.getSimpleName();
1983 1980
		// }
1984
		// FIXME: SJ: new version to manage the lazy loading of child of an edited parent (eg. LT => Specificities where the user modify the LT property)
1981
		// FIXME: SJ: new version to manage the lazy loading of child of an edited parent (e.g. LT => Specificities where the user modify the LT property)
1985 1982
		// Need to check that all works well then remove the above original version
1986 1983
		else if (this.getSimpleName() != null && !this.getSimpleName().isEmpty()) {
1987 1984
			return this.getSimpleName();
......
2420 2417
				// m = SubMonitor.convert(m, this.getComputingStartMessage(), 100);
2421 2418
				
2422 2419
				// store a new sub-monitor dedicated to subclasses computation method
2423
				this.monitor = mainSubMonitor.split(1).setWorkRemaining(100);
2420
				// this.monitor = mainSubMonitor.split(1).setWorkRemaining(100);
2424 2421
				
2425
				if (!this._compute()) {
2422
				if (!this._compute(new TXMProgressMonitor(mainSubMonitor.split(1)))) {
2426 2423
					Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": computing failed.");
2427 2424
					this.computing = false;
2428 2425
					return false;
2429 2426
				}
2427
				//
2428
				// // delete the monitor used by subclasses computation method
2429
				// // if (this.monitor != null) {
2430
				// // this.monitor.done();
2431
				// this.monitor = null;
2432
				// // }
2433
				//
2434
				// // subMonitor.worked(1);
2430 2435
				
2431
				// delete the monitor used by subclasses computation method
2432
				if (this.monitor != null) {
2433
					// this.monitor.done();
2434
					this.monitor = null;
2435
				}
2436
				
2437
				// subMonitor.worked(1);
2438
				
2439 2436
			}
2440 2437
			else {
2441 2438
				mainSubMonitor.setWorkRemaining(1);
......
2572 2569
			this.dirty = true;
2573 2570
			this.computing = false;
2574 2571
			this.hasBeenComputedOnce = false;
2575
			this.monitorSetCanceled(true);
2576 2572
			
2573
			// FIXME: SJ: old code, used when the monitor was stored in the TXMResult, need to check if we need a replacement for this
2574
			// this.monitorSetCanceled(true);
2575
			// this.monitor = null;
2576
			
2577 2577
			Log.finest(NLS.bind("Computing state of {0} ({1}) has been reset...", this.getName(), this.getClass().getSimpleName()));
2578 2578
			
2579 2579
			// deep canceling
......
2594 2594
	 * 
2595 2595
	 * @throws Exception
2596 2596
	 */
2597
	protected abstract boolean _compute() throws Exception;
2597
	protected abstract boolean _compute(TXMProgressMonitor monitor) throws Exception;
2598 2598
	
2599 2599
	
2600 2600
	/***
......
2694 2694
	// Log.fine(name);
2695 2695
	// }
2696 2696
	
2697
	/**
2698
	 * Sets the monitor state as canceled.
2699
	 * 
2700
	 * @param value
2701
	 */
2702
	public void monitorSetCanceled(boolean value) {
2703
		if (this.monitor != null) {
2704
			Log.info(NLS.bind("Canceling computing of {0} ({1})...", this.getName(), this.getClass().getSimpleName()));
2705
			this.monitor.setCanceled(value);
2706
		}
2707
	}
2708 2697
	
2709
	/**
2710
	 * Sets the monitor current task name.
2711
	 * 
2712
	 * @param name
2713
	 */
2714
	public void monitorSetTask(String name) {
2715
		if (this.monitor != null) {
2716
			this.monitor.subTask(name);
2717
		}
2718
		Log.fine(name);
2719
	}
2720 2698
	
2721
	/**
2722
	 * Increments the progress monitor of the specified amount of work.
2723
	 *
2724
	 * @param amount of work
2725
	 */
2726
	public void monitorSetWorked(int amount) {
2727
		if (this.monitor != null) {
2728
			this.monitor.worked(amount);
2729
		}
2730
	}
2699
	//
2700
	// /**
2701
	// * You must set the current monitor to be available to manage the process
2702
	// * progress
2703
	// *
2704
	// * @param monitor
2705
	// * can be null
2706
	// */
2707
	// public boolean setCurrentMonitor(SubMonitor monitor) {
2708
	// if (monitor == null) {
2709
	// return false;
2710
	// }
2711
	// if (monitor.isCanceled()) {
2712
	// return false;
2713
	// }
2714
	// this.monitor = monitor;
2715
	// return true;
2716
	// }
2717
	//
2731 2718
	
2732
	
2733 2719
	/**
2734
	 * Checks if the monitor is canceled.
2735
	 *
2736
	 * @return true if the monitor has been canceled by the user
2737
	 */
2738
	public boolean monitorIsCanceled() {
2739
		if (this.monitor != null) {
2740
			return this.monitor.isCanceled();
2741
		}
2742
		return false;
2743
	}
2744
	
2745
	/**
2746
	 * Sets the monitor state as done.
2747
	 */
2748
	public void monitorDone() {
2749
		if (this.monitor != null) {
2750
			this.monitor.done();
2751
		}
2752
	}
2753
	
2754
	/**
2755
	 * Sets the work remaining for the internal SubMonitor instance.
2756
	 * 
2757
	 * @param workRemaining number of ticks
2758
	 */
2759
	public void monitorSetWorkRemaining(int workRemaining) {
2760
		if (this.monitor != null) {
2761
			this.monitor.setWorkRemaining(workRemaining);
2762
		}
2763
	}
2764
	
2765
	/**
2766
	 * Splits the current monitor and returns a new SubMonitor with 100 ticks of remaining work.
2767
	 * 
2768
	 * @param totalWork
2769
	 * @return
2770
	 */
2771
	public SubMonitor splitMonitor(int totalWork) {
2772
		return this.monitor.split(totalWork).setWorkRemaining(100);
2773
	}
2774
	
2775
	
2776
	/**
2777
	 * You must set the current monitor to be available to manage the process
2778
	 * progress
2779
	 * 
2780
	 * @param monitor
2781
	 *            can be null
2782
	 */
2783
	public boolean setCurrentMonitor(SubMonitor monitor) {
2784
		if (monitor == null) {
2785
			return false;
2786
		}
2787
		if (monitor.isCanceled()) {
2788
			return false;
2789
		}
2790
		this.monitor = monitor;
2791
		return true;
2792
	}
2793
	
2794
	
2795
	/**
2796 2720
	 * Gets the user defined name.
2797 2721
	 * 
2798 2722
	 * @return the user name
tmp/org.txm.core/src/java/org/txm/objects/Text.java (revision 2619)
34 34
import org.txm.core.results.Parameter;
35 35
import org.txm.core.results.TXMParameters;
36 36
import org.txm.core.results.TXMResult;
37
import org.txm.utils.TXMProgressMonitor;
37 38
import org.w3c.dom.Element;
38 39
import org.w3c.dom.NodeList;
39 40

  
......
141 142
	 */
142 143
	@SuppressWarnings("unchecked")
143 144
	public List<Edition> getEditions() {
144
		return (List<Edition>) getChildren(Edition.class);
145
		return getChildren(Edition.class);
145 146
	}
146 147
	
147 148
	/**
......
298 299
	}
299 300
	
300 301
	@Override
301
	protected boolean _compute() throws Exception {
302
	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
302 303
		// TODO System.out.println("CALL IMPORTMODULE TO BUILD TEXT="+userName);
303 304
		return true;
304 305
	}
tmp/org.txm.core/src/java/org/txm/objects/SavedQuery.java (revision 2619)
18 18
// You should have received a copy of the GNU General
19 19
// Public License along with the TXM platform. If not, see
20 20
// http://www.gnu.org/licenses.
21

  
22
//

23
// This file is part of the TXM platform.

24
//

25
// The TXM platform is free software: you can redistribute it and/or modif y

26
// it under the terms of the GNU General Public License as published by

27
// the Free Software Foundation, either version 3 of the License, or

28
// (at your option) any later version.

29
//

30
// The TXM platform is distributed in the hope that it will be useful,

31
// but WITHOUT ANY WARRANTY; without even the implied warranty of

32
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

33
// GNU General Public License for more details.

34
//

35
// You should have received a copy of the GNU General Public License

36
// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.

37
// 

38
// 

39
// 

40
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $

41
// $LastChangedRevision: 2386 $

42
// $LastChangedBy: mdecorde $ 

43
//

44
package org.txm.objects;

45

  
21

  
22
//
23
// This file is part of the TXM platform.
24
//
25
// The TXM platform is free software: you can redistribute it and/or modif y
26
// it under the terms of the GNU General Public License as published by
27
// the Free Software Foundation, either version 3 of the License, or
28
// (at your option) any later version.
29
//
30
// The TXM platform is distributed in the hope that it will be useful,
31
// but WITHOUT ANY WARRANTY; without even the implied warranty of
32
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33
// GNU General Public License for more details.
34
//
35
// You should have received a copy of the GNU General Public License
36
// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
37
// 
38
// 
39
// 
40
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
41
// $LastChangedRevision: 2386 $
42
// $LastChangedBy: mdecorde $ 
43
//
44
package org.txm.objects;
45

  
46 46
import java.io.File;
47
import java.util.ArrayList;

47
import java.util.ArrayList;
48 48
import java.util.List;
49 49

  
50 50
import org.txm.core.preferences.TBXPreferences;
51 51
import org.txm.core.results.Parameter;
52 52
import org.txm.core.results.TXMParameters;
53 53
import org.txm.core.results.TXMResult;
54
import org.w3c.dom.Element;
55
import org.w3c.dom.NodeList;
56

  
57
// TODO: Auto-generated Javadoc
58
/**
59
 * contains a query and examples of results @ author mdecorde.
60
 */
61
public class SavedQuery extends TXMResult {
62
	
63
	@Parameter(key=TBXPreferences.VALUE)
54
import org.txm.utils.TXMProgressMonitor;
55
import org.w3c.dom.Element;
56
import org.w3c.dom.NodeList;
57

  
58
// TODO: Auto-generated Javadoc
59
/**
60
 * contains a query and examples of results @ author mdecorde.
61
 */
62
public class SavedQuery extends TXMResult {
63
	
64
	@Parameter(key = TBXPreferences.VALUE)
64 65
	String pValue;
65
	
66
	/** The examples. */

67
	List<String> examples;

68
	
69
	/** The base. */

70
	CorpusBuild corpus;

71
	
72
	/**

73
	 * Instantiates a new query log.

74
	 *

75
	 * @param c the corpus

76
	 * @param query the query

77
	 * @param examples the examples

78
	 */

66
	
67
	/** The examples. */
68
	List<String> examples;
69
	
70
	/** The base. */
71
	CorpusBuild corpus;
72
	
73
	/**
74
	 * Instantiates a new query log.
75
	 *
76
	 * @param c the corpus
77
	 * @param query the query
78
	 * @param examples the examples
79
	 */
79 80
	public SavedQuery(CorpusBuild c) {
80
		super(c);

81
		this.setVisible(false);

81
		super(c);
82
		this.setVisible(false);
82 83
	}
83 84
	
84 85
	/**
......
91 92
	public SavedQuery(String node) {
92 93
		super(node);
93 94
		this.setVisible(false);
94
	}
95

  
96
	protected boolean _compute() {
95
	}
96
	
97
	@Override
98
	protected boolean _compute(TXMProgressMonitor monitor) {
97 99
		return true;
98
	}
99

  
100
	protected boolean setParameters(Element pElement) {
101
		this.userName = pElement.getAttribute("name"); //$NON-NLS-1$
102
		this.pValue = pElement.getAttribute("value"); //$NON-NLS-1$
103
		this.examples = new ArrayList<String>();
104
		NodeList examplesN = pElement.getElementsByTagName("example"); //$NON-NLS-1$
105
		for (int i = 0; i < examplesN.getLength(); i++) {
106
			Element e = (Element) examplesN.item(i);
107
			examples.add(e.getTextContent());
108
		}
109
		if (this.userName == null || this.pValue == null)
110
			return false;
111
		return true;
112
	}
113

  
114
	/**
115
	 * Gets the query.
116
	 *
117
	 * @return the query
118
	 */
119
	public String getQuery() {
120
		return pValue;
121
	}
122

  
123
	/**
124
	 * Gets the examples.
125
	 *
126
	 * @return the examples
127
	 */
128
	public List<String> getExamples() {
129
		return examples;
130
	}
131

  
132
	/* (non-Javadoc)
133
	 * @see java.lang.Object#toString()
134
	 */
135
	@Override
136
	public String toString() {
137
		return this.userName + "=" + this.pValue; //+ " >> " + this.examples; //$NON-NLS-1$ 
138 100
	}
139

  
101
	
102
	protected boolean setParameters(Element pElement) {
103
		this.userName = pElement.getAttribute("name"); //$NON-NLS-1$
104
		this.pValue = pElement.getAttribute("value"); //$NON-NLS-1$
105
		this.examples = new ArrayList<>();
106
		NodeList examplesN = pElement.getElementsByTagName("example"); //$NON-NLS-1$
107
		for (int i = 0; i < examplesN.getLength(); i++) {
108
			Element e = (Element) examplesN.item(i);
109
			examples.add(e.getTextContent());
110
		}
111
		if (this.userName == null || this.pValue == null)
112
			return false;
113
		return true;
114
	}
115
	
116
	/**
117
	 * Gets the query.
118
	 *
119
	 * @return the query
120
	 */
121
	public String getQuery() {
122
		return pValue;
123
	}
124
	
125
	/**
126
	 * Gets the examples.
127
	 *
128
	 * @return the examples
129
	 */
130
	public List<String> getExamples() {
131
		return examples;
132
	}
133
	
134
	/*
135
	 * (non-Javadoc)
136
	 * @see java.lang.Object#toString()
137
	 */
140 138
	@Override
139
	public String toString() {
140
		return this.userName + "=" + this.pValue; // + " >> " + this.examples; //$NON-NLS-1$
141
	}
142
	
143
	@Override
141 144
	public boolean saveParameters() throws Exception {
142 145
		return true;
143 146
	}
144

  
147
	
145 148
	@Override
146 149
	public boolean loadParameters() throws Exception {
147 150
		return true;
148 151
	}
149

  
152
	
150 153
	@Override
151 154
	public boolean setParameters(TXMParameters parameters) throws Exception {
152 155
		this.userName = parameters.getString(TBXPreferences.NAME);
153 156
		this.pValue = parameters.getString(TBXPreferences.VALUE);
154 157
		return true;
155 158
	}
156

  
159
	
157 160
	@Override
158 161
	public String getName() {
159 162
		return userName;
160 163
	}
161

  
164
	
162 165
	@Override
163 166
	public String getSimpleName() {
164 167
		return userName;
165 168
	}
166

  
169
	
167 170
	@Override
168 171
	public String getDetails() {
169 172
		return toString();
170 173
	}
171

  
174
	
172 175
	@Override
173 176
	public void clean() {
174 177
		
175 178
	}
176

  
179
	
177 180
	@Override
178 181
	public boolean canCompute() throws Exception {
179 182
		return true;
180 183
	}
181

  
184
	
182 185
	@Override
183 186
	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
184 187
		return false;
185 188
	}
186

  
189
	
187 190
	@Override
188 191
	public String getResultType() {
189 192
		return "SavedQuery";
190 193
	}
191

  
194
	
192 195
	public void setParameters(String query, ArrayList<String> examples) {
193 196
		this.userName = query;
194 197
		this.pValue = query;
195 198
		this.examples = examples;
196
	}
197
}
199
	}
200
}
tmp/org.txm.core/src/java/org/txm/objects/Edition.java (revision 2619)
41 41
import org.txm.core.results.TXMParameters;
42 42
import org.txm.core.results.TXMResult;
43 43
import org.txm.utils.DeleteDir;
44
import org.txm.utils.TXMProgressMonitor;
44 45
import org.txm.utils.logger.Log;
45 46
import org.w3c.dom.Element;
46 47
import org.w3c.dom.NodeList;
......
425 426
	}
426 427
	
427 428
	@Override
428
	protected boolean _compute() throws Exception {
429
	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
429 430
		// System.out.println("USE THE PROJECT IMPORTMODULE TO BUILD THE EDITION="+userName);
430 431
		pages.clear();
431 432
		
tmp/org.txm.core/src/java/org/txm/objects/Workspace.java (revision 2619)
45 45
import org.txm.core.results.TXMParameters;
46 46
import org.txm.core.results.TXMResult;
47 47
import org.txm.utils.LogMonitor;
48
import org.txm.utils.TXMProgressMonitor;
48 49
import org.txm.utils.logger.Log;
49 50
import org.w3c.dom.Element;
50 51

  
......
384 385
	}
385 386
	
386 387
	@Override
387
	protected boolean _compute() throws Exception {
388
	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
388 389
		// TODO should ensure its files are up to date
389 390
		return true;
390 391
	}
tmp/org.txm.core/src/java/org/txm/objects/Project.java (revision 2619)
68 68
import org.txm.core.results.TXMResult;
69 69
import org.txm.importer.xtz.ImportKeys;
70 70
import org.txm.utils.LogMonitor;
71
import org.txm.utils.TXMProgressMonitor;
71 72
import org.txm.utils.logger.Log;
72 73
import org.txm.utils.zip.Zip;
73 74
import org.w3c.dom.Element;
......
183 184
		this.hasBeenComputedOnce = true;
184 185
		this.setVisible(false);
185 186
		
186
		initRCPStuffs();
187
		initRCPStuffs(new TXMProgressMonitor());
187 188
		if (isOpen()) {
188 189
			this.autoSaveParametersFromAnnotations();
189 190
			this.saveParameters();
......
209 210
	public boolean open(IProgressMonitor monitor) {
210 211
		if (rcpProject != null && !rcpProject.isOpen()) {
211 212
			try {
212
				if (monitor != null) monitor.subTask("Openning project");
213 213
				
214
				TXMProgressMonitor subMonitor = new TXMProgressMonitor(monitor);
215
				subMonitor.monitorSetTask("Openning project");
214 216
				
217
				
215 218
				rcpProject.open(monitor);
216 219
				
217
				initRCPStuffs();
220
				initRCPStuffs(subMonitor);
218 221
				
219
				if (monitor != null) monitor.subTask("loading results");
222
				subMonitor.monitorSetTask("loading results");
223
				
220 224
				this.loadResults(null);
221 225
				
222 226
				for (TXMResult cb : getCorpora()) {
......
232 236
					}
233 237
				}
234 238
				
235
				if (monitor != null) monitor.subTask("");
239
				subMonitor.monitorSetTask("");
236 240
			}
237 241
			catch (CoreException e) {
238 242
				e.printStackTrace();
......
296 300
		this.hasBeenComputedOnce = true;
297 301
		this.setVisible(false);
298 302
		
299
		initRCPStuffs();
303
		initRCPStuffs(new TXMProgressMonitor());
300 304
		
301 305
		//
302 306
		// this.setPath(project.getPath() + getName());
......
343 347
	
344 348
	
345 349
	@Override
346
	protected boolean _compute() throws Exception {
350
	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
347 351
		
348 352
		// build the main corpus, texts, editions, etc.
349 353
		if (this.needToBuild) {
......
383 387
				return true;
384 388
			}
385 389
			
386
			SubMonitor monitor = null;
387
			if (this.monitorIsCanceled()) {
388
				monitor = SubMonitor.convert(new LogMonitor(), "computing " + this, 100);
389
			}
390
			SubMonitor subMonitor = SubMonitor.convert(new LogMonitor(), "computing " + this, 100);
390 391
			
391 392
			Log.finest("RUNNING IMPORT MODULE WITH NAME = " + getImportModuleName());
392 393
			
393
			boolean state = engine.build(this, monitor).isOK();
394
			boolean state = engine.build(this, subMonitor).isOK();
394 395
			if (state == true) {
395 396
				this.needToBuild = false;
396 397
				// This step could be done only if the compiler step if done and only if it modifying/deleting the corpus builds
......
421 422
	 * 
422 423
	 * @throws CoreException
423 424
	 */
424
	private void initRCPStuffs() throws CoreException {
425
	private void initRCPStuffs(TXMProgressMonitor monitor) throws CoreException {
425 426
		IWorkspace rcpWorkspace = ResourcesPlugin.getWorkspace();
426 427
		if (this.rcpProject == null) {
427 428
			String n = this.getName();
......
429 430
		}
430 431
		
431 432
		if (!rcpProject.exists()) {
432
			createRCPProject();
433
			createRCPProject(monitor);
433 434
		}
434 435
		
435 436
		// if (!rcpProject.isOpen()) {
......
446 447
		}
447 448
	}
448 449
	
449
	private void createRCPProject() throws CoreException {
450
	private void createRCPProject(TXMProgressMonitor monitor) throws CoreException {
450 451
		
451 452
		IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(rcpProject.getName());
452 453
		IFolder folder = Workspace.getInstance().corporaProject.getFolder(rcpProject.getName());
......
454 455
		description.setLocation(folder.getLocation());
455 456
		description.setNatureIds(new String[] { TXMCORPUSNATURE });
456 457
		
457
		SubMonitor monitor = this.splitMonitor(100);
458
		SubMonitor subMonitor = monitor.createNewMonitor(100);
458 459
		
459
		rcpProject.create(description, monitor);
460
		rcpProject.open(monitor);
460
		rcpProject.create(description, subMonitor);
461
		rcpProject.open(subMonitor);
461 462
		// TODO might fail if corpus source directory changed
462 463
		IFolder srcFolder = rcpProject.getFolder("src");
463 464
		if (pSrcDirectory != null && !pSrcDirectory.getName().isEmpty()) {
464 465
			IPath path = new Path(pSrcDirectory.getAbsolutePath());
465 466
			if (!srcFolder.exists()) {
466
				srcFolder.createLink(path, IResource.ALLOW_MISSING_LOCAL, monitor);
467
				srcFolder.createLink(path, IResource.ALLOW_MISSING_LOCAL, subMonitor);
467 468
			}
468 469
		}
469 470
	}
tmp/org.txm.core/src/java/org/txm/utils/TXMProgressMonitor.java (revision 2619)
1
package org.txm.utils;
2

  
3
import org.eclipse.core.runtime.IProgressMonitor;
4
import org.eclipse.core.runtime.SubMonitor;
5
import org.eclipse.osgi.util.NLS;
6
import org.txm.utils.logger.Log;
7

  
8
/**
9
 * 
10
 * Wrapper for a {@link SubMonitor} instance dedicated to computing tasks.
11
 * The wrapper permits to protect the main root task.
12
 * 
13
 * @author sjacquot
14
 *
15
 */
16
public class TXMProgressMonitor {
17
	
18
	
19
	/**
20
	 * Wrapped sub-monitor instance.
21
	 */
22
	protected SubMonitor monitor;
23
	
24
	
25
	/**
26
	 * Creates a new {@link TXMProgressMonitor} wrapping a default {@link LogMonitor}.
27
	 */
28
	public TXMProgressMonitor() {
29
		this(new LogMonitor());
30
	}
31
	
32
	
33
	/**
34
	 * Creates a new {@link TXMProgressMonitor} wrapping specified monitor.
35
	 * Also converts the monitor into a {@link SubMonitor} with 100 ticks of remaining work.
36
	 * 
37
	 * @param monitor the monitor to wrap and convert
38
	 */
39
	public TXMProgressMonitor(IProgressMonitor monitor) {
40
		this.monitor = SubMonitor.convert(monitor, 100);
41
	}
42
	
43
	
44
	/**
45
	 * Sets the monitor state as canceled.
46
	 * 
47
	 * @param value
48
	 */
49
	public void monitorSetCanceled(boolean value) {
50
		// Log.info(NLS.bind("Canceling computing of {0} ({1})...", this.getName(), this.getClass().getSimpleName()));
51
		this.monitor.setCanceled(value);
52
	}
53
	
54
	/**
55
	 * Sets the monitor current task name.
56
	 * 
57
	 * @param name
58
	 */
59
	public void monitorSetTask(String name) {
60
		this.monitor.subTask(name);
61
		Log.fine(name);
62
	}
63
	
64
	/**
65
	 * Increments the progress monitor of the specified amount of work.
66
	 *
67
	 * @param amount of work
68
	 */
69
	public void monitorSetWorked(int amount) {
70
		this.monitor.worked(amount);
71
	}
72
	
73
	
74
	/**
75
	 * Checks if the monitor is canceled.
76
	 *
77
	 * @return true if the monitor has been canceled by the user
78
	 */
79
	public boolean monitorIsCanceled() {
80
		return this.monitor.isCanceled();
81
	}
82
	
83
	/**
84
	 * Sets the monitor state as done.
85
	 */
86
	public void monitorDone() {
87
		this.monitor.done();
88
	}
89
	
90
	/**
91
	 * Sets the work remaining for the internal SubMonitor instance.
92
	 * 
93
	 * @param workRemaining number of ticks
94
	 */
95
	public void monitorSetWorkRemaining(int workRemaining) {
96
		this.monitor.setWorkRemaining(workRemaining);
97
	}
98
	
99
	/**
100
	 * Splits the current computing monitor if exists and returns a new SubMonitor with 100 ticks of remaining work.
101
	 * If current computing monitor doesn't exist, typically if calling this method outside of the TXMResult._compute() implementations,
102
	 * it returns a new LogMonitor with 100 ticks.
103
	 * 
104
	 * @param totalWork
105
	 * @return
106
	 */
107
	public SubMonitor createNewMonitor(int totalWork) {
108
		return this.monitor.split(totalWork).setWorkRemaining(100);
109
	}
110
	
111
}
0 112

  
tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java (revision 2619)
27 27
import org.txm.searchengine.cqp.corpus.WordProperty;
28 28
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
29 29
import org.txm.searchengine.cqp.corpus.query.Match;
30
import org.txm.utils.TXMProgressMonitor;
30 31
import org.txm.utils.io.IOUtils;
31 32
import org.txm.utils.logger.Log;
32 33

  
......
114 115
	
115 116
	
116 117
	@Override
117
	protected boolean _compute() throws Exception {
118
	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
118 119
		
119 120
		if (this.hasParameterChanged(InternalViewPreferences.STRUCTURAL_UNIT)) {
120 121
			
tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java (revision 2619)
19 19
import org.txm.searchengine.cqp.corpus.CQPCorpus;
20 20
import org.txm.searchengine.cqp.corpus.Part;
21 21
import org.txm.searchengine.cqp.corpus.Partition;
22
import org.txm.utils.TXMProgressMonitor;
22 23

  
23 24
/**
24 25
 * Partition dimensions.
......
108 109
	
109 110
	
110 111
	@Override
111
	protected boolean __compute() throws Exception {
112
	protected boolean __compute(TXMProgressMonitor monitor) throws Exception {
112 113
		// retrieve the parts
113 114
		this.parts = this.getPartition().getParts();
114 115
		
tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java (revision 2619)
51 51
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
52 52
import org.txm.searchengine.cqp.corpus.CQPCorpus;
53 53
import org.txm.searchengine.cqp.corpus.CorpusManager;
54
import org.txm.searchengine.cqp.corpus.Partition;
55 54
import org.txm.searchengine.cqp.corpus.Property;
56 55
import org.txm.searchengine.cqp.corpus.QueryResult;
57 56
import org.txm.searchengine.cqp.corpus.StructuralUnit;
......
60 59
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
61 60
import org.txm.searchengine.cqp.corpus.query.Match;
62 61
import org.txm.searchengine.cqp.serverException.CqiServerError;
62
import org.txm.utils.TXMProgressMonitor;
63 63
import org.txm.utils.logger.Log;
64 64

  
65 65
/**
......
321 321
	 * @throws IOException
322 322
	 */
323 323
	@Override
324
	protected boolean __compute() throws Exception {
324
	protected boolean __compute(TXMProgressMonitor monitor) throws Exception {
325 325
		
326 326
		// Queries
327 327
		if (this.hasParameterChanged(ProgressionPreferences.QUERIES)) {
......
329 329
			this.structurePositions = new int[0];
330 330
			this.structureNames = new String[0];
331 331
			
332
			this.monitorSetTask("Processing queries...");
333
			if (!this.stepQueries()) {
332
			monitor.monitorSetTask("Processing queries...");
333
			if (!this.stepQueries(monitor)) {
334 334
				return true;
335 335
			}
336 336
			
337
			if (this.monitorIsCanceled()) {
337
			if (monitor.monitorIsCanceled()) {
338 338
				return false;
339 339
			}
340
			this.monitorSetWorked(10);
340
			monitor.monitorSetWorked(10);
341 341
		}
342 342
		
343 343
		// Structural units
344
		this.monitorSetTask("Processing structural units...");
345
		if (!this.stepStructuralUnits()) {
344
		monitor.monitorSetTask("Processing structural units...");
345
		if (!this.stepStructuralUnits(monitor)) {
346 346
			return false;
347 347
		}
348
		this.monitorSetWorked(20);
348
		monitor.monitorSetWorked(20);
349 349
		
350 350
		
351 351
		// Finalization steps
352 352
		if (this.hasParameterChanged(ProgressionPreferences.QUERIES)) {
353
			this.monitorSetTask("Finalizing...");
353
			monitor.monitorSetTask("Finalizing...");
354 354
			if (!stepFinalize()) {
355 355
				return false;
356 356
			}
357
			this.monitorSetWorked(20);
357
			monitor.monitorSetWorked(20);
358 358
		}
359 359
		
360 360
		return true;
......
436 436
	 *
437 437
	 * @throws CqiClientException the cqi client exception
438 438
	 */
439
	public boolean stepQueries() throws CqiClientException {
439
	public boolean stepQueries(TXMProgressMonitor monitor) throws CqiClientException {
440 440
		this.maxX = this.getCorpus().getSize();
441 441
		int npositions = 0;
442 442
		
......
472 472
			for (Match m : matches) {
473 473
				positions[i++] = m.getStart();
474 474
				npositions++;
475
				this.monitorSetWorked(1);
475
				monitor.monitorSetWorked(1);
476 476
			}
477 477
		}
478 478
		return npositions > 0;
......
485 485
	 * @throws CqiServerError
486 486
	 * @throws IOException
487 487
	 */
488
	public boolean stepStructuralUnits() throws CqiClientException, IOException, CqiServerError {
488
	public boolean stepStructuralUnits(TXMProgressMonitor monitor) throws CqiClientException, IOException, CqiServerError {
489 489
		// structure query
490 490
		if (structuralUnit != null) {
491 491
			CQLQuery query = new CQLQuery("<" + structuralUnit.getName() + ">[]"); //$NON-NLS-1$ //$NON-NLS-2$
......
557 557
				
558 558
				i++;
559 559
				
560
				this.monitorSetWorked(1);
560
				monitor.monitorSetWorked(1);
561 561
			}
562 562
			this.bande = distmin * this.bandeMultiplier;
563 563
		}
tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java (revision 2619)
24 24
import org.txm.searchengine.cqp.corpus.query.Match;
25 25
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
26 26
import org.txm.textsbalance.core.preferences.TextsBalancePreferences;
27
import org.txm.utils.TXMProgressMonitor;
27 28
import org.txm.utils.logger.Log;
28 29

  
29 30
/**
......
125 126
	 * @param countTexts
126 127
	 * @throws CqiClientException
127 128
	 */
128
	protected boolean __compute() {
129
	protected boolean __compute(TXMProgressMonitor monitor) {
129 130
		
130
		this.monitorSetTask("Computing balance with metadata propertyName = " + this.structuralUnitProperty + ", structural unit = " + this.structuralUnit.getName() + " and groupByTexts = " + this.countTexts); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
131
		monitor.monitorSetTask("Computing balance with metadata propertyName = " + this.structuralUnitProperty + ", structural unit = " + this.structuralUnit.getName() + " and groupByTexts = " + this.countTexts); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
131 132
		try {
132 133
			this.dataset = new HashMap<Integer, Comparable[]>();
133 134
			
tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java (revision 2619)
14 14
import org.txm.searchengine.ts.TSMatch;
15 15
import org.txm.searchengine.ts.TSResult;
16 16
import org.txm.tigersearch.commands.ComputeTIGERSearch;
17
import org.txm.utils.TXMProgressMonitor;
17 18
import org.txm.utils.logger.Log;
18 19

  
19 20
public class TIGERSearch extends TXMResult {
20

  
21
	
21 22
	protected TSCorpusManager manager;
23
	
22 24
	protected TSCorpus tscorpus;
25
	
23 26
	protected boolean ready = false;
27
	
24 28
	protected TSResult tsresult;
29
	
25 30
	protected String T, NT;
31
	
26 32
	protected CorpusBuild corpus;
27

  
28
	@Parameter(key=TXMPreferences.QUERY)
33
	
34
	@Parameter(key = TXMPreferences.QUERY)
29 35
	protected String pQuery;
30

  
36
	
31 37
	public CorpusBuild getCorpus() {
32 38
		return corpus;
33 39
	}
34

  
40
	
35 41
	public TIGERSearch(CorpusBuild corpus2) {
36 42
		this(null, corpus2);
37

  
43
		
38 44
	}
39 45
	
40 46
	public TIGERSearch(String parentNodePath, CorpusBuild corpus2) {
41 47
		super(parentNodePath, corpus2);
42 48
		
43 49
		this.corpus = getParent();
44

  
50
		
45 51
		String id = corpus.getRootCorpusBuild().getName();
46
		File configfile = new File(corpus.getProjectDirectory(),"tiger/tigersearch.logprop");
52
		File configfile = new File(corpus.getProjectDirectory(), "tiger/tigersearch.logprop");
47 53
		File registrydir = new File(corpus.getProjectDirectory(), "tiger");
48
		File tscorpusdir = new File(corpus.getProjectDirectory(), "tiger/"+id);
49

  
54
		File tscorpusdir = new File(corpus.getProjectDirectory(), "tiger/" + id);
55
		
50 56
		if (!tscorpusdir.exists()) {
51
			System.out.println("Error: can't find corpus directory: "+tscorpusdir);
57
			System.out.println("Error: can't find corpus directory: " + tscorpusdir);
52 58
			return;
53 59
		}
54

  
60
		
55 61
		TSCorpusManager manager = new TSCorpusManager(registrydir, configfile);
56 62
		if (manager.isInitialized()) {
57

  
63
			
58 64
			tscorpus = manager.getCorpus(id);
59 65
			if (tscorpus == null) {
60
				System.out.println("TIGERSearch corpus not found in "+registrydir);
66
				System.out.println("TIGERSearch corpus not found in " + registrydir);
61 67
				ready = false;
62

  
68
				
63 69
				return;
64 70
			}
65

  
71
			
66 72
			ready = true;
67 73
		}
68 74
	}
69 75
	
70 76
	public TIGERSearch(String parentNodePath) {
71
		this( parentNodePath, null);
77
		this(parentNodePath, null);
72 78
	}
73

  
79
	
74 80
	public TSResult getTSResult() {
75 81
		return tsresult;
76 82
	}
77

  
83
	
78 84
	public boolean isComputed() {
79 85
		return tsresult != null;
80 86
	}
81

  
87
	
82 88
	public boolean isDrawn() {
83
		return tsresult!= null && T != null && NT != null;
89
		return tsresult != null && T != null && NT != null;
84 90
	}
85

  
91
	
86 92
	public boolean toSVG(File svgFile, int sent, int sub, String T, String NT) {
87 93
		if (tsresult == null) return false; // no result
88 94
		this.T = T;
89 95
		this.NT = NT;
90 96
		
91 97
		if (tsresult.getNumberOfMatch() == 0) return false;
92

  
98
		
93 99
		tsresult.setDisplayProperties(Arrays.asList(T), NT);
94

  
100
		
95 101
		try {
96 102
			// iterate to the sub th subgraph
97 103
			TSMatch match = tsresult.getMatch(sent);
......
99 105
			svgFile.delete();
100 106
			match.toSVGFile(svgFile);
101 107
			if (!svgFile.exists()) {
102
				System.out.println("Fail to render SVG match for sent="+sent+" and sub="+sub);
108
				System.out.println("Fail to render SVG match for sent=" + sent + " and sub=" + sub);
103 109
				return false;
104 110
			}
105
		} catch(Exception e) {
111
		}
112
		catch (Exception e) {
106 113
			Log.printStackTrace(e);
107 114
		}
108 115
		return true;
109 116
	}
110

  
117
	
111 118
	public String[] getTProperties() {
112 119
		if (tscorpus == null) return new String[0];
113 120
		List<String> tFeatures = tscorpus.getTFeatures();
114 121
		return tFeatures.toArray(new String[tFeatures.size()]);
115 122
	}
116

  
123
	
117 124
	public String[] getNTProperties() {
118 125
		if (tscorpus == null) return new String[0];
119 126
		List<String> ntFeatures = tscorpus.getNTFeatures();
120 127
		return ntFeatures.toArray(new String[ntFeatures.size()]);
121 128
	}
122

  
129
	
130
	@Override
123 131
	public CorpusBuild getParent() {
124
		return (CorpusBuild)super.getParent();
132
		return (CorpusBuild) super.getParent();
125 133
	}
126

  
134
	
127 135
	public boolean isReady() {
128 136
		return ready;
129 137
	}
130

  
138
	
131 139
	public String getT() {
132 140
		return T;
133 141
	}
134

  
142
	
135 143
	public String getNT() {
136 144
		return NT;
137 145
	}
138

  
146
	
139 147
	public int getNSentences() {
140 148
		if (tsresult == null) return 0;
141 149
		return tsresult.getNumberOfMatch();
142 150
	}
143

  
151
	
144 152
	public int getNSubGraph(int matchNo) {
145 153
		if (tsresult == null) return 0;
146 154
		if (tsresult.getMatch(matchNo) == null) return 0;
147 155
		
148 156
		return tsresult.getMatch(matchNo).getNumberOfSubGraph();
149 157
	}
150

  
151
//	public int getSent() {
152
//		if (tsresult == null) return 0;
153
//		return tsresult.getCurrentMatchNo();
154
//	}
155

  
158
	
159
	// public int getSent() {
160
	// if (tsresult == null) return 0;
161
	// return tsresult.getCurrentMatchNo();
162
	// }
163
	
156 164
	public int getSub(int matchNo) {
157 165
		if (tsresult == null) return 0;
158 166
		if (tsresult.getMatch(matchNo) == null) return 0;
159 167
		
160 168
		return tsresult.getMatch(matchNo).getCurrentSubMatchNo();
161 169
	}
162

  
170
	
163 171
	public String getQuery() {
164 172
		return pQuery;
165 173
	}
166

  
174
	
175
	@Override
167 176
	public String toString() {
168 177
		if (pQuery != null)
169
			return pQuery.substring(0, Math.min(20,  pQuery.length())).replaceAll("\n", " ")+" T: "+T+" NT: "+NT;
170

  
171
		return ""+corpus;
178
			return pQuery.substring(0, Math.min(20, pQuery.length())).replaceAll("\n", " ") + " T: " + T + " NT: " + NT;
179
		
180
		return "" + corpus;
172 181
	}
173

  
182
	
174 183
	public boolean openEditor() {
175 184
		ComputeTIGERSearch.openEditor(this);
176 185
		return true;
177 186
	}
178

  
187
	
179 188
	@Override
180 189
	public boolean toTxt(File outfile, String encoding, String colseparator,
181 190
			String txtseparator) throws Exception {
182 191
		return tsresult.toXml(outfile);
183 192
	}
184

  
193
	
185 194
	@Override
186 195
	public void clean() {
187

  
196
		
188 197
	}
189

  
198
	
190 199
	/**
191 200
	 * 
192 201
	 * @return the array of extensions to show in the FileDialog SWT widget
193 202
	 */
203
	@Override
194 204
	public String[] getExportTXTExtensions() {
195
		return new String[]{"*.xml"};
205
		return new String[] { "*.xml" };
196 206
	}
197

  
207
	
198 208
	@Override
199 209
	public String getName() {
200 210
		return pQuery;
201 211
	}
202

  
212
	
203 213
	@Override
204 214
	public String getSimpleName() {
205 215
		return pQuery;
206 216
	}
207

  
217
	
208 218
	@Override
209 219
	public String getDetails() {
210 220
		return pQuery;
211 221
	}
212

  
222
	
213 223
	@Override
214 224
	public boolean canCompute() {
215
		return corpus != null; // && pQuery != null && pQuery.length() > 0; // if pQuery is empty/null set a default query 
225
		return corpus != null; // && pQuery != null && pQuery.length() > 0; // if pQuery is empty/null set a default query
216 226
	}
217

  
227
	
218 228
	@Override
219 229
	public boolean setParameters(TXMParameters parameters) {
220 230
		if (parameters.getString("query") != null) {
......
222 232
		}
223 233
		return true;
224 234
	}
225

  
235
	
226 236
	@Override
227 237
	public boolean saveParameters() throws Exception {
228 238
		return true;
229 239
	}
230

  
240
	
231 241
	@Override
232 242
	public boolean loadParameters() throws Exception {
233 243
		return true;
234 244
	}
235

  
245
	
236 246
	@Override
237
	protected boolean _compute() throws Exception {
238

  
247
	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
248
		
239 249
		if (tscorpus == null) return false;
240 250
		
241 251
		tsresult = null;
......
247 257
		tsresult.getFirst();
248 258
		return true;
249 259
	}
250

  
260
	
251 261
	@Override
252 262
	public String getResultType() {
253 263
		return "Tiger search";
tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java (revision 2619)
10 10
import org.txm.index.core.functions.Index;
11 11
import org.txm.index.core.functions.Line;
12 12
import org.txm.statsengine.r.core.RWorkspace;
13
import org.txm.utils.TXMProgressMonitor;
13 14
import org.txm.utils.logger.Log;
14 15
import org.txm.wordcloud.core.messages.WordCloudCoreMessages;
15 16
import org.txm.wordcloud.core.preferences.WordCloudPreferences;
......
93 94
	
94 95
	
95 96
	@Override
96
	protected boolean __compute() {
97
	protected boolean __compute(TXMProgressMonitor monitor) {
97 98
		// // FIXME: source must always be an Index because the corpus source produces an Index
98 99
		// // from corpus
99 100
		// if (source instanceof Corpus) {
......
246 247
	
247 248
	@Override
248 249
	public String getSimpleName() {
249
		return "Fmin=" + this.fMin + " Vmax=" + this.maxWordsCount; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
250
		return "Fmin=" + this.fMin + " Vmax=" + this.maxWordsCount; //$NON-NLS-1$ //$NON-NLS-2$ 
250 251
	}
251 252
	
252 253
	@Override
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java (revision 2619)
3 3
 */
4 4
package org.txm.chartsengine.core.results;
5 5

  
6
import org.eclipse.core.runtime.IProgressMonitor;
6
import java.util.ArrayList;
7

  
7 8
import org.txm.chartsengine.core.ChartCreator;
8 9
import org.txm.chartsengine.core.ChartsEngine;
9 10
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
10 11
import org.txm.core.results.Parameter;
11 12
import org.txm.core.results.TXMResult;
13
import org.txm.utils.TXMProgressMonitor;
12 14
import org.txm.utils.logger.Log;
13 15

  
14 16
/**
......
162 164
		this.chartDirty = true;
163 165
	}
164 166
	
165
	@Override
166
	public boolean compute(IProgressMonitor monitor) throws InterruptedException {
167
		return compute(monitor, true);
168
	}
169
	
170 167
	/**
171 168
	 * This method is dedicated to be implemented by the inherited result classes to run the computing steps.
172 169
	 * Subclasses can monitor progress using the dedicated methods.
......
176 173
	 * 
177 174
	 * @throws Exception
178 175
	 */
179
	protected abstract boolean __compute() throws Exception;
176
	protected abstract boolean __compute(TXMProgressMonitor monitor) throws Exception;
180 177
	
181 178
	
182 179
	@Override
183
	protected final boolean _compute() {
180
	protected final boolean _compute(TXMProgressMonitor monitor) {
184 181
		
185 182
		boolean computingState = true;
186 183
		
......
189 186
			
190 187
			// FIXME: SJ: Computes the result only if at least one computing parameter has changed
191 188
			// if(this.hasParameterChanged()) {
192
			computingState = this.__compute();
189
			computingState = this.__compute(monitor);
193 190
			// }
194 191
			if (computingState) {
195
				computingState = this.renderChart();
192
				computingState = this.renderChart(monitor);
196 193
			}
197 194
		}
198 195
		catch (Exception e) {
......
211 208
	 * @return true if the chart has been rendered
212 209
	 * @throws Exception
213 210
	 */
214
	protected boolean renderChart() throws Exception {
211
	protected boolean renderChart(TXMProgressMonitor monitor) throws Exception {
215 212
		
216
		this.monitorSetTask("Rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "...");
213
		monitor.monitorSetTask("Rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "...");
217 214
		
218 215
		Log.finest("*** ChartResult.renderChart(): rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "..."); //$NON-NLS-1$
219 216
		
......
308 305
		}
309 306
	}
310 307
	
308
	
309
	/**
310
	 * Stores the last parameters used for computing and rendering.
311
	 * 
312
	 * @throws Exception
313
	 */
311 314
	@Override
315
	protected void updateLastParameters() throws Exception {
316
		// FIXME: SJ: linked to the bug of computing dirty state and rendering dirty state.
317
		// the rendering parameters should be stored here, but if they are stored there is an unidentified bug linked to the dirty state and the _compute() is skipped in TXMREsult.compute()
318
		// need to investigate further
319
		ArrayList<Integer> parametersTypes = new ArrayList<>();
320
		parametersTypes.add(Parameter.COMPUTING);
321
		// parametersTypes.add(Parameter.RENDERING);
322
		this.updateLastParameters(parametersTypes);
323
	}
324
	
325
	
326
	
327
	@Override
312 328
	public String dumpParameters() {
313 329
		return super.dumpParameters() + "\n" + this.dumpParameters(Parameter.RENDERING); //$NON-NLS-1$
314 330
	}
......
337 353
	public void updateDirtyFromHistory() throws Exception {
338 354
		this.dirty = super.hasParameterChanged();
339 355
		if (!this.dirty) {
340
			this.dirty = this.hasRenderingParameterChanged();
356
			this.dirty = this.hasRenderingParameterChanged(); // FIXME: SJ: temporary but breaks the dirty computing state and rendering computing state management
341 357
		}
342 358
	}
343 359
	
......
349 365
	 * @throws Exception
350 366
	 */
351 367
	public void updateChartDirtyFromHistory() throws Exception {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff