Révision 1170
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/Eigenvalues.java (revision 1170) | ||
---|---|---|
72 | 72 |
// nothing to do |
73 | 73 |
} |
74 | 74 |
|
75 |
/* (non-Javadoc) |
|
76 |
* @see org.txm.core.results.TXMResult#canCompute() |
|
77 |
*/ |
|
78 | 75 |
@Override |
79 | 76 |
public boolean canCompute() throws Exception { |
80 |
return this.parent != null; |
|
77 |
return this.parent != null && this.parent.hasBeenComputedOnce();
|
|
81 | 78 |
} |
82 | 79 |
|
83 | 80 |
@Override |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java (revision 1170) | ||
---|---|---|
732 | 732 |
throw new RWorkspaceException(e); |
733 | 733 |
} |
734 | 734 |
try { |
735 |
connection .voidEval(variableName |
|
736 |
+ "<- matrix(" + variableName + ", nrow=" + nrow + ", ncol=" + ncol + ", byrow=T)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
|
735 |
String command = variableName + "<- matrix(" + variableName + ", nrow=" + nrow + ", ncol=" + ncol + ", byrow=T)"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
|
736 |
|
|
737 |
Log.finest("MATRIX_ADDED_TO_WORKSPACE: " + command); //$NON-NLS-1$ |
|
738 |
|
|
739 |
connection.voidEval(command); |
|
737 | 740 |
} catch (RserveException e) { |
738 | 741 |
throw new RWorkspaceException(e); |
739 | 742 |
} |
... | ... | |
863 | 866 |
* @param colNames the col names |
864 | 867 |
* @throws RWorkspaceException the r workspace exception |
865 | 868 |
*/ |
866 |
public void assignColNamesToMatrix(String matrix, String colNames) |
|
867 |
throws RWorkspaceException { |
|
869 |
public void assignColNamesToMatrix(String matrix, String colNames) throws RWorkspaceException { |
|
868 | 870 |
voidEval("colnames(" + matrix + ") <- " + colNames); //$NON-NLS-1$ //$NON-NLS-2$ |
869 | 871 |
} |
870 | 872 |
|
tmp/org.txm.statsengine.core/src/org/txm/statsengine/core/utils/VectorizeArray.java (revision 1170) | ||
---|---|---|
127 | 127 |
if (inner_length != matrix[i].length) { |
128 | 128 |
throw new IllegalArgumentException(StatsEngineCoreMessages.VectorizeArray_7); |
129 | 129 |
} |
130 |
System.arraycopy(matrix[i], 0, vector, i * inner_length, |
|
131 |
inner_length); |
|
130 |
System.arraycopy(matrix[i], 0, vector, i * inner_length, inner_length); |
|
132 | 131 |
} |
133 | 132 |
return vector; |
134 | 133 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/listeners/ComputeSelectionListener.java (revision 1170) | ||
---|---|---|
27 | 27 |
@Override |
28 | 28 |
public void widgetSelected(SelectionEvent e) { |
29 | 29 |
// this method is called on a Spinner even when a key is pressed, that's not what we want, so this test breaks the behavior |
30 |
if(!(e.getSource() instanceof Spinner) || e.stateMask != 0) {
|
|
30 |
if(RCPPreferences.getInstance().getBoolean(RCPPreferences.AUTO_UPDATE_EDITOR) && (!(e.getSource() instanceof Spinner) || e.stateMask != 0)) {
|
|
31 | 31 |
this.editor.compute(true); |
32 | 32 |
} |
33 | 33 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/ThresholdsGroup.java (revision 1170) | ||
---|---|---|
68 | 68 |
* @param parent |
69 | 69 |
* @param style |
70 | 70 |
* @param editor |
71 |
* @param autoCompute |
|
71 | 72 |
*/ |
72 | 73 |
public ThresholdsGroup(Composite parent, int style, TXMEditor editor, boolean autoCompute) { |
74 |
this(parent, style, editor, autoCompute, true); |
|
75 |
} |
|
76 |
|
|
77 |
/** |
|
78 |
* |
|
79 |
* @param parent |
|
80 |
* @param style |
|
81 |
* @param editor |
|
82 |
*/ |
|
83 |
public ThresholdsGroup(Composite parent, int style, TXMEditor editor, boolean autoCompute, boolean displayFMax) { |
|
73 | 84 |
super(parent, style); |
74 | 85 |
|
75 | 86 |
//this.setLayout(new RowLayout()); |
... | ... | |
80 | 91 |
ComputeKeyListener computeKeyListener = new ComputeKeyListener(editor); |
81 | 92 |
|
82 | 93 |
GridLayout gridLayout = new GridLayout(); |
83 |
gridLayout.numColumns = 6; |
|
94 |
|
|
95 |
if(displayFMax) { |
|
96 |
gridLayout.numColumns = 6; |
|
97 |
} |
|
98 |
else { |
|
99 |
gridLayout.numColumns = 4; |
|
100 |
} |
|
101 |
|
|
84 | 102 |
gridLayout.makeColumnsEqualWidth = false; |
85 | 103 |
this.setLayout(gridLayout); |
86 | 104 |
|
... | ... | |
100 | 118 |
fMinSpinner.setLayoutData(fieldsGridData); |
101 | 119 |
|
102 | 120 |
// Fmax |
103 |
Label lFmax = new Label(this, SWT.NONE); |
|
104 |
lFmax.setText(TXMCoreMessages.common_fMax); |
|
105 |
lFmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); |
|
106 |
|
|
107 |
fMaxSpinner = new Spinner(this, SWT.BORDER); |
|
108 |
fMaxSpinner.setMinimum(0); |
|
109 |
fMaxSpinner.setMaximum(9999999); |
|
110 |
fMaxSpinner.setIncrement(1); |
|
111 |
fMaxSpinner.setPageIncrement(100); |
|
112 |
fMaxSpinner.setLayoutData(fieldsGridData); |
|
113 |
|
|
121 |
if(displayFMax) { |
|
122 |
Label lFmax = new Label(this, SWT.NONE); |
|
123 |
lFmax.setText(TXMCoreMessages.common_fMax); |
|
124 |
lFmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); |
|
125 |
|
|
126 |
fMaxSpinner = new Spinner(this, SWT.BORDER); |
|
127 |
fMaxSpinner.setMinimum(0); |
|
128 |
fMaxSpinner.setMaximum(9999999); |
|
129 |
fMaxSpinner.setIncrement(1); |
|
130 |
fMaxSpinner.setPageIncrement(100); |
|
131 |
fMaxSpinner.setLayoutData(fieldsGridData); |
|
132 |
} |
|
133 |
|
|
114 | 134 |
// Vmax |
115 | 135 |
Label lVmax = new Label(this, SWT.NONE); |
116 | 136 |
lVmax.setText(TXMCoreMessages.VMAX_1); |
... | ... | |
126 | 146 |
if(autoCompute) { |
127 | 147 |
fMinSpinner.addKeyListener(computeKeyListener); |
128 | 148 |
fMinSpinner.addSelectionListener(computeSelectionListener); |
129 |
fMaxSpinner.addKeyListener(computeKeyListener); |
|
130 |
fMaxSpinner.addSelectionListener(computeSelectionListener); |
|
149 |
|
|
150 |
if(displayFMax) { |
|
151 |
fMaxSpinner.addKeyListener(computeKeyListener); |
|
152 |
fMaxSpinner.addSelectionListener(computeSelectionListener); |
|
153 |
} |
|
154 |
|
|
131 | 155 |
vMaxSpinner.addKeyListener(computeKeyListener); |
132 | 156 |
vMaxSpinner.addSelectionListener(computeSelectionListener); |
133 | 157 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/ComputeTXMResult.java (revision 1170) | ||
---|---|---|
6 | 6 |
import org.eclipse.ui.IWorkbenchPart; |
7 | 7 |
import org.eclipse.ui.handlers.HandlerUtil; |
8 | 8 |
import org.txm.rcp.editors.TXMEditor; |
9 |
import org.txm.rcp.editors.TXMMultiPageEditor; |
|
9 | 10 |
|
10 | 11 |
/** |
11 | 12 |
* Calls TXMEditor.ompute() on the current active editor. |
... | ... | |
19 | 20 |
@Override |
20 | 21 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
21 | 22 |
IWorkbenchPart part = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart(); |
23 |
|
|
24 |
// gets the main editor if the active editor is a multipages editor |
|
25 |
if(part instanceof TXMMultiPageEditor) { |
|
26 |
part = (IWorkbenchPart) ((TXMMultiPageEditor)part).getEditors().get(0); |
|
27 |
} |
|
28 |
|
|
22 | 29 |
if (!(part instanceof TXMEditor)) { |
23 | 30 |
System.out.println("Active editor is not a TXMEditor. Aborting."); |
24 | 31 |
return null; |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages_fr.properties (revision 1170) | ||
---|---|---|
266 | 266 |
ExecuteGroovyScript_1 = Erreur lors de l'initialisation des paramètres |
267 | 267 |
ExecuteGroovyScript_2 = L'utilisateur a intérompu l'exécution du script |
268 | 268 |
|
269 |
ExecuteRScript_11 = Exécution de {0} |
|
270 |
ExecuteRScript_12 = Terminé : |
|
271 |
ExecuteRScript_13 = \ ms |
|
272 |
|
|
269 | 273 |
ExecuteScriptImport_0 = Début de l'importation |
270 | 274 |
ExecuteScriptImport_1 = ** Le fichier de script {0} n''existe pas |
271 | 275 |
ExecuteScriptImport_2 = ** Erreur: le dossier 'corpora' n'existe pas : |
... | ... | |
274 | 278 |
ExecuteScriptImport_6 = L'import n'a pas abouti. |
275 | 279 |
ExecuteScriptImport_7 = Importation terminée : |
276 | 280 |
ExecuteScriptImport_8 = ** Erreur lors du chargement du corpus |
277 |
|
|
278 |
ExecuteScript_0 = Exécution de {0} ... |
|
279 |
ExecuteScript_1 = Sauver le fichier avant d'exécuter ? |
|
280 |
ExecuteScript_2 = Sauver et lancer |
|
281 |
ExecuteScript_3 = ** Aucun interpréteur trouvé pour l'extension du fichier de script |
|
282 |
ExecuteScript_4 = Annuler |
|
283 |
ExecuteScript_5 = Ne pas sauver et lancer |
|
284 |
ExecuteScript_6 = Toujours sauvegarder avant de lancer |
|
285 |
ExecuteScript_7 = Exécution annulée. |
|
286 |
ExecuteRScript_11 = Exécution de {0} |
|
287 |
ExecuteRScript_12 = Terminé : |
|
288 |
ExecuteRScript_13 = \\ ms |
|
289 | 281 |
|
282 |
ExecuteScript_0 = Exécution de {0} ... |
|
283 |
ExecuteScript_1 = Sauver le fichier avant d'exécuter ? |
|
284 |
ExecuteScript_2 = Sauver et lancer |
|
285 |
ExecuteScript_3 = ** Aucun interpréteur trouvé pour l'extension du fichier de script |
|
286 |
ExecuteScript_4 = Annuler |
|
287 |
ExecuteScript_5 = Ne pas sauver et lancer |
|
288 |
ExecuteScript_6 = Toujours sauvegarder avant de lancer |
|
289 |
ExecuteScript_7 = Exécution annulée. |
|
290 |
|
|
290 | 291 |
Exit_Menu_Label = Quitter |
291 | 292 |
|
292 | 293 |
Explorer_0 = Le dossier {0} ne devrait pas être supprimé |
... | ... | |
620 | 621 |
|
621 | 622 |
UIParameterException_0 = Erreur |
622 | 623 |
|
623 |
UserPreferencePage_1 = |
|
624 |
UserPreferencePage_1 = Recalcul automatique lors du changement d'un paramètre
|
|
624 | 625 |
UserPreferencePage_3 = Pas de confirmation pour supprimer un objet |
625 | 626 |
|
626 | 627 |
common_areYouSure = Sûr(e) ? |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages.properties (revision 1170) | ||
---|---|---|
302 | 302 |
ExecuteLastGroovyScript_1 = Executing last script: |
303 | 303 |
ExecuteLastGroovyScript_3 = Error: Current Groovy script directory does not exist: |
304 | 304 |
|
305 |
ExecuteRScript_11 = Running {0} |
|
306 |
ExecuteRScript_12 = Done: |
|
307 |
ExecuteRScript_13 = \ ms |
|
308 |
|
|
305 | 309 |
ExecuteScriptImport_0 = Import started |
306 | 310 |
ExecuteScriptImport_1 = ** {0} script file doesn''t exist |
307 | 311 |
ExecuteScriptImport_2 = ** Error: 'corpora' directory doesn't exist: |
... | ... | |
310 | 314 |
ExecuteScriptImport_6 = The import process failed. |
311 | 315 |
ExecuteScriptImport_7 = Import done: |
312 | 316 |
ExecuteScriptImport_8 = ** Error while loading corpus |
313 |
ExecuteRScript_11 = Running {0} |
|
314 |
ExecuteRScript_12 = Done: |
|
315 |
ExecuteRScript_13 = \ ms |
|
316 | 317 |
|
317 | 318 |
ExecuteScript_0 = Execution of {0} |
318 | 319 |
ExecuteScript_1 = Save file before execution ? |
... | ... | |
681 | 682 |
|
682 | 683 |
UIParameterException_0 = Error |
683 | 684 |
|
684 |
UserPreferencePage_1 = Recompute automatically
|
|
685 |
UserPreferencePage_1 = Automatic recomputing when changing a parameter
|
|
685 | 686 |
UserPreferencePage_3 = Do not confirm to delete an object |
686 | 687 |
|
687 | 688 |
common_areYouSure = Are you sure ? |
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCA.java (revision 1170) | ||
---|---|---|
31 | 31 |
import org.eclipse.core.commands.ExecutionException; |
32 | 32 |
import org.eclipse.jface.dialogs.MessageDialog; |
33 | 33 |
import org.eclipse.osgi.util.NLS; |
34 |
import org.eclipse.swt.widgets.Display; |
|
34 | 35 |
import org.eclipse.ui.IEditorPart; |
35 | 36 |
import org.eclipse.ui.IWorkbenchPage; |
36 | 37 |
import org.eclipse.ui.IWorkbenchWindow; |
... | ... | |
77 | 78 |
System.out.println(CAUIMessages.ComputeCorrespondanceAnalysis_15); |
78 | 79 |
CA ca = null; |
79 | 80 |
|
80 |
// Creates from Partition -> need a LexicalTable
|
|
81 |
// Creating from Partition
|
|
81 | 82 |
if (selection instanceof Partition) { |
82 | 83 |
|
83 |
Partition partition = (Partition) selection; |
|
84 |
final Partition partition = (Partition) selection;
|
|
84 | 85 |
|
85 |
if (partition.getPartsCount() < 4) { // error to few parts |
|
86 |
MessageDialog d = new MessageDialog(window.getShell(), "", null, //$NON-NLS-1$ |
|
87 |
NLS.bind(CAUIMessages.ComputeCorrespondanceAnalysis_4, partition.getPartsCount()), 0, new String[] { ""}, 0); //$NON-NLS-1$ |
|
88 |
d.open(); |
|
86 |
// not enough parts error |
|
87 |
if (partition.getPartsCount() < 4) { |
|
88 |
Display.getDefault().syncExec(new Runnable() { |
|
89 |
|
|
90 |
@Override |
|
91 |
public void run() { |
|
92 |
MessageDialog d = new MessageDialog(window.getShell(), TXMCoreMessages.error_error2, null, |
|
93 |
NLS.bind(CAUIMessages.ComputeCorrespondanceAnalysis_4, partition.getPartsCount()), 0, new String[] { TXMCoreMessages.common_ok}, 0); |
|
94 |
d.open(); |
|
95 |
} |
|
96 |
}); |
|
89 | 97 |
return null; |
90 | 98 |
} |
99 |
|
|
100 |
// FIXME: old version using dialog box for parameters |
|
91 | 101 |
// ask property and Fmins and Vmax |
92 | 102 |
String title = TXMUIMessages.bind(CAUIMessages.ComputeCorrespondanceAnalysisDialog_0, partition.getName()); |
93 | 103 |
CAParametersDialog d = new CAParametersDialog(window.getShell(), partition.getParent(), title); |
... | ... | |
106 | 116 |
return null; |
107 | 117 |
} |
108 | 118 |
|
119 |
// FIXME: SJ: new version, creating a, empty LT and an empty CA |
|
120 |
// does not work at this time because of some problem in CAEditor (refreshing and component creation + eigenvalues computing) |
|
109 | 121 |
// ca = new CA(new LexicalTable(partition)); |
110 | 122 |
} |
111 |
// Creates from Lexical Table
|
|
123 |
// Creating from Lexical Table
|
|
112 | 124 |
else if (selection instanceof LexicalTable) { |
113 | 125 |
LexicalTable lexicalTable = (LexicalTable) selection; |
114 | 126 |
Property property = lexicalTable.getProperty(); |
... | ... | |
116 | 128 |
Log.info(NLS.bind(CAUIMessages.ComputeCorrespondanceAnalysis_0, lexicalTable, property)); |
117 | 129 |
|
118 | 130 |
if (lexicalTable.getNColumns() < 4) { |
131 |
// FIXME: remove this swing code that freeze the UI |
|
119 | 132 |
MessageBox.error(CAUIMessages.ComputeCorrespondanceAnalysis_13); |
120 | 133 |
return null; |
121 | 134 |
} |
122 | 135 |
if (lexicalTable.getNRows() < 4) { |
136 |
// FIXME: remove this swing code that freeze the UI |
|
123 | 137 |
MessageBox.error(CAUIMessages.ComputeCorrespondanceAnalysis_1); |
124 | 138 |
return null; |
125 | 139 |
} |
126 | 140 |
|
127 | 141 |
ca = new CA(lexicalTable); |
128 | 142 |
} |
129 |
// Reopens an existing editor
|
|
143 |
// Reopening an existing result
|
|
130 | 144 |
else if (selection instanceof CA) { |
131 | 145 |
ca = (CA) selection; |
132 | 146 |
} |
... | ... | |
134 | 148 |
Log.severe(CAUIMessages.bind(CAUIMessages.error_cannot_compute_with_selection, selection)); |
135 | 149 |
return null; |
136 | 150 |
} |
151 |
// FIXME: should be done in the CAEditor |
|
137 | 152 |
// compute the CA |
138 | 153 |
ca.compute(); |
139 | 154 |
|
140 | 155 |
try { |
141 |
System.out.println(CAUIMessages.ComputeCorrespondanceAnalysis_8);
|
|
156 |
Log.info(CAUIMessages.ComputeCorrespondanceAnalysis_8);
|
|
142 | 157 |
|
143 | 158 |
TXMResultEditorInput<CA> editorInput = new TXMResultEditorInput(ca); |
144 | 159 |
IWorkbenchPage page = TXMWindows.getActivePage(); |
... | ... | |
147 | 162 |
|
148 | 163 |
} |
149 | 164 |
catch (Throwable e) { |
150 |
System.out.println(CAUIMessages.bind(CAUIMessages.error_opening, ca));
|
|
165 |
Log.severe(CAUIMessages.bind(CAUIMessages.error_opening, ca));
|
|
151 | 166 |
Log.printStackTrace(e); |
152 | 167 |
} |
153 | 168 |
} |
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java (revision 1170) | ||
---|---|---|
330 | 330 |
|
331 | 331 |
// Editor part |
332 | 332 |
ChartEditor caFactorialMapEditorPart = new CAFactorialMapChartEditor(new ChartEditorInput<CA>(ca)); |
333 |
//caFactorialMapEditorPart.compute(false); |
|
333 | 334 |
editors.add(caFactorialMapEditorPart); |
334 | 335 |
|
335 | 336 |
// Editor input |
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java (revision 1170) | ||
---|---|---|
247 | 247 |
|
248 | 248 |
|
249 | 249 |
// advanced parameters |
250 |
ThresholdsGroup thresholdsGroup = new ThresholdsGroup(this.getExtendedParametersComposite(), this);
|
|
250 |
ThresholdsGroup thresholdsGroup = new ThresholdsGroup(this.getExtendedParametersComposite(), SWT.NONE, this, true, false);
|
|
251 | 251 |
this.fMinSpinner = thresholdsGroup.getFMinSpinner(); |
252 | 252 |
this.fMaxSpinner = thresholdsGroup.getFMaxSpinner(); |
253 | 253 |
this.vMaxSpinner = thresholdsGroup.getVMaxSpinner(); |
Formats disponibles : Unified diff