Revision 544

tmp/org.txm.cah.core/src/org/txm/cah/core/functions/AHC.java (revision 544)
133 133
		dirty = true;
134 134
	}
135 135

  
136
	@Override
137
	public boolean setParameters(TXMParameters parameters) {
138
		try {
139
			Boolean columns = this.getBooleanParameterValue(AHCPreferences.COLUMNS_COMPUTING);
140
			String metric = this.getStringParameterValue(AHCPreferences.METRIC);
141
			Integer nCluster = this.getIntParameterValue(AHCPreferences.N_CLUSTERS);
142
			String method = this.getStringParameterValue(AHCPreferences.METHOD);
143
			this.setParameters(columns, metric, nCluster, method);
144
		} catch(Exception e) {
145
			System.out.println("Error while setting CAH parameters: "+e.getLocalizedMessage());
146
			return false;
147
		}
148
		return true;
136

  
137
	public void loadParameters() {
138
		this.setParameters(
139
				this.getBooleanParameterValue(AHCPreferences.COLUMNS_COMPUTING),
140
				this.getStringParameterValue(AHCPreferences.METRIC),
141
				this.getIntParameterValue(AHCPreferences.N_CLUSTERS),
142
				this.getStringParameterValue(AHCPreferences.METHOD)
143
				);
149 144
	}
150 145

  
151
//	@Override
152
//	public void loadParameters() {
153
//		this.setParameters(
154
//				this.getBooleanParameterValue(AHCPreferences.COLUMNS_COMPUTING),
155
//				this.getStringParameterValue(AHCPreferences.METRIC),
156
//				this.getIntParameterValue(AHCPreferences.N_CLUSTERS),
157
//				this.getStringParameterValue(AHCPreferences.METHOD)
158
//				);
159
//	}
160

  
161 146
	
162 147
	@Override
163 148
	public boolean canCompute() {
......
217 202
	@Override
218 203
	protected boolean _compute(boolean update)	{
219 204

  
205
		this.loadParameters();
206
		
220 207
		Log.info("Computing CAH...");
221 208
		try {
222 209
			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java (revision 544)
10 10

  
11 11
import org.eclipse.swt.SWT;
12 12
import org.eclipse.swt.custom.ScrolledComposite;
13
import org.eclipse.swt.events.KeyEvent;
14
import org.eclipse.swt.events.KeyListener;
13 15
import org.eclipse.swt.events.SelectionEvent;
14 16
import org.eclipse.swt.events.SelectionListener;
15 17
import org.eclipse.swt.layout.FormAttachment;
......
20 22
import org.eclipse.swt.widgets.Button;
21 23
import org.eclipse.swt.widgets.Combo;
22 24
import org.eclipse.swt.widgets.Composite;
25
import org.eclipse.swt.widgets.Display;
23 26
import org.eclipse.swt.widgets.Event;
24 27
import org.eclipse.swt.widgets.Label;
25 28
import org.eclipse.swt.widgets.Listener;
......
29 32
import org.txm.core.messages.TXMCoreMessages;
30 33
import org.txm.progression.core.functions.Progression;
31 34
import org.txm.progression.core.preferences.ProgressionPreferences;
35
import org.txm.progression.rcp.messages.ProgressionUIMessages;
32 36
import org.txm.rcp.RCPMessages;
33 37
import org.txm.rcp.StatusLine;
34 38
import org.txm.rcp.swt.widget.AssistedQueryWidget;
......
67 71
	/** The graphtype. */
68 72
	private boolean cumulative = true;
69 73
	
70
	private boolean blackAndWhite = true;
71
	
72 74
	/** The monostyle. */
73 75
	private boolean monostyle = true;
74 76
	
......
199 201
			// controls
200 202
			// graph param
201 203
			Label typeLabel = new Label(paramPanel, SWT.NONE);
202
			typeLabel.setText(RCPMessages.ProgressionDialog_1);
204
			typeLabel.setText(ProgressionUIMessages.ProgressionDialog_1);
203 205
			typeLabel.setAlignment(SWT.CENTER);
204 206

  
205 207
			cumuButton = new Button(paramPanel, SWT.RADIO);
206
			cumuButton.setText(RCPMessages.ProgressionDialog_2);
208
			cumuButton.setText(ProgressionUIMessages.ProgressionDialog_2);
207 209
			cumuButton.setSelection(cumulative);
208 210

  
209 211
			Button densityButton = new Button(paramPanel, SWT.RADIO);
210
			densityButton.setText(RCPMessages.ProgressionDialog_3);
212
			densityButton.setText(ProgressionUIMessages.ProgressionDialog_3);
211 213
			densityButton.setSelection(!cumulative);
212 214

  
213 215
			//Bande size
214 216
			typeLabel = new Label(paramPanel, SWT.NONE);
215
			typeLabel.setText(RCPMessages.ProgressionDialog_11);
217
			typeLabel.setText(ProgressionUIMessages.ProgressionDialog_11);
216 218
			typeLabel.setAlignment(SWT.CENTER);
217 219

  
218 220
			bandeField = new Text(paramPanel, SWT.BORDER);
......
221 223
			
222 224
			// Structural units
223 225
//			Group displayParam = new Group(paramPanel, SWT.BORDER);
224
//			displayParam.setText(RCPMessages.ProgressionDialog_13);
226
//			displayParam.setText(ProgressionUIMessages.ProgressionDialog_13);
225 227
//			displayParam.setLayout(new GridLayout(3, true));
226 228
//			displayParam.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 3, 1));
227 229

  
228 230
			Label structLabel = new Label(paramPanel, SWT.NONE);
229
			structLabel.setText(RCPMessages.ProgressionDialog_4);
231
			structLabel.setText(ProgressionUIMessages.ProgressionDialog_4);
230 232
			structLabel.setAlignment(SWT.CENTER);
231 233

  
232 234
			structuralUnitsCombo = new Combo(paramPanel, SWT.READ_ONLY);
......
311 313
			
312 314
			// property value field
313 315
			Label regexLabel = new Label(paramPanel, SWT.NONE);
314
			regexLabel.setText(RCPMessages.ProgressionDialog_7);
316
			regexLabel.setText(ProgressionUIMessages.ProgressionDialog_7);
315 317
			regexLabel.setAlignment(SWT.CENTER);
316 318

  
317 319
			regexValue = new Text(paramPanel, SWT.SINGLE | SWT.BORDER);
......
322 324
			
323 325
			//spacer
324 326
			styleButton = new Button(paramPanel, SWT.CHECK);
325
			styleButton.setText(RCPMessages.ProgressionDialog_14);
327
			styleButton.setText(ProgressionUIMessages.ProgressionDialog_14);
326 328
			styleButton.setSelection(monostyle);
327 329

  
328 330
			//Repeat options
329 331
			repeatButton = new Button(paramPanel, SWT.CHECK);
330
			repeatButton.setText(RCPMessages.ProgressionDialog_15);
332
			repeatButton.setText(ProgressionUIMessages.ProgressionDialog_15);
331 333
			repeatButton.setSelection(repeatvalues);
332 334

  
333 335
			
......
353 355
			
354 356
			// queries parameters
355 357
			Label focusLabel = new Label(queriesFocusComposite, SWT.NONE);
356
			focusLabel.setText(RCPMessages.ProgressionDialog_8);
358
			focusLabel.setText(ProgressionUIMessages.ProgressionDialog_8);
357 359
			focusLabel.setAlignment(SWT.CENTER);
358 360

  
359 361
			// add query button
360 362
			Button plusButton = new Button(queriesFocusComposite, SWT.NONE);
361 363
			plusButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
362 364
					true, true));
363
			plusButton.setText(RCPMessages.ProgressionDialog_9);
365
			plusButton.setText(ProgressionUIMessages.ProgressionDialog_9);
364 366
			
365 367
			plusButton.addListener(SWT.Selection, new Listener() {
366 368
				@Override
......
378 380
			// delete query button
379 381
			Button minusButton = new Button(queriesFocusComposite, SWT.NONE);
380 382
			minusButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
381
			minusButton.setText(RCPMessages.ProgressionDialog_5);
383
			minusButton.setText(ProgressionUIMessages.ProgressionDialog_5);
382 384
			minusButton.addListener(SWT.Selection, new Listener() {
383 385
				@Override
384 386
				public void handleEvent(Event event) {
......
414 416
				
415 417
				@Override
416 418
				public void widgetSelected(SelectionEvent evt) {
417
					// TODO Auto-generated method stub
418
					queries = new ArrayList<Query>();
419
					for (AssistedQueryWidget wid : queryWidgets) {
420
						if (!wid.getQueryString().equals("\"\"")) { //$NON-NLS-1$
421
							queries.add(new Query(wid.getQueryString()));
422
							wid.memorize();
423
						}
424
					}
425 419

  
426
					if (propertyCombo.getSelectionIndex() > 0) {
427
						selectedStructuralUnitProperty = structuralUnitsProperties.get(propertyCombo.getSelectionIndex() - 1);
428
					}
429
					else {
430
						selectedStructuralUnitProperty = null;
431
					}
432
					if (structuralUnitsCombo.getSelectionIndex() > 0) {
433
						selectedStructuralUnit = structuralUnits.get(structuralUnitsCombo.getSelectionIndex() - 1);
434
					}
435
					else {
436
						selectedStructuralUnit = null;
437
						selectedStructuralUnitProperty = null;// need a structuralunit
438
					}
439

  
440
					try {
441
						Pattern.compile(regexValue.getText());
442
						regexpropertyValue = regexValue.getText();
443

  
444
						if (regexpropertyValue.length() == 0) {
445
							regexpropertyValue = null;
446
						}
447
					} catch (PatternSyntaxException e) {
448
						System.out.println(RCPMessages.ProgressionDialog_10 + e);
449
					}
450

  
451
					cumulative = cumuButton.getSelection();
452
					monostyle = styleButton.getSelection();
453
					repeatvalues = repeatButton.getSelection();
454
					String smultibande = bandeField.getText();
455
					if (smultibande != null && smultibande.length() > 0) {
456
						try {
457
							bandemultiplier = Float.parseFloat(smultibande);
458
						} catch(Exception e) {
459
							bandemultiplier = 1.0f;
460
							System.out.println(RCPMessages.ProgressionDialog_17+e);
461
							StatusLine.error(RCPMessages.ProgressionDialog_17+e);
462
						}
463
					}
464
					else	{
465
						bandemultiplier = 1.0f;
466
					}
467

  
468
					((Progression)getResultData()).setParameters(queries, selectedStructuralUnit, selectedStructuralUnitProperty, regexpropertyValue, cumulative, linewidth, repeatvalues, bandemultiplier);
420
					updateResultFromEditor();
469 421
					compute(false);
470 422
					
471 423
				}
......
521 473
		focusTextBox.setLayoutData(gridData);
522 474
		focusTextBox.setFocus();
523 475
		queryWidgets.add(focusTextBox);
476
		
477
		focusTextBox.addKeyListener(new KeyListener() {
478
			@Override
479
			public void keyPressed(KeyEvent e) {
480
				// System.out.println("key pressed : "+e.keyCode);
481
				if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
482
					updateResultFromEditor();
483
					compute(true);
484
				}
485
			}
486

  
487
			@Override
488
			public void keyReleased(KeyEvent e) {
489
			}
490
		});
491

  
492
		
524 493
		return focusTextBox;
525 494
	}
526 495

  
......
537 506
	public Progression getResultData() {
538 507
		return (Progression) super.getResultData();
539 508
	}
509
	
510
	
511
	@Override
512
	public void updateResultFromEditor() {
513
		
514
		Display.getDefault().syncExec(new Runnable() {
515
			@Override
516
			public void run() {
517

  
518
				
519
				queries = new ArrayList<Query>();
520
				for (AssistedQueryWidget wid : queryWidgets) {
521
					if (!wid.getQueryString().equals("\"\"")) { //$NON-NLS-1$
522
						queries.add(new Query(wid.getQueryString()));
523
						wid.memorize();
524
					}
525
				}
526

  
527
				if (propertyCombo.getSelectionIndex() > 0) {
528
					selectedStructuralUnitProperty = structuralUnitsProperties.get(propertyCombo.getSelectionIndex() - 1);
529
				}
530
				else {
531
					selectedStructuralUnitProperty = null;
532
				}
533
				if (structuralUnitsCombo.getSelectionIndex() > 0) {
534
					selectedStructuralUnit = structuralUnits.get(structuralUnitsCombo.getSelectionIndex() - 1);
535
				}
536
				else {
537
					selectedStructuralUnit = null;
538
					selectedStructuralUnitProperty = null;// need a structuralunit
539
				}
540

  
541
				try {
542
					Pattern.compile(regexValue.getText());
543
					regexpropertyValue = regexValue.getText();
544

  
545
					if (regexpropertyValue.length() == 0) {
546
						regexpropertyValue = null;
547
					}
548
				} catch (PatternSyntaxException e) {
549
					System.out.println(ProgressionUIMessages.ProgressionDialog_10 + e);
550
				}
551

  
552
				cumulative = cumuButton.getSelection();
553
				monostyle = styleButton.getSelection();
554
				repeatvalues = repeatButton.getSelection();
555
				String smultibande = bandeField.getText();
556
				if (smultibande != null && smultibande.length() > 0) {
557
					try {
558
						bandemultiplier = Float.parseFloat(smultibande);
559
					} catch(Exception e) {
560
						bandemultiplier = 1.0f;
561
						System.out.println(ProgressionUIMessages.ProgressionDialog_17+e);
562
						StatusLine.error(ProgressionUIMessages.ProgressionDialog_17+e);
563
					}
564
				}
565
				else	{
566
					bandemultiplier = 1.0f;
567
				}
568

  
569
				((Progression)getResultData()).setParameters(queries, selectedStructuralUnit, selectedStructuralUnitProperty, regexpropertyValue, cumulative, linewidth, repeatvalues, bandemultiplier);
570
			}
571
		});
572

  
573
	}
574
	
540 575
}
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/chartsengine/events/ProgressionEventCallBack.java (revision 544)
374 374
			
375 375
			
376 376
			// Loads new lines, fill the display area and select the table row
377
			if (loadLines)	{
377
			if(loadLines)	{
378
				//FIXME: old code that workd but Matt has removed this method from the ConcordanceEditor, see if it still work
379
				//linkedEditor.fillDisplayArea(top, bottom);
378 380
				linkedEditor.fillDisplayArea();
379 381
			}
380 382

  
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/forms/ProgressionParametersComposite.java (revision 544)
1
package org.txm.progression.rcp.forms;
2
import org.eclipse.swt.SWT;
3
import org.eclipse.swt.custom.SashForm;
4
import org.eclipse.swt.custom.ScrolledComposite;
5
import org.eclipse.swt.layout.FillLayout;
6
import org.eclipse.swt.layout.GridData;
7
import org.eclipse.swt.layout.GridLayout;
8
import org.eclipse.swt.widgets.Button;
9
import org.eclipse.swt.widgets.Combo;
10
import org.eclipse.swt.widgets.Composite;
11
import org.eclipse.swt.widgets.Label;
12
import org.eclipse.swt.widgets.Table;
13
import org.eclipse.swt.widgets.Text;
14
import org.txm.rcp.RCPMessages;
15

  
16

  
17
public class ProgressionParametersComposite extends Composite {
18
	SashForm sashForm;
19
	
20
	private Table table;
21
	private Text scaleTextEdit;
22
	private Text regTextEdit;
23
	
24
	Button btnSupprimer;
25
	Button cumulBtn;
26
	Button densiBtn;
27
	
28
	Combo structCombo;
29
	Combo propCombo;
30
	private Button styleRadio;
31
	private Button repeatRadio;
32
	private Button NBRadio;
33
	private Button btnNewButton;
34

  
35
	
36
	/**
37
	 * Creates the composite.
38
	 * @param parent
39
	 * @param style
40
	 */
41
	public ProgressionParametersComposite(Composite parent, int style) {
42
		super(parent, style);
43
		
44
		
45
		//parent.setLayout(new GridLayout(1, true));
46
		
47
//		ExpandBar bar = new ExpandBar(parent, SWT.NONE);
48
		
49
//		sashForm = new SashForm(parent, SWT.VERTICAL);
50
//		sashForm.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
51
		
52
		
53
		
54
		ScrolledComposite scrolledComposite_1 = new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
55
		scrolledComposite_1.setExpandHorizontal(true);
56
		scrolledComposite_1.setExpandVertical(true);
57

  
58
//		Composite scrolledComposite_1 = new Composite(this, SWT.BORDER);
59
		
60
		Composite composite_1 = new Composite(scrolledComposite_1, SWT.NONE);
61
		composite_1.setLayout(new FillLayout(SWT.VERTICAL));
62
		
63
		Composite composite = new Composite(composite_1, SWT.NONE);
64
		composite.setLayout(new GridLayout(5, false));
65
		
66
		Label label = new Label(composite, SWT.NONE);
67
		GridData gd_label = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
68
		gd_label.widthHint = 29;
69
		label.setLayoutData(gd_label);
70
		label.setText(RCPMessages.ProgressionForm_0);
71
		
72
		cumulBtn = new Button(composite, SWT.RADIO);
73
		cumulBtn.setText(RCPMessages.ProgressionForm_1);
74
		cumulBtn.setSelection(true);
75
		
76
		densiBtn = new Button(composite, SWT.RADIO);
77
		densiBtn.setText(RCPMessages.ProgressionForm_2);
78
		
79
		Label lblEchelle = new Label(composite, SWT.NONE);
80
		lblEchelle.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
81
		lblEchelle.setText(RCPMessages.ProgressionForm_3);
82
		
83
		scaleTextEdit = new Text(composite, SWT.BORDER);
84
		scaleTextEdit.setText("1.0"); //$NON-NLS-1$
85
		
86
		Label lblOptionsDaffichage = new Label(composite, SWT.NONE);
87
		lblOptionsDaffichage.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
88
		lblOptionsDaffichage.setText(RCPMessages.ProgressionForm_5);
89
		new Label(composite, SWT.NONE);
90
		
91
		Label label_6 = new Label(composite, SWT.NONE);
92
		label_6.setText(RCPMessages.ProgressionForm_6);
93
		
94
		structCombo = new Combo(composite, SWT.NONE);
95
		
96
		Label label_5 = new Label(composite, SWT.NONE);
97
		label_5.setText(RCPMessages.ProgressionForm_7);
98
		
99
		propCombo = new Combo(composite, SWT.NONE);
100
		propCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
101
		new Label(composite, SWT.NONE);
102
		new Label(composite, SWT.NONE);
103
		
104
		Label label_7 = new Label(composite, SWT.NONE);
105
		label_7.setText(RCPMessages.ProgressionForm_8);
106
		
107
		regTextEdit = new Text(composite, SWT.BORDER);
108
		regTextEdit.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
109
		new Label(composite, SWT.NONE);
110
		
111
		styleRadio = new Button(composite, SWT.CHECK);
112
		styleRadio.setText(RCPMessages.ProgressionForm_9);
113
		styleRadio.setSelection(true);
114
		
115
		repeatRadio = new Button(composite, SWT.CHECK);
116
		repeatRadio.setText(RCPMessages.ProgressionForm_10);
117
		
118
		NBRadio = new Button(composite, SWT.CHECK);
119
		NBRadio.setText(RCPMessages.ProgressionForm_11);
120
		new Label(composite, SWT.NONE);
121
	
122
		Composite composite_2 = new Composite(composite_1, SWT.NONE);
123
		composite_2.setLayout(new GridLayout(1, false));
124
		
125
		Composite composite_3 = new Composite(composite_2, SWT.NONE);
126
		composite_3.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
127
		composite_3.setLayout(new FillLayout(SWT.HORIZONTAL));
128
		
129
		Label lblRequetes = new Label(composite_3, SWT.NONE);
130
		lblRequetes.setText(RCPMessages.ProgressionForm_12);
131
		
132
		btnNewButton = new Button(composite_3, SWT.NONE);
133
		btnNewButton.setText(RCPMessages.ProgressionForm_13);
134
		
135
		btnSupprimer = new Button(composite_3, SWT.NONE);
136
		btnSupprimer.setText(RCPMessages.ProgressionForm_14);
137
		
138
		scrolledComposite_1.setContent(composite_1);
139
		scrolledComposite_1.setMinSize(composite_1.computeSize(SWT.DEFAULT, SWT.DEFAULT));
140
		
141
		
142
//		table = new Table(sashForm, SWT.BORDER | SWT.FULL_SELECTION);
143
//		table.setHeaderVisible(true);
144
//		table.setLinesVisible(true);
145
//		sashForm.setWeights(new int[] {215, 334});
146
		//return sashForm;
147
		
148
		
149
		scrolledComposite_1.setBounds(20, 20, 800, 800);
150

  
151
	}
152
	
153
	
154
	
155
	public void setTable(Table table) {
156
		this.table = table;
157
		//table = new Table(sashForm, SWT.BORDER | SWT.FULL_SELECTION);
158
		table.setHeaderVisible(true);
159
		table.setLinesVisible(true);
160
		sashForm.setWeights(new int[] {215, 334});
161
	}
162
	
163

  
164

  
165
	public SashForm getSash() {
166
		return sashForm;
167
	}
168
	
169
	/**
170
	 * @return the table
171
	 */
172
	public Table getTable() {
173
		return table;
174
	}
175

  
176
	/**
177
	 * @return the scaleTextEdit
178
	 */
179
	public Text getScaleTextEdit() {
180
		return scaleTextEdit;
181
	}
182

  
183
	/**
184
	 * @return the regTextEdit
185
	 */
186
	public Text getRegTextEdit() {
187
		return regTextEdit;
188
	}
189

  
190
	/**
191
	 * @return the btnSupprimer
192
	 */
193
	public Button getBtnSupprimer() {
194
		return btnSupprimer;
195
	}
196

  
197
	/**
198
	 * @return the cumulBtn
199
	 */
200
	public Button getCumulBtn() {
201
		return cumulBtn;
202
	}
203

  
204
	/**
205
	 * @return the densiBtn
206
	 */
207
	public Button getDensiBtn() {
208
		return densiBtn;
209
	}
210

  
211
	/**
212
	 * @return the structCombo
213
	 */
214
	public Combo getStructCombo() {
215
		return structCombo;
216
	}
217

  
218
	/**
219
	 * @return the propCombo
220
	 */
221
	public Combo getPropCombo() {
222
		return propCombo;
223
	}
224

  
225
	/**
226
	 * @return the styleRadio
227
	 */
228
	public Button getStyleRadio() {
229
		return styleRadio;
230
	}
231

  
232
	/**
233
	 * @return the repeatRadio
234
	 */
235
	public Button getRepeatRadio() {
236
		return repeatRadio;
237
	}
238

  
239
	/**
240
	 * @return the nBRadio
241
	 */
242
	public Button getNBRadio() {
243
		return NBRadio;
244
	}
245

  
246
	/**
247
	 * @return the btnNewButton
248
	 */
249
	public Button getBtnNewButton() {
250
		return btnNewButton;
251
	}
252

  
253

  
254
}
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/forms/___ProgressionParametersComposite.java (revision 544)
1
package org.txm.progression.rcp.forms;
2
import org.eclipse.swt.SWT;
3
import org.eclipse.swt.custom.SashForm;
4
import org.eclipse.swt.custom.ScrolledComposite;
5
import org.eclipse.swt.layout.FillLayout;
6
import org.eclipse.swt.layout.GridData;
7
import org.eclipse.swt.layout.GridLayout;
8
import org.eclipse.swt.widgets.Button;
9
import org.eclipse.swt.widgets.Combo;
10
import org.eclipse.swt.widgets.Composite;
11
import org.eclipse.swt.widgets.Label;
12
import org.eclipse.swt.widgets.Table;
13
import org.eclipse.swt.widgets.Text;
14
import org.txm.rcp.RCPMessages;
15

  
16

  
17
public class ___ProgressionParametersComposite extends Composite {
18
	SashForm sashForm;
19
	
20
	private Table table;
21
	private Text scaleTextEdit;
22
	private Text regTextEdit;
23
	
24
	Button btnSupprimer;
25
	Button cumulBtn;
26
	Button densiBtn;
27
	
28
	Combo structCombo;
29
	Combo propCombo;
30
	private Button styleRadio;
31
	private Button repeatRadio;
32
	private Button NBRadio;
33
	private Button btnNewButton;
34

  
35
	
36
	/**
37
	 * Creates the composite.
38
	 * @param parent
39
	 * @param style
40
	 */
41
	public ___ProgressionParametersComposite(Composite parent, int style) {
42
		super(parent, style);
43
		
44
		
45
		//parent.setLayout(new GridLayout(1, true));
46
		
47
//		ExpandBar bar = new ExpandBar(parent, SWT.NONE);
48
		
49
//		sashForm = new SashForm(parent, SWT.VERTICAL);
50
//		sashForm.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
51
		
52
		
53
		
54
		ScrolledComposite scrolledComposite_1 = new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
55
		scrolledComposite_1.setExpandHorizontal(true);
56
		scrolledComposite_1.setExpandVertical(true);
57

  
58
//		Composite scrolledComposite_1 = new Composite(this, SWT.BORDER);
59
		
60
		Composite composite_1 = new Composite(scrolledComposite_1, SWT.NONE);
61
		composite_1.setLayout(new FillLayout(SWT.VERTICAL));
62
		
63
		Composite composite = new Composite(composite_1, SWT.NONE);
64
		composite.setLayout(new GridLayout(5, false));
65
		
66
		Label label = new Label(composite, SWT.NONE);
67
		GridData gd_label = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
68
		gd_label.widthHint = 29;
69
		label.setLayoutData(gd_label);
70
		label.setText(RCPMessages.ProgressionForm_0);
71
		
72
		cumulBtn = new Button(composite, SWT.RADIO);
73
		cumulBtn.setText(RCPMessages.ProgressionForm_1);
74
		cumulBtn.setSelection(true);
75
		
76
		densiBtn = new Button(composite, SWT.RADIO);
77
		densiBtn.setText(RCPMessages.ProgressionForm_2);
78
		
79
		Label lblEchelle = new Label(composite, SWT.NONE);
80
		lblEchelle.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
81
		lblEchelle.setText(RCPMessages.ProgressionForm_3);
82
		
83
		scaleTextEdit = new Text(composite, SWT.BORDER);
84
		scaleTextEdit.setText("1.0"); //$NON-NLS-1$
85
		
86
		Label lblOptionsDaffichage = new Label(composite, SWT.NONE);
87
		lblOptionsDaffichage.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
88
		lblOptionsDaffichage.setText(RCPMessages.ProgressionForm_5);
89
		new Label(composite, SWT.NONE);
90
		
91
		Label label_6 = new Label(composite, SWT.NONE);
92
		label_6.setText(RCPMessages.ProgressionForm_6);
93
		
94
		structCombo = new Combo(composite, SWT.NONE);
95
		
96
		Label label_5 = new Label(composite, SWT.NONE);
97
		label_5.setText(RCPMessages.ProgressionForm_7);
98
		
99
		propCombo = new Combo(composite, SWT.NONE);
100
		propCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
101
		new Label(composite, SWT.NONE);
102
		new Label(composite, SWT.NONE);
103
		
104
		Label label_7 = new Label(composite, SWT.NONE);
105
		label_7.setText(RCPMessages.ProgressionForm_8);
106
		
107
		regTextEdit = new Text(composite, SWT.BORDER);
108
		regTextEdit.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
109
		new Label(composite, SWT.NONE);
110
		
111
		styleRadio = new Button(composite, SWT.CHECK);
112
		styleRadio.setText(RCPMessages.ProgressionForm_9);
113
		styleRadio.setSelection(true);
114
		
115
		repeatRadio = new Button(composite, SWT.CHECK);
116
		repeatRadio.setText(RCPMessages.ProgressionForm_10);
117
		
118
		NBRadio = new Button(composite, SWT.CHECK);
119
		NBRadio.setText(RCPMessages.ProgressionForm_11);
120
		new Label(composite, SWT.NONE);
121
	
122
		Composite composite_2 = new Composite(composite_1, SWT.NONE);
123
		composite_2.setLayout(new GridLayout(1, false));
124
		
125
		Composite composite_3 = new Composite(composite_2, SWT.NONE);
126
		composite_3.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
127
		composite_3.setLayout(new FillLayout(SWT.HORIZONTAL));
128
		
129
		Label lblRequetes = new Label(composite_3, SWT.NONE);
130
		lblRequetes.setText(RCPMessages.ProgressionForm_12);
131
		
132
		btnNewButton = new Button(composite_3, SWT.NONE);
133
		btnNewButton.setText(RCPMessages.ProgressionForm_13);
134
		
135
		btnSupprimer = new Button(composite_3, SWT.NONE);
136
		btnSupprimer.setText(RCPMessages.ProgressionForm_14);
137
		
138
		scrolledComposite_1.setContent(composite_1);
139
		scrolledComposite_1.setMinSize(composite_1.computeSize(SWT.DEFAULT, SWT.DEFAULT));
140
		
141
		
142
//		table = new Table(sashForm, SWT.BORDER | SWT.FULL_SELECTION);
143
//		table.setHeaderVisible(true);
144
//		table.setLinesVisible(true);
145
//		sashForm.setWeights(new int[] {215, 334});
146
		//return sashForm;
147
		
148
		
149
		scrolledComposite_1.setBounds(20, 20, 800, 800);
150

  
151
	}
152
	
153
	
154
	
155
	public void setTable(Table table) {
156
		this.table = table;
157
		//table = new Table(sashForm, SWT.BORDER | SWT.FULL_SELECTION);
158
		table.setHeaderVisible(true);
159
		table.setLinesVisible(true);
160
		sashForm.setWeights(new int[] {215, 334});
161
	}
162
	
163

  
164

  
165
	public SashForm getSash() {
166
		return sashForm;
167
	}
168
	
169
	/**
170
	 * @return the table
171
	 */
172
	public Table getTable() {
173
		return table;
174
	}
175

  
176
	/**
177
	 * @return the scaleTextEdit
178
	 */
179
	public Text getScaleTextEdit() {
180
		return scaleTextEdit;
181
	}
182

  
183
	/**
184
	 * @return the regTextEdit
185
	 */
186
	public Text getRegTextEdit() {
187
		return regTextEdit;
188
	}
189

  
190
	/**
191
	 * @return the btnSupprimer
192
	 */
193
	public Button getBtnSupprimer() {
194
		return btnSupprimer;
195
	}
196

  
197
	/**
198
	 * @return the cumulBtn
199
	 */
200
	public Button getCumulBtn() {
201
		return cumulBtn;
202
	}
203

  
204
	/**
205
	 * @return the densiBtn
206
	 */
207
	public Button getDensiBtn() {
208
		return densiBtn;
209
	}
210

  
211
	/**
212
	 * @return the structCombo
213
	 */
214
	public Combo getStructCombo() {
215
		return structCombo;
216
	}
217

  
218
	/**
219
	 * @return the propCombo
220
	 */
221
	public Combo getPropCombo() {
222
		return propCombo;
223
	}
224

  
225
	/**
226
	 * @return the styleRadio
227
	 */
228
	public Button getStyleRadio() {
229
		return styleRadio;
230
	}
231

  
232
	/**
233
	 * @return the repeatRadio
234
	 */
235
	public Button getRepeatRadio() {
236
		return repeatRadio;
237
	}
238

  
239
	/**
240
	 * @return the nBRadio
241
	 */
242
	public Button getNBRadio() {
243
		return NBRadio;
244
	}
245

  
246
	/**
247
	 * @return the btnNewButton
248
	 */
249
	public Button getBtnNewButton() {
250
		return btnNewButton;
251
	}
252

  
253

  
254
}
0 255

  
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/messages_ru.properties (revision 544)
1 1

  
2
ProgressionDialog_0  = Параметры прогрессии 
3
ProgressionDialog_1  = Тип графа: 
4
ProgressionDialog_10 = Прогрессия: некорректное регулярное выражение: 
5
ProgressionDialog_11 = Масштаб полос
6
ProgressionDialog_13 = Опции вида
7
ProgressionDialog_14 = Различные стили строк
8
ProgressionDialog_15 = Повторять идентичные значения
9
ProgressionDialog_16 = Ч/Б
10
ProgressionDialog_17 = Ошибка: мультипликатор полосы: 
11
ProgressionDialog_2  = кумулятивный
12
ProgressionDialog_3  = плотность
13
ProgressionDialog_4  = Структурная единица: 
14
ProgressionDialog_5  = удалить
15
ProgressionDialog_7  = Рег. Выр.: 
16
ProgressionDialog_8  = Запросы: 
17
ProgressionDialog_9  = добавить
18

  
2 19
ProgressionPreferencePage_3 = Кумулятивный граф прогрессии
3 20
ProgressionPreferencePage_5 = Линии в одном стиле
4 21
ProgressionPreferencePage_6 = Повторять значения с свойств структур
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/messages_fr.properties (revision 544)
1 1

  
2
ProgressionDialog_0  = Paramètres de la progression 
3
ProgressionDialog_1  = Type de graphe : 
4
ProgressionDialog_10 = Progression : mauvaise expression régulière : 
5
ProgressionDialog_11 = Échelle des bandeaux
6
ProgressionDialog_13 = Options d'affichage
7
ProgressionDialog_14 = Style de ligne unique
8
ProgressionDialog_15 = Répéter les valeurs identiques
9
ProgressionDialog_16 = N/B
10
ProgressionDialog_17 = Erreur : multiplicateur de bande : 
11
ProgressionDialog_2  = cumulatif
12
ProgressionDialog_3  = densité
13
ProgressionDialog_4  = Unité structurelle : 
14
ProgressionDialog_5  = supprimer
15
ProgressionDialog_7  = Exp. Rég. : 
16
ProgressionDialog_8  = Requêtes : 
17
ProgressionDialog_9  = ajouter
18

  
2 19
ProgressionPreferencePage_3 = Graphe de progression cumulatif
3 20
ProgressionPreferencePage_5 = Style de ligne unique
4 21
ProgressionPreferencePage_6 = Répéter les valeurs de propriétés de structures
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/ProgressionUIMessages.java (revision 544)
12 12
	public static String ProgressionPreferencePage_6;
13 13
	public static String ProgressionPreferencePage_7;
14 14

  
15
	public static String ProgressionDialog_0;
16
	public static String ProgressionDialog_1;
17
	public static String ProgressionDialog_10;
18
	public static String ProgressionDialog_11;
19
	public static String ProgressionDialog_13;
20
	public static String ProgressionDialog_14;
21
	public static String ProgressionDialog_15;
22
	public static String ProgressionDialog_16;
23
	public static String ProgressionDialog_17;
24
	public static String ProgressionDialog_2;
25
	public static String ProgressionDialog_3;
26
	public static String ProgressionDialog_4;
27
	public static String ProgressionDialog_5;
28
	public static String ProgressionDialog_7;
29
	public static String ProgressionDialog_8;
30
	public static String ProgressionDialog_9;
31

  
32
	
15 33
	static {
16 34
		// initializes resource bundle
17 35
		Utf8NLS.initializeMessages(BUNDLE_NAME, ProgressionUIMessages.class);
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/messages.properties (revision 544)
1 1

  
2
ProgressionDialog_0  = Progression Parameters
3
ProgressionDialog_1  = Graph type:
4
ProgressionDialog_10 = Progression dialog: wrong regular expression:
5
ProgressionDialog_11 = Bandewidth multiplier:
6
ProgressionDialog_13 = Display options
7
ProgressionDialog_14 = Single line style
8
ProgressionDialog_15 = Repeat same values
9
ProgressionDialog_16 = Monochrome
10
ProgressionDialog_17 = Strip multiplier error:
11
ProgressionDialog_2  = cumulative
12
ProgressionDialog_3  = density
13
ProgressionDialog_4  = Structural Unit:
14
ProgressionDialog_5  = delete
15
ProgressionDialog_7  = Regex:
16
ProgressionDialog_8  = Queries:
17
ProgressionDialog_9  = add
18

  
2 19
ProgressionPreferencePage_3 = Default graph type is cumulative
3 20
ProgressionPreferencePage_5 = Single line style
4 21
ProgressionPreferencePage_6 = Repeat the values of the structure properties
tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java (revision 544)
55 55
	}
56 56

  
57 57

  
58
	@Override
59
	public boolean setParameters(TXMParameters parameters) {
60
		try {
61
			this.setParameters((boolean)parameters.get(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE));
62
			return true;
63
		}
64
		catch(Exception e) {
65
			// TODO Auto-generated catch block
66
			e.printStackTrace();
67
		}
68
		return false;
69
	}
70 58

  
59
//	public boolean setParameters(TXMParameters parameters) {
60
//		try {
61
//			this.setParameters((boolean)parameters.get(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE));
62
//			return true;
63
//		}
64
//		catch(Exception e) {
65
//			// TODO Auto-generated catch block
66
//			e.printStackTrace();
67
//		}
68
//		return false;
69
//	}
71 70

  
71

  
72 72
	/**
73 73
	 * 
74 74
	 * @param sortByPartSize
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 544)
957 957
			public void keyPressed(KeyEvent e) {
958 958
				// System.out.println("key pressed : "+e.keyCode);
959 959
				if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
960
					Query query = new Query(queryWidget.getQueryString());
961
					concordance.setQuery(query);
960
					updateResultFromEditor();
962 961
					compute(true);
963 962
				}
964 963
			}
......
1025 1024
		go.addSelectionListener(new SelectionListener() {
1026 1025
			@Override
1027 1026
			public void widgetSelected(SelectionEvent e) {
1028
				Query query = new Query(queryWidget.getQueryString());
1029
				concordance.setQuery(query);
1027
				updateResultFromEditor();
1030 1028
				compute(true);
1031 1029
			}
1032 1030

  
......
2003 2001
		return this.concordance.getParent().getName().equals(parent.getName());
2004 2002
	}
2005 2003

  
2006
	@Override public Concordance getResultData() {
2004
	@Override
2005
	public Concordance getResultData() {
2007 2006
		return concordance;
2008 2007
	}
2009 2008

  
......
2027 2026
		public void controlMoved(ControlEvent e) { }
2028 2027
		@Override
2029 2028
		public void controlResized(ControlEvent e) {
2030
			if (column != null && !column.isDisposed() &&column.getWidth() < 5) column.setWidth(5);
2031

  
2029
			if (column != null && !column.isDisposed() &&column.getWidth() < 5) {
2030
				column.setWidth(5);
2031
			}
2032 2032
		}
2033 2033
	}
2034 2034

  
2035 2035
	public String getLocale() {
2036 2036
		return locale;
2037 2037
	}
2038

  
2039
	@Override
2040
	public void updateResultFromEditor() {
2041
		Display.getDefault().syncExec(new Runnable() {
2042
			@Override
2043
			public void run() {
2044
				Query query = new Query(queryWidget.getQueryString());
2045
				concordance.setQuery(query);
2046
			}
2047
		});
2048
	}
2038 2049
}
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java (revision 544)
43 43
	public ChartResult(TXMResult parent) {
44 44
		super(parent);
45 45
		this.chartDirty = true;
46
		this.needsToResetView = false;
47
		this.needsToClearItemsSelection = false;
46 48
	}
47 49
	
48 50
	
......
148 150
	    try {
149 151
			clone = (ChartResult) super.clone();
150 152
			clone.chart = null;
153
			// FIXME: would be nice to clone the chart if possible
154
			//clone.chart = this.chart.clone();
151 155
			clone.chartDirty = true;
152 156
		}
153 157
		catch(Exception e) {
tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/summary/Summary.java (revision 544)
276 276
		return false;
277 277
	}
278 278

  
279
	@Override
280
	public boolean setParameters(TXMParameters parameters) {
281
		return false;
282
	}
283 279

  
284 280
	@Override
285 281
	public boolean saveParameters() {
tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/preview/Preview.java (revision 544)
106 106
		return false;
107 107
	}
108 108

  
109
	@Override
110
	public boolean setParameters(TXMParameters parameters) {
111
		return false;
112
	}
113 109

  
114 110
	@Override
115 111
	public boolean saveParameters() {
tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java (revision 544)
141 141
		dirty = true;
142 142
	}
143 143
	
144
	@Override
145
	public boolean setParameters(TXMParameters parameters) {
146
		try {
147
			Integer max = null;
148
			Object o = parameters.get(CQPPreferences.MAXVALUE);
149
			if (o instanceof Integer) max = (Integer)o;
150
			else if (o instanceof String) max = Integer.parseInt(o.toString());
151
			
152
			this.setParameters(max);
153
		} catch (Exception e) {
154
			System.out.println("Error while setting parameters of Informations: "+e.getLocalizedMessage());
155
			return false;
156
		}
157
		return true;
158
	}
144

  
145
//	public boolean setParameters(TXMParameters parameters) {
146
//		try {
147
//			Integer max = null;
148
//			Object o = parameters.get(CQPPreferences.MAXVALUE);
149
//			if (o instanceof Integer) max = (Integer)o;
150
//			else if (o instanceof String) max = Integer.parseInt(o.toString());
151
//			
152
//			this.setParameters(max);
153
//		} catch (Exception e) {
154
//			System.out.println("Error while setting parameters of Informations: "+e.getLocalizedMessage());
155
//			return false;
156
//		}
157
//		return true;
158
//	}
159 159
	
160 160
	/**
161 161
	 * Step general infos.
tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/selection/Selection.java (revision 544)
490 490

  
491 491
	@Override
492 492
	public boolean canCompute() {
493
		return corpus != null;
493
		return this.corpus != null;
494 494
	}
495 495

  
496 496
	@Override
......
505 505
		return false;
506 506
	}
507 507

  
508
	@Override
509
	public boolean setParameters(TXMParameters parameters) {
510
		return false;
511
	}
512 508
}
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java (revision 544)
89 89
	int[] partSizes;
90 90

  
91 91
	public String toString() {
92
		if (name != null) return name;
92
		if (name != null) {
93
			return name;
94
		}
93 95
		return super.toString();
94 96
	}
95 97
	
......
293 295
		try {
294 296
			CorpusManager.getCorpusManager().getCqiClient().cqpQuery(
295 297
					this.getCorpus().getQualifiedCqpId(), partCqpId, query);
296
			part = new Part(partCqpId, partitionName, partName, this,
297
					new Query(query));
298
			part = new Part(partCqpId, partitionName, partName, this, new Query(query));
298 299
		} catch (Exception e) {
299 300
			try {
300
				throw new CqiClientException(TXMCoreMessages.Partition_9 + partitionName
301
						+ "_" + partName+ e +" last error: "+CQPEngine.getCqiClient().getLastCQPError()); //$NON-NLS-1$ //$NON-NLS-2$
301
				throw new CqiClientException(TXMCoreMessages.Partition_9 + partitionName + "_" + partName + e + " last error: " + CQPEngine.getCqiClient().getLastCQPError()); //$NON-NLS-1$ //$NON-NLS-2$
302 302
			} catch (Exception e1) {
303 303
				System.out.println(TXMCoreMessages.Partition_18+e1);
304 304
				org.txm.utils.logger.Log.printStackTrace(e1);
......
306 306
			}
307 307
		}
308 308
		long end = System.currentTimeMillis();
309
		Log.finest(NLS.bind(TXMCoreMessages.PART_CREATED, partitionName
310
				+ "_" + partName, (end - start))); //$NON-NLS-1$//$NON-NLS-2$
309
		Log.finest(NLS.bind(TXMCoreMessages.PART_CREATED, partitionName + "_" + partName, (end - start))); //$NON-NLS-1
311 310
		return part;
312 311
	}
313 312

  
......
320 319
	 * @return the part
321 320
	 * @throws CqiClientException the cqi client exception
322 321
	 */
323
	private Part createPart(String partitionName, String partName, Query query)
324
	throws CqiClientException {
325
		if (partName.length() == 0) partName = "-"; //$NON-NLS-1$
322
	private Part createPart(String partitionName, String partName, Query query)	throws CqiClientException {
323
		if (partName.length() == 0) {
324
			partName = "-"; //$NON-NLS-1$
325
		}
326 326
		return createPart(partitionName, partName, query.getQueryString());
327 327
	}
328 328

  
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java (revision 544)
104 104
		
105 105
		// FIXME: to validate
106 106
		if(addToParent)	{
107
			parent.addResult(this);
107
			parent.addChild(this);
108 108
		}
109 109
		
110 110
		this.query = query;
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java (revision 544)
51 51
	private String shortName;
52 52

  
53 53
	/**
54
	 * Instantiates a new part.
54
	 * Instantiates a new Part.
55 55
	 *
56 56
	 * @param cqpId the cqp id
57 57
	 * @param partitionName the full complex partition name
......
60 60
	 * @param query the query
61 61
	 * @throws InvalidCqpIdException the invalid cqp id exception
62 62
	 */
63
	protected Part(String cqpId, String partitionName, String shortName,
64
			Partition partition, Query query) throws InvalidCqpIdException {
63
	protected Part(String cqpId, String partitionName, String shortName, Partition partition, Query query) throws InvalidCqpIdException {
65 64
		super(cqpId, partitionName + "_" + shortName, partition.getCorpus(), query, false); //$NON-NLS-1$
66 65
		this.shortName = shortName;
67 66
		this.name = shortName;
68 67
		this.partition = partition;
68

  
69
		// FIXME: to validate
70
		this.partition.addChild(this);
69 71
	}
70 72

  
71 73
	/**
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/StructuralUnit.java (revision 544)
28 28
package org.txm.searchengine.cqp.corpus;
29 29

  
30 30
import java.util.ArrayList;
31
import java.util.Arrays;
31 32
import java.util.Collections;
32 33
import java.util.List;
33 34

  
......
44 45
 */
45 46
public class StructuralUnit implements Comparable {
46 47

  
48
	
49
	/**
50
	 * Internal properties names.
51
	 */
52
	private static String[] INTERNAL_PROPERTIES_NAMES = new String[] {"base", "project"}; //$NON-NLS-1$ //$NON-NLS-2$
53

  
54
	
47 55
	/** The name. */
48 56
	private String name;
49 57

  
......
53 61
	/** The properties. */
54 62
	private List<StructuralUnitProperty> properties;
55 63

  
64

  
65
	
56 66
	/**
57 67
	 * Instantiates a new StrucutalUnit.
58 68
	 *
......
98 108
	}
99 109

  
100 110
	/**
111
	 * Gets the properties defined on this type of structural unit.
112
	 * Does not return the internal properties as base, project, etc.
113
	 * @return
114
	 */
115
	public List<StructuralUnitProperty> getUserDefinedProperties() {
116
		List<StructuralUnitProperty> userDefinedProperties = new ArrayList<StructuralUnitProperty>();
117
		
118
		for(int i = 0; i < this.properties.size(); i++) {
119
			StructuralUnitProperty p = this.properties.get(i);
120
			if (Arrays.asList(INTERNAL_PROPERTIES_NAMES).contains(p.getName()))	{ 
121
				continue;
122
			}
123
			userDefinedProperties.add(p);
124
		}
125
		return userDefinedProperties;
126
	}
127

  
128
	
129
	/**
130
	 * Gets the ordered properties.
131
	 * Does not return the internal properties as base, project, etc.
132
	 *
133
	 * @return the ordered properties
134
	 */
135
	public List<StructuralUnitProperty> getOrderedProperties() {
136
		List<StructuralUnitProperty> props = this.getProperties();
137
		Collections.sort(props);
138
		return props;
139
	}
140
	
141

  
142
	/**
143
	 * Gets the user defined ordered properties.
144
	 * @return
145
	 */
146
	public List<StructuralUnitProperty> getUserDefinedOrderedProperties() {
147
		List<StructuralUnitProperty> props = this.getUserDefinedProperties();
148
		Collections.sort(props);
149
		return props;
150
	}
151

  
152
	
153
	/**
101 154
	 * Gets a property from its name.
102 155
	 * 
103 156
	 * @param name
......
106 159
	 * @return the property
107 160
	 */
108 161
	public StructuralUnitProperty getProperty(String name) {
109
		for (StructuralUnitProperty property : properties)
110
			if (property.getName().equals(name))
162
		for (StructuralUnitProperty property : properties) {
163
			if (property.getName().equals(name)) {
111 164
				return property;
165
			}
166
		}
112 167
		return null;
113 168

  
114 169
	}
......
142 197
		return 0;
143 198
	}
144 199

  
145
	/**
146
	 * Gets the ordered properties.
147
	 *
148
	 * @return the ordered properties
149
	 */
150
	public List<StructuralUnitProperty> getOrderedProperties() {
151
		List<StructuralUnitProperty> props = this.getProperties();
152
		Collections.sort(props);
153
		return props;
154
	}
155 200

  
201
	
202
 
203
	
204
	
205
	
206
	
207

  
156 208
	public static List<StructuralUnit> stringToStructuralUnits(Corpus corpus, String v) {
157 209
		ArrayList<StructuralUnit> structs = new ArrayList<StructuralUnit>();
158 210
		if (v == null) return structs;
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPEngine.java (revision 544)
214 214
				corp.setSelfElement(c);
215 215
				corp.setParent(base);
216 216
				corp.load(); // don't load corpus right now, wait for the search engine to be ready
217
				base.addResult(corp);
217
				base.addChild(corp);
218 218
				if (!corp.getMetadatas().containsKey("lang")) { //$NON-NLS-1$
219 219
					corp.setAttribute("lang", c.getAttribute("lang")); //$NON-NLS-1$ //$NON-NLS-2$
220 220
				}
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java (revision 544)
400 400
//				children.addAll(sub);
401 401
//				children.addAll(results);
402 402
				
403
				ArrayList<TXMResult> children = ((TXMResult)element).getDeepResults();
403
				ArrayList<TXMResult> children = ((TXMResult)element).getDeepChildren();
404 404
				
405 405
				for(int i = 0 ; i < children.size() ; i++)
406 406
				{
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/swt/JFCComposite.java (revision 544)
284 284

  
285 285
	@Override
286 286
	public void loadChart()	{
287
		if(!this.chartEditor.getResultData().isChartDirty())	{
287
		
288
		// loads the chart from the result
289
		Object chart = this.chartEditor.getChart();
290
		
291
		//FIXME: old version
292
		//if(!this.chartEditor.getResultData().isChartDirty())	{
293
		if(chart != null)	{
288 294
			// creates components if they not exist
289 295
			if(this.chartComponent == null)	{
290 296
				
......
296 302
				this.frame.setVisible(true);
297 303
			}
298 304

  
299
			// loads the chart from the result
300
			Object chart = this.chartEditor.getChart();
301 305
			// recreates the chart if not of right type
302 306
			// FIXME: does not work? step to reproduce : create a chart with R/SVG, close the editor, select JFC/Java2d as chart engine, double click on the result 
303 307
			if(!(chart instanceof JFreeChart))	{
tmp/org.txm.ca.core/src/org/txm/ca/core/messages/CACoreMessages.java (revision 544)
24 24
	public static String charts_singularValues_tooltipSum;
25 25
	public static String charts_singularValues_tooltipYLabel;
26 26
	public static String charts_singularValues_xAxisLabel;
27
	public static String charts_singularValues_xLabelsPrefix;
28 27
	public static String charts_singularValues_yAxisLabel;
29 28
	
30 29
	public static String c1;
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java (revision 544)
71 71
	/** The coltitles. */
72 72
	String[] coltitles; // of the colinfo table
73 73

  
74
	/** The analysis property. */
75
	private Property pAnalysisProperty;
76 74
	String pattern = "(cos2|contrib) (([0-9]+\\.[0-9]+)|([0-9]+))";
77

  
78
	/** The first dim. */
79
	Integer pFirstDimension = 1;
80

  
81
	/** The second dim. */
82
	Integer pSecondDimension = 2;
83

  
75
	
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff