Revision 1091

tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/MatrixImpl.java (revision 1091)
45 45
import org.txm.statsengine.core.utils.ArrayIndex;
46 46
import org.txm.statsengine.r.core.RWorkspace;
47 47
import org.txm.statsengine.r.core.exceptions.RException;
48
import org.txm.statsengine.r.core.exceptions.RObjectDoesNotExist;
49 48
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
50
import org.txm.statsengine.r.core.messages.RCoreMessages;
51 49
import org.txm.utils.CharsetDetector;
52 50
import org.txm.utils.OSDetector;
51
import org.txm.utils.logger.Log;
53 52

  
54 53
import cern.colt.matrix.DoubleMatrix2D;
55 54

  
......
490 489
		try {
491 490
			return RWorkspace.getRWorkspaceInstance().eval(StatsEngineCoreMessages.MatrixImpl_2+symbol+")[2]").asInteger(); //$NON-NLS-2$
492 491
		} catch (Exception e) {
493
			System.out.println("Matrix: failed to get nrow: "+e); //$NON-NLS-1$
492
			Log.severe("Matrix: failed to get nrow: "+e); //$NON-NLS-1$
494 493
		}
495 494
		return 0;
496 495
	}
......
503 502
		try {
504 503
			return RWorkspace.getRWorkspaceInstance().eval(StatsEngineCoreMessages.MatrixImpl_2+symbol+")[1]").asInteger(); //$NON-NLS-2$
505 504
		} catch (Exception e) {
506
			System.out.println(StatsEngineCoreMessages.MatrixImpl_67+e);
505
			Log.severe(StatsEngineCoreMessages.MatrixImpl_67 + e);
507 506
		}
508 507
		return 0;
509 508
	}
tmp/org.txm.ahc.core/src/org/txm/ahc/core/functions/AHC.java (revision 1091)
659 659

  
660 660

  
661 661
	@Override
662
	public String getName() {
663
		return getParent().getName();
664
	}
665

  
666

  
667
	@Override
668 662
	public String getSimpleName() {
669 663
		// FIXME: to define
670 664
//		StringBuffer buffer = new StringBuffer();
......
677 671

  
678 672
	@Override
679 673
	public String getDetails() {
674
		// FIXME: to define
680 675
		return this.getName();
681 676
	}
682 677

  
678
	@Override
679
	public String getName() {
680
		// FIXME: to define
681
		// TMP solution below
682
		try {
683
			return getParent().getName();
684
		}
685
		catch (Exception e) {
686
			return this.getEmptyName();
687
		}
688
	}
689

  
690

  
691
	
683 692
	/**
684 693
	 * Gets the 2D rendering state.
685 694
	 * If false, the rendering will be done in 3D.
tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java (revision 1091)
200 200
		queryLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, true));
201 201

  
202 202
		// [ (v)]
203
		queryWidget = new AssistedChoiceQueryWidget(getMainParametersComposite(), SWT.DROP_DOWN,	index.getCorpus());
203
		queryWidget = new AssistedChoiceQueryWidget(getMainParametersComposite(), SWT.DROP_DOWN, index.getCorpus());
204 204
		GridData layoutData = new GridData(GridData.VERTICAL_ALIGN_CENTER);
205 205
		layoutData.horizontalAlignment = GridData.FILL;
206 206
		layoutData.grabExcessHorizontalSpace = true;
......
253 253
		fMinSpinner.setPageIncrement(100);
254 254
		fMinSpinner.setLayoutData(fieldsGridData);
255 255
		fMinSpinner.addKeyListener(computeKeyListener);
256
		fMinSpinner.addSelectionListener(computeSelectionListener);
256 257

  
257 258
		Label lFmax = new Label(filtercontrols, SWT.NONE);
258 259
		lFmax.setText(TXMCoreMessages.common_fMax);
......
265 266
		fMaxSpinner.setPageIncrement(100);
266 267
		fMaxSpinner.setLayoutData(fieldsGridData);
267 268
		fMaxSpinner.addKeyListener(computeKeyListener);
269
		fMaxSpinner.addSelectionListener(computeSelectionListener);
268 270

  
269 271
		Label lVmax = new Label(filtercontrols, SWT.NONE);
270 272
		lVmax.setText(TXMCoreMessages.VMAX_1);
......
277 279
		vMaxSpinner.setPageIncrement(100);
278 280
		vMaxSpinner.setLayoutData(fieldsGridData);
279 281
		vMaxSpinner.addKeyListener(computeKeyListener);
282
		vMaxSpinner.addSelectionListener(computeSelectionListener);
280 283

  
281 284
		Label lNLigneppage = new Label(filtercontrols, SWT.NONE);
282 285
		lNLigneppage.setText(IndexUIMessages.IndexEditor_8);
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 1091)
437 437

  
438 438
	public Vector getColMarginsVector() {
439 439
		try {
440
			computeForTheVeryFirstTime();
441 440
			return statsData.getColMarginsVector();
442 441
		}
443 442
		catch (Exception e) {
......
447 446

  
448 447
	public Vector getColNames() {
449 448
		try {
450
			computeForTheVeryFirstTime();
451 449
			return statsData.getColNames();
452 450
		}
453 451
		catch (Exception e) {
......
466 464
	}
467 465

  
468 466
	public int getFMin() {
469
		try {
470
			computeForTheVeryFirstTime();
471
		} catch (Exception e) {
472
			// TODO Auto-generated catch block
473
			e.printStackTrace();
474
			return 0;
475
		}
476 467
		return statsData.getFMin();
477 468
	}
478 469

  
......
497 488
	 * @throws Exception 
498 489
	 */
499 490
	public int getNColumns() throws Exception {
500
		computeForTheVeryFirstTime();
501 491
		return statsData.getNColumns();
502 492
	}
503 493

  
......
509 499
	 * @throws Exception 
510 500
	 */
511 501
	public int getNRows() throws Exception {
512
		computeForTheVeryFirstTime();
513 502
		return statsData.getNRows();
514 503
	}
515 504

  
......
542 531
	}
543 532

  
544 533
	public Vector getRow(int i) throws Exception {
545
		computeForTheVeryFirstTime();
546 534
		return statsData.getRow(i);
547 535
	}
548 536

  
549 537
	public Vector getRowMarginsVector() throws Exception {
550
		computeForTheVeryFirstTime();
551 538
		return statsData.getRowMarginsVector();
552 539
	}
553 540

  
554 541
	public Vector getRowNames() throws Exception {
555
		computeForTheVeryFirstTime();
556 542
		return statsData.getRowNames();
557 543
	}
558 544

  
559 545
	@Override
560 546
	public String getSimpleName() {
561
		if (!hasBeenComputedOnce) {
562
			if (this.getLazyName() != null) {
563
				return this.getLazyName();
564
			}
565
			else	{
566
				return this.getEmptyName();
567
			}
568
		}
569
		else {
547
		// FIXME: old version, bugged, the name is not restored when reloading the result
548
//		if (!hasBeenComputedOnce) {
549
//			if (this.getLazyName() != null) {
550
//				return this.getLazyName();
551
//			}
552
//			else	{
553
//				return this.getEmptyName();
554
//			}
555
//		}
556
//		else {
557
//			StringBuilder strb = new StringBuilder();
558
//			if (property != null) {
559
//				strb.append(property.getName() + " ");
560
//			}
561
//			if (statsData != null) {
562
//				try {
563
//					strb.append(this.getFMin() + " / " + this.getNRows());
564
//				} catch (Exception e) {
565
//					// TODO Auto-generated catch block
566
//					e.printStackTrace();
567
//				}
568
//			}
569
//			if(strb.length() > 0)	{
570
//				return strb.toString();			
571
//			}
572
//			else	{
573
//				return this.getEmptyName();
574
//			}
575
//		}
576
		
577
		
578
		if (statsData != null) {
570 579
			StringBuilder strb = new StringBuilder();
571 580
			if (property != null) {
572 581
				strb.append(property.getName() + " ");
573 582
			}
574
			if (statsData != null) {
575
				try {
576
					strb.append(this.getFMin() + " / " + this.getNRows());
577
				} catch (Exception e) {
578
					// TODO Auto-generated catch block
579
					e.printStackTrace();
580
				}
583
			try {
584
				strb.append(this.getFMin() + " / " + this.getNRows());
585
			} catch (Exception e) {
586
				// TODO Auto-generated catch block
587
				e.printStackTrace();
581 588
			}
582
			if(strb.length() > 0)	{
583
				return strb.toString();			
584
			}
585
			else	{
586
				return this.getEmptyName();
587
			}
589
			return strb.toString();
590
			
588 591
		}
592
		else	{
593
			return this.getEmptyName();	
594
		}
589 595
	}
590 596

  
591 597
	/**
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/EmpantWidget.java (revision 1091)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.cooccurrence.rcp.editors;
29

  
30
import org.eclipse.swt.SWT;
31
import org.eclipse.swt.events.SelectionEvent;
32
import org.eclipse.swt.events.SelectionListener;
33
import org.eclipse.swt.layout.GridData;
34
import org.eclipse.swt.layout.GridLayout;
35
import org.eclipse.swt.widgets.Button;
36
import org.eclipse.swt.widgets.Combo;
37
import org.eclipse.swt.widgets.Composite;
38
import org.eclipse.swt.widgets.Label;
39
import org.eclipse.swt.widgets.Spinner;
40
import org.txm.rcp.messages.TXMUIMessages;
41
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
42
import org.txm.searchengine.cqp.corpus.Corpus;
43
import org.txm.searchengine.cqp.corpus.StructuralUnit;
44

  
45
// TODO: Auto-generated Javadoc
46
/**
47
 * Used by the Cooc Editor Allow to choose a structural unit and the size @
48
 * author mdecorde.
49
 */
50
public class EmpantWidget extends Composite {
51

  
52
	/** The struct type. */
53
	Button structType;
54
	
55
	/** The word type. */
56
	Button wordType;
57
	
58
	/** The structs. */
59
	Combo structs;
60
	
61
	/** The max left. */
62
	Spinner maxLeft;
63
	
64
	/** The max right. */
65
	Spinner maxRight;
66
	
67
	/** The min right. */
68
	Spinner minRight;
69
	
70
	/** The min left. */
71
	Spinner minLeft;
72
	
73
	/** The check xword. */
74
	Button checkXword;
75
	
76
	/** The check xword. */
77
	Button checkLeft;
78
	
79
	/** The check xword. */
80
	Button checkRight;
81

  
82
	Label infoLabel;
83
	
84
	/** The corpus. */
85
	Corpus corpus;
86

  
87
	/**
88
	 * Instantiates a new empant widget.
89
	 *
90
	 * @param parent the parent
91
	 * @param style the style
92
	 * @param corpus the corpus
93
	 */
94
	public EmpantWidget(Composite parent, int style, Corpus corpus) {
95
		super(parent, style);
96
		this.corpus = corpus;
97
		GridLayout mainLayout = new GridLayout(1, true);
98
		//mainLayout.verticalSpacing = 0;
99
		mainLayout.marginWidth = 0;
100
		this.setLayout(mainLayout);
101
		
102
		Composite line1 = new Composite(this, style);
103
		Composite line2 = new Composite(this, style);
104
		line1.setLayout(new GridLayout(7, false));
105
		line2.setLayout(new GridLayout(9, false));
106
		line1.setLayoutData(new GridData(GridData.FILL, GridData.FILL,true,true));
107
		line2.setLayoutData(new GridData(GridData.FILL, GridData.FILL,true,true));
108
		
109
		
110
		Label l = new Label(line1, SWT.NONE);
111
		l.setText(TXMUIMessages.EmpantWidget_0);
112

  
113
		wordType = new Button(line1, SWT.RADIO);
114
		wordType.setText(TXMUIMessages.EmpantWidget_1);
115
		wordType.addSelectionListener(new SelectionListener() {
116
			@Override
117
			public void widgetSelected(SelectionEvent e) {
118
				structs.setEnabled(false);
119
				checkXword.setEnabled(false);
120
			}
121

  
122
			@Override
123
			public void widgetDefaultSelected(SelectionEvent e) {
124
			}
125
		});
126
		wordType.setSelection(true);
127

  
128
		structType = new Button(line1, SWT.RADIO);
129
		structType.setText(TXMUIMessages.EmpantWidget_2);
130
		structType.addSelectionListener(new SelectionListener() {
131
			@Override
132
			public void widgetSelected(SelectionEvent e) {
133
				structs.setEnabled(true);
134
				checkXword.setEnabled(true);
135
			}
136

  
137
			@Override
138
			public void widgetDefaultSelected(SelectionEvent e) {
139
			}
140
		});
141

  
142
		// [info]
143
		structs = new Combo(line1, SWT.READ_ONLY | SWT.SINGLE | SWT.BORDER);
144
		GridData layoutData = new GridData(GridData.VERTICAL_ALIGN_CENTER);
145
		structs.setLayoutData(layoutData);
146

  
147
		checkLeft = new Button(line1, SWT.CHECK);
148
		checkLeft.setSelection(true);
149
		checkLeft.setText(TXMUIMessages.EmpantWidget_8);
150
		checkLeft.addSelectionListener(new SelectionListener() {
151
			@Override
152
			public void widgetSelected(SelectionEvent e) {
153
				boolean sel = checkLeft.getSelection();
154
				maxLeft.setEnabled(sel);
155
				minLeft.setEnabled(sel);
156
			}
157
			
158
			@Override
159
			public void widgetDefaultSelected(SelectionEvent e) { }
160
		});
161
		
162
		checkRight = new Button(line1, SWT.CHECK);
163
		checkRight.setSelection(true);
164
		checkRight.setText(TXMUIMessages.EmpantWidget_9);
165
		checkRight.addSelectionListener(new SelectionListener() {
166
			@Override
167
			public void widgetSelected(SelectionEvent e) {
168
				boolean sel = checkRight.getSelection();
169
				maxRight.setEnabled(sel);
170
				minRight.setEnabled(sel);
171
			}
172
			
173
			@Override
174
			public void widgetDefaultSelected(SelectionEvent e) { }
175
		});
176
		
177
		checkXword = new Button(line1, SWT.CHECK);
178
		checkXword.setText(TXMUIMessages.EmpantWidget_7);
179

  
180
		
181
		// LINE 2
182
		l = new Label(line2, SWT.NONE);
183
		l.setText(TXMUIMessages.EmpantWidget_3);
184

  
185
		// | [ ] [ ] [ |v] [ ] [ ] |
186
		maxLeft = new Spinner(line2, SWT.BORDER);
187
		maxLeft.setMinimum(0);
188
		maxLeft.setMaximum(9999);
189
		maxLeft.setIncrement(1);
190
		maxLeft.setPageIncrement(10);
191
		maxLeft.addSelectionListener(new SelectionListener() {
192
			@Override
193
			public void widgetSelected(SelectionEvent e) {
194
				minLeft.setMaximum(maxLeft.getSelection());
195
			}
196

  
197
			@Override
198
			public void widgetDefaultSelected(SelectionEvent e) {
199
			}
200
		});
201

  
202
		l = new Label(line2, SWT.NONE);
203
		l.setText(TXMUIMessages.EmpantWidget_4);
204

  
205
		minLeft = new Spinner(line2, SWT.BORDER);
206
		minLeft.setMinimum(0);
207
		minLeft.setMaximum(9999);
208
		minLeft.setIncrement(1);
209
		minLeft.setPageIncrement(10);
210
		minLeft.addSelectionListener(new SelectionListener() {
211
			@Override
212
			public void widgetSelected(SelectionEvent e) {
213
				maxLeft.setMinimum(minLeft.getSelection());
214
			}
215

  
216
			@Override
217
			public void widgetDefaultSelected(SelectionEvent e) {
218
			}
219
		});
220
				
221
		l = new Label(line2, SWT.NONE);
222
		l.setText(TXMUIMessages.EmpantWidget_5);
223

  
224
		// [>]
225
		minRight = new Spinner(line2, SWT.BORDER);
226
		minRight.setMinimum(0);
227
		minRight.setMaximum(9999);
228
		minRight.setIncrement(1);
229
		minRight.setPageIncrement(10);
230
		minRight.addSelectionListener(new SelectionListener() {
231
			@Override
232
			public void widgetSelected(SelectionEvent e) {
233
				maxRight.setMinimum(minRight.getSelection());
234
			}
235

  
236
			@Override
237
			public void widgetDefaultSelected(SelectionEvent e) {
238
			}
239
		});
240

  
241
		l = new Label(line2, SWT.NONE);
242
		l.setText(TXMUIMessages.EmpantWidget_6);
243

  
244
		// [>|]
245
		maxRight = new Spinner(line2, SWT.BORDER);
246
		maxRight.setMinimum(0);
247
		maxRight.setMaximum(9999);
248
		maxRight.setIncrement(1);
249
		maxRight.setPageIncrement(10);
250
		maxRight.addSelectionListener(new SelectionListener() {
251
			@Override
252
			public void widgetSelected(SelectionEvent e) {
253
				minRight.setMaximum(maxRight.getSelection());
254
			}
255

  
256
			@Override
257
			public void widgetDefaultSelected(SelectionEvent e) {
258
			}
259
		});
260

  
261
		infoLabel = new Label(line2, SWT.NONE);
262
		GridData infoLabelData = new GridData(GridData.END, GridData.CENTER, true, false);
263
		infoLabel.setLayoutData(infoLabelData);
264
		
265
		loadStructs();
266
		structs.setEnabled(false);
267
		checkXword.setEnabled(false);
268
	}
269
	
270
	public void setInfo(String txt, String tooltip) {
271
		infoLabel.setText(txt);
272
		infoLabel.setToolTipText(tooltip);
273
	}
274

  
275
	/**
276
	 * Load structs.
277
	 */
278
	private void loadStructs() {
279
		try {
280
			java.util.List<StructuralUnit> corpusstructuralunits = corpus.getOrderedStructuralUnits();
281
			for (StructuralUnit su : corpusstructuralunits) {
282
				if (!su.getName().equals("text") //$NON-NLS-1$
283
						&& !su.getName().equals("txmcorpus")) //$NON-NLS-1$
284
				{
285
					structs.add(su.getName());
286
				}
287
			}
288
			if (corpusstructuralunits.size() > 0) {
289
				structs.select(0);
290
			}
291
		} catch (CqiClientException e) {
292
			// TODO Auto-generated catch block
293
			org.txm.rcp.utils.Logger.printStackTrace(e);
294
		}
295
	}
296

  
297
	/**
298
	 * Adds the first listener.
299
	 *
300
	 * @param selectionListener the selection listener
301
	 */
302
	public void addFirstListener(SelectionListener selectionListener) {
303
		maxLeft.addSelectionListener(selectionListener);
304
	}
305

  
306
	/**
307
	 * Adds the next listener.
308
	 *
309
	 * @param selectionListener the selection listener
310
	 */
311
	public void addNextListener(SelectionListener selectionListener) {
312
		minRight.addSelectionListener(selectionListener);
313
	}
314

  
315
	/**
316
	 * Adds the previous listener.
317
	 *
318
	 * @param selectionListener the selection listener
319
	 */
320
	public void addPreviousListener(SelectionListener selectionListener) {
321
		minLeft.addSelectionListener(selectionListener);
322
	}
323

  
324
	/**
325
	 * Adds the last listener.
326
	 *
327
	 * @param selectionListener the selection listener
328
	 */
329
	public void addLastListener(SelectionListener selectionListener) {
330
		maxRight.addSelectionListener(selectionListener);
331
	}
332

  
333
	/**
334
	 * Sets the max left.
335
	 *
336
	 * @param maxleft the new max left
337
	 */
338
	public void setMaxLeft(int maxleft) {
339
		this.maxLeft.setSelection(maxleft);
340
	}
341

  
342
	/**
343
	 * Sets the min left.
344
	 *
345
	 * @param minleft the new min left
346
	 */
347
	public void setMinLeft(int minleft) {
348
		this.minLeft.setSelection(minleft);
349
	}
350

  
351
	/**
352
	 * Sets the max right.
353
	 *
354
	 * @param maxright the new max right
355
	 */
356
	public void setMaxRight(int maxright) {
357
		this.maxRight.setSelection(maxright);
358
	}
359

  
360
	/**
361
	 * Sets the min right.
362
	 *
363
	 * @param minright the new min right
364
	 */
365
	public void setMinRight(int minright) {
366
		this.minRight.setSelection(minright);
367
	}
368

  
369
	/**
370
	 * Gets the max left.
371
	 *
372
	 * @return the max left
373
	 */
374
	public int getMaxLeft() {
375
		if (maxLeft.isEnabled())
376
			return maxLeft.getSelection();
377
		return -1;
378
	}
379

  
380
	/**
381
	 * Gets the min left.
382
	 *
383
	 * @return the min left
384
	 */
385
	public int getMinLeft() {
386
		if (minLeft.isEnabled())
387
			return minLeft.getSelection();
388
		return -1;
389
	}
390

  
391
	/**
392
	 * Gets the max right.
393
	 *
394
	 * @return the max right
395
	 */
396
	public int getMaxRight() {
397
		if (maxRight.isEnabled())
398
			return maxRight.getSelection();
399
		return -1;
400
	}
401

  
402
	/**
403
	 * Gets the min right.
404
	 *
405
	 * @return the min right
406
	 */
407
	public int getMinRight() {
408
		if (minRight.isEnabled())
409
			return minRight.getSelection();
410
		return -1;
411
	}
412

  
413
	/**
414
	 * Sets the structure. If null then swap to word mode.
415
	 *
416
	 * @param su the new structure
417
	 */
418
	public void setStructure(StructuralUnit su) {
419
		if (su != null) {
420
			structType.setSelection(true);
421
			wordType.setSelection(false);
422
			structs.setText(su.getName());
423
			structs.setEnabled(true);
424
			checkXword.setEnabled(true);
425
		}
426
		else {
427
			structType.setSelection(false);
428
			wordType.setSelection(true);
429
			structs.setText(""); //$NON-NLS-1$
430
			structs.setEnabled(false);
431
			checkXword.setEnabled(false);
432
		}
433
	}
434

  
435
	/**
436
	 * Gets the struct.
437
	 *
438
	 * @return the struct
439
	 */
440
	public StructuralUnit getStruct() {
441
		if (this.wordType.getSelection()) {
442
			return null;
443
		}
444
		try {
445
			if (structs.getText().length() == 0) {
446
				return null;
447
			}
448
			return this.corpus.getStructuralUnit(structs.getText());
449
		} catch (CqiClientException e) {
450
			// TODO Auto-generated catch block
451
			org.txm.rcp.utils.Logger.printStackTrace(e);
452
		}
453
		return null;
454
	}
455

  
456
	/**
457
	 * Gets the x pivot.
458
	 *
459
	 * @return the x pivot
460
	 */
461
	public boolean getXPivot() {
462
		return this.checkXword.getSelection();
463
	}
464

  
465
	public void addSelectionListener(SelectionListener listener) {
466
		structType.addSelectionListener(listener);
467
		wordType.addSelectionListener(listener);
468
		structs.addSelectionListener(listener);
469
		maxLeft.addSelectionListener(listener);
470
		maxRight.addSelectionListener(listener);
471
		minRight.addSelectionListener(listener);
472
		minLeft.addSelectionListener(listener);
473
		checkXword.addSelectionListener(listener);
474
		checkLeft.addSelectionListener(listener);
475
		checkRight.addSelectionListener(listener);
476
	}
477
	
478
	public void removeSelectionListener(SelectionListener listener) {
479
		structType.removeSelectionListener(listener);
480
		wordType.removeSelectionListener(listener);
481
		structs.removeSelectionListener(listener);
482
		maxLeft.removeSelectionListener(listener);
483
		maxRight.removeSelectionListener(listener);
484
		minRight.removeSelectionListener(listener);
485
		minLeft.removeSelectionListener(listener);
486
		checkXword.removeSelectionListener(listener);
487
		checkLeft.removeSelectionListener(listener);
488
		checkRight.removeSelectionListener(listener);
489
	}
490

  
491
}
0 492

  
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java (revision 1091)
32 32
import java.util.List;
33 33

  
34 34
import org.eclipse.core.runtime.IProgressMonitor;
35
import org.eclipse.jface.action.MenuManager;
36 35
import org.eclipse.jface.operation.IRunnableWithProgress;
37 36
import org.eclipse.jface.viewers.TableViewer;
38 37
import org.eclipse.osgi.util.NLS;
39 38
import org.eclipse.swt.SWT;
40
import org.eclipse.swt.custom.ScrolledComposite;
41
import org.eclipse.swt.events.KeyEvent;
42
import org.eclipse.swt.events.KeyListener;
43 39
import org.eclipse.swt.events.SelectionEvent;
44 40
import org.eclipse.swt.events.SelectionListener;
45 41
import org.eclipse.swt.graphics.Font;
......
53 49
import org.eclipse.swt.layout.RowLayout;
54 50
import org.eclipse.swt.widgets.Composite;
55 51
import org.eclipse.swt.widgets.Display;
56
import org.eclipse.swt.widgets.Event;
57 52
import org.eclipse.swt.widgets.Label;
58
import org.eclipse.swt.widgets.Listener;
59
import org.eclipse.swt.widgets.Menu;
60 53
import org.eclipse.swt.widgets.Spinner;
61 54
import org.eclipse.swt.widgets.TableColumn;
62
import org.eclipse.swt.widgets.Text;
63 55
import org.eclipse.ui.IEditorInput;
64 56
import org.eclipse.ui.IEditorSite;
65 57
import org.eclipse.ui.PartInitException;
66 58
import org.eclipse.ui.PlatformUI;
67
import org.txm.concordance.core.preferences.ConcordancePreferences;
68 59
import org.txm.cooccurrence.core.functions.Cooccurrence;
69 60
import org.txm.cooccurrence.core.functions.comparators.CLineComparator;
70 61
import org.txm.cooccurrence.core.functions.comparators.DistComparator;
......
83 74
import org.txm.rcp.editors.TXMResultEditorInput;
84 75
import org.txm.rcp.editors.TableKeyListener;
85 76
import org.txm.rcp.editors.listeners.ComputeKeyListener;
86
import org.txm.rcp.editors.listeners.ComputeListener;
87 77
import org.txm.rcp.editors.listeners.ComputeSelectionListener;
88
import org.txm.rcp.messages.TXMUIMessages;
89
import org.txm.rcp.preferences.RCPPreferences;
90 78
import org.txm.rcp.swt.widget.AssistedQueryWidget;
91
import org.txm.rcp.swt.widget.EmpantWidget;
79
import org.txm.rcp.swt.widget.FloatSpinner;
92 80
import org.txm.rcp.swt.widget.PropertiesSelector;
93 81
import org.txm.rcp.views.QueriesView;
94 82
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
......
115 103
	/** The empant panel. */
116 104
	EmpantWidget empantPanel;
117 105

  
118
	/** The T score. */
119
	Text TScore;
120

  
121
	/** The T count. */
122
	Spinner TCount;
123

  
124
	/** The T freq. */
125
	Spinner TFreq;
126

  
127 106
	/** The line table viewer. */
128 107
	TableViewer viewer;
129 108

  
......
152 131
	
153 132
	// params
154 133
	/** The query widget. */
155
	@Parameter(key=CooccurrencePreferences.QUERY)
134
	@Parameter(key=TXMPreferences.QUERY)
156 135
	AssistedQueryWidget queryWidget;
157 136

  
158 137
	/** The props area. */
159 138
	@Parameter(key=TXMPreferences.UNIT_PROPERTIES)
160 139
	PropertiesSelector<WordProperty> propertiesSelector;
161 140
	
141
	/** The T freq. */
142
	@Parameter(key=TXMPreferences.F_MIN)
143
	Spinner fMin;
144

  
145
	/** The T count. */
146
	@Parameter(key=CooccurrencePreferences.MIN_COUNT)
147
	Spinner cMin;
148

  
149
	/** The T score. */
150
	@Parameter(key=CooccurrencePreferences.MIN_SCORE)
151
	FloatSpinner minScore;
162 152
	
163 153
	
164
	/**
165
	 * Instantiates a new cooccurrences editor.
166
	 */
167
	public CooccurrencesEditor() {
168
		super();
169
	}
170 154

  
171 155
	/**
172 156
	 * Initialize the editor with the cooccurrences TXMResult
......
197 181
	@Override
198 182
	public void _createPartControl() {
199 183

  
184
		// FIXME: became useless?
200 185
		// FormLayout parentLayout = new FormLayout();
201 186
		// parent.setLayout(parentLayout);
202 187

  
......
212 197
		FormLayout paramLayout = new FormLayout();
213 198
		paramArea.setLayout(paramLayout);
214 199

  
200
		// FIXME: became useless?
215 201
		// scrollComposite.setContent(paramArea);
216 202
		// scrollComposite.setExpandVertical(true);
217 203
		// scrollComposite.setExpandHorizontal(true);
......
244 230

  
245 231
		queryArea.setLayout(new GridLayout(3, false));
246 232

  
247
		getMainParametersComposite().getLayout().numColumns = 3;
248
		getMainParametersComposite().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
233
		this.getMainParametersComposite().getLayout().numColumns = 3;
234
		this.getMainParametersComposite().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
249 235
		
250 236
		Label queryLabel = new Label(getMainParametersComposite(), SWT.NONE);
251 237
		queryLabel.setText(TXMCoreMessages.common_query);
......
259 245
		queryWidget.setLayoutData(layoutData);
260 246
		queryWidget.addKeyListener(computeKeyListener);
261 247
		
248
		// FIXME: became useless?
262 249
//		final Button go = new Button(queryArea, SWT.BOLD);
263 250
//		go.setText(CooccurrenceUIMessages.CooccurrencesEditor_2);
264 251
//
......
307 294
		propertiesSelector.setTitle(CooccurrenceUIMessages.CooccurrencesEditor_3);
308 295
		propertiesSelector.addSelectionListener(computeSelectionListener);
309 296

  
297
		// FIXME: became useless?
310 298
		/*
311 299
		 * FormData propsLayoutData = new FormData(); propsLayoutData.top = new
312 300
		 * FormAttachment (queryArea, 0); propsLayoutData.left = new
......
320 308
		 * filtercontrols.setLayout(gridLayout);
321 309
		 */
322 310

  
323
		Label seuilLabel = new Label(filtercontrols, SWT.NONE);
324
		seuilLabel.setText(CooccurrenceUIMessages.CooccurrencesEditor_4);
325

  
311
		Label label = new Label(filtercontrols, SWT.NONE);
312
		label.setText(CooccurrenceUIMessages.CooccurrencesEditor_4);
326 313
		
327
		TFreq = new Spinner(filtercontrols, SWT.BORDER);
328
		TFreq.setMinimum(1);
329
		TFreq.setMaximum(99999);
330
		TFreq.setIncrement(1);
331
		TFreq.setPageIncrement(100);
332
		TFreq.addSelectionListener(computeSelectionListener);
314
		fMin = new Spinner(filtercontrols, SWT.BORDER);
315
		fMin.setMinimum(1);
316
		fMin.setMaximum(99999);
317
		fMin.setIncrement(1);
318
		fMin.setPageIncrement(100);
319
		fMin.addSelectionListener(computeSelectionListener);
333 320

  
334
		seuilLabel = new Label(filtercontrols, SWT.NONE);
335
		seuilLabel.setText(CooccurrenceUIMessages.CooccurrencesEditor_5);
336
		TCount = new Spinner(filtercontrols, SWT.BORDER);
337
		TCount.setMinimum(1);
338
		TCount.setMaximum(99999);
339
		TCount.setIncrement(1);
340
		TCount.setPageIncrement(100);
341
		TCount.addSelectionListener(computeSelectionListener);
321
		label = new Label(filtercontrols, SWT.NONE);
322
		label.setText(CooccurrenceUIMessages.CooccurrencesEditor_5);
323
		cMin = new Spinner(filtercontrols, SWT.BORDER);
324
		cMin.setMinimum(1);
325
		cMin.setMaximum(99999);
326
		cMin.setIncrement(1);
327
		cMin.setPageIncrement(100);
328
		cMin.addSelectionListener(computeSelectionListener);
342 329

  
343
		seuilLabel = new Label(filtercontrols, SWT.NONE);
344
		seuilLabel.setText(CooccurrenceUIMessages.CooccurrencesEditor_6);
345
		TScore = new Text(filtercontrols, SWT.BORDER);
346
		TScore.addSelectionListener(new ComputeSelectionListener(this));
347
		TScore.addKeyListener(computeKeyListener);
330
		label = new Label(filtercontrols, SWT.NONE);
331
		label.setText(CooccurrenceUIMessages.CooccurrencesEditor_6);
332
		minScore = new FloatSpinner(filtercontrols, SWT.BORDER);
333
		minScore.addSelectionListener(new ComputeSelectionListener(this));
334
		minScore.addKeyListener(computeKeyListener);
335
		
348 336
		// empant
349 337
		empantPanel = new EmpantWidget(paramArea, SWT.NONE, this.getCorpus());
350

  
351 338
		FormData empantLayoutData = new FormData();
352 339
		empantLayoutData.top = new FormAttachment(filtercontrols, 0);
353 340
		empantLayoutData.bottom = new FormAttachment(100);
......
359 346
		
360 347
		// result area
361 348
		Composite resultArea = this.getResultArea();
349
		// FIXME: became useless?
362 350
		// FormData resultLayoutData = new FormData();
363 351
		// resultLayoutData.top = new FormAttachment(scrollComposite, 0);
364 352
		// resultLayoutData.left = new FormAttachment(0);
......
477 465
		// Register the context menu
478 466
		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer);
479 467
		
480
		initializeFields();
481

  
482 468
		// descending initial sorting on score column
483 469
		viewer.getTable().setSortColumn(scoreColumn);
484 470
		viewer.getTable().setSortDirection(SWT.UP);
......
571 557
		parameters.put(CooccurrencePreferences.MIN_LEFT, this.empantPanel.getMinLeft() + 1);
572 558
		parameters.put(CooccurrencePreferences.MIN_RIGHT, this.empantPanel.getMinRight() + 1);
573 559
		parameters.put(CooccurrencePreferences.MAX_RIGHT, this.empantPanel.getMaxRight() + 1);
574
		parameters.put(TXMPreferences.F_MIN, this.TFreq.getSelection());
575
		parameters.put(CooccurrencePreferences.MIN_COUNT, this.TCount.getSelection());
560
		parameters.put(TXMPreferences.F_MIN, this.fMin.getSelection());
561
		parameters.put(CooccurrencePreferences.MIN_COUNT, this.cMin.getSelection());
576 562
		parameters.put(CooccurrencePreferences.INCLUDE_X_PIVOT, this.empantPanel.getXPivot());
577 563
		parameters.put(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE, this.getBooleanParameterValue(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE));
578 564

  
579 565
		Double minScore = 0.0;
580 566
		try {
581
			Double d = Double.parseDouble(this.TScore.getText());
567
			Double d = Double.parseDouble(this.minScore.getText());
582 568
			minScore = d;
583 569
		} catch (Exception e) {
584
			Log.severe(NLS.bind(CooccurrenceUIMessages.CooccurrencesEditor_18, this.TScore.getText()));
570
			Log.severe(NLS.bind(CooccurrenceUIMessages.CooccurrencesEditor_18, this.minScore.getText()));
585 571
		}
586 572

  
587 573
		parameters.put(CooccurrencePreferences.MIN_SCORE, minScore);
......
589 575
		return parameters;
590 576
	}
591 577

  
592
	/**
593
	 * Updates the parameters area from values from parameters, local result
594
	 * node or preferences.
595
	 */
596
	protected void initializeFields() {
597

  
598
		if (this.cooc.getProperties() != null) {
599
			List<WordProperty> available;
600
			try {
601
				available = new ArrayList<WordProperty>(this.cooc.getCorpus().getProperties());
602
				available.removeAll(cooc.getProperties());
603
				this.propertiesSelector.setProperties(available, cooc.getProperties());
604
			} catch (Exception e) {
605
				// TODO Auto-generated catch block
606
				org.txm.rcp.utils.Logger.printStackTrace(e);
607
			}
608
		}
609

  
610
		TFreq.setSelection(this.getIntParameterValue(TXMPreferences.F_MIN));
611
		TCount.setSelection(this.getIntParameterValue(CooccurrencePreferences.MIN_COUNT));
612

  
613
		TScore.setText("" + this.getDoubleParameterValue(CooccurrencePreferences.MIN_SCORE));
614

  
615
		empantPanel.setMinLeft(this.getIntParameterValue(CooccurrencePreferences.MIN_LEFT) - 1);
616
		empantPanel.setMaxLeft(this.getIntParameterValue(CooccurrencePreferences.MAX_LEFT) - 1);
617
		empantPanel.setMinRight(this.getIntParameterValue(CooccurrencePreferences.MIN_RIGHT) - 1);
618
		empantPanel.setMaxRight(this.getIntParameterValue(CooccurrencePreferences.MAX_RIGHT) - 1);
619
	}
620

  
621 578
	
622 579

  
623 580
	/**
......
668 625

  
669 626
	@Override
670 627
	public void updateEditorFromResult(boolean update) {
671

  
672
		// clear the UI for non-electric parameters
673
		// FIXME: doesn't work
674
		if(this.getResult().hasParameterChanged(CooccurrencePreferences.STRUCTURAL_UNIT_LIMIT))	{
675
			viewer.setInput(null);
676
			return;
628
		
629
		if (this.cooc.getProperties() != null) {
630
			List<WordProperty> available;
631
			try {
632
				available = new ArrayList<WordProperty>(this.cooc.getCorpus().getProperties());
633
				available.removeAll(cooc.getProperties());
634
				this.propertiesSelector.setProperties(available, cooc.getProperties());
635
			} catch (Exception e) {
636
				// TODO Auto-generated catch block
637
				org.txm.rcp.utils.Logger.printStackTrace(e);
638
			}
677 639
		}
678 640
		
641
		//fMin.setSelection(this.getIntParameterValue(TXMPreferences.F_MIN));
642
		//TCount.setSelection(this.getIntParameterValue(CooccurrencePreferences.MIN_COUNT));
643
//		minScore.setText("" + this.getDoubleParameterValue(CooccurrencePreferences.MIN_SCORE));
644

  
645
		// Structural unit limit
646
		empantPanel.setStructure(this.cooc.getStructuralUnitLimit());
647
		
648
		// Contexts
649
		empantPanel.setMinLeft(this.getIntParameterValue(CooccurrencePreferences.MIN_LEFT) - 1);
650
		empantPanel.setMaxLeft(this.getIntParameterValue(CooccurrencePreferences.MAX_LEFT) - 1);
651
		empantPanel.setMinRight(this.getIntParameterValue(CooccurrencePreferences.MIN_RIGHT) - 1);
652
		empantPanel.setMaxRight(this.getIntParameterValue(CooccurrencePreferences.MAX_RIGHT) - 1);
653

  
654
		
679 655
		String txt = "tp " + cooc.getNumberOfKeyword() + ", vc " + cooc.getNumberOfDifferentCooccurrents() + ", tc " + cooc.getNumberOfCooccurrents(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
680 656
		try {
681 657
			txt += ", T " + cooc.getCorpus().getSize();  //$NON-NLS-1$
tmp/org.txm.core/src/java/org/txm/core/messages/messages_ru.properties (revision 1091)
3 3
ApplicationWorkbenchAdvisor_39 = Не хватает папки в директории установки TXM : {0}
4 4
ApplicationWorkbenchAdvisor_40 = ** Не удалось скопировать файлы из папки TXMINSTALL в TXMHOME: {0}
5 5

  
6
common_cols            = 
6 7
common_delete          = удалить
7 8
common_description     = Описание
9
common_fMax            = 
10
common_fMin            = 
8 11
common_frequency       = Частотность
9 12
common_lowestFrequency = Минимальная частотность
10 13
common_numberOfLines   = Число строк
tmp/org.txm.core/src/java/org/txm/core/messages/messages_fr.properties (revision 1091)
272 272
common_delete          = Supprimer
273 273
common_description     = Description
274 274
common_done            = Terminé.
275
common_fMax            = Fmax 
276
common_fMin            = Fmin 
275
common_fMax            = Fmax
276
common_fMin            = Fmin
277 277
common_frequency       = Fréquence
278 278
common_lowestFrequency = Fréquence minimale
279 279
common_mode            = Mode
tmp/org.txm.core/src/java/org/txm/core/messages/messages.properties (revision 1091)
285 285
common_delete          = Delete
286 286
common_description     = Description
287 287
common_done            = Done.
288
common_fMax            = Fmax 
289
common_fMin            = Fmin 
288
common_fMax            = Fmax
289
common_fMin            = Fmin
290 290
common_frequency       = Frequency
291 291
common_lowestFrequency = Lowest frequency
292 292
common_mode            = Mode
tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java (revision 1091)
3 3
import java.util.Locale;
4 4

  
5 5
import org.osgi.service.prefs.Preferences;
6
import org.txm.Toolbox;
7 6

  
8 7
public class TBXPreferences extends TXMPreferences {
9 8
	
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 1091)
2 2

  
3 3
import java.io.File;
4 4
import java.io.IOException;
5
import java.io.Serializable;
6 5
import java.lang.reflect.Field;
7 6
import java.text.DateFormat;
8 7
import java.text.SimpleDateFormat;
......
114 113
	 */
115 114
	protected String lazyName;
116 115
	
117
	protected void computeForTheVeryFirstTime() throws Exception {
118
		if (!this.hasBeenComputedOnce) {
119
			this.compute();
120
		}
121
	}
122 116

  
123 117
	/**
124 118
	 * The command preferences node qualifier.
......
737 731
	 */
738 732
	public void saveParameter(String key, Object value)	{
739 733
		// FIXME: debug
740
		//Log.info("TXMResult.saveParameter(): saving parameter " + key + " = " + value + " for " + this.getClass() + " (" + value.getClass() + ") to node.");
734
		Log.info("TXMResult.saveParameter(): saving parameter " + key + " = " + value + " for " + this.getClass() + " (" + value.getClass() + ") to node.");
741 735

  
742 736
		TXMPreferences.putLocal(this, key, value);
743 737
	}
......
781 775
				continue; // no preference key defined
782 776
			}
783 777

  
784
			// FIXME: remove because we want that saveParameter(key, value) call value.toString() if it is an Object 
785
//			if (f.getType().isAssignableFrom(int.class) || f.getType().isAssignableFrom(Integer.class) ||
786
//					f.getType().isAssignableFrom(double.class) || f.getType().isAssignableFrom(Double.class) ||
787
//					f.getType().isAssignableFrom(float.class) || f.getType().isAssignableFrom(Float.class) ||
788
//					f.getType().isAssignableFrom(boolean.class) || f.getType().isAssignableFrom(Boolean.class) ||
789
//					f.getType().isAssignableFrom(String.class)) {
778
			if (f.getType().isAssignableFrom(int.class) || f.getType().isAssignableFrom(Integer.class) ||
779
					f.getType().isAssignableFrom(double.class) || f.getType().isAssignableFrom(Double.class) ||
780
					f.getType().isAssignableFrom(float.class) || f.getType().isAssignableFrom(Float.class) ||
781
					f.getType().isAssignableFrom(boolean.class) || f.getType().isAssignableFrom(Boolean.class) ||
782
					f.getType().isAssignableFrom(String.class)
783
					
784
					// FIXME: do not pass a Serializable for now
785
					//|| !f.getType().isAssignableFrom(Serializable.class)
786
					//|| !Serializable.class.isInstance(f)
787
					
788
					) {
790 789
			
791 790
			
792 791
				f.setAccessible(true); // set accessible to test the field values
793 792
				try {
794 793
					Object value = f.get(this);
795 794
					if (value != null) {
796
						// FIXME: but do not pass a Serializable for now
797
						if (!Serializable.class.isInstance(value)) {
798
							this.saveParameter(key, value);
799
						}
795
						this.saveParameter(key, value);
800 796
					}
801 797
				} catch (Exception e) {
802 798
					e.printStackTrace();
803 799
				}
804
//			}
800
			}
805 801
		}
806 802
		return true;
807 803
	}
tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java (revision 1091)
42 42
import org.txm.chartsengine.core.results.ChartResult;
43 43
import org.txm.chartsengine.r.core.themes.DefaultTheme;
44 44
import org.txm.core.preferences.TBXPreferences;
45
import org.txm.core.preferences.TXMPreferences;
45 46
import org.txm.core.results.Parameter;
46 47
import org.txm.core.results.TXMParameters;
47 48
import org.txm.progression.core.messages.ProgressionCoreMessages;
......
54 55
import org.txm.searchengine.cqp.corpus.StructuralUnit;
55 56
import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
56 57
import org.txm.searchengine.cqp.corpus.Subcorpus;
58
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
57 59
import org.txm.searchengine.cqp.corpus.query.Match;
58
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
59 60
import org.txm.searchengine.cqp.serverException.CqiServerError;
60 61
import org.txm.utils.logger.Log;
61 62

  
......
163 164
	
164 165
	@Override
165 166
	public boolean loadParameters() {
166
		if(!this.getStringParameterValue(TBXPreferences.QUERIES).isEmpty())	{
167
			this.queries = CQLQuery.stringToQueries(this.getStringParameterValue(TBXPreferences.QUERIES));
167
		if(!this.getStringParameterValue(TXMPreferences.QUERIES).isEmpty())	{
168
			this.queries = CQLQuery.stringToQueries(this.getStringParameterValue(TXMPreferences.QUERIES));
168 169
		}
169 170
		
170
		if(!this.getStringParameterValue(TBXPreferences.STRUCTURAL_UNIT).isEmpty())	{
171
		if(!this.getStringParameterValue(TXMPreferences.STRUCTURAL_UNIT).isEmpty())	{
171 172
			try {
172
				this.structuralUnit = this.getCorpus().getStructuralUnit(this.getStringParameterValue(TBXPreferences.STRUCTURAL_UNIT));
173
				if(!this.getStringParameterValue(TBXPreferences.STRUCTURAL_UNIT_PROPERTY).isEmpty())	{
174
					this.structuralUnitProperty = this.structuralUnit.getProperty(this.getStringParameterValue(TBXPreferences.STRUCTURAL_UNIT_PROPERTY));
173
				this.structuralUnit = this.getCorpus().getStructuralUnit(this.getStringParameterValue(TXMPreferences.STRUCTURAL_UNIT));
174
				if(!this.getStringParameterValue(TXMPreferences.STRUCTURAL_UNIT_PROPERTY).isEmpty())	{
175
					this.structuralUnitProperty = this.structuralUnit.getProperty(this.getStringParameterValue(TXMPreferences.STRUCTURAL_UNIT_PROPERTY));
175 176
				}
176 177
			}
177 178
			catch (CqiClientException e) {
......
194 195
	public boolean saveParameters() {
195 196

  
196 197
		if(this.queries != null && !this.queries.isEmpty())	{
197
			this.saveParameter(ProgressionPreferences.QUERIES, CQLQuery.queriesToString(this.queries));
198
			this.saveParameter(TXMPreferences.QUERIES, CQLQuery.queriesToString(this.queries));
198 199
		}
199 200

  
200 201
		if(this.structuralUnit != null)	{
201
			this.saveParameter(ProgressionPreferences.STRUCTURAL_UNIT, this.structuralUnit.getName());
202
			this.saveParameter(TXMPreferences.STRUCTURAL_UNIT, this.structuralUnit.getName());
202 203
		}
203 204

  
204 205
		if(this.structuralUnitProperty != null)	{
205
			this.saveParameter(ProgressionPreferences.STRUCTURAL_UNIT_PROPERTY, this.structuralUnitProperty.getName());
206
			this.saveParameter(TXMPreferences.STRUCTURAL_UNIT_PROPERTY, this.structuralUnitProperty.getName());
206 207
		}
207 208
		
208 209
		return true;
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java (revision 1091)
93 93
	 * First dimension.
94 94
	 */
95 95
	@Parameter(key=CAPreferences.FIRST_DIMENSION, type=Parameter.RENDERING)
96
	protected int firstDimension = 1;
96
	protected int firstDimension;
97 97

  
98 98
	/**
99 99
	 * Second dimension.
100 100
	 */
101 101
	@Parameter(key=CAPreferences.SECOND_DIMENSION, type=Parameter.RENDERING)
102
	protected int secondDimension = 2;
102
	protected int secondDimension;
103 103

  
104 104
	/**
105 105
	 * To show/hide individuals.
......
721 721

  
722 722
	@Override
723 723
	public String getDetails() {
724
		return "FMin = " + this.getLexicalTable().getFMin();
724
		try {
725
			return TXMCoreMessages.common_fMin + " = " + this.getLexicalTable().getFMin();
726
		}
727
		catch (Exception e) {
728
			return ""; //$NON-NLS-1$
729
		}
725 730
	}
726 731

  
727 732
	@Override
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1091)
356 356
			if (extendedParametersComposite.getChildren().length == 0) {
357 357
				this.topToolBar.unInstallGroup(COMPUTING_PARAMETERS_GROUP_ID);
358 358
			}
359
			
359 360
		}
360 361
		catch(Throwable e) {
361 362
			Log.severe("TXMEditor.createPartControl(): can not create the editor for result " + this.getResult() + "."); //$NON-NLS-1$  //$NON-NLS-2$
......
850 851
					((ToolItem)object).setSelection((Boolean) value); 
851 852
				}
852 853
				else if(object instanceof FloatSpinner)	{
853
					((FloatSpinner)object).setSelection((Float) value); 
854
					if(value instanceof Double) {
855
						((FloatSpinner)object).setSelection((Double) value);	
856
					}
857
					else {
858
						((FloatSpinner)object).setSelection((Float) value);
859
					}
854 860
				}
855 861
				else if(object instanceof Spinner)	{
856 862
					((Spinner)object).setSelection((Integer) value); 
857 863
				}
858 864
				else if(object instanceof Text)	{
859
					((Text)object).setText((String) value); 
865
					((Text)object).setText(String.valueOf(value)); 
860 866
				}
861 867
				else if(object instanceof Button)	{
862 868
					((Button)object).setSelection((Boolean) value);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/EmpantWidget.java (revision 1091)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.rcp.swt.widget;
29

  
30
import org.eclipse.swt.SWT;
31
import org.eclipse.swt.events.SelectionEvent;
32
import org.eclipse.swt.events.SelectionListener;
33
import org.eclipse.swt.layout.GridData;
34
import org.eclipse.swt.layout.GridLayout;
35
import org.eclipse.swt.widgets.Button;
36
import org.eclipse.swt.widgets.Combo;
37
import org.eclipse.swt.widgets.Composite;
38
import org.eclipse.swt.widgets.Label;
39
import org.eclipse.swt.widgets.Spinner;
40
import org.txm.rcp.messages.TXMUIMessages;
41
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
42
import org.txm.searchengine.cqp.corpus.Corpus;
43
import org.txm.searchengine.cqp.corpus.StructuralUnit;
44

  
45
// TODO: Auto-generated Javadoc
46
/**
47
 * Used by the Cooc Editor Allow to choose a structural unit and the size @
48
 * author mdecorde.
49
 */
50
public class EmpantWidget extends Composite {
51

  
52
	/** The struct type. */
53
	Button structType;
54
	
55
	/** The word type. */
56
	Button wordType;
57
	
58
	/** The structs. */
59
	Combo structs;
60
	
61
	/** The max left. */
62
	Spinner maxLeft;
63
	
64
	/** The max right. */
65
	Spinner maxRight;
66
	
67
	/** The min right. */
68
	Spinner minRight;
69
	
70
	/** The min left. */
71
	Spinner minLeft;
72
	
73
	/** The check xword. */
74
	Button checkXword;
75
	
76
	/** The check xword. */
77
	Button checkLeft;
78
	
79
	/** The check xword. */
80
	Button checkRight;
81

  
82
	Label infoLabel;
83
	
84
	/** The corpus. */
85
	Corpus corpus;
86

  
87
	/**
88
	 * Instantiates a new empant widget.
89
	 *
90
	 * @param parent the parent
91
	 * @param style the style
92
	 * @param corpus the corpus
93
	 */
94
	public EmpantWidget(Composite parent, int style, Corpus corpus) {
95
		super(parent, style);
96
		this.corpus = corpus;
97
		GridLayout mainLayout = new GridLayout(1, true);
98
		//mainLayout.verticalSpacing = 0;
99
		mainLayout.marginWidth = 0;
100
		this.setLayout(mainLayout);
101
		
102
		Composite line1 = new Composite(this, style);
103
		Composite line2 = new Composite(this, style);
104
		line1.setLayout(new GridLayout(7, false));
105
		line2.setLayout(new GridLayout(9, false));
106
		line1.setLayoutData(new GridData(GridData.FILL, GridData.FILL,true,true));
107
		line2.setLayoutData(new GridData(GridData.FILL, GridData.FILL,true,true));
108
		
109
		
110
		Label l = new Label(line1, SWT.NONE);
111
		l.setText(TXMUIMessages.EmpantWidget_0);
112

  
113
		wordType = new Button(line1, SWT.RADIO);
114
		wordType.setText(TXMUIMessages.EmpantWidget_1);
115
		wordType.addSelectionListener(new SelectionListener() {
116
			@Override
117
			public void widgetSelected(SelectionEvent e) {
118
				structs.setEnabled(false);
119
				checkXword.setEnabled(false);
120
			}
121

  
122
			@Override
123
			public void widgetDefaultSelected(SelectionEvent e) {
124
			}
125
		});
126
		wordType.setSelection(true);
127

  
128
		structType = new Button(line1, SWT.RADIO);
129
		structType.setText(TXMUIMessages.EmpantWidget_2);
130
		structType.addSelectionListener(new SelectionListener() {
131
			@Override
132
			public void widgetSelected(SelectionEvent e) {
133
				structs.setEnabled(true);
134
				checkXword.setEnabled(true);
135
			}
136

  
137
			@Override
138
			public void widgetDefaultSelected(SelectionEvent e) {
139
			}
140
		});
141

  
142
		// [info]
143
		structs = new Combo(line1, SWT.READ_ONLY | SWT.SINGLE | SWT.BORDER);
144
		GridData layoutData = new GridData(GridData.VERTICAL_ALIGN_CENTER);
145
		structs.setLayoutData(layoutData);
146

  
147
		checkLeft = new Button(line1, SWT.CHECK);
148
		checkLeft.setSelection(true);
149
		checkLeft.setText(TXMUIMessages.EmpantWidget_8);
150
		checkLeft.addSelectionListener(new SelectionListener() {
151
			@Override
152
			public void widgetSelected(SelectionEvent e) {
153
				boolean sel = checkLeft.getSelection();
154
				maxLeft.setEnabled(sel);
155
				minLeft.setEnabled(sel);
156
			}
157
			
158
			@Override
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff