Revision 2694

tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/SWTEditorsUtils.java (revision 2694)
8 8
import java.util.HashSet;
9 9
import java.util.List;
10 10
import java.util.Map;
11
import java.util.Map.Entry;
11 12
import java.util.Set;
12 13

  
13 14
import org.eclipse.core.commands.ExecutionEvent;
......
51 52
	// TODO: SJ: do only one pass when we will remove the TXMMultipageEditor
52 53
	public static Set<ITXMResultEditor<TXMResult>> getEditors(List<TXMResult> results) {
53 54
		
54
		Map<TXMResult, ITXMResultEditor<TXMResult>> tmpEditors = new HashMap<>();
55
		Map<TXMResult, ArrayList<ITXMResultEditor<TXMResult>>> tmpEditors = new HashMap<>();
55 56
		
56 57
		HashSet<ITXMResultEditor<TXMResult>> editors = new HashSet<>();
57 58
		
......
68 69
						for (int i = 0; i < txmMultipageEditor.getEditors().size(); i++) {
69 70
							if (txmMultipageEditor.getEditors().get(i) instanceof ITXMResultEditor) {
70 71
								ITXMResultEditor txmEditor = ((ITXMResultEditor) txmMultipageEditor.getEditors().get(i));
71
								tmpEditors.put(txmEditor.getResult(), txmEditor);
72
								ArrayList eds = tmpEditors.get(txmEditor.getResult());
73
								if (eds == null) {
74
									eds = new ArrayList<>();
75
									tmpEditors.put(txmEditor.getResult(), eds);
76
								}
77
								eds.add(txmEditor);
72 78
							}
73 79
						}
74 80
					}
75 81
					else if (tmpEditor instanceof ITXMResultEditor) {
76
						tmpEditors.put(((ITXMResultEditor<TXMResult>) tmpEditor).getResult(), (ITXMResultEditor<TXMResult>) tmpEditor);
82
						
83
						ArrayList eds = tmpEditors.get(((ITXMResultEditor<TXMResult>) tmpEditor).getResult());
84
						if (eds == null) {
85
							eds = new ArrayList<>();
86
							tmpEditors.put(((ITXMResultEditor<TXMResult>) tmpEditor).getResult(), eds);
87
						}
88
						eds.add(tmpEditor);
77 89
					}
78 90
				}
79 91
			}
80 92
		}
81 93
		
82 94
		// second pass: filtering on used results if needed
83
		for (Map.Entry<TXMResult, ITXMResultEditor<TXMResult>> entry : tmpEditors.entrySet()) {
95
		for (Entry<TXMResult, ArrayList<ITXMResultEditor<TXMResult>>> entry : tmpEditors.entrySet()) {
84 96
			if (results == null || results.contains(entry.getKey())) {
85
				editors.add(entry.getValue());
97
				ArrayList<ITXMResultEditor<TXMResult>> eds = entry.getValue();
98
				for (int i = 0; i < eds.size(); i++) {
99
					editors.add(eds.get(i));
100
				}
86 101
			}
87 102
		}
88 103
		
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 2694)
1211 1211
			Set<ITXMResultEditor<TXMResult>> editors = SWTEditorsUtils.getEditors(results.get(i));
1212 1212
			
1213 1213
			// FIXME: Debug
1214
			// Log.finest("TXMEditor.refresh(): " + className + ": child result = " + results.get(i).getClass().getSimpleName() + " / editors to refresh = " + editors + "."); //$NON-NLS-1$
1215
			// //$NON-NLS-2$
1214
			Log.finest("TXMEditor.refresh(): " + className + ": child result = " + results.get(i).getClass().getSimpleName() + " / editors to refresh = " + editors + "."); //$NON-NLS-1$
1215
			// $NON-NLS-2$
1216 1216
			
1217 1217
			for (ITXMResultEditor<TXMResult> txmEditor : editors) {
1218 1218
				if (txmEditor != this
1219 1219
				// && txmEditor.isDirty() // SJ: break the chart loading
1220
				// SJ 2: some changes has been made in the dirty management, need to check again and may restore the txmEditor.isDirty() test
1220 1221
				) {
1221 1222
					
1222 1223
					// FIXME: SJ: need to prove/test this code
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 2694)
705 705
			hasParameterChanged = this.hasParameterChanged(name, lastParameters);
706 706
			
707 707
			if (hasParameterChanged) {
708
				Log.finest("TXMResult.hasParameterChanged(): " + this.getClass().getSimpleName() + ": parameter " + name + " has changed.");
708
				Log.finest("TXMResult.hasParameterChanged(): " + this.getClass().getSimpleName() + ": parameter " + name + " has changed (type = " + parameterType + ").");
709 709
				break;
710 710
			}
711 711
		}
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java (revision 2694)
183 183
		try {
184 184
			Log.finest("*** ChartResult._compute(): " + this.getClass().getSimpleName() + ": starting computing process...");
185 185
			
186
			// computes the result only if at least one computing parameter has changed
187
			boolean changed = super.hasParameterChanged();
188
			boolean rchanged = this.hasRenderingParameterChanged();
189
			if (isDirty()) {
186
			boolean computingParametersChanged = super.hasParameterChanged();
187
			boolean renderingParametersChanged = this.hasRenderingParameterChanged();
188
			
189
			if (this.isDirty()) {
190
				
191
				// Debug
192
				Log.finest("+++ ChartResult._compute(): " + this.getClass().getSimpleName() + ": computing result of type " + this.getClass() + "...");
193
				
190 194
				computingState = this.__compute(monitor.createNewMonitor(90)) && this.renderChart(monitor.createNewMonitor(10));
191 195
			}
192 196
			else {
193
				if (changed) { // no parameter changed but result is dirty
197
				if (computingParametersChanged) { // no parameter changed but result is dirty
198
					
199
					// Debug
200
					Log.finest("+++ ChartResult._compute(): " + this.getClass().getSimpleName() + ": computing result of type " + this.getClass() + "...");
201
					
194 202
					computingState = this.__compute(monitor.createNewMonitor(90)) && this.renderChart(monitor.createNewMonitor(10));
195 203
				}
196
				else if (rchanged) {
204
				else if (renderingParametersChanged) {
205
					
206
					// Debug
207
					Log.finest("--- ChartResult._compute(): " + this.getClass().getSimpleName() + ": result parameters have not changed since last computing, computing skipped.");
208
					
197 209
					computingState = this.renderChart(monitor.createNewMonitor(100));
198 210
				}
199 211
				else {
200
					Log.warning("ChartResult _compute has been called without parameter changed and not dirty?");
212
					// FIXME: Debug
213
					Log.finest("--- ChartResult.renderChart(): chart rendering parameters have not changed since last rendering, rendering skipped."); //$NON-NLS-1$
214
					// Log.warning("ChartResult _compute has been called without parameter changed and not dirty?");
201 215
				}
202 216
			}
203 217
			
......
390 404
		return this.hasParameterChanged(this.getLastParametersFromHistory(), Parameter.RENDERING);
391 405
	}
392 406
	
393
	/**
394
	 * Checks if at least one rendering parameter value has changed since last computing.
395
	 * 
396
	 * @return
397
	 * @throws Exception
398
	 */
399 407
	@Override
400 408
	public boolean hasParameterChanged() throws Exception {
401 409
		return super.hasParameterChanged() || this.hasRenderingParameterChanged();
tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java (revision 2694)
122 122
	/**
123 123
	 * Structural unit.
124 124
	 */
125
	@Parameter(key = TXMPreferences.STRUCTURAL_UNIT, type = Parameter.RENDERING)
125
	@Parameter(key = TXMPreferences.STRUCTURAL_UNIT)
126 126
	protected StructuralUnit structuralUnit;
127 127
	
128 128
	/**
129 129
	 * Structural unit property.
130 130
	 */
131
	@Parameter(key = TXMPreferences.STRUCTURAL_UNIT_PROPERTY, type = Parameter.RENDERING)
131
	@Parameter(key = TXMPreferences.STRUCTURAL_UNIT_PROPERTY)
132 132
	protected StructuralUnitProperty structuralUnitProperty;
133 133
	
134 134
	/**
135
	 * Repeats or not the same value when displaying the section markers.
136
	 */
137
	@Parameter(key = ProgressionPreferences.REPEAT_SAME_VALUES, type = Parameter.RENDERING)
138
	protected boolean repeatValues;
139
	
140
	/**
141 135
	 * Only used in Density mode.
142 136
	 */
143 137
	@Parameter(key = ProgressionPreferences.BANDE_MULTIPLIER)
......
146 140
	/**
147 141
	 * Regex to display only the property that match it.
148 142
	 */
149
	@Parameter(key = ProgressionPreferences.PROPERTY_REGEX, type = Parameter.RENDERING)
143
	@Parameter(key = ProgressionPreferences.PROPERTY_REGEX)
150 144
	protected String propertyRegex;
151 145
	
152 146
	
153 147
	/**
148
	 * Repeats or not the same value when displaying the section markers.
149
	 */
150
	@Parameter(key = ProgressionPreferences.REPEAT_SAME_VALUES, type = Parameter.RENDERING)
151
	protected boolean repeatValues;
152
	
153
	
154
	
155
	/**
154 156
	 * Creates a not computed progression
155 157
	 * 
156 158
	 * @param parent
......
337 339
			if (monitor.isCanceled()) {
338 340
				return false;
339 341
			}
340
			monitor.worked(10);
342
			monitor.worked(40);
341 343
		}
342 344
		
343 345
		// Structural units
......
345 347
		if (!this.stepStructuralUnits(monitor)) {
346 348
			return false;
347 349
		}
348
		monitor.worked(20);
350
		monitor.worked(40);
349 351
		
350 352
		
351 353
		// Finalization steps
......
573 575
		if (this.getCorpus() instanceof Subcorpus) {
574 576
			List<Match> matches = ((Subcorpus) getCorpus()).getMatches();
575 577
			if (matches.size() == 0) {
576
				System.out.println(ProgressionCoreMessages.errorColonSubcorpusWithSize0);
578
				Log.severe(ProgressionCoreMessages.errorColonSubcorpusWithSize0);
577 579
				return false;
578 580
			}
579 581
			

Also available in: Unified diff