Révision 1389

tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/chartsengine/events/ProgressionEventCallBack.java (revision 1389)
31 31
import org.txm.edition.rcp.editors.RGBA;
32 32
import org.txm.edition.rcp.editors.SynopticEditionEditor;
33 33
import org.txm.edition.rcp.handlers.OpenEdition;
34
import org.txm.objects.CorpusBuild;
34 35
import org.txm.objects.Edition;
35 36
import org.txm.objects.Page;
36 37
import org.txm.objects.Text;
......
88 89
	
89 90
						// Linked edition (CTRL/CMD + double click)
90 91
						if((mouseEvent.getModifiers() & ZoomAndPanCallBack.keyboardZoomModifierKeyMask) != 0) {
91
							// Updates the linked editor
92
							// Creates or updates the linked editor
92 93
							updateLinkedEditionEditor((SynopticEditionEditor) chartEditor.getLinkedEditor(SynopticEditionEditor.class), selectedPointPositions);
93 94
						}
94 95
						// Linked concordance
95 96
						else	{
96
							// Updates the linked editor
97
							// Creates or updates the linked editor
97 98
							updateLinkedConcordanceEditor(chartEditor.getLinkedEditors(ConcordanceEditor.class), selectedPointPositions);
98 99
						}
99 100
					}
......
131 132
						return;
132 133
					}
133 134
					
134
					// Arrow keys
135
					if(keyEvent.getKeyCode() == KeyEvent.VK_LEFT || keyEvent.getKeyCode() == KeyEvent.VK_RIGHT)	{
135
					// Arrow keys + return key
136
					if(keyEvent.getKeyCode() == KeyEvent.VK_LEFT || keyEvent.getKeyCode() == KeyEvent.VK_RIGHT
137
							 || keyEvent.getKeyCode() == KeyEvent.VK_ENTER)	{
136 138
					
137 139
						final ArrayList<Integer> selectedPointPositions = ((ProgressionChartCreator) chartEditor.getResult().getChartCreator()).getSelectedPointPositions(chartEditor.getChart());
138 140
	
139 141
						// Get the linked concordance editors and update the one linked to the progression curve if it exists
140 142
						ArrayList<EditorPart> linkedConcordancesEditors = chartEditor.getLinkedEditors(ConcordanceEditor.class);
141
						if(!linkedConcordancesEditors.isEmpty())	{
143
						if(keyEvent.getKeyCode() == KeyEvent.VK_ENTER || !linkedConcordancesEditors.isEmpty())	{
142 144
							updateLinkedConcordanceEditor(linkedConcordancesEditors, selectedPointPositions);
143 145
						}
144 146
						
......
157 159
	
158 160
	
159 161
	/**
160
	 * Updates the linked concordance editor.
162
	 * Creates or updates the linked concordance editor.
161 163
	 * If the editor doesn't exist it will be created.
162 164
	 * 
163 165
	 * @param linkedEditors
......
235 237
					position = EModelService.RIGHT_OF;
236 238
					parentEditor = linkedEditors.get(linkedEditors.size() - 1);
237 239
					
240
					// FIXME: Debug
238 241
					System.err.println("ProgressionEventCallBack.updateLinkedConcordanceEditor(): parent editor for splitting: " + parentEditor); //$NON-NLS-1$
239 242
				}
240 243
				// Split and add linked editor
......
368 371
			}
369 372
			
370 373
			CQPCorpus corpus = ((Progression) chartEditor.getResult()).getCorpus();
371
			StructuralUnit textS = corpus.getStructuralUnit("text"); //$NON-NLS-1$
372
			Property textP = textS.getProperty("id"); //$NON-NLS-1$
374
			StructuralUnit textS = corpus.getStructuralUnit(CorpusBuild.TEXT);
375
			Property textP = textS.getProperty(CorpusBuild.ID);
373 376
			Match selectedWordMatch = new Match(selectedPointPositions.get(selectedPointPositions.size() - 1), selectedPointPositions.get(selectedPointPositions.size() - 1));
374 377
			String textId = selectedWordMatch.getValueForProperty(textP);
375 378

  
......
386 389
				return;
387 390
			}
388 391

  
392
			// Compute the edition if needed
393
			if(!edition.hasBeenComputedOnce())	{
394
				edition.compute();
395
			}
396
			
389 397
			// Get the current selected word to highlight more
390
			List<String> selectedWordIds = selectedWordMatch.getValuesForProperty(corpus.getProperty("id")); //$NON-NLS-1$;
398
			List<String> selectedWordIds = selectedWordMatch.getValuesForProperty(corpus.getProperty(CorpusBuild.ID));
391 399

  
392 400
			// Get all words to highlight from the progression chart data set
393 401
			ArrayList<ArrayList<Integer>> allPointPositionsBySeries = ((ProgressionChartCreator)chartEditor.getResult().getChartCreator()).getAllPointPositionsBySeries(chartEditor.getChart());
......
399 407
				for(int j = 0; j < positions.size(); j++) {
400 408
					Match match = new Match(positions.get(j), positions.get(j));					
401 409
					if(match.getValueForProperty(textP).equals(textId)) {
402
						wordsIds.add(match.getValueForProperty(corpus.getProperty("id"))); //$NON-NLS-1$;
410
						wordsIds.add(match.getValueForProperty(corpus.getProperty(CorpusBuild.ID))); //$NON-NLS-1$;
403 411
					}
404 412
				}
405 413
				allWordIds.add(wordsIds);
tmp/org.txm.progression.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 1389)
5 5

  
6 6
command.name.3 = Envoyer vers la progression
7 7

  
8
command.tooltip = Calculer le graphique de progression d'une ou plusieurs requêtes
8
command.tooltip = Calculer le graphique de progression d'une ou plusieurs requrequ\u00EAtetes
9 9

  
10 10
page.name = Progression
tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartCreator.java (revision 1389)
32 32
			System.out.println("GSChartCreator.updateChart() style sheet dump: " + graph.getAttribute("ui.stylesheet"));
33 33
			
34 34
			// Add the current shared preferences as Font size, etc.
35
			graph.addAttribute("ui.stylesheet", graph.getAttribute("ui.stylesheet") + "node {"
36
					+ " text-size: " + result.getFont().split("\\|")[2] + ";" 
37
					+ " text-font: \"" + result.getFont().split("\\|")[1] + "\";" 
38
							
39
							+ " }");
35
//			graph.addAttribute("ui.stylesheet", graph.getAttribute("ui.stylesheet") + "node {"
36
//					+ " text-size: " + result.getFont().split("\\|")[2] + ";" 
37
//					+ " text-font: \"" + result.getFont().split("\\|")[1] + "\";" 
38
//							
39
//							+ " }");
40 40

  
41 41
			// FIXME: Debug
42 42
			System.out.println("GSChartCreator.updateChart() style sheet dump: " + graph.getAttribute("ui.stylesheet"));
tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/preferences/GSChartsEnginePreferences.java (revision 1389)
33 33
	
34 34
	@Override
35 35
	public void initializeDefaultPreferences() {
36
		super.initializeDefaultPreferences();
36 37
		Preferences defaultPreferences = this.getDefaultPreferencesNode();
37 38
		defaultPreferences.put(OUTPUT_FORMAT, GSChartsEngine.OUTPUT_FORMAT_GRAPHSTREAM);
38 39
	}
tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java (revision 1389)
176 176
			IWorkbenchPage page = window.getActivePage();
177 177

  
178 178
			SynopticEditorInput editorInput = new SynopticEditorInput(corpus, text.getName(), editions);
179
			SynopticEditionEditor editor = (SynopticEditionEditor) page.openEditor(editorInput,
180
					SynopticEditionEditor.ID, true);
179
			SynopticEditionEditor editor = (SynopticEditionEditor) page.openEditor(editorInput, SynopticEditionEditor.ID, true);
181 180

  
182 181
			return editor;
183 182

  
tmp/org.txm.cooccurrence.chartsengine/src/org/txm/cooccurrence/functions/CooccurrenceGraph.java (revision 1389)
21 21
	 */
22 22
	public CooccurrenceGraph(TXMResult parent) {
23 23
		super(parent);
24
		// TODO Auto-generated constructor stub
24
		
25
		// FIXME: conception problem
26
		// Since the command has no preferences, the default charts engine preferences are not loaded in TXMResult constructor, so the code above is needed to reload the parameters
27
		this.commandPreferencesNodePath = "org.txm.chartsengine.core";
28
		try {
29
			this.autoLoadParametersFromAnnotations();
30
		}
31
		catch (Exception e) {
32
			// TODO Auto-generated catch block
33
			e.printStackTrace();
34
		}
25 35
	}
26 36

  
27 37
	/**
......
29 39
	 */
30 40
	public CooccurrenceGraph(String parametersNodePath) {
31 41
		super(parametersNodePath);
32
		// TODO Auto-generated constructor stub
33 42
	}
34 43

  
35 44

  
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/CheckRPackages.java (revision 1389)
120 120
					}
121 121
				} else { // package is not present, install it
122 122
					try {
123
						System.out.println(TXMCoreMessages.bind("The '{0}' package is not installed. Trying to install it now...", p));
123
						Log.info(TXMCoreMessages.bind("The '{0}' package is not installed. Trying to install it now...", p));
124 124
						
125 125
						try {rw.eval("detach(\"package:"+p+"\", character.only = TRUE)");} catch(Exception tmpE){} // unload package to be able to reinstall it //$NON-NLS-1$ //$NON-NLS-2$
126 126
						
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/AdvancedPreferencePage.java (revision 1389)
115 115
		// Expert mode
116 116
		addField(new BooleanFieldEditor(TBXPreferences.EXPERT_USER, TXMUIMessages.advancedUserMode, getFieldEditorParent()));
117 117

  
118
		// Auto save each result after computing and auto load them at startup
119
		addField(new BooleanFieldEditor(TBXPreferences.AUTO_PERSISTENCE_ENABLED, TXMUIMessages.enableAutomaticSaveOfAllResultsPersistence, getFieldEditorParent()));
120

  
121 118
	}
122 119

  
123 120
	/* (non-Javadoc)
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/UserPreferencePage.java (revision 1389)
28 28
package org.txm.rcp.preferences;
29 29

  
30 30
import org.eclipse.jface.preference.BooleanFieldEditor;
31
import org.eclipse.jface.preference.FieldEditorPreferencePage;
32
import org.eclipse.ui.IWorkbench;
33
import org.eclipse.ui.IWorkbenchPreferencePage;
31
import org.txm.core.preferences.TBXPreferences;
34 32
import org.txm.rcp.messages.TXMUIMessages;
35
// TODO: Auto-generated Javadoc
36 33
/**
37
 * The Class UserPreferencePage.
34
 * User preferences page.
35
 * 
36
 * @author mdecorde
37
 * @author sjacquot
38
 * 
38 39
 */
39 40
public class UserPreferencePage extends RCPPreferencesPage {
40 41

  
......
47 48

  
48 49
	@Override
49 50
	protected void createFieldEditors() {
50
		addField(new BooleanFieldEditor(RCPPreferences.USER_ALERT_DELETE, TXMUIMessages.doNotConfirmToDeleteAnObject, BooleanFieldEditor.SEPARATE_LABEL, getFieldEditorParent()));
51
		addField(new BooleanFieldEditor(RCPPreferences.AUTO_UPDATE_EDITOR, TXMUIMessages.automaticRecomputingWhenChangingAParameter, BooleanFieldEditor.SEPARATE_LABEL, getFieldEditorParent()));
51
		this.addField(new BooleanFieldEditor(RCPPreferences.USER_ALERT_DELETE, TXMUIMessages.doNotConfirmToDeleteAnObject, BooleanFieldEditor.SEPARATE_LABEL, this.getFieldEditorParent()));
52

  
53
		// Auto compute the resul when a parameter changes
54
		this.addField(new BooleanFieldEditor(RCPPreferences.AUTO_UPDATE_EDITOR, TXMUIMessages.automaticRecomputingWhenChangingAParameter, BooleanFieldEditor.SEPARATE_LABEL, this.getFieldEditorParent()));
55
		
56
		// Auto save each result after computing and auto load them at startup
57
		this.addField(new BooleanFieldEditor(TBXPreferences.AUTO_PERSISTENCE_ENABLED, TXMUIMessages.enableAutomaticSaveOfAllResultsPersistence, BooleanFieldEditor.SEPARATE_LABEL, this.getFieldEditorParent()));
52 58
	}
53 59
}
tmp/org.txm.core/src/java/org/txm/Toolbox.java (revision 1389)
162 162
	}
163 163

  
164 164

  
165
	public static EnginesManager<? extends Engine> getEngineManager(EngineType et) {
165
	/**
166
	 * Gets the manager of the specified engine type.
167
	 * @param engineType
168
	 * @return
169
	 */
170
	public static EnginesManager<? extends Engine> getEngineManager(EngineType engineType) {
166 171

  
167 172
		if (enginesManagers == null) {
168 173
			return null;
169 174
		}
170
		return enginesManagers.get(et);
175
		return enginesManagers.get(engineType);
171 176
	}
172 177

  
173 178
	/**
174
	 * 
179
	 * Gets the TXM working directory.
175 180
	 * @return the TXM working directory set with the USER_TXM_HOME preference key 
176 181
	 */
177 182
	public static String getTxmHomePath() {
......
205 210
		return ret;
206 211
	}
207 212

  
213
	/**
214
	 * 
215
	 * @param preferencesStore
216
	 * @return
217
	 * @throws Exception
218
	 */
208 219
	public static boolean initialize(Class preferencesStore) throws Exception {
209 220
		return initialize(preferencesStore, null);
210 221
	}
tmp/org.txm.core/src/java/org/txm/objects/Edition.java (revision 1389)
405 405
		//System.out.println("USE THE PROJECT IMPORTMODULE TO BUILD THE EDITION="+userName);
406 406
		if (pages == null) {
407 407
			pages = new ArrayList<Page>();
408
		} else {
408
		}
409
		else {
409 410
			pages.clear();
410 411
		}
411 412
		

Formats disponibles : Unified diff