Revision 599

tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 599)
1
command.name.0=Calculer le diagramme en bâtons des lignes sélectionnées
2
command.name=Spécificités
3
editor.name=Spécificités
4
page.name=Spécificités
5
command.label=Spécificitiés
6
command.tooltip=Calculer les mots spécifiques de chaque partie
1
command.name.0=Calculer le diagramme en b?tons des lignes s?lectionn?es
2
command.name=Sp?cificit?s
3
editor.name=Sp?cificit?s
4
page.name=Sp?cificit?s
5
command.label=Sp?cificiti?s
6
command.tooltip=Calculer les mots sp?cifiques de chaque partie
tmp/org.txm.specificities.rcp/plugin.xml (revision 599)
6 6
      <editor
7 7
            class="org.txm.specificities.rcp.editors.SpecificitiesSelectionEditor"
8 8
            default="false"
9
            icon="icons/functions/specificities.png"
9
            icon="icons/functions/specificities_selection.png"
10 10
            id="org.txm.specificities.core.functions.SpecificitiesSelection"
11 11
            name="Specificities Chart">
12 12
      </editor>
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/adapters/SpecificitiesAdapterFactory.java (revision 599)
23 23
	public static final ImageDescriptor ICON =
24 24
			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(SpecificitiesAdapterFactory.class).getSymbolicName(),
25 25
					"platform:/plugin/"+ FrameworkUtil.getBundle(SpecificitiesAdapterFactory.class).getSymbolicName() + "/icons/functions/specificities.png"); //$NON-NLS-1$
26
	public static final ImageDescriptor ICON_SELECTION =
27
			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(SpecificitiesAdapterFactory.class).getSymbolicName(),
28
					"platform:/plugin/"+ FrameworkUtil.getBundle(SpecificitiesAdapterFactory.class).getSymbolicName() + "/icons/functions/specificities_selection.png"); //$NON-NLS-1$
26 29

  
27 30

  
28 31
	@Override
......
42 45
				return new TXMResultAdapter() {
43 46
					@Override
44 47
					public ImageDescriptor getImageDescriptor(Object object) {
45
						return ICON;
48
						return ICON_SELECTION;
46 49
					}
47 50
				};
48 51
			}
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitiesSelection.java (revision 599)
117 117
		for (int i = 0; i < selectedTypeNames.length; i++) {
118 118
			name += selectedTypeNames[i] + " ";
119 119
		}
120
		if (name.length() > 20) name = name.substring(0, 19)+"...";
120 121
		return name;
121 122
	}
122 123

  
tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/CA.java (revision 599)
106 106
	 */
107 107
	public CA(ILexicalTable table) throws StatException {
108 108
		
109
		if (!rw.containsVariable(table.getSymbol())) {
110
			throw new StatException(CACoreMessages.error_lexicalTableNotFoundInWorkspace);
111
		}
109
		
112 110

  
113 111
		loadLibrary();
114 112
		this.table = table;
115
		
116
		try {
117
			rw.callFunctionAndAffect(
118
					"ca", new String[] { table.getSymbol() }, symbol); //$NON-NLS-1$
119
		} catch (RWorkspaceException e) {
120
			throw new StatException(CACoreMessages.error_errorWhileComputingCA + e.getMessage(), e);
121
		}
122 113
	}
123 114

  
124 115
	/* (non-Javadoc)
......
500 491
	public int getColumnsCount() {
501 492
		return this.table.getColumnsCount();
502 493
	}
494

  
495
	@Override
496
	public void compute() throws StatException {
497
		
498
		if (!rw.containsVariable(table.getSymbol())) {
499
			throw new StatException(CACoreMessages.error_lexicalTableNotFoundInWorkspace);
500
		}
501
		try {
502
			rw.callFunctionAndAffect(
503
					"ca", new String[] { table.getSymbol() }, symbol); //$NON-NLS-1$
504
		} catch (RWorkspaceException e) {
505
			throw new StatException(CACoreMessages.error_errorWhileComputingCA + e.getMessage(), e);
506
		}
507
	}
503 508
}
tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/FactoMineRCA.java (revision 599)
105 105
	 */
106 106
	public FactoMineRCA(ILexicalTable table) throws StatException {
107 107

  
108
		loadLibrary();
109
		this.table = table;
110
	}
111
	
112
	public void compute() throws StatException {
108 113
		if (!rw.containsVariable(table.getSymbol())) {
109 114
			throw new StatException(CACoreMessages.error_lexicalTableNotFoundInWorkspace);
110 115
		}
111

  
112
		loadLibrary();
113

  
114
		this.table = table;
115 116
		try {
116 117
			//rw.callFunctionAndAffect("FactoMineR:CA", new String[] { table.getSymbol() }, symbol); //$NON-NLS-1$
117 118
			rw.eval(symbol+" <- FactoMineR::CA("+table.getSymbol()+", graph=FALSE)"); //$NON-NLS-1$ //$NON-NLS-2$
tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/ICA.java (revision 599)
33 33

  
34 34
// TODO: Auto-generated Javadoc
35 35
/**
36
 * The Interface ICA.
36
 * The Interface ICA. The CA command needs a R implementation of CA.
37 37
 */
38 38
public interface ICA {
39 39
	
40
	public void compute() throws StatException;
41
	
40 42
	/**
41 43
	 * Gets the col contrib.
42 44
	 *
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java (revision 599)
43 43
import org.txm.core.results.TXMParameters;
44 44
import org.txm.lexicaltable.core.functions.LexicalTable;
45 45
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
46
import org.txm.searchengine.cqp.corpus.Property;
47 46
import org.txm.statsengine.core.StatException;
48 47

  
49 48
/**
......
57 56
public class CA extends ChartResult {
58 57

  
59 58
	/** The ca. */
60
	private ICA ca;
59
	private ICA r_ca;
61 60

  
62 61
	float cex = 0.7f;
63 62

  
......
106 105
	 */
107 106
	public CA(LexicalTable lexicalTable) throws StatException {
108 107
		super(lexicalTable);
109

  
110
		if (useFactoMineR) {
111
			ca = new FactoMineRCA(lexicalTable.getData());
112
		} else {
113
			ca = new org.txm.ca.core.statsengine.r.functions.CA(lexicalTable.getData());
114
		}
115 108
	}
116 109

  
117 110
	@Override
......
122 115
	@Override
123 116
	protected boolean _compute(boolean update) throws Exception {
124 117
		
125
		// compute the lexical table
126
		this.getParent().compute(update);
127

  
128
		
129 118
		if (useFactoMineR) {
130
			ca = new FactoMineRCA(this.getLexicalTable().getData());
119
			r_ca = new FactoMineRCA(this.getLexicalTable().getData());
120
		} else {
121
			r_ca = new org.txm.ca.core.statsengine.r.functions.CA(this.getLexicalTable().getData());
131 122
		}
132
		else {
133
			ca = new org.txm.ca.core.statsengine.r.functions.CA(this.getLexicalTable().getData());
134
		}
135 123
		
124
		r_ca.compute();
125
		
136 126
		 // in case the lexical table changes
137 127
		getColNames();
138 128
		 // in case the lexical table changes
......
146 136
		this.cex = Math.abs(cex);
147 137
		if (col.matches(pattern)) {
148 138
			this.colfilter = col;
149
		}
150
		else {
139
		} else {
151 140
			System.out.println("Col filter malformed follow this pattern " + pattern);
152 141
		}
142
		
153 143
		if (row.matches(pattern)) {
154 144
			this.rowfilter = row;
155
		}
156
		else {
145
		} else {
157 146
			System.out.println("Row filter malformed follow this pattern " + pattern);
158 147
		}
159 148
	}
......
244 233
	 * @return the ca
245 234
	 */
246 235
	public org.txm.ca.core.statsengine.r.functions.ICA getCA() {
247
		return ca;
236
		return r_ca;
248 237
	}
249 238

  
250 239
	public float getCex() {
......
280 269

  
281 270
		try {
282 271
			sv = getValeursPropres();
283
			mass = ca.getColsMass();
284
			colcoords = ca.getColsCoords();
285
			colcontribs = ca.getColContrib();
286
			colcos2s = ca.getColCos2();
287
			coldist = ca.getColDist();
272
			mass = r_ca.getColsMass();
273
			colcoords = r_ca.getColsCoords();
274
			colcontribs = r_ca.getColContrib();
275
			colcos2s = r_ca.getColCos2();
276
			coldist = r_ca.getColDist();
288 277
			//add dist
289 278
			getColNames();
290 279
		} catch (StatException e) {
......
377 366
	 * @return the columns coordinates
378 367
	 */
379 368
	public double[][] getColsCoords() {
380
		return this.ca.getColsCoords();
369
		return this.r_ca.getColsCoords();
381 370
	}
382 371

  
383 372
	/**
......
387 376
	 * @throws StatException the stat exception
388 377
	 */
389 378
	public double[] getColsDist() throws StatException {
390
		return this.ca.getColDist();
379
		return this.r_ca.getColDist();
391 380
	}
392 381

  
393 382
	/**
......
397 386
	 * @throws StatException the stat exception
398 387
	 */
399 388
	public double[] getColsInertia() throws StatException {
400
		return this.ca.getColsInertia();
389
		return this.r_ca.getColsInertia();
401 390
	}
402 391

  
403 392
	/**
......
407 396
	 * @throws StatException the stat exception
408 397
	 */
409 398
	public double[] getColsMass() throws StatException {
410
		return this.ca.getColsMass();
399
		return this.r_ca.getColsMass();
411 400
	}
412 401

  
413 402
	/**
......
415 404
	 * @return the number of columns
416 405
	 */
417 406
	public int getColumnsCount()	{
418
		return this.ca.getColumnsCount();
407
		return this.r_ca.getColumnsCount();
419 408
	}
420 409

  
421 410

  
......
448 437
	 * @throws StatException 
449 438
	 */
450 439
	public double[][] getRowContrib() throws StatException {
451
		return ca.getRowContrib();
440
		return r_ca.getRowContrib();
452 441
	}
453 442

  
454 443
	/**
......
458 447
	 * @throws StatException 
459 448
	 */
460 449
	public double[][] getRowCos2() throws StatException {
461
		return ca.getRowCos2();
450
		return r_ca.getRowCos2();
462 451
	}
463 452

  
464 453
	public String getRowFilter() {
......
482 471
		double[][] rowcos2s = null;
483 472

  
484 473
		try {
485
			mass = ca.getRowsMass();
486
			rowcoords = ca.getRowsCoords();
487
			rowcontribs = ca.getRowContrib();
488
			rowcos2s = ca.getRowCos2();
489
			dist = ca.getRowDist();
474
			mass = r_ca.getRowsMass();
475
			rowcoords = r_ca.getRowsCoords();
476
			rowcontribs = r_ca.getRowContrib();
477
			rowcos2s = r_ca.getRowCos2();
478
			dist = r_ca.getRowDist();
490 479
			getRowNames();
491 480
		} catch (StatException e) {
492 481
			org.txm.utils.logger.Log.printStackTrace(e);
......
578 567
	 * @return the rows coords
579 568
	 */
580 569
	public double[][] getRowsCoords() {
581
		return this.ca.getRowsCoords();
570
		return this.r_ca.getRowsCoords();
582 571
	}
583 572

  
584 573
	/**
......
586 575
	 * @return the number of rows
587 576
	 */
588 577
	public int getRowsCount()	{
589
		return this.ca.getRowsCount();
578
		return this.r_ca.getRowsCount();
590 579
	}
591 580

  
592 581
	/**
......
596 585
	 * @throws StatException the stat exception
597 586
	 */
598 587
	public double[] getRowsDist() throws StatException {
599
		return this.ca.getRowDist();
588
		return this.r_ca.getRowDist();
600 589
	}
601 590

  
602 591
	/**
......
606 595
	 * @throws StatException the stat exception
607 596
	 */
608 597
	public double[] getRowsInertia() throws StatException {
609
		return this.ca.getRowsInertia();
598
		return this.r_ca.getRowsInertia();
610 599
	}
611 600

  
612 601
	/**
......
616 605
	 * @throws StatException the stat exception
617 606
	 */
618 607
	public double[] getRowsMass() throws StatException {
619
		return this.ca.getRowsMass();
608
		return this.r_ca.getRowsMass();
620 609
	}
621 610

  
622 611
//	/**
......
690 679
	 * @throws StatException the stat exception
691 680
	 */
692 681
	public double[] getSingularValues() throws StatException {
693
		return ca.getSingularValues();
682
		return r_ca.getSingularValues();
694 683
	}
695 684

  
696 685
	/**
......
746 735
	 * @return the R symbol of the CA result
747 736
	 */
748 737
	public String getSymbol() {
749
		return ca.getSymbol();
738
		return r_ca.getSymbol();
750 739
	}
751 740

  
752 741
	/**
......
756 745
	 * @throws StatException the stat exception
757 746
	 */
758 747
	public double[] getValeursPropres() throws StatException {
759
		return ca.getEigenvalues();
748
		return r_ca.getEigenvalues();
760 749
	}
761 750

  
762 751
	/**
......
810 799
	@Deprecated
811 800
	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
812 801
		acquireSemaphore();
813
		boolean rez = ca.toTxt(outfile, encoding, colseparator, txtseparator);
802
		boolean rez = r_ca.toTxt(outfile, encoding, colseparator, txtseparator);
814 803
		releaseSemaphore();
815 804

  
816 805
		return rez;
tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/chartcreators/JFCCAChartCreator.java (revision 599)
70 70
//			String yAxisLabel = CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_AXIS_LABEL_PREFIX  + " " + ca.getSecondDimension() + " (" + percent2 + "%)";
71 71
			
72 72
			
73
			chart = ChartFactory.createScatterPlot(Utils.createCAFactorialMapChartTitle(ca), "", "", dataset, PlotOrientation.VERTICAL, TXMPreferences.getBoolean(ChartsEnginePreferences.SHOW_LEGEND, CAPreferences.PREFERENCES_NODE), false, false);
73
			chart = ChartFactory.createScatterPlot(Utils.createCAFactorialMapChartTitle(ca), 
74
					"", "", dataset, PlotOrientation.VERTICAL, 
75
					TXMPreferences.getBoolean(ChartsEnginePreferences.SHOW_LEGEND, 
76
					CAPreferences.PREFERENCES_NODE), false, false);
74 77

  
75 78
			// Custom renderer
76 79
			chart.getXYPlot().setRenderer(new FCAItemSelectionRenderer(ca));
77

  
78

  
79 80
		}
80 81
		catch(StatException e) {
81 82
			Log.severe("Can't create CA factorial map scatter plot" + e);
83
			return null;
82 84
		}
83 85

  
84

  
85
		this.updateChart(result);
86 86
		
87
		//this.updateChart(result);
88
		
87 89
		return chart;		
88 90
		
89 91
	}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages_ru.properties (revision 599)
200 200
ComputeCoocMatrix_5  = N/A_"
201 201
ComputeCoocMatrix_7  = N/A_CoocMatrix parameters
202 202

  
203
ComputeCooccurrences_0 = Загрузка таблицы совместной встречаемости
204
ComputeCooccurrences_1 = ** Невозможно вычислить совместную встречаемость в выделении
205

  
206 203
ComputeFrequencyList_2 = Расчет списка значений свойства {0} в корпусе {1}
207 204

  
208 205
ComputeIndexFromLines_0 = Выполнить команду Индекс на выделении
......
242 239

  
243 240
ConvertCorpus_0 = N/A_Corpus conversion failed.
244 241

  
245
CoocPreferencePage_0  = Формат индекса (по умолчанию 0.0000E00)
246
CoocPreferencePage_1  = Минимальный порог количества совместных употреблений
247
CoocPreferencePage_11 = Минимум справа
248
CoocPreferencePage_12 = Максимум справа
249
CoocPreferencePage_2  = Минимальный порог частотности совместной встречаемости
250
CoocPreferencePage_3  = Минимальный порог индекса совместной встречаемости
251
CoocPreferencePage_4  = Максимум слева
252
CoocPreferencePage_5  = Совместная встречаемость
253
CoocPreferencePage_6  = Минимум слева
254
CoocPreferencePage_8  = N/A_Use partial lexical table
255

  
256
CooccurrencesEditor_0  = Сортировать по: {0}
257
CooccurrencesEditor_10 = Совместная частотность
258
CooccurrencesEditor_11 = Значение индекса не соответствует формату двойной плавающей точки
259
CooccurrencesEditor_12 = Расчет совместной встречаемости {0}
260
CooccurrencesEditor_13 = Отладка расчета совместной встречаемости
261
CooccurrencesEditor_14 = Расчет совместной встречаемости
262
CooccurrencesEditor_15 = Отображение результатов
263
CooccurrencesEditor_16 = ** Невозможно вычислить совместную встречаемость без контекстов
264
CooccurrencesEditor_17 = Индекс
265
CooccurrencesEditor_18 = Порог индекса должен быть действительным числом, отличным от {0}
266
CooccurrencesEditor_2  = Рассчитать
267
CooccurrencesEditor_20 = Расчет совместной встречаемости  <{0}> в корпусе {1}
268
CooccurrencesEditor_23 = Готово: ни одного результата.
269
CooccurrencesEditor_24 = Готово: один результат.
270
CooccurrencesEditor_27 = Расчет запроса
271
CooccurrencesEditor_28 = Расчет ответов
272
CooccurrencesEditor_29 = Расчет подписей к строкам
273
CooccurrencesEditor_3  = Свойства совместных употреблений: 
274
CooccurrencesEditor_30 = Подсчет
275
CooccurrencesEditor_31 = Расчет словарной таблицы
276
CooccurrencesEditor_32 = Расчет показателей специфичности\	
277
CooccurrencesEditor_33 = Начало расчета совместной встречаемости
278
CooccurrencesEditor_34 = Готово: {1} совместных употреблений на {0} употреблений мотива
279
CooccurrencesEditor_4  = Пороги: Част ≥
280
CooccurrencesEditor_5  = Совм-част ≥ 
281
CooccurrencesEditor_6  = Показатель ≥ 
282
CooccurrencesEditor_8  = Кооккуррент
283
CooccurrencesEditor_9  = Средняя дистанция
284

  
285 242
CorporaView_0 = Корпус
286 243
CorporaView_1 = ** Ошибка: {0}
287 244
CorporaView_2 = ** Не удалось получить размеры корпуса {0}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/EmpantWidget.java (revision 599)
446 446
	public boolean getXPivot() {
447 447
		return this.checkXword.getSelection();
448 448
	}
449

  
450
	public void addSelectionListener(SelectionListener listener) {
451
		structType.addSelectionListener(listener);
452
		wordType.addSelectionListener(listener);
453
		structs.addSelectionListener(listener);
454
		maxLeft.addSelectionListener(listener);
455
		maxRight.addSelectionListener(listener);
456
		minRight.addSelectionListener(listener);
457
		minLeft.addSelectionListener(listener);
458
		checkXword.addSelectionListener(listener);
459
		checkLeft.addSelectionListener(listener);
460
		checkRight.addSelectionListener(listener);
461
	}
462
	
463
	public void removeSelectionListener(SelectionListener listener) {
464
		structType.removeSelectionListener(listener);
465
		wordType.removeSelectionListener(listener);
466
		structs.removeSelectionListener(listener);
467
		maxLeft.removeSelectionListener(listener);
468
		maxRight.removeSelectionListener(listener);
469
		minRight.removeSelectionListener(listener);
470
		minLeft.removeSelectionListener(listener);
471
		checkXword.removeSelectionListener(listener);
472
		checkLeft.removeSelectionListener(listener);
473
		checkRight.removeSelectionListener(listener);
474
	}
449 475
}
tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/editors/PartitionDimensionsEditor.java (revision 599)
14 14
import org.txm.rcp.IImageKeys;
15 15

  
16 16
/**
17
 * 
17 18
 * Partition dimensions chart editor.
18 19
 * @author sjacquot
19 20
 *
20 21
 */
21
public class PartitionDimensionsEditor extends ChartEditorPart {
22

  
23

  
22
public class PartitionDimensionsEditor extends ChartEditorPart<PartitionDimensions> {
24 23
	
25 24
	@Override
26 25
	public void createPartControl(Composite parent) {
......
28 27
		this.createComputingParametersArea = false;
29 28
		
30 29
		super.createPartControl(parent);
31

  
30
		
32 31
		// extend the tool bar
33 32
		new ToolItem(this.getToolBar(), SWT.SEPARATOR);
34 33
		final ToolItem sortByPartSize = new ToolItem(this.getToolBar(), SWT.CHECK);
......
45 44
			}
46 45
			
47 46
			@Override
48
			public void widgetDefaultSelected(SelectionEvent e) {
49
				// TODO Auto-generated method stub
50
				
51
			}
47
			public void widgetDefaultSelected(SelectionEvent e) { }
52 48
		});
53 49
	}
54
	
55
	
56
	@Override
57
	public PartitionDimensions getResultData() {
58
		// TODO Auto-generated method stub
59
		return (PartitionDimensions) super.getResultData();
60
	}
61
	
62 50
}
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 599)
765 765
		this.buildLexicalTableWithCooccurrents = buildLexicalTableWithCooccurrents;
766 766

  
767 767
	}
768
	
769
	public void setIncludeXpivot(boolean b) {
770
		pIncludeXpivot = b;
771
	}
768 772

  
769 773
	public boolean setParameters(TXMParameters parameters) {
770 774
		try {
......
1489 1493
	@Override
1490 1494
	public boolean loadParameters() throws CqiClientException {
1491 1495
		
1492
		pCooccurentQueryFilter = this.getStringParameterValue(CooccurrencePreferences.COOCQUERYFILTER);
1493
		pFCoocFilter = this.getIntParameterValue(CooccurrencePreferences.MIN_COUNT);
1494
		pFminFilter = this.getIntParameterValue(CooccurrencePreferences.MIN_FREQ);
1495
		pIncludeXpivot  = this.getBooleanParameterValue(CooccurrencePreferences.INCLUDE_X_PIVOT);
1496
		pMaxLeftContextSize = this.getIntParameterValue(CooccurrencePreferences.MAX_LEFT);
1497
		pMaxRightContextSize = this.getIntParameterValue(CooccurrencePreferences.MAX_RIGHT);
1498
		pMinLeftContextSize = this.getIntParameterValue(CooccurrencePreferences.MIN_LEFT);
1499
		pMinRightContextSize = this.getIntParameterValue(CooccurrencePreferences.MIN_RIGHT);
1496
//		pCooccurentQueryFilter = this.getStringParameterValue(CooccurrencePreferences.COOCQUERYFILTER);
1497
//		pFCoocFilter = this.getIntParameterValue(CooccurrencePreferences.MIN_COUNT);
1498
//		pFminFilter = this.getIntParameterValue(CooccurrencePreferences.MIN_FREQ);
1499
//		pIncludeXpivot  = this.getBooleanParameterValue(CooccurrencePreferences.INCLUDE_X_PIVOT);
1500
//		pMaxLeftContextSize = this.getIntParameterValue(CooccurrencePreferences.MAX_LEFT);
1501
//		pMaxRightContextSize = this.getIntParameterValue(CooccurrencePreferences.MAX_RIGHT);
1502
//		pMinLeftContextSize = this.getIntParameterValue(CooccurrencePreferences.MIN_LEFT);
1503
//		pMinRightContextSize = this.getIntParameterValue(CooccurrencePreferences.MIN_RIGHT);
1500 1504
		
1501 1505
		String s = this.getStringParameterValue(CooccurrencePreferences.PROPERTIES);
1502 1506
		pProperties = WordProperty.fromStringToList(getCorpus(), s);
1503 1507
		
1504 1508
		pQuery = new Query(this.getStringParameterValue(CooccurrencePreferences.QUERY));
1505
		pScoreMinFilter = this.getIntParameterValue(CooccurrencePreferences.MIN_SCORE);
1509
//		pScoreMinFilter = this.getIntParameterValue(CooccurrencePreferences.MIN_SCORE);
1506 1510
		
1507 1511
		s = this.getStringParameterValue(CooccurrencePreferences.STRUCTURE_LIMIT);
1508 1512
		pStructuralUnitLimit = getCorpus().getStructuralUnit(s);
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java (revision 599)
72 72
		preferences.putInt(MAX_RIGHT, 10);
73 73
		
74 74
		preferences.put(QUERY, ""); //$NON-NLS-1$
75
		preferences.put(PROPERTIES, "word"); //$NON-NLS-1$
75 76
		
76 77
		
77 78
	}
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java (revision 599)
83 83
import org.txm.core.messages.TXMCoreMessages;
84 84
import org.txm.core.preferences.TXMPreferences;
85 85
import org.txm.core.results.TXMParameters;
86
import org.txm.core.results.TXMResult;
86 87
import org.txm.rcp.JobsTimer;
87 88
import org.txm.rcp.RCPMessages;
88 89
import org.txm.rcp.StatusLine;
......
110 111
 * 
111 112
 * @author mdecorde
112 113
 */
113
public class CooccurrencesEditor extends TXMEditorPart {
114
public class CooccurrencesEditor extends TXMEditorPart<Cooccurrence> {
114 115

  
115 116
	/** The Constant ID. */
116 117
	public static final String ID = CooccurrencesEditor.class.getName(); //$NON-NLS-1$
......
187 188
	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
188 189
		super.init(site, input);
189 190

  
190
		this.cooc = (Cooccurrence) ((TXMResultEditorInput) input).getResult();
191
		this.cooc = (Cooccurrence) ((TXMResultEditorInput<Cooccurrence>) input).getResult();
191 192
	}
192 193

  
193 194
	/**
......
267 268
			@Override
268 269
			public void keyReleased(KeyEvent e) {
269 270
			}
270

  
271 271
		});
272 272

  
273
		final Button go = new Button(queryArea, SWT.BOLD);
274
		go.setText(CooccurrenceUIMessages.CooccurrencesEditor_2);
273
//		final Button go = new Button(queryArea, SWT.BOLD);
274
//		go.setText(CooccurrenceUIMessages.CooccurrencesEditor_2);
275
//
276
//		Font f = go.getFont();
277
//		FontData defaultFont = f.getFontData()[0];
278
//		defaultFont.setStyle(SWT.BOLD);
279
//		Font newf = new Font(go.getDisplay(), defaultFont);
280
//		go.setFont(newf);
281
//
282
//		layoutData = new GridData(GridData.VERTICAL_ALIGN_CENTER);
283
//		layoutData.horizontalAlignment = GridData.FILL;
284
//		layoutData.grabExcessHorizontalSpace = false;
285
//		go.setLayoutData(layoutData);
286
//
287
//		go.addSelectionListener(new SelectionListener() {
288
//			@Override
289
//			public void widgetSelected(SelectionEvent e) {
290
//				updateResultFromEditor();
291
//				compute(true);
292
//				// FIXME old method
293
//				//TXMEditorPart.compute(CooccurrencesEditor.this.getResultData(), true, CooccurrencesEditor.this);
294
//			}
295
//
296
//			@Override
297
//			public void widgetDefaultSelected(SelectionEvent e) {
298
//			}
299
//		});
275 300

  
276
		Font f = go.getFont();
277
		FontData defaultFont = f.getFontData()[0];
278
		defaultFont.setStyle(SWT.BOLD);
279
		Font newf = new Font(go.getDisplay(), defaultFont);
280
		go.setFont(newf);
281

  
282
		layoutData = new GridData(GridData.VERTICAL_ALIGN_CENTER);
283
		layoutData.horizontalAlignment = GridData.FILL;
284
		layoutData.grabExcessHorizontalSpace = false;
285
		go.setLayoutData(layoutData);
286

  
287
		go.addSelectionListener(new SelectionListener() {
288
			@Override
289
			public void widgetSelected(SelectionEvent e) {
290
				updateResultFromEditor();
291
				compute(true);
292
				// FIXME old method
293
				//TXMEditorPart.compute(CooccurrencesEditor.this.getResultData(), true, CooccurrencesEditor.this);
294
			}
295

  
296
			@Override
297
			public void widgetDefaultSelected(SelectionEvent e) {
298
			}
299
		});
300

  
301 301
		// Filters
302 302
		Composite filtercontrols = new Composite(paramArea, SWT.NONE);
303 303
		FormData filtersLayoutData = new FormData();
......
343 343
		Label seuilLabel = new Label(filtercontrols, SWT.NONE);
344 344
		seuilLabel.setText(CooccurrenceUIMessages.CooccurrencesEditor_4);
345 345

  
346
		SelectionListener thListener = new SelectionListener() {
347
			
348
			@Override
349
			public void widgetSelected(SelectionEvent e) {
350
				cooc.setThresfold(TFreq.getSelection(), TCount.getSelection(), TScore.getSelectionCount());
351
				compute(true);
352
			}
353
			
354
			@Override
355
			public void widgetDefaultSelected(SelectionEvent e) { }
356
		};
357
		
346 358
		TFreq = new Spinner(filtercontrols, SWT.BORDER);
347 359
		TFreq.setMinimum(1);
348 360
		TFreq.setMaximum(99999);
349 361
		TFreq.setIncrement(1);
350 362
		TFreq.setPageIncrement(100);
363
		TFreq.addSelectionListener(thListener);
351 364

  
352 365
		seuilLabel = new Label(filtercontrols, SWT.NONE);
353 366
		seuilLabel.setText(CooccurrenceUIMessages.CooccurrencesEditor_5);
......
356 369
		TCount.setMaximum(99999);
357 370
		TCount.setIncrement(1);
358 371
		TCount.setPageIncrement(100);
372
		TCount.addSelectionListener(thListener);
359 373

  
360 374
		seuilLabel = new Label(filtercontrols, SWT.NONE);
361 375
		seuilLabel.setText(CooccurrenceUIMessages.CooccurrencesEditor_6);
362 376
		TScore = new Text(filtercontrols, SWT.BORDER);
377
		TScore.addSelectionListener(thListener);
378
		TScore.addKeyListener(new KeyListener() {
379
			@Override
380
			public void keyPressed(KeyEvent e) {
381
				// System.out.println("key pressed : "+e.keyCode);
382
				if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
383
					cooc.setThresfold(TFreq.getSelection(), TCount.getSelection(), TScore.getSelectionCount());
384
					compute(true);
385
				}
386
			}
363 387

  
388
			@Override
389
			public void keyReleased(KeyEvent e) {
390
			}
391
		});
364 392
		// empant
365 393
		empantPanel = new EmpantWidget(paramArea, SWT.NONE, this.getCorpus());
366 394

  
......
370 398
		empantLayoutData.left = new FormAttachment(0);
371 399
		empantLayoutData.right = new FormAttachment(100);
372 400
		empantPanel.setLayoutData(empantLayoutData);
373

  
401
		empantPanel.addSelectionListener(new SelectionListener() {
402
			
403
			@Override
404
			public void widgetSelected(SelectionEvent e) {
405
				cooc.setStructure(empantPanel.getStruct());
406
				cooc.setMaxLeft(empantPanel.getMaxLeft() + 1);
407
				cooc.setMinLeft(empantPanel.getMinLeft() + 1);
408
				cooc.setMinRight(empantPanel.getMinRight() + 1);
409
				cooc.setMaxRight(empantPanel.getMaxRight() + 1);
410
				cooc.setIncludeXpivot(empantPanel.getXPivot());
411
			}
412
			
413
			@Override
414
			public void widgetDefaultSelected(SelectionEvent e) { }
415
		});
374 416
		// result
375 417
		Composite resultArea = this.getResultArea();
376 418
		// FormData resultLayoutData = new FormData();
......
516 558
		setColComparator(new ScoreComparator(), scoreColumn);
517 559
		sort();
518 560
		createContextMenu(viewer);
561
		
519 562
		initializeFields();
520 563

  
521 564
		for (TableColumn col : viewer.getTable().getColumns()) {
......
728 771

  
729 772
				empantPanel.setInfo(txt, tooltip);
730 773

  
731
				
732 774
				System.out.println(""+cooc.getLines());
733 775
				viewer.setInput(cooc.getLines());
734 776
				sort();
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java (revision 599)
38 38
import java.util.Set;
39 39
import java.util.UUID;
40 40

  
41
import org.txm.Toolbox;
42
import org.txm.core.messages.TXMCoreMessages;
43
import org.txm.core.preferences.___CorpusScope;
44
import org.txm.core.results.TXMParameters;
45 41
import org.eclipse.core.runtime.IProgressMonitor;
42
import org.txm.core.messages.TXMCoreMessages;
46 43
import org.txm.objects.Base;
47
import org.txm.objects.BaseParameters;
48 44
import org.txm.objects.SavedQuery;
49 45
import org.txm.objects.Text;
50 46
import org.txm.objects.TxmObject;
......
602 598
	}
603 599

  
604 600
	@Override
605
	protected boolean _compute(boolean update) throws Exception {
606
		// TODO Auto-generated method stub
607
		return false;
608
	}
609

  
610
	@Override
611 601
	public boolean toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception {
612 602
		// TODO Auto-generated method stub
613 603
		return false;
614 604
	}
615 605
	
616
	@Override
617
	public boolean canCompute() {
618
		// TODO Auto-generated method stub
619
		System.err.println("MainCorpus.canCompute(): not yet implemented.");
620
		return true;
621
	}
622

  
623
	@Override
624
	public boolean setParameters(TXMParameters parameters) {
625
		// TODO Auto-generated method stub
626
		System.err.println("MainCorpus.setParameters(): not yet implemented.");
627
		return true;
628
	}
629

  
630
	
631 606
}
632 607

  
tmp/org.txm.lexicaltable.core/META-INF/MANIFEST.MF (revision 599)
3 3
Bundle-Name: Lexical Table Core
4 4
Bundle-SymbolicName: org.txm.lexicaltable.core;singleton:=true
5 5
Bundle-Version: 1.0.0.qualifier
6
Require-Bundle: org.eclipse.osgi;bundle-version="3.10.2",
7
 org.eclipse.core.runtime;bundle-version="3.10.0",
8
 org.txm.utils;bundle-version="1.0.0",
9
 org.txm.searchengine.cqp.core;bundle-version="1.1.0",
10
 org.txm.statsengine.core;bundle-version="1.0.0",
11
 org.txm.statsengine.r.core;bundle-version="1.0.0",
12
 org.txm.core;bundle-version="0.7.0",
13
 org.txm.index.core;bundle-version="1.0.0",
14
 org.txm.lexicon.core;bundle-version="1.0.0"
6
Require-Bundle: org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,
7
 org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,
8
 org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
9
 org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
10
 org.txm.statsengine.core;bundle-version="1.0.0";visibility:=reexport,
11
 org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
12
 org.txm.core;bundle-version="0.7.0";visibility:=reexport,
13
 org.txm.index.core;bundle-version="1.0.0";visibility:=reexport,
14
 org.txm.lexicon.core;bundle-version="1.0.0";visibility:=reexport
15 15
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
16 16
Bundle-ActivationPolicy: lazy
17 17
Export-Package: org.txm.functions.intertextualdistance,
tmp/org.txm.core/src/java/org/txm/objects/Workspace.java (revision 599)
362 362
	}
363 363

  
364 364
	@Override
365
	public boolean canCompute() {
366
		// TODO Auto-generated method stub
367
		return false;
368
	}
369

  
370
	@Override
371
	protected boolean _compute(boolean update) throws Exception {
372
		// TODO Auto-generated method stub
373
		return false;
374
	}
375

  
376
	@Override
377 365
	public boolean toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception {
378 366
		// TODO Auto-generated method stub
379 367
		return false;
tmp/org.txm.core/src/java/org/txm/objects/TxmObject.java (revision 599)
259 259

  
260 260
	@Override
261 261
	public boolean canCompute() {
262
		// TODO Auto-generated method stub
263
		System.err.println("TxmObject.canCompute(): not yet implemented.");
262
		// not implemented in TxmObjects
264 263
		return true;
265 264
	}
266 265

  
267 266
	@Override
268 267
	protected boolean _compute(boolean update) throws Exception {
269
		// TODO Auto-generated method stub
270
		return false;
268
		// not implemented in TxmObjects
269
		return true;
271 270
	}
272 271

  
273 272
	@Override
......
278 277

  
279 278
	@Override
280 279
	public boolean setParameters(TXMParameters parameters) {
281
		// TODO Auto-generated method stub
282
		System.err.println("TxmObject.setParameters(): not yet implemented.");
283 280
		return true;
284 281
	}
285 282
	
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 599)
1244 1244
		this.monitor = monitor;
1245 1245

  
1246 1246
		// FIXME: Debug
1247
		System.err.println("TXMResult.compute(): computing result of type " + this.getClass() + "...");
1247
		System.err.println("TXMResult.compute() "+this.getClass().getSimpleName()+" : computing result of type " + this.getClass() + "...");
1248 1248

  
1249 1249
		if (!this.isDirtyFromHistory()) {
1250 1250

  
1251 1251
			// FIXME: Debug
1252
			System.err.println("TXMResult.compute(): result parameters have not changed since last computing, computing skipped.");
1252
			System.err.println("TXMResult.compute() "+this.getClass().getSimpleName()+" : result parameters have not changed since last computing, computing skipped.");
1253 1253

  
1254 1254
			return true;
1255 1255
		}
......
1257 1257
		if (!this.isDirty()) {
1258 1258

  
1259 1259
			// FIXME: Debug
1260
			System.err.println("TXMResult.compute(): result is not dirty, computing skipped.");
1260
			System.err.println("TXMResult.compute() "+this.getClass().getSimpleName()+" : result is not dirty, computing skipped.");
1261 1261

  
1262 1262
			return true;
1263 1263
		}
1264
		
1265
//		// TODO THIS IS FUCKING LAZY LINE CODES OH YEAH YOU MAD BRO
1266
		// TODO where do we put this parent compute ? :o
1267
		//		if (parent != null && !parent.getHasBeenComputedOnce()) { // parent must be computed at least one time
1268
		// SJ: other way, test the object itself
1269
		if (parent != null && !this.getHasBeenComputedOnce()) { 
1270
			if (!this.parent.compute(update, monitor)) {
1271
				System.err.println("TXMResult.compute() "+this.getClass().getSimpleName()+" : parent result could not be computed, computing stoped.");
1264 1272

  
1273
				return false;
1274
			}
1275
		}
1276

  
1265 1277
		if (!this.canCompute()) {
1266 1278
			// FIXME: Debug
1267
			System.err.println("TXMResult.compute(): missing or wrong parameters, computing aborted.");
1279
			System.err.println("TXMResult.compute() "+this.getClass().getSimpleName()+" : missing or wrong parameters, computing aborted.");
1268 1280

  
1269 1281
			return false;
1270 1282
		}
1271 1283

  
1272
		//		// TODO THIS IS FUCKING LAZY LINE CODES OH YEAH YOU MAD BRO
1273
		// TODO where do we put this parent compute ? :o
1274
		//		if (parent != null && !parent.getHasBeenComputedOnce()) { // parent must be computed at least one time
1275
		// SJ: other way, test the object itself
1276
		if (parent != null && !this.getHasBeenComputedOnce()) { 
1277
			this.parent.compute(update, monitor);
1278
		}
1279

  
1280 1284
		if (!this._compute(update)) {
1281 1285

  
1282 1286
			// FIXME: Debug
1283
			System.err.println("TXMResult.compute(): computing failed.");
1287
			System.err.println("TXMResult.compute() "+this.getClass().getSimpleName()+" : computing failed.");
1284 1288

  
1285 1289
			return false;
1286 1290
		}
......
1291 1295
		}
1292 1296

  
1293 1297
		if (!this.saveParameters()) {
1294
			System.out.println("Warning: failed to save parameters for " + this.getName() + ".");
1298
			System.out.println("TXMResult.compute() "+this.getClass().getSimpleName()+" : failed to save parameters for " + this.getName() + ".");
1295 1299
		}
1296 1300

  
1297 1301
		this.dirty = false; // the computing was successful, the result is no more dirty
1298 1302
		this.hasBeenComputedOnce = true; 
1299 1303
		// FIXME: Debug
1300
		System.err.println("TXMResult.compute(): computing of result type " + this.getClass() + " done.");
1304
		System.err.println("TXMResult.compute() "+this.getClass().getSimpleName()+" : computing of result type " + this.getClass() + " done.");
1301 1305

  
1302 1306
		return true;
1303 1307
	}
1304 1308

  
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java (revision 599)
124 124
			System.out.println("Error while retrieving "+RFRAGMENT+" bundle directory.");
125 125
			return;
126 126
		}
127
		File cwbDir = new File(bundleDir, "res");
128
		File OSDir = new File(cwbDir, os);
127
		File rpluginDir = new File(bundleDir, "res");
128
		File OSDir = new File(rpluginDir, os);
129 129
		File execFile = new File(OSDir, "bin/R"+ext);
130 130
		execFile.setExecutable(true);
131 131
		preferences.put(PATH_TO_EXECUTABLE, execFile.getAbsolutePath());
132 132
				
133
		
134 133
		if (!osname.contains("windows")) { 
135 134
			try {
136 135
				Log.info("Setting execution file rights to: "+OSDir.getAbsolutePath());
......
143 142
		}
144 143
	
145 144
		if (!execFile.exists()) {
146
			System.out.println("Cannot find CQP executable file: "+execFile);
145
			System.out.println("Cannot find R executable file: "+execFile);
147 146
			return;
148 147
		}
149 148
		

Also available in: Unified diff