Révision 863

tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/handlers/ComputeProgression.java (revision 863)
40 40

  
41 41
/**
42 42
 * Opens a Progression editor.
43
 * Computes the result if it contains all required parameters.
43 44
 * 
44 45
 * @author mdecorde
45 46
 * @author sjacquot
47
 * 
46 48
 */
47 49
public class ComputeProgression extends BaseAbstractHandler {
48 50
	
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/ComputeConcordance.java (revision 863)
40 40

  
41 41
/**
42 42
 * Opens a Concordance editor.
43
 * Computes the result according to its parameters.
43
 * Computes the result if it contains all required parameters.
44 44
 * 
45 45
 * @author mdecorde
46 46
 * @author sjacquot
tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/handlers/ComputeInternalView.java (revision 863)
10 10
import org.txm.searchengine.cqp.corpus.Corpus;
11 11

  
12 12
/**
13
 * Computes an internal view and opens an editor.
13
 * Opens an internal view editor.
14
 * Computes the result if it contains all required parameters.
14 15
 * 
15 16
 * @author mdecorde
16 17
 * @author sjacquot
17
 *
18
 * 
18 19
 */
19 20
public class ComputeInternalView extends BaseAbstractHandler {
20 21

  
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/ComputeCooccurrences.java (revision 863)
37 37
import org.txm.cooccurrence.core.preferences.CooccurrencePreferences;
38 38
import org.txm.cooccurrence.rcp.editors.CooccurrencesEditor;
39 39
import org.txm.core.preferences.TXMPreferences;
40
import org.txm.progression.core.functions.Progression;
41 40
import org.txm.rcp.StatusLine;
42 41
import org.txm.rcp.editors.TXMEditor;
43 42
import org.txm.rcp.handlers.BaseAbstractHandler;
44 43
import org.txm.rcp.messages.TXMUIMessages;
45 44
import org.txm.searchengine.cqp.corpus.Corpus;
46
import org.txm.searchengine.cqp.corpus.Property;
47 45
import org.txm.searchengine.cqp.corpus.StructuralUnit;
48 46
import org.txm.searchengine.cqp.corpus.WordProperty;
49 47
import org.txm.searchengine.cqp.corpus.query.Query;
50 48
import org.txm.utils.logger.Log;
51 49

  
52 50
/**
53
 * If the selection is a corpus, opens an empty Cooc editor, if the selection is
54
 * a concordance, opens a Cooc editor already computed.
51
 * Opens a Cooccurrence editor.
52
 * Computes the result if it contains all required parameters.
55 53
 * 
56 54
 * @author mdecorde
55
 * @author sjacquot
57 56
 * 
58 57
 */
59 58
public class ComputeCooccurrences extends BaseAbstractHandler {
tmp/org.txm.ahc.rcp/src/org/txm/ahc/rcp/handlers/ComputeAHC.java (revision 863)
29 29

  
30 30
import org.eclipse.core.commands.ExecutionEvent;
31 31
import org.eclipse.core.commands.ExecutionException;
32
import org.eclipse.jface.dialogs.Dialog;
33 32
import org.eclipse.jface.window.Window;
34
import org.eclipse.swt.SWT;
35
import org.eclipse.swt.layout.GridLayout;
36
import org.eclipse.swt.widgets.Button;
37
import org.eclipse.swt.widgets.Composite;
38
import org.eclipse.swt.widgets.Control;
39 33
import org.eclipse.swt.widgets.Display;
40
import org.eclipse.swt.widgets.Label;
41 34
import org.eclipse.swt.widgets.Shell;
42
import org.eclipse.swt.widgets.Spinner;
43
import org.txm.ca.core.functions.CA;
44
import org.txm.ca.core.preferences.CAPreferences;
45 35
import org.txm.ahc.core.functions.AHC;
46
import org.txm.ahc.core.messages.AHCCoreMessages;
47
import org.txm.ahc.core.preferences.AHCPreferences;
48 36
import org.txm.ahc.rcp.messages.AHCUIMessages;
37
import org.txm.ca.core.functions.CA;
38
import org.txm.ca.core.preferences.CAPreferences;
49 39
import org.txm.chartsengine.rcp.editors.ChartEditor;
50 40
import org.txm.core.preferences.TXMPreferences;
51 41
import org.txm.lexicaltable.core.functions.LexicalTable;
52 42
import org.txm.lexicaltable.rcp.editors.LexicalTableDialog;
53 43
import org.txm.rcp.handlers.BaseAbstractHandler;
54
import org.txm.rcp.views.corpora.CorporaView;
55 44
import org.txm.searchengine.cqp.corpus.Partition;
56 45
import org.txm.searchengine.cqp.corpus.Property;
57 46
import org.txm.statsengine.core.StatException;
58 47
import org.txm.utils.logger.Log;
59 48

  
60 49
/**
61
 * If the selection is a CA or a Lexical Table result computes the CAH.
62
 *
50
 * Opens a Cooccurrence editor.
51
 * Computes the result if it contains all required parameters.
52
 * 
63 53
 * @author mdecorde
64 54
 * @author sjacquot
55
 * 
65 56
 */
66 57
public class ComputeAHC extends BaseAbstractHandler {
67 58

  
68 59

  
69
	// adds a double click listener to the Corpus View
70
//	static	{
71
//		CorporaView.addDoubleClickListener(AHC.class, ComputeAHC.class);
72
//	}
73
	
74

  
75
	/* (non-Javadoc)
76
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
77
	 */
78 60
	@Override
79 61
	public Object execute(ExecutionEvent event) throws ExecutionException {
80 62

  
......
140 122
		}
141 123

  
142 124
		ChartEditor.openEditor(ahc);
143

  
144

  
145 125
		return null;
146 126
	}
147 127

  
148 128

  
149

  
150

  
151
	/**
152
	 * The Class CAHParamDialog.
153
	 */
154
	// FIXME: not used?
155
	public class CAHParamDialog extends Dialog {
156

  
157
		//protected Combo methodsCombo;
158
		//protected Combo metricsCombo;
159
		/** The ncluster spinner. */
160
		protected Spinner nclusterSpinner;
161

  
162
		/** The docolumns button. */
163
		protected Button docolumnsButton;
164

  
165
		/** The title. */
166
		protected String title;
167

  
168
		/**
169
		 * Instantiates a new cAH param dialog.
170
		 *
171
		 * @param parentShell the parent shell
172
		 */
173
		public CAHParamDialog(Shell parentShell) {
174
			super(parentShell);
175
			this.title = AHCCoreMessages.RESULT_TYPE;
176
		}
177

  
178
		/* (non-Javadoc)
179
		 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
180
		 */
181
		@Override
182
		protected void configureShell(Shell newShell) {
183
			super.configureShell(newShell);
184

  
185
			if (title != null)
186
				newShell.setText(title);
187
			else
188
				newShell.setText(AHCCoreMessages.RESULT_TYPE);
189
		}
190

  
191
		/** The composite. */
192
		protected Composite composite;
193

  
194
		/** The method. */
195
		private String method;
196

  
197
		/** The metric. */
198
		private String metric;
199

  
200
		/** The Ncluster. */
201
		private int Ncluster;
202

  
203
		/** The doculumns. */
204
		private boolean doculumns;
205

  
206
		/* (non-Javadoc)
207
		 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
208
		 */
209
		@Override
210
		protected Control createDialogArea(Composite parent) {
211
			composite = new Composite(parent, SWT.NONE);
212
			GridLayout layout = new GridLayout(2, false);
213
			composite.setLayout(layout);
214

  
215
			// N CLUSTERS
216
			Label label = new Label(composite, SWT.NONE);
217
			label.setText(AHCUIMessages.CAHPreferencePage_2);
218

  
219
			nclusterSpinner = new Spinner(composite, SWT.BORDER);
220
			nclusterSpinner.setMinimum(2);
221
			nclusterSpinner.setIncrement(1);
222
			nclusterSpinner.setSelection(TXMPreferences.getInt(AHCPreferences.N_CLUSTERS, AHCPreferences.PREFERENCES_NODE));
223
			nclusterSpinner.setMaximum(50);
224

  
225
			// ROWS OR COLS
226
			docolumnsButton = new Button(composite, SWT.RADIO);
227
			docolumnsButton.setText(AHCUIMessages.COMPUTE_COLUMNS);
228
			docolumnsButton.setSelection(true);
229

  
230
			Button dorowsButton = new Button(composite, SWT.RADIO);
231
			dorowsButton.setText(AHCUIMessages.COMPUTE_ROWS);
232

  
233
			/*
234
			// METHODS
235
			Label methodLabel = new Label(composite, SWT.NONE);
236
			methodLabel.setText("Methods");
237

  
238
			methodLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER,
239
					false, false));
240

  
241
			methodsCombo = new Combo(composite, SWT.READ_ONLY);
242
			methodsCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
243
					true, false));
244
			methodsCombo.select(methodsCombo.indexOf(CAH.getDefaultMethod()));
245
			for(String method : CAH.getMethods())
246
				methodsCombo.add(method);
247

  
248
			// METRICS
249
			Label metricsLabel = new Label(composite, SWT.NONE);
250
			metricsLabel.setText("Methods");
251

  
252
			metricsLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER,
253
					false, false));
254

  
255
			metricsCombo = new Combo(composite, SWT.READ_ONLY);
256
			metricsCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
257
					true, false));
258
			metricsCombo.select(metricsCombo.indexOf(CAH.getDefaultMetric()));
259
			for(String method : CAH.getMetrics())
260
				metricsCombo.add(method);
261
				*/
262

  
263
			return composite;
264
		}
265

  
266
		/* (non-Javadoc)
267
		 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
268
		 */
269
		@Override
270
		protected void okPressed() {
271
			/*int idx = methodsCombo.getSelectionIndex();
272
			method = methodsCombo.getItem(idx);
273

  
274
			idx = metricsCombo.getSelectionIndex();
275
			metric = metricsCombo.getItem(idx);
276
*/
277
			Ncluster = this.nclusterSpinner.getSelection();
278

  
279
			doculumns = this.docolumnsButton.getSelection();
280

  
281
			super.okPressed();
282
		}
283

  
284
		/**
285
		 * Gets the method.
286
		 *
287
		 * @return the method
288
		 */
289
		public String getMethod() {
290
			return method;
291
		}
292

  
293
		/**
294
		 * Gets the metric.
295
		 *
296
		 * @return the metric
297
		 */
298
		public String getMetric() {
299
			return metric;
300
		}
301

  
302
		/**
303
		 * Gets the ncluster.
304
		 *
305
		 * @return the ncluster
306
		 */
307
		public int getNcluster() {
308
			return Ncluster;
309
		}
310

  
311
		/**
312
		 * Checks if is doculumns.
313
		 *
314
		 * @return true, if is doculumns
315
		 */
316
		public boolean isDoculumns() {
317
			return doculumns;
318
		}
319
	}
320

  
321

  
322 129
}
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCA.java (revision 863)
52 52
import org.txm.utils.logger.MessageBox;
53 53

  
54 54
/**
55
 * If the selection is a lexical table: opens the CA,
56
 * if the selection is a partition: asks the user which property used and which threshold used then opens an editor
55
 * Opens a CA editor.
56
 * Computes the result if it contains all required parameters.
57 57
 * 
58 58
 * @author mdecorde
59 59
 * @author sjacquot
60
 * 
60 61
 */
61 62
public class ComputeCA extends BaseAbstractHandler {
62 63

  
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/handlers/ComputeSpecifictiesSelectionChart.java (revision 863)
13 13
import org.txm.specificities.core.functions.SpecificitiesSelection;
14 14
import org.txm.specificities.rcp.editors.SpecificitiesEditor;
15 15

  
16

  
17

  
16 18
/**
17 19
 * Computes a specificities chart from a selection of lines of a specificities result table.
18 20
 * 
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java (revision 863)
56 56
import org.txm.utils.logger.Log;
57 57

  
58 58
/**
59
 * if the selection is a Partition : creates a lexical table already filled if
60
 * the selection is a index : creates a lexical table with the Index
61
 * entries @ author mdecorde.
59
 * Opens a lexical table editor.
60
 * Computes the result if it contains all required parameters.
61
 * 
62
 * @author mdecorde
63
 * @author sjacquot
64
 * 
62 65
 */
63 66
public class ComputeLexicalTable extends BaseAbstractHandler {
64 67

  
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java (revision 863)
38 38
import org.txm.searchengine.cqp.corpus.Partition;
39 39

  
40 40
/**
41
 * Computes an index and opens an editor.
41
 * Opens a Index editor.
42
 * Computes the result if it contains all required parameters.
42 43
 * 
43 44
 * @author mdecorde
44 45
 * @author sjacquot
46
 * 
45 47
 */
46 48
public class ComputeIndex extends BaseAbstractHandler {
47 49

  
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeLexicon.java (revision 863)
13 13
import org.txm.searchengine.cqp.corpus.Corpus;
14 14
import org.txm.searchengine.cqp.corpus.query.Query;
15 15

  
16

  
16 17
/**
17
 * Computes a Lexicon, uses it to create an Index (object), then opens it in the DictionnaryEditor.
18
 * Opens a Lexicon editor.
19
 * Computes the result if it contains all required parameters.
18 20
 * 
19 21
 * @author mdecorde
20 22
 * @author sjacquot
23
 * 
21 24
 */
22 25
public class ComputeLexicon extends BaseAbstractHandler {
23 26
	

Formats disponibles : Unified diff