Révision 883

tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/SwingChartComposite.java (revision 883)
20 20

  
21 21
import org.eclipse.swt.awt.SWT_AWT;
22 22
import org.eclipse.swt.widgets.Composite;
23
import org.jfree.chart.JFreeChart;
24 23
import org.txm.chartsengine.core.results.ChartResult;
25 24
import org.txm.chartsengine.rcp.IChartComponent;
26 25
import org.txm.chartsengine.rcp.editors.ChartEditor;
tmp/org.txm.chartsengine.rcp/META-INF/MANIFEST.MF (revision 883)
1 1
Manifest-Version: 1.0
2
Require-Bundle: org.eclipse.ui;bundle-version="3.106.1";visibility:=re
3
 export,org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=r
4
 eexport,org.txm.rcp;bundle-version="0.7.8";visibility:=reexport,org.e
5
 clipse.core.resources;visibility:=reexport,org.eclipse.swt;visibility
6
 :=reexport,org.eclipse.core.expressions;bundle-version="3.4.600";visi
7
 bility:=reexport,org.eclipse.e4.ui.workbench.renderers.swt;visibility
8
 :=reexport
2
Require-Bundle: org.txm.rcp;bundle-version="0.7.8";visibility:=reexport
9 3
Export-Package: org.txm.chartsengine.rcp,org.txm.chartsengine.rcp.edit
10 4
 ors,org.txm.chartsengine.rcp.events,org.txm.chartsengine.rcp.handlers
11 5
 ,org.txm.chartsengine.rcp.messages,org.txm.chartsengine.rcp.preferenc
tmp/org.txm.statsengine.r.rcp/META-INF/MANIFEST.MF (revision 883)
1 1
Manifest-Version: 1.0
2
Require-Bundle: org.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,
3
 org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
4
 org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,
5
 org.eclipse.jface.text;bundle-version="3.9.2";visibility:=reexport,
6
 org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,
7
 org.eclipse.ui.console;bundle-version="3.5.300";visibility:=reexport,
8
 org.eclipse.ui.ide;bundle-version="3.10.2";visibility:=reexport,
9
 org.txm.index.core;bundle-version="1.0.0";visibility:=reexport,
10
 org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexport,
11
 org.txm.lexicaltable.core;bundle-version="1.0.0";visibility:=reexport,
12
 org.txm.ca.core;bundle-version="1.0.0";visibility:=reexport,
13
 org.txm.specificities.core;bundle-version="1.0.0";visibility:=reexport,
14
 org.txm.progression.core;bundle-version="1.0.0";visibility:=reexport,
15
 org.txm.ahc.core;bundle-version="1.0.0";visibility:=reexport,
16
 org.txm.cooccurrence.core;bundle-version="1.0.0";visibility:=reexport,
17
 org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport,
18
 org.txm.referencer.core;bundle-version="1.0.0";visibility:=reexport,
19
 org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport,
20
 org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
21
 org.txm.statsengine.core;bundle-version="1.0.0";visibility:=reexport,
22
 org.txm.core;bundle-version="0.7.0";visibility:=reexport,
23
 org.txm.rcp;bundle-version="0.8.0"
2
Require-Bundle: org.txm.rcp;bundle-version="0.8.0";visibility:=reexport,
3
 org.txm.statsengine.r.core;bundle-version="1.0.0";visibility:=reexport
24 4
Export-Package: org.txm.rcp.commands.R,
25 5
 org.txm.statsengine.r.rcp.decorators,
26 6
 org.txm.statsengine.r.rcp.handlers,
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RConsole.java (revision 883)
229 229
	}
230 230
	
231 231
	public void connectToRWorkspace() {
232
		if (!readyToDisplay && Toolbox.getEngineManager(EngineType.STATS).getEngine("R").getState()) {
232
		if (!readyToDisplay && Toolbox.getEngineManager(EngineType.STATS).isCurrentEngineAvailable()) {
233 233
			RWorkspace rw = null;
234 234
			Log.warning(RUIMessages.RConsole_0);
235 235
			try {
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java (revision 883)
59 59
import org.eclipse.ui.PlatformUI;
60 60
import org.eclipse.ui.part.ViewPart;
61 61
import org.txm.Toolbox;
62
import org.txm.ahc.core.functions.AHC;
63
import org.txm.ca.core.functions.CA;
64
import org.txm.concordance.core.functions.Concordance;
65
import org.txm.cooccurrence.core.functions.Cooccurrence;
66 62
import org.txm.core.results.TXMResult;
67
import org.txm.index.core.functions.Index;
68
import org.txm.index.core.functions.Lexicon;
69
import org.txm.lexicaltable.core.functions.LexicalTable;
70 63
import org.txm.objects.Base;
71
import org.txm.progression.core.functions.Progression;
72 64
import org.txm.rcp.IImageKeys;
73 65
import org.txm.rcp.commands.R.CopySelection;
74 66
import org.txm.rcp.handlers.files.EditFile;
75
import org.txm.rcp.messages.TXMUIMessages;
76
import org.txm.referencer.core.functions.Referencer;
77 67
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
78 68
import org.txm.searchengine.cqp.corpus.Corpus;
79 69
import org.txm.searchengine.cqp.corpus.CorpusManager;
80 70
import org.txm.searchengine.cqp.corpus.MainCorpus;
81 71
import org.txm.searchengine.cqp.corpus.Partition;
82
import org.txm.specificities.core.functions.Specificities;
83 72
import org.txm.statsengine.r.core.RWorkspace;
84 73
import org.txm.statsengine.r.rcp.messages.RUIMessages;
85 74
/**
......
359 348
				return IImageKeys.getImage(IImageKeys.CORPUS);
360 349
			else if (element instanceof Partition)
361 350
				return IImageKeys.getImage(IImageKeys.PARTITION);
362
//			else if (element instanceof Lexicon)
363
//				return IImageKeys.getImage(IImageKeys.ACTION_FREQUENCY_LIST);
364
//			else if (element instanceof Index)
365
//				return IImageKeys.getImage(IImageKeys.ACTION_INDEX);
366
//			else if (element instanceof Specificities)
367
//				return IImageKeys.getImage(IImageKeys.ACTION_SPECIFICITIES);
368
//			else if (element instanceof Concordance)
369
//				return IImageKeys.getImage(IImageKeys.ACTION_CONCORDANCES);
370
//			else if (element instanceof Cooccurrence)
371
//				return IImageKeys.getImage(IImageKeys.ACTION_COOCCURRENCE);
372
//			else if (element instanceof LexicalTable)
373
//				return IImageKeys.getImage(IImageKeys.LEXICALTABLE);
374
//			else if (element instanceof CA)
375
//				return IImageKeys.getImage(IImageKeys.ACTION_CORRESPONDANCE_ANALYSIS);
376
//			else if (element instanceof AHC)
377
//				return IImageKeys.getImage(IImageKeys.ACTION_CAH);
378
//			else if (element instanceof Referencer)
379
//				return IImageKeys.getImage(IImageKeys.ACTION_REFERENCER);
380
//			else if (element instanceof Progression)
381
//				return IImageKeys.getImage(IImageKeys.ACTION_PROGRESSION);
382 351
			
383 352
			return null;
384 353
		}
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/CheckRPackages.java (revision 883)
91 91
		else if (Util.isLinux()) method = "wget"; //$NON-NLS-1$
92 92
		
93 93
		boolean ret = true;
94
		if (Toolbox.getEngineManager(EngineType.STATS).getEngine("R").getState()) {
94
		if (Toolbox.getEngineManager(EngineType.STATS).isCurrentEngineAvailable()) {
95 95
			RWorkspace rw = null;
96 96
			try {
97 97
				rw = RWorkspace.getRWorkspaceInstance();
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAParametersDialog.java (revision 883)
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.ca.rcp.editors;
29

  
30
import java.util.ArrayList;
31
import java.util.List;
32

  
33
import org.eclipse.jface.dialogs.Dialog;
34
import org.eclipse.jface.dialogs.MessageDialog;
35
import org.eclipse.swt.SWT;
36
import org.eclipse.swt.layout.GridData;
37
import org.eclipse.swt.layout.GridLayout;
38
import org.eclipse.swt.widgets.Combo;
39
import org.eclipse.swt.widgets.Composite;
40
import org.eclipse.swt.widgets.Control;
41
import org.eclipse.swt.widgets.Label;
42
import org.eclipse.swt.widgets.Shell;
43
import org.eclipse.swt.widgets.Spinner;
44
import org.txm.ca.core.preferences.CAPreferences;
45
import org.txm.core.messages.TXMCoreMessages;
46
import org.txm.core.preferences.TXMPreferences;
47
import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
48
import org.txm.rcp.messages.TXMUIMessages;
49
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
50
import org.txm.searchengine.cqp.corpus.Corpus;
51
import org.txm.searchengine.cqp.corpus.Property;
52
/**
53
 * Retrieve the property analysis to be used for computing correspondence
54
 * analysis. and also the max number of entries and their minimal frequency
55
 * 
56
 * @author sjacquot
57
 * @author sloiseau
58
 * 
59
 */
60
public class CAParametersDialog extends Dialog {
61

  
62
	/** The property. */
63
	private Property property;
64
	
65
	/** The properties. */
66
	private List<Property> properties;
67
	
68
	/** The ana prop combo. */
69
	private Combo anaPropCombo;
70
	
71
	/** The fmin label. */
72
	Label fminLabel;
73
	
74
	/** The maxlines label. */
75
	Label maxlinesLabel;
76
	
77
	/** The maxlines spinner. */
78
	Spinner maxlinesSpinner;
79
	
80
	/** The fmin spinner. */
81
	Spinner fminSpinner;
82
	
83
	/** The corpus. */
84
	Corpus corpus;
85

  
86
	/** The title. */
87
	String title;
88
	
89
	/** The mess. */
90
	String mess;
91
	
92
	/** The max, default value read from CA preferences. */
93
	private int vmax = TXMPreferences.getInt(CAPreferences.V_MAX, CAPreferences.PREFERENCES_NODE);
94
	
95
	/** The fmin, default value read from CA preferences. */
96
	private int fmin = TXMPreferences.getInt(CAPreferences.F_MIN, CAPreferences.PREFERENCES_NODE);
97

  
98
	/**
99
	 * Instantiates a new compute correspondence analysis dialog.
100
	 *
101
	 * @param parentShell the parent shell
102
	 * @param corpus the corpus
103
	 */
104
	public CAParametersDialog(Shell parentShell, Corpus corpus, String title) {
105
		super(parentShell);
106
		try {
107
			this.corpus = corpus;
108
			this.title = title;
109
			this.properties = new ArrayList<Property>(corpus.getOrderedProperties());
110
		} catch (CqiClientException e) {
111
			org.txm.rcp.utils.Logger.printStackTrace(e);
112
		}
113
	}
114

  
115
	/**
116
	 * Instantiates a new compute correspondence analysis dialog.
117
	 *
118
	 * @param parentShell the parent shell
119
	 * @param corpus the corpus
120
	 * @param title the title
121
	 * @param mess the mess
122
	 */
123
	public CAParametersDialog(Shell parentShell,
124
			Corpus corpus, String title, String mess) {
125
		super(parentShell);
126
		this.corpus = corpus;
127
		this.title = title;
128
		this.mess = mess;
129
		try {
130
			this.properties = new ArrayList<Property>(corpus.getOrderedProperties());
131
		} catch (CqiClientException e) {
132
			org.txm.rcp.utils.Logger.printStackTrace(e);
133
		}
134
	}
135

  
136
	/* (non-Javadoc)
137
	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
138
	 */
139
	@Override
140
	protected void configureShell(Shell newShell) {
141
		super.configureShell(newShell);
142
		newShell.setText(LexicalTableUIMessages.LexicalTablePreferencePage_0);
143
		if (title != null)
144
			newShell.setText(title);
145
	}
146

  
147
	/* (non-Javadoc)
148
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
149
	 */
150
	@Override
151
	protected Control createDialogArea(Composite parent) {
152
		Composite composite = new Composite(parent, SWT.NONE);
153
		GridLayout layout = new GridLayout(2, false);
154
		composite.setLayout(layout);
155

  
156
		Label anaPropLabel = new Label(composite, SWT.NONE);
157
		if (mess != null) {
158
			anaPropLabel.setText(mess);
159
		}
160
		else {
161
			anaPropLabel.setText(TXMCoreMessages.common_properties);
162
		}
163
		anaPropLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER,
164
				false, false));
165

  
166
		anaPropCombo = new Combo(composite, SWT.READ_ONLY);
167
		anaPropCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
168
				true, false));
169
		int iword= 0;
170
		int i = 0;
171
		for (Property p : properties) {
172
			anaPropCombo.add(p.getName());
173
			if (p.getName().equals(TXMPreferences.DEFAULT_UNIT_PROPERTY)) {
174
				iword=i;
175
			}
176
			i++;
177
		}
178
		anaPropCombo.select(iword);
179

  
180
		maxlinesLabel = new Label(composite, SWT.NONE);
181
		maxlinesLabel.setText(TXMUIMessages.NumberOfLines);
182
		maxlinesLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false));
183
		maxlinesSpinner = new Spinner(composite, SWT.BORDER);
184
		maxlinesSpinner.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
185
		maxlinesSpinner.setMaximum(9999999);
186
		maxlinesSpinner.setMinimum(1);
187
		maxlinesSpinner.setSelection(9999999);
188
		maxlinesSpinner.setSelection(vmax);
189
		
190
		fminLabel = new Label(composite, SWT.NONE);
191
		fminLabel.setText(TXMCoreMessages.common_fMin);
192
		fminLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false));
193
		fminSpinner = new Spinner(composite, SWT.BORDER);
194
		fminSpinner.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
195
		fminSpinner.setMaximum(9999999);
196
		fminSpinner.setMinimum(1);
197
		fminSpinner.setSelection(fmin);
198

  
199
		return composite;
200
	}
201

  
202
	/* (non-Javadoc)
203
	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
204
	 */
205
	@Override
206
	protected void okPressed() {
207
		int propIndex = anaPropCombo.getSelectionIndex();
208
		if (propIndex == -1) {
209
			MessageDialog.openError(getShell(),
210
					TXMUIMessages.Invalid_analysis_property,
211
					TXMUIMessages.Structure_field_not_empty);
212
			return;
213
		}
214
		property = properties.get(propIndex);
215

  
216
		vmax = maxlinesSpinner.getSelection();
217
		fmin = fminSpinner.getSelection();
218
		super.okPressed();
219
	}
220

  
221
	/**
222
	 * Gets the property.
223
	 *
224
	 * @return the property
225
	 */
226
	public Property getProperty() {
227
		return property;
228
	}
229

  
230
	/**
231
	 * Gets the fmin.
232
	 *
233
	 * @return the fmin
234
	 */
235
	public int getFmin() {
236
		return fmin;
237
	}
238

  
239
	/**
240
	 * Gets the max lines.
241
	 *
242
	 * @return the max lines
243
	 */
244
	public int getMaxLines() {
245
		return vmax;
246
	}
247
	
248
	public void setFminAndVMax(int fmin, int vmax) {
249
		this.fmin = fmin;
250
		this.vmax = vmax;
251
	}
252
}
0 253

  
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCA.java (revision 883)
37 37
import org.eclipse.ui.handlers.HandlerUtil;
38 38
import org.txm.ca.core.functions.CA;
39 39
import org.txm.ca.rcp.editors.CAEditor;
40
import org.txm.ca.rcp.editors.CAParametersDialog;
40 41
import org.txm.ca.rcp.messages.CAUIMessages;
41 42
import org.txm.core.messages.TXMCoreMessages;
42 43
import org.txm.lexicaltable.core.functions.LexicalTable;
43
import org.txm.lexicaltable.rcp.editors.LexicalTableDialog;
44 44
import org.txm.rcp.StatusLine;
45 45
import org.txm.rcp.TXMWindows;
46 46
import org.txm.rcp.editors.TXMResultEditorInput;
......
90 90
				}
91 91
				// ask property and Fmins and Vmax
92 92
				String title = TXMUIMessages.bind(CAUIMessages.ComputeCorrespondanceAnalysisDialog_0, partition.getName());
93
				LexicalTableDialog d = new LexicalTableDialog(window.getShell(), partition.getCorpus(), title);
93
				CAParametersDialog d = new CAParametersDialog(window.getShell(), partition.getCorpus(), title);
94 94

  
95 95
				if (d.open() == MessageDialog.OK) {
96 96
					Property property = d.getProperty();
......
130 130
				ca = (CA) selection;
131 131
			}
132 132
			else {
133
				throw new Throwable();
133
				Log.severe("Error: cannot compute a CA with current selection: " + selection);
134
				return null;
134 135
			}
135 136
			// compute the CA
136 137
			ca.compute();
137 138

  
138
			System.out.println(CAUIMessages.ComputeCorrespondanceAnalysis_8);
139
			try {
139 140

  
140
			TXMResultEditorInput editorInput = new TXMResultEditorInput(ca);
141
			IWorkbenchPage page = TXMWindows.getActivePage();
142
			StatusLine.setMessage(CAUIMessages.ComputeCorrespondanceAnalysis_14);
143
			IEditorPart editor = page.openEditor(editorInput, CAEditor.class.getName());
141
				System.out.println(CAUIMessages.ComputeCorrespondanceAnalysis_8);
144 142

  
143
				TXMResultEditorInput editorInput = new TXMResultEditorInput(ca);
144
				IWorkbenchPage page = TXMWindows.getActivePage();
145
				StatusLine.setMessage(CAUIMessages.ComputeCorrespondanceAnalysis_14);
146
				IEditorPart editor = page.openEditor(editorInput, CAEditor.class.getName());
147
				
148

  
149
				
150
			}
151
			catch (Throwable e) {
152
				System.out.println("Error while opening CAEditor with " + ca);
153
				Log.printStackTrace(e);
154
			}
155

  
145 156
		}
146 157
		catch (Throwable e) {
158
			Log.severe("Error while computing CA with " + selection);
147 159
			Log.printStackTrace(e);
148
			return super.logCanNotCompute(selection);
149 160
		}
150 161
		return null;
151 162
	}
tmp/org.txm.ca.rcp/.classpath (revision 883)
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<classpath>
3 3
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
4
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
4
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
5
		<accessrules>
6
			<accessrule kind="accessible" pattern="**"/>
7
		</accessrules>
8
	</classpathentry>
5 9
	<classpathentry kind="src" path="src"/>
6 10
	<classpathentry kind="output" path="bin"/>
7 11
</classpath>
tmp/org.txm.ca.rcp/META-INF/MANIFEST.MF (revision 883)
2 2
Export-Package: org.txm.ca.rcp.adapters,org.txm.ca.rcp.chartsengine.ev
3 3
 ents,org.txm.ca.rcp.editors,org.txm.ca.rcp.handlers,org.txm.ca.rcp.me
4 4
 ssages,org.txm.ca.rcp.preferences
5
Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
6
 ort,org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,org
7
 .eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,or
8
 g.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,org.txm.se
9
 archengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,org.t
10
 xm.lexicaltable.core;bundle-version="1.0.0";visibility:=reexport,org.
11
 txm.lexicaltable.rcp;bundle-version="1.0.0";visibility:=reexport,org.
12
 txm.ca.core;bundle-version="1.0.0";visibility:=reexport,org.txm.chart
13
 sengine.rcp;visibility:=reexport,org.txm.core;bundle-version="0.7.0";
14
 visibility:=reexport,org.txm.rcp;visibility:=reexport,org.eclipse.cor
15
 e.expressions;bundle-version="3.4.600";visibility:=reexport,org.txm.s
16
 tatsengine.core;bundle-version="1.0.0";visibility:=reexport
5
Require-Bundle: org.txm.lexicaltable.rcp;bundle-version="1.0.0";visibility:=reexport,
6
 org.txm.chartsengine.rcp;visibility:=reexport,
7
 org.txm.ca.core;bundle-version="1.0.0";visibility:=reexport
17 8
Bundle-Vendor: Textometrie.org
18 9
Bundle-ActivationPolicy: lazy
19 10
Bundle-Version: 1.0.0.qualifier

Formats disponibles : Unified diff