Révision 1522

tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java (revision 1522)
54 54
import org.txm.Toolbox;
55 55
import org.txm.core.messages.TXMCoreMessages;
56 56
import org.txm.core.preferences.TBXPreferences;
57
import org.txm.core.preferences.TXMPreferences;
57 58
import org.txm.core.results.Parameter;
58 59
import org.txm.index.core.functions.PartitionIndex;
59 60
import org.txm.lexicaltable.core.functions.LexicalTable;
60 61
import org.txm.lexicaltable.core.preferences.LexicalTablePreferences;
61 62
import org.txm.lexicaltable.rcp.handlers.MergeLines;
62 63
import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
64
import org.txm.objects.CorpusBuild;
63 65
import org.txm.rcp.StatusLine;
64 66
import org.txm.rcp.editors.TXMEditor;
65 67
import org.txm.rcp.editors.TableKeyListener;
......
185 187
					this.getResult().getProperty(),
186 188
					false);
187 189

  
188
			if (getResult().getParent() instanceof PartitionIndex) {
190
			// disable the property selection on Lexical table created from partition index 
191
			if (this.getResult().getParent() instanceof PartitionIndex) {
189 192
				this.unitPropertyComboViewer.getCombo().setEnabled(false);
190 193
			}
191 194
			
......
193 196
			// Extended parameters
194 197
			Composite extendedParametersArea = this.getExtendedParametersGroup();
195 198
			
196
			// FIXME: Apply button
199
			// FIXME: SJ: became useless? Apply button
197 200
//			Button keepTop = new Button(extendedParametersArea, SWT.PUSH);
198 201
//			keepTop.setText(LexicalTableUIMessages.LexicalTableEditor_4);
199 202
//			keepTop.addSelectionListener(new SelectionListener() {
......
264 267
							}
265 268
							String newname = d.getMergeName();
266 269

  
267
							System.out.println(NLS.bind(LexicalTableUIMessages.mergeColsColonP0, colindices));
270
							Log.info(NLS.bind(LexicalTableUIMessages.mergeColsColonP0, colindices));
271
							
268 272
							double[] firstcol = cols.get(colindices.get(0));
269 273

  
270 274
							// merge selected cols into the first one
......
304 308
								// form, freq
305 309
							}
306 310
							viewer.getTable().getColumns()[colindices.get(0) + 3].setText(newname);
307
							refreshTable(true);
308
						} else// delete
309
						{
310
							System.out.println(NLS.bind(LexicalTableUIMessages.deleteColsColonP0, colindices));
311
							compute(false);
312
						}
313
						// delete
314
						else {
315
							Log.info(NLS.bind(LexicalTableUIMessages.deleteColsColonP0, colindices));
316
							
311 317
							lexicalTable.getData().removeCols(colindices);
312

  
318
							lexicalTable.setAltered();
319
							
313 320
							collist = new ArrayList<Object>();
314 321
							Vector colnames = lexicalTable.getColNames();
315 322
							try {
......
323 330

  
324 331
							Collections.sort(colindices);
325 332
							for (int i = colindices.size() - 1; i >= 0; i--) {
326
								viewer.getTable().getColumns()[colindices
327
								                                        .get(i) + 3].dispose();
333
								viewer.getTable().getColumns()[colindices.get(i) + 3].dispose();
328 334
							}
329
							refreshTable(true);
335
							compute(false);
330 336
						}
331 337
					}
332 338
					StatusLine.setMessage(""); //$NON-NLS-1$
......
362 368
							MergeLines.mergeLines(LexicalTableEditor.this, d.getMergeName(), rowindices);
363 369
						} else {
364 370
							lexicalTable.getData().removeRows(rowindices);
365
							refreshTable(true);
366
							viewer.getTable().deselectAll();
371
							lexicalTable.setAltered();
372
							compute(false);
367 373
						}
368 374
					}
369 375
				}
......
475 481
	/**
476 482
	 * Refreshes table.
477 483
	 */
478
	// FIXME: not optimized, need to mix the update/not update code and do not remove column each computing, only when needed
479
	// FIXME: + usine à gaz... virer la variable "collist"
484
	// FIXME: SJ: not optimized, need to mix the update/not update code and do not remove column each computing, only when needed
485
	// FIXME: SJ: + usine à gaz... virer la variable "collist"
480 486
	public void refreshTable(boolean update) {
481 487

  
482 488
		
......
619 625
	 */
620 626
	 @Deprecated
621 627
	public void exportData(File file) {
622
		 lexicalTable.getData().toTxt(file, "UTF-8", "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$
628
		 lexicalTable.getData().toTxt(file, TXMPreferences.DEFAULT_ENCODING, "\t", ""); //$NON-NLS-1$
623 629
	}
624 630

  
625 631
	/**
......
672 678
		 * @param col the col
673 679
		 * @param index the index
674 680
		 */
675
	 // FIXME: try to use a ViewerSorter instead of this but also manage the result sorting for export
681
	 // FIXME: SJ: try to use a ViewerSorter instead of this but also manage the result sorting for export
676 682
		public void sort(TableViewerColumn col, int index) {
677 683

  
678 684
			if (index == previousSortedCol) {
......
716 722

  
717 723
	 @Override
718 724
	public void updateEditorFromResult(boolean update) {
719
		if(this.lexicalTable.getData() != null)	{
725

  
726
		 // enable/disable the edition buttons according to the computed state
727
		if (this.lexicalTable.getData() != null) {
720 728
			this.mergeDeleteColumnsButton.setEnabled(true);
721 729
			this.mergeDeleteRowsButton.setEnabled(true);
722
			
730

  
723 731
			this.refreshInfos();
724 732
		}
725
		else	{
733
		else {
726 734
			this.mergeDeleteColumnsButton.setEnabled(false);
727 735
			this.mergeDeleteRowsButton.setEnabled(false);
728 736
		}
729 737

  
730 738
		this.refreshTable(update);
731
		
739

  
732 740
		QueriesView.refresh();
733 741
		RVariablesView.refresh();
734 742
	}
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/MergeLines.java (revision 1522)
43 43
import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
44 44
import org.txm.rcp.StatusLine;
45 45
import org.txm.rcp.messages.TXMUIMessages;
46
// TODO: Auto-generated Javadoc
47 46
/**
48
 * Allow the user to merge Lexical Table lines columns values are added to the
49
 * first and the others lines are deleted @ author mdecorde.
47
 * Allows the user to merge Lexical Table lines columns values are added to the first and the others lines are deleted.
48
 * 
49
 * @author mdecorde
50 50
 */
51 51
public class MergeLines extends AbstractHandler {
52 52

  
53
	/* (non-Javadoc)
54
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
55
	 */
53

  
56 54
	@Override
57 55
	public Object execute(ExecutionEvent event) throws ExecutionException {
58 56
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
......
84 82
	}
85 83

  
86 84
	/**
87
	 * Merge lines.
85
	 * Merges lines of the table.
88 86
	 *
89 87
	 * @param LTeditor the l teditor
90 88
	 * @param newname the newname
91 89
	 * @param selection the selection
92 90
	 */
93
	static public void mergeLines(LexicalTableEditor LTeditor, String newname,
94
			int[] selection) {
91
	static public void mergeLines(LexicalTableEditor LTeditor, String newname, int[] selection) {
95 92
		// sum the lines
96 93
		StatusLine.setMessage(LexicalTableUIMessages.mergingLines);
97 94
		List<double[]> cols = LTeditor.getCols();
......
117 114
		// reset line name
118 115
		try {
119 116
			table.getRowNames().setString(selection[0], newname);
120

  
121
			LTeditor.refreshTable();
122
			lineTableViewer.getTable().deselectAll();
123

  
124
			LTeditor.refresh(false);
117
			LTeditor.compute(false);
118
			
125 119
		} catch (Exception e) {
126 120
			// TODO Auto-generated catch block
127 121
			e.printStackTrace();
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/DeleteLines.java (revision 1522)
94 94

  
95 95
		LTeditor.getLexicalTable().getData().removeRows(selection);
96 96
		LTeditor.getLexicalTable().setAltered();
97
		LTeditor.refreshTable();
98
		LTeditor.getlineTableViewer().getTable().deselectAll();
99
		try {
100
			LTeditor.refresh(false);
101
		} catch (Exception e) {
102
			// TODO Auto-generated catch block
103
			e.printStackTrace();
104
		}
97
		LTeditor.compute(false);
105 98
	}
106 99

  
107 100
}
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/___MergeCols.java (revision 1522)
54 54
	 */
55 55
	@Override
56 56
	public Object execute(ExecutionEvent event) throws ExecutionException {
57
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
58
				.getShell();
57
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
59 58

  
60 59
		IWorkbenchPart editor = HandlerUtil.getActiveWorkbenchWindow(event)
61 60
				.getActivePage().getActivePart();
......
67 66
				return null;
68 67

  
69 68
			String newname = ""; //$NON-NLS-1$
70
			InputDialog d = new InputDialog(shell, TXMUIMessages.newName,
71
					TXMUIMessages.editTheNameOfTheNewColumnCreatedByTheMergedColumns, "", null); //$NON-NLS-1$ 
69
			InputDialog d = new InputDialog(shell, TXMUIMessages.newName, TXMUIMessages.editTheNameOfTheNewColumnCreatedByTheMergedColumns, "", null); //$NON-NLS-1$ 
72 70
			if (d.open() == Window.OK)
73 71
				newname = d.getValue();
74 72
			else
tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RSingularValuesChartCreator.java (revision 1522)
1
package org.txm.ca.core.chartsengine.r;
2

  
3
import java.io.File;
4

  
5
import org.txm.ca.core.functions.CA;
6
import org.txm.ca.core.functions.Eigenvalues;
7
import org.txm.ca.core.messages.CACoreMessages;
8
import org.txm.ca.core.statsengine.r.functions.FactoMineRCA;
9
import org.txm.chartsengine.core.results.ChartResult;
10
import org.txm.chartsengine.r.core.RChartCreator;
11

  
12
/**
13
 * R CA Eigenvalues chart creator.
14
 * @author mdecorde
15
 * @author sjacquot
16
 *
17
 */
18
public class RSingularValuesChartCreator extends RChartCreator {
19

  
20
	@Override
21
	public File createChartFile(ChartResult result, File file) {
22

  
23
		CA ca = (CA) ((Eigenvalues) result).getCA();
24
		
25
		// FactoMineR R package
26
		if(ca.useFactoMineR())	{
27
			return this.createSingularValuesBarPlot((FactoMineRCA) ca.getCA(), file);
28
		}
29
		// CA R package
30
		else	{
31
			return this.createSingularValuesBarPlot((org.txm.ca.core.statsengine.r.functions.CA) ca.getCA(), file);
32
		}
33

  
34
	}
35

  
36

  
37
	/**
38
	 * Creates a bar plot with singular values of the specified CA result from "FactoMineR" R package.
39
	 * @param ca
40
	 * @param file
41
	 * @return the singular values bar plot object
42
	 */
43
	public File createSingularValuesBarPlot(FactoMineRCA ca, File file) {
44
		
45
		// Create the X axis labels with custom prefix
46
		StringBuilder xLabels = new StringBuilder(30);
47
		xLabels.append("c("); //$NON-NLS-1$
48
		for(int i = 0, c = ca.getColumnsCount() - 1; i < c; i++) {
49
			if(i > 0)	 {
50
				xLabels.append(", "); //$NON-NLS-1$
51
			}
52
			xLabels.append("\"" + (i + 1) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
53
		}
54
		xLabels.append(")"); //$NON-NLS-1$
55

  
56
		String cmd = "tmpY <- " + ca.getSymbol() + "$eig$eigenvalue[1:length(" + ca.getSymbol() + "$eig$eigenvalue) - 1];\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
57
		cmd += "barplot(tmpY, main=\"" //$NON-NLS-1$
58
				+ CACoreMessages.eigenvalues + "\", ylab=\"" + //$NON-NLS-1$
59
				CACoreMessages.eigenvalue + "\", xlab=\"" + //$NON-NLS-1$
60
				CACoreMessages.axis + "\", names.arg=" + xLabels + ");\n"; //$NON-NLS-1$ //$NON-NLS-2$
61

  
62
		this.getChartsEngine().plot(file, cmd);
63

  
64
		return file;
65
	}
66

  
67

  
68
	/**
69
	 * Creates a bar plot with singular values of the specified CA result from "CA" R package.
70
	 * @param ca
71
	 * @param file
72
	 * @return the singular values bar plot object
73
	 */
74
	public File createSingularValuesBarPlot(org.txm.ca.core.statsengine.r.functions.CA ca, File file) {
75
		this.getChartsEngine().plot(file, "barplot(" +  ca.getSymbol() + "$sv)"); //$NON-NLS-1$ //$NON-NLS-2$
76
		return file;
77
	}
78

  
79

  
80
	
81
	@Override
82
	public Class getResultDataClass() {
83
		return Eigenvalues.class;
84
	}
85

  
86

  
87

  
88

  
89
}
tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/REigenvaluesChartCreator.java (revision 1522)
1
package org.txm.ca.core.chartsengine.r;
2

  
3
import java.io.File;
4

  
5
import org.txm.ca.core.functions.CA;
6
import org.txm.ca.core.functions.Eigenvalues;
7
import org.txm.ca.core.messages.CACoreMessages;
8
import org.txm.ca.core.statsengine.r.functions.FactoMineRCA;
9
import org.txm.chartsengine.core.results.ChartResult;
10
import org.txm.chartsengine.r.core.RChartCreator;
11

  
12
/**
13
 * R CA Eigenvalues chart creator.
14
 * 
15
 * @author mdecorde
16
 * @author sjacquot
17
 *
18
 */
19
public class REigenvaluesChartCreator extends RChartCreator {
20

  
21
	@Override
22
	public File createChartFile(ChartResult result, File file) {
23

  
24
		CA ca = (CA) ((Eigenvalues) result).getCA();
25
		
26
		// FactoMineR R package
27
		if(ca.useFactoMineR())	{
28
			return this.createSingularValuesBarPlot((FactoMineRCA) ca.getCA(), file);
29
		}
30
		// CA R package
31
		else	{
32
			return this.createSingularValuesBarPlot((org.txm.ca.core.statsengine.r.functions.CA) ca.getCA(), file);
33
		}
34

  
35
	}
36

  
37

  
38
	/**
39
	 * Creates a bar plot with eigenvalues of the specified CA result from "FactoMineR" R package.
40
	 * @param ca
41
	 * @param file
42
	 * @return the singular values bar plot object
43
	 */
44
	public File createSingularValuesBarPlot(FactoMineRCA ca, File file) {
45
		
46
		// Create the X axis labels with custom prefix
47
		StringBuilder xLabels = new StringBuilder(30);
48
		xLabels.append("c("); //$NON-NLS-1$
49
		for(int i = 0, c = ca.getColumnsCount() - 1; i < c; i++) {
50
			if(i > 0)	 {
51
				xLabels.append(", "); //$NON-NLS-1$
52
			}
53
			xLabels.append("\"" + (i + 1) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
54
		}
55
		xLabels.append(")"); //$NON-NLS-1$
56

  
57
		String cmd = "tmpY <- " + ca.getSymbol() + "$eig$eigenvalue[1:length(" + ca.getSymbol() + "$eig$eigenvalue) - 1];\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
58
		cmd += "barplot(tmpY, main=\"" //$NON-NLS-1$
59
				+ CACoreMessages.eigenvalues + "\", ylab=\"" + //$NON-NLS-1$
60
				CACoreMessages.eigenvalue + "\", xlab=\"" + //$NON-NLS-1$
61
				CACoreMessages.axis + "\", names.arg=" + xLabels + ");\n"; //$NON-NLS-1$ //$NON-NLS-2$
62

  
63
		this.getChartsEngine().plot(file, cmd);
64

  
65
		return file;
66
	}
67

  
68

  
69
	/**
70
	 * Creates a bar plot with eigenvalues of the specified CA result from "CA" R package.
71
	 * @param ca
72
	 * @param file
73
	 * @return the singular values bar plot object
74
	 */
75
	public File createSingularValuesBarPlot(org.txm.ca.core.statsengine.r.functions.CA ca, File file) {
76
		this.getChartsEngine().plot(file, "barplot(" +  ca.getSymbol() + "$sv)"); //$NON-NLS-1$ //$NON-NLS-2$
77
		return file;
78
	}
79

  
80

  
81
	
82
	@Override
83
	public Class<Eigenvalues> getResultDataClass() {
84
		return Eigenvalues.class;
85
	}
86

  
87

  
88

  
89

  
90
}
0 91

  
tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/chartcreators/JFCSingularValueChartCreator.java (revision 1522)
1
package org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.chartcreators;
2

  
3
import org.eclipse.osgi.util.NLS;
4
import org.jfree.chart.JFreeChart;
5
import org.jfree.chart.axis.NumberAxis;
6
import org.jfree.data.category.DefaultCategoryDataset;
7
import org.jfree.data.general.DatasetUtilities;
8
import org.jfree.data.xy.XYSeriesCollection;
9
import org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers.CASingularValuesItemSelectionRenderer;
10
import org.txm.ca.core.functions.CA;
11
import org.txm.ca.core.functions.Eigenvalues;
12
import org.txm.ca.core.messages.CACoreMessages;
13
import org.txm.chartsengine.core.results.ChartResult;
14
import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
15
import org.txm.chartsengine.jfreechart.core.themes.base.ExtendedNumberAxis;
16
import org.txm.statsengine.core.StatException;
17
import org.txm.utils.logger.Log;
18

  
19
/**
20
 * JFC Eigenvalues chart creator.
21
 * 
22
 * @author sjacquot
23
 *
24
 */
25
public class JFCSingularValueChartCreator extends JFCChartCreator {
26

  
27

  
28
	@Override
29
	public Object createChart(ChartResult result) {
30
		
31
		
32
		CA ca = (CA) ((Eigenvalues) result).getCA();
33

  
34
		JFreeChart chart = null;
35

  
36
			
37
			// Creates the empty dataset
38
			DefaultCategoryDataset dataset = new DefaultCategoryDataset();
39
			// Create the chart
40
			chart = this.getChartsEngine().createCategoryBarChart(dataset, CACoreMessages.eigenvalues, CACoreMessages.axis, CACoreMessages.eigenvalue, false, false, false);
41

  
42
			// Custom renderer
43
			chart.getCategoryPlot().setRenderer(new CASingularValuesItemSelectionRenderer(ca));
44
	        
45

  
46

  
47

  
48
		return chart;
49
	}
50

  
51
	
52
	@Override
53
	public void updateChart(ChartResult result) {
54

  
55
		CA ca = (CA) ((Eigenvalues) result).getCA();
56
		JFreeChart chart = (JFreeChart) result.getChart();
57

  
58
		
59
		// freeze rendering while computing
60
		chart.setNotify(false);
61

  
62
		// update the dataset
63
		try {
64

  
65
			DefaultCategoryDataset dataset = (DefaultCategoryDataset) chart.getCategoryPlot().getDataset();
66
			dataset.clear();
67

  
68
			
69
			double[] singularValues = ca.getValeursPropres();
70
	
71
			for(int i = 0; i < singularValues.length; i++) {
72
				dataset.setValue(singularValues[i], CACoreMessages.eigenvalue, String.valueOf(i + 1));
73
			}
74
	
75
		}
76
		catch(StatException e) {
77
			Log.severe(NLS.bind(CACoreMessages.cantCreateBarChartOfTheCASingularValuesP0, e));
78
			Log.printStackTrace(e);
79
		}
80

  
81
        // Custom range axis for ticks drawing options
82
        chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue()));
83

  
84
		
85
		super.updateChart(result);
86

  
87
	}
88
	
89
	
90
	@Override
91
	public Class getResultDataClass() {
92
		return Eigenvalues.class;
93
	}
94

  
95

  
96
	
97

  
98
}
tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/chartcreators/JFCCAChartCreator.java (revision 1522)
44 44
		JFreeChart chart  = null;
45 45

  
46 46
		try {
47
			CAXYDataset dataset = new CAXYDataset(ca);
47
			//CAXYDataset dataset = new CAXYDataset(ca);
48 48

  
49 49
			chart = ChartFactory.createScatterPlot(Utils.createCAFactorialMapChartTitle(ca), 
50
					"", "", dataset, PlotOrientation.VERTICAL, 
50
					"", "", null, PlotOrientation.VERTICAL, 
51 51
					CAPreferences.getInstance().getBoolean(ChartsEnginePreferences.SHOW_LEGEND), false, false);
52 52

  
53 53
			// Custom renderer
......
73 73
		// freeze rendering while computing
74 74
		chart.setNotify(false);
75 75

  
76
		try {
77
			chart.getXYPlot().setDataset(new CAXYDataset(ca));
78
		}
79
		catch (Exception e) {
80
			// TODO Auto-generated catch block
81
			e.printStackTrace();
82
		}
83
		
76 84
		CAItemSelectionRenderer renderer = (CAItemSelectionRenderer) chart.getXYPlot().getRenderer(); 
77 85
		
78 86
		renderer.setSeriesVisible(0, ca.isShowVariables());
tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/chartcreators/JFCEigenvaluesChartCreator.java (revision 1522)
1
package org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.chartcreators;
2

  
3
import org.eclipse.osgi.util.NLS;
4
import org.jfree.chart.JFreeChart;
5
import org.jfree.chart.axis.NumberAxis;
6
import org.jfree.data.category.DefaultCategoryDataset;
7
import org.jfree.data.general.DatasetUtilities;
8
import org.jfree.data.xy.XYSeriesCollection;
9
import org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers.CAEigenvaluesItemSelectionRenderer;
10
import org.txm.ca.core.functions.CA;
11
import org.txm.ca.core.functions.Eigenvalues;
12
import org.txm.ca.core.messages.CACoreMessages;
13
import org.txm.chartsengine.core.results.ChartResult;
14
import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
15
import org.txm.chartsengine.jfreechart.core.themes.base.ExtendedNumberAxis;
16
import org.txm.statsengine.core.StatException;
17
import org.txm.utils.logger.Log;
18

  
19
/**
20
 * JFC Eigenvalues chart creator.
21
 * 
22
 * @author sjacquot
23
 *
24
 */
25
public class JFCEigenvaluesChartCreator extends JFCChartCreator {
26

  
27

  
28
	@Override
29
	public Object createChart(ChartResult result) {
30
		
31
		CA ca = (CA) ((Eigenvalues) result).getCA();
32
		JFreeChart chart = null;
33

  
34
		// Creates the empty dataset
35
		DefaultCategoryDataset dataset = new DefaultCategoryDataset();
36
		// Create the chart
37
		chart = this.getChartsEngine().createCategoryBarChart(dataset, CACoreMessages.eigenvalues, CACoreMessages.axis, CACoreMessages.eigenvalue, false, false, false);
38

  
39
		// Custom renderer
40
		chart.getCategoryPlot().setRenderer(new CAEigenvaluesItemSelectionRenderer(ca));
41

  
42
		return chart;
43
	}
44

  
45
	
46
	@Override
47
	public void updateChart(ChartResult result) {
48

  
49
		CA ca = (CA) ((Eigenvalues) result).getCA();
50
		JFreeChart chart = (JFreeChart) result.getChart();
51
		
52
		// freeze rendering while computing
53
		chart.setNotify(false);
54

  
55
		// update the dataset
56
		try {
57

  
58
			DefaultCategoryDataset dataset = (DefaultCategoryDataset) chart.getCategoryPlot().getDataset();
59
			dataset.clear();
60

  
61
			
62
			double[] singularValues = ca.getValeursPropres();
63
	
64
			for(int i = 0; i < singularValues.length; i++) {
65
				dataset.setValue(singularValues[i], CACoreMessages.eigenvalue, String.valueOf(i + 1));
66
			}
67
	
68
		}
69
		catch(StatException e) {
70
			Log.severe(NLS.bind(CACoreMessages.cantCreateBarChartOfTheCASingularValuesP0, e));
71
			Log.printStackTrace(e);
72
		}
73

  
74
        // Custom range axis for ticks drawing options
75
        chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue()));
76
		
77
		super.updateChart(result);
78
	}
79
	
80
	
81
	@Override
82
	public Class getResultDataClass() {
83
		return Eigenvalues.class;
84
	}
85

  
86

  
87
	
88

  
89
}
0 90

  
tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/CASingularValuesItemSelectionRenderer.java (revision 1522)
1
package org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers;
2

  
3
import java.awt.Color;
4
import java.text.DecimalFormat;
5
import java.util.List;
6

  
7
import org.jfree.chart.labels.CategoryToolTipGenerator;
8
import org.jfree.data.category.CategoryDataset;
9
import org.jfree.data.category.DefaultCategoryDataset;
10
import org.txm.ca.core.functions.CA;
11
import org.txm.ca.core.messages.CACoreMessages;
12
import org.txm.chartsengine.core.ChartsEngine;
13
import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages;
14
import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection;
15
import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.renderers.ItemSelectionCategoryBarRenderer;
16
import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.swing.CustomHTMLToolTip;
17

  
18

  
19
/**
20
 * Renderer providing item selection system and drawing features for selected item and custom rendering for CA singular values bar charts.
21
 * @author sjacquot
22
 *
23
 */
24
public class CASingularValuesItemSelectionRenderer extends ItemSelectionCategoryBarRenderer {
25

  
26

  
27
	/**
28
	 * Percent values number format.
29
	 */
30
	protected DecimalFormat percentValuesNumberFormat;
31

  
32

  
33
	/**
34
	 * Creates a renderer dedicated to CA charts.
35
	 */
36
	public CASingularValuesItemSelectionRenderer(CA ca) {
37
		super();
38
		this.mouseOverItemSelector.setResult(ca);
39
		this.percentValuesNumberFormat = new DecimalFormat("#.00");
40
	}
41

  
42

  
43

  
44
	@Override
45
	public void initToolTipGenerator(final IRendererWithItemSelection renderer)	{
46
		this.setBaseToolTipGenerator(new CategoryToolTipGenerator() {
47

  
48
			@Override
49
			public String generateToolTip(CategoryDataset dataset, int row, int column) {
50

  
51
				// Hexadecimal color
52
				Color color = (Color) getSeriesPaint(row);
53
				String hex = "#" + Integer.toHexString(color.getRGB()).substring(2);
54

  
55
				DefaultCategoryDataset catDataset = (DefaultCategoryDataset) dataset;
56
				Number value = catDataset.getValue(row, column);
57

  
58

  
59
				CA ca = (CA) getItemsSelector().getResult();
60
				List<List<Object>> singularValuesData = ca.getSingularValuesInfos();
61

  
62
				return CustomHTMLToolTip.getDefaultHTMLBody(renderer, hex) + "<p>#" + catDataset.getColumnKey(column) + "</p>"
63
						+ "<p><span style=\"color: " + hex + ";\">" + catDataset.getRowKey(row) + ChartsEngineCoreMessages.EMPTY
64
							+ " </span><b>" + valuesNumberFormat.format(value) + "</b></p>"
65
						+ "<p><span style=\"color: " + hex + ";\">" + CACoreMessages.percent + ChartsEngineCoreMessages.EMPTY
66
							+ " </span><b>" + percentValuesNumberFormat.format(singularValuesData.get(column).get(2)) + "</b></p>"
67
						+ "<p><span style=\"color: " + hex + ";\">" + CACoreMessages.charts_singularValues_tooltipSum + CACoreMessages.percent
68
							+ ChartsEngineCoreMessages.EMPTY
69
							+ " </span><b>" + percentValuesNumberFormat.format(singularValuesData.get(column).get(3)) + "</b></p>"
70
						+ "</body><html>";
71
			}
72
		});
73
	}
74

  
75

  
76

  
77
}
tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/CAEigenvaluesItemSelectionRenderer.java (revision 1522)
1
package org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers;
2

  
3
import java.awt.Color;
4
import java.text.DecimalFormat;
5
import java.util.List;
6

  
7
import org.jfree.chart.labels.CategoryToolTipGenerator;
8
import org.jfree.data.category.CategoryDataset;
9
import org.jfree.data.category.DefaultCategoryDataset;
10
import org.txm.ca.core.functions.CA;
11
import org.txm.ca.core.messages.CACoreMessages;
12
import org.txm.chartsengine.core.ChartsEngine;
13
import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages;
14
import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection;
15
import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.renderers.ItemSelectionCategoryBarRenderer;
16
import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.swing.CustomHTMLToolTip;
17

  
18

  
19
/**
20
 * Renderer providing item selection system and drawing features for selected item and custom rendering for CA eigenvalues bar charts.
21
 * @author sjacquot
22
 *
23
 */
24
public class CAEigenvaluesItemSelectionRenderer extends ItemSelectionCategoryBarRenderer {
25

  
26

  
27
	/**
28
	 * Percent values number format.
29
	 */
30
	protected DecimalFormat percentValuesNumberFormat;
31

  
32

  
33
	/**
34
	 * Creates a renderer dedicated to CA charts.
35
	 */
36
	public CAEigenvaluesItemSelectionRenderer(CA ca) {
37
		super();
38
		this.mouseOverItemSelector.setResult(ca);
39
		this.percentValuesNumberFormat = new DecimalFormat("#.00");
40
	}
41

  
42

  
43

  
44
	@Override
45
	public void initToolTipGenerator(final IRendererWithItemSelection renderer)	{
46
		this.setBaseToolTipGenerator(new CategoryToolTipGenerator() {
47

  
48
			@Override
49
			public String generateToolTip(CategoryDataset dataset, int row, int column) {
50

  
51
				// Hexadecimal color
52
				Color color = (Color) getSeriesPaint(row);
53
				String hex = "#" + Integer.toHexString(color.getRGB()).substring(2);
54

  
55
				DefaultCategoryDataset catDataset = (DefaultCategoryDataset) dataset;
56
				Number value = catDataset.getValue(row, column);
57

  
58

  
59
				CA ca = (CA) getItemsSelector().getResult();
60
				List<List<Object>> singularValuesData = ca.getSingularValuesInfos();
61

  
62
				return CustomHTMLToolTip.getDefaultHTMLBody(renderer, hex) + "<p>#" + catDataset.getColumnKey(column) + "</p>"
63
						+ "<p><span style=\"color: " + hex + ";\">" + catDataset.getRowKey(row) + ChartsEngineCoreMessages.EMPTY
64
							+ " </span><b>" + valuesNumberFormat.format(value) + "</b></p>"
65
						+ "<p><span style=\"color: " + hex + ";\">" + CACoreMessages.percent + ChartsEngineCoreMessages.EMPTY
66
							+ " </span><b>" + percentValuesNumberFormat.format(singularValuesData.get(column).get(2)) + "</b></p>"
67
						+ "<p><span style=\"color: " + hex + ";\">" + CACoreMessages.charts_singularValues_tooltipSum + CACoreMessages.percent
68
							+ ChartsEngineCoreMessages.EMPTY
69
							+ " </span><b>" + percentValuesNumberFormat.format(singularValuesData.get(column).get(3)) + "</b></p>"
70
						+ "</body><html>";
71
			}
72
		});
73
	}
74

  
75

  
76

  
77
}
0 78

  
tmp/org.txm.ca.core/plugin.xml (revision 1522)
14 14
            fileNamePrefix="ca">
15 15
      </ChartCreator>
16 16
      <ChartCreator
17
            class="org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.chartcreators.JFCSingularValueChartCreator"
17
            class="org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.chartcreators.JFCEigenvaluesChartCreator"
18 18
            fileNamePrefix="singular_values">
19 19
      </ChartCreator>
20 20
      <ChartCreator
......
22 22
            fileNamePrefix="ca">
23 23
      </ChartCreator>
24 24
      <ChartCreator
25
            class="org.txm.ca.core.chartsengine.r.RSingularValuesChartCreator"
25
            class="org.txm.ca.core.chartsengine.r.REigenvaluesChartCreator"
26 26
            fileNamePrefix="singular_values">
27 27
      </ChartCreator>
28 28
   </extension>
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1522)
801 801

  
802 802
				this.runInit(monitor);
803 803

  
804
				if (isLocked()) return Status.CANCEL_STATUS;
804
				if (isLocked()) {
805
					return Status.CANCEL_STATUS;
806
				}
805 807
				
806 808
				try {
807 809
					JobsTimer.start();
......
954 956
	 */
955 957
	public final void refresh(boolean update) throws Exception {
956 958
		
959
		// skip refresh if the part creation has failed
957 960
		if (!createPartControlDoneSucessfully) {
958
			return; // no refresh
961
			return;
959 962
		}
960
		notifyExtensions("notifyStartOfRefresh"); //$NON-NLS-1$
963
		
964
		this.notifyExtensions("notifyStartOfRefresh"); //$NON-NLS-1$
961 965

  
962 966
		TXMResult result = this.getResult();
963 967

  
......
1010 1014
						//&& txmEditor.isDirty()
1011 1015
						)	{
1012 1016
					//txmEditor.synchronizeResultFromEditor();
1017
					
1018
					// FIXME: SJ: need to prove/test this code
1019
					// recreate all if the parent result is altered 
1020
					//txmEditor.refresh(!this.getResult().isAltered());
1013 1021
					txmEditor.refresh(true);
1014 1022
				}
1015 1023
			}
1016 1024
		}
1017 1025
		
1018
		notifyExtensions("notifyEndOfRefresh"); //$NON-NLS-1$
1026
		this.notifyExtensions("notifyEndOfRefresh"); //$NON-NLS-1$
1019 1027
	}
1020 1028

  
1021 1029
	/**
1022
	 * Synchronizes the result with editor parameters.
1030
	 * Synchronizes the result parameters with editor widgets.
1023 1031
	 * <p>
1024 1032
	 * It should be called or called itself in the UI thread when accessing Widget parameters.
1025 1033
	 */
1026 1034
	public abstract void updateResultFromEditor();
1027 1035

  
1028
	/**
1029
	 * UI safe
1030
	 * 
1031
	 * Synchronizes the editor with the result. 
1032
	 * Dedicated to dynamically change the editor components from the stored result.
1033
	 * <p>
1034
	 * Use this method if you need to save parameter with Type not managed by the autoUpdateEditorFieldsFromResult method
1035
	 * @throws Exception 
1036
	 */
1037
	public final void updateFromResult(final boolean update) throws Exception {
1038
		if (this.parent != null && !this.parent.isDisposed()) {
1039
			this.parent.getDisplay().syncExec(new Runnable() {
1036
	// FIXME: became useless?
1037
//	/**
1038
//	 * UI safe
1039
//	 * 
1040
//	 * Synchronizes the editor with the result. 
1041
//	 * Dedicated to dynamically change the editor components from the stored result.
1042
//	 * <p>
1043
//	 * Use this method if you need to save parameter with Type not managed by the autoUpdateEditorFieldsFromResult method
1044
//	 * @throws Exception 
1045
//	 */
1046
//	public final void updateFromResult(final boolean update) throws Exception {
1047
//		if (this.parent != null && !this.parent.isDisposed()) {
1048
//			this.parent.getDisplay().syncExec(new Runnable() {
1049
//
1050
//				@Override
1051
//				public void run() {
1052
//					try {
1053
//						refresh(update);
1054
//					} catch (Exception e) {
1055
//						// TODO Auto-generated catch block
1056
//						e.printStackTrace();
1057
//					}
1058
//				}
1059
//			});
1060
//		}
1061
//	}
1040 1062

  
1041
				@Override
1042
				public void run() {
1043
					try {
1044
						refresh(update);
1045
					} catch (Exception e) {
1046
						// TODO Auto-generated catch block
1047
						e.printStackTrace();
1048
					}
1049
				}
1050
			});
1051
		}
1052
	}
1053

  
1054 1063
	/**
1055
	 * Synchronizes the editor with the result. 
1064
	 * Synchronizes the editor widgets with the result parameters. 
1056 1065
	 * Dedicated to dynamically change the editor components from the stored result.
1057
	 * <p>
1058
	 * Use this method if you need to save parameter with Type not managed by the autoUpdateEditorFieldsFromResult method
1066
	 * 
1067
	 * Use this method if you need to save parameter with Type not managed by the autoUpdateEditorFieldsFromResult method.
1059 1068
	 * @throws Exception 
1060 1069
	 */
1061 1070
	public abstract void updateEditorFromResult(boolean update) throws Exception;
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_ru.properties (revision 1522)
1
#TXM messages generated by the PluginMessagesManager class
2
#Thu Dec 06 15:02:43 CET 2018
3
coordColumnFormat=Формат колонки Coord
4
eigenvalues=Собственные значения
5
contributionColumnFormat=Формат колонки Вклад
6
openingTheCorrespondenceAnalysisResults=Открытие результатов факторного анализа соответствий
7
cosColumnFormat=Формат колонки Cos²
8
showTheColumns=Показать колонки в графике факторного плана
9
canNotComputeFactorialAnalysisWithOnlyP0PartsTheMinimumIs4Parts=** Невозможно провести факторный анализ соответствий при наличии только 
10
showTheRows=Показать строчки в графике факторного плана
11
distanceColumnFormat=Формат колонки Дистанция
12
factPlan=Факт. план
13
loadingCorrespondenceAnalysisResults=Загрузка результатов факторного анализа
14
computingCorrespondenceAnalysisOnP0WithPropertyP1=Расчет факторного анализа соответствий
15
CorrespondanceAnalysisEditorInput_11=∑%
16
eigenvalue=Собственные значения
17
canNotComputeCAOnLexicalTableWithLessThan4Columns=** Невозможно провести факторный анализ соответствий при наличии менее 4-х колонок
18
chi=χ²
19
CorrespondanceAnalysisEditorInput_4=Фактор
20
q=Qual
21
infosColonP0=Информация\: {0}
22
wrongInput=Ошибочный ввод
23
creatingCA=Создание окна ФАС
24
eigenvaluesHistogram=Гистограмма собственных значений
25
canNotComputeCAWithLessThan4RowsInTheTable=** Невозможно провести факторный анализ соответствий при наличии менее 4-х колонок в таблице
26
massColumnFormat=Формат колонки Масса
27
rowsInfos=Инф Строчки
28
qualityColumnFormat=Формат колонки Качество
29
colsInfos=Инф Колонки
1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
2
#TXM messages generated by the PluginMessagesManager class
3
#Thu Dec 06 15:02:43 CET 2018
4

  
5
CorrespondanceAnalysisEditorInput_11 = ∑%
6
CorrespondanceAnalysisEditorInput_4  = Фактор
7

  
8
canNotComputeCAOnLexicalTableWithLessThan4Columns = ** Невозможно провести факторный анализ соответствий при наличии менее 4-х колонок
9

  
10
canNotComputeCAWithLessThan4RowsInTheTable = ** Невозможно провести факторный анализ соответствий при наличии менее 4-х колонок в таблице
11

  
12
canNotComputeFactorialAnalysisWithOnlyP0PartsTheMinimumIs4Parts = ** Невозможно провести факторный анализ соответствий при наличии только 
13

  
14
chi = χ²
15

  
16
colsInfos = Инф Колонки
17

  
18
computingCorrespondenceAnalysisOnP0WithPropertyP1 = Расчет факторного анализа соответствий
19

  
20
contributionColumnFormat = Формат колонки Вклад
21

  
22
coordColumnFormat = Формат колонки Coord
23

  
24
cosColumnFormat = Формат колонки Cos²
25

  
26
creatingCA = Создание окна ФАС
27

  
28
distanceColumnFormat = Формат колонки Дистанция
29

  
30
eigenvalue = Собственные значения
31

  
32
eigenvalues = Собственные значения
33

  
34
eigenvaluesBarChat = Гистограмма собственных значений
35

  
36
factPlan = Факт. план
37

  
38
infosColonP0 = Информация: {0}
39

  
40
loadingCorrespondenceAnalysisResults = Загрузка результатов факторного анализа
41

  
42
massColumnFormat = Формат колонки Масса
43

  
44
openingTheCorrespondenceAnalysisResults = Открытие результатов факторного анализа соответствий
45

  
46
q = 
47

  
48
qualityColumnFormat = Формат колонки Качество
49

  
50
rowsInfos = Инф Строчки
51

  
52
showTheColumns = Показать колонки в графике факторного плана
53

  
54
showTheRows = Показать строчки в графике факторного плана
55

  
56
wrongInput = Ошибочный ввод
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/CAUIMessages.java (revision 1522)
41 41
	public static String eigenvalues; 
42 42
	public static String CorrespondanceAnalysisEditorInput_11;
43 43
	public static String factPlan; 
44
	public static String eigenvaluesHistogram; 
44
	public static String eigenvaluesBarChat; 
45 45
	public static String CorrespondanceAnalysisEditorInput_4;
46 46
	public static String eigenvalue; 
47 47
	public static String rowsInfos; 
......
58 58

  
59 59
	
60 60
	public static String error_cannot_compute_with;
61

  
62 61
	public static String error_cannot_compute_with_selection;
63

  
64 62
	public static String error_opening;
65 63

  
66 64

  
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_fr.properties (revision 1522)
1
#TXM messages generated by the PluginMessagesManager class
2
#Thu Dec 06 15:02:43 CET 2018
3
coordColumnFormat=Format de la colonne Coord
4
eigenvalues=Valeurs propres
5
showhidePointShapes=Afficher/Masquer les points
6
showhideTheRowPoints=Afficher/Masquer les lignes
7
contributionColumnFormat=Format de la colonne Contribution
8
axesColon=Axes \: 
9
cosColumnFormat=Format de la colonne Cos²
10
openingTheCorrespondenceAnalysisResults=Ouverture des résultats de l'analyse factorielle des correspondances
11
showTheColumns=Afficher les colonnes
12
canNotComputeFactorialAnalysisWithOnlyP0PartsTheMinimumIs4Parts=** Impossible de calculer l''analyse factorielle avec seulement {0} parties (le minimum est de 4 parties).
13
showTheRows=Afficher les lignes
14
distanceColumnFormat=Format de la colonne Distance
15
errorWhileOpeningCAEditorColonP0=** Erreur lors de l'ouverture de la fenêtre de résultats de l'AFC \: 
16
loadingCorrespondenceAnalysisResults=Chargement des résultats de l'analyse factorielle...
17
factPlan=Plan fact.
18
computingCorrespondenceAnalysisOnP0WithPropertyP1=Calcul de l''analyse factorielle des correspondances de {0} avec la propriété {1}
19
error_opening=** Erreur \: impossible d'ouvrir la fenêtre des résultats de l'AFC de {0}
20
showhideTheColumnPoints=Afficher/Masquer les colonnes
21
CorrespondanceAnalysisEditorInput_11=∑%
22
eigenvalue=Valeur propre
23
canNotComputeCAOnLexicalTableWithLessThan4Columns=** Impossible de calculer l'analyse factorielle des correspondances avec moins de 4 colonnes  ans la table
24
chi=χ²
25
showPointShapes=Afficher les points
26
CorrespondanceAnalysisEditorInput_4=\#
27
q=Q
28
infosColonP0=Informations \: {0}
29
error_cannot_compute_with_selection=** Erreur \: impossible de calculer l'AFC avec {0}
30
wrongInput=Entrée erronée
31
creatingCA=Création de la fenêtre de l'AFC
32
eigenvaluesHistogram=Diagramme à barres des valeurs propres
33
canNotComputeCAWithLessThan4RowsInTheTable=** Impossible de calculer l'analyse factorielle des correspondances avec moins de 4 lignes dans la table
34
massColumnFormat=Format de la colonne Masse
35
rowsInfos=Informations lignes
36
qualityColumnFormat=Format de la colonne Qualité
37
error_cannot_compute_with=** Erreur \: impossible de calculer l'AFC avec {0}
38
colsInfos=Informations sur les colonnes
39
lexicalTableCreatedWhenCalledFromAPartition=Table lexicale (créée quand appelée depuis une partition)
1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
2
#TXM messages generated by the PluginMessagesManager class
3
#Thu Dec 06 15:02:43 CET 2018
4

  
5
CorrespondanceAnalysisEditorInput_11 = ∑%
6
CorrespondanceAnalysisEditorInput_4  = #
7

  
8
axesColon = Axes : 
9

  
10
canNotComputeCAOnLexicalTableWithLessThan4Columns = ** Impossible de calculer l'analyse factorielle des correspondances avec moins de 4 colonnes  ans la table
11

  
12
canNotComputeCAWithLessThan4RowsInTheTable = ** Impossible de calculer l'analyse factorielle des correspondances avec moins de 4 lignes dans la table
13

  
14
canNotComputeFactorialAnalysisWithOnlyP0PartsTheMinimumIs4Parts = ** Impossible de calculer l''analyse factorielle avec seulement {0} parties (le minimum est de 4 parties).
15

  
16
chi = χ²
17

  
18
colsInfos = Informations sur les colonnes
19

  
20
computingCorrespondenceAnalysisOnP0WithPropertyP1 = Calcul de l''analyse factorielle des correspondances de {0} avec la propriété {1}
21

  
22
contributionColumnFormat = Format de la colonne Contribution
23

  
24
coordColumnFormat = Format de la colonne Coord
25

  
26
cosColumnFormat = Format de la colonne Cos²
27

  
28
creatingCA = Création de la fenêtre de l'AFC
29

  
30
distanceColumnFormat = Format de la colonne Distance
31

  
32
eigenvalue = Valeur propre
33

  
34
eigenvalues = Valeurs propres
35

  
36
eigenvaluesBarChat = Diagramme à barres des valeurs propres
37

  
38
errorWhileOpeningCAEditorColonP0 = ** Erreur lors de l'ouverture de la fenêtre de résultats de l'AFC : 
39

  
40
error_cannot_compute_with           = ** Erreur : impossible de calculer l'AFC avec {0}
41
error_cannot_compute_with_selection = ** Erreur : impossible de calculer l'AFC avec {0}
42
error_opening                       = ** Erreur : impossible d'ouvrir la fenêtre des résultats de l'AFC de {0}
43

  
44
factPlan = Plan fact.
45

  
46
infosColonP0 = Informations : {0}
47

  
48
lexicalTableCreatedWhenCalledFromAPartition = Table lexicale (créée quand appelée depuis une partition)
49

  
50
loadingCorrespondenceAnalysisResults = Chargement des résultats de l'analyse factorielle...
51

  
52
massColumnFormat = Format de la colonne Masse
53

  
54
openingTheCorrespondenceAnalysisResults = Ouverture des résultats de l'analyse factorielle des correspondances
55

  
56
q = Q
57

  
58
qualityColumnFormat = Format de la colonne Qualité
59

  
60
rowsInfos = Informations lignes
61

  
62
showPointShapes = Afficher les points
63

  
64
showTheColumns = Afficher les colonnes
65

  
66
showTheRows = Afficher les lignes
67

  
68
showhidePointShapes = Afficher/Masquer les points
69

  
70
showhideTheColumnPoints = Afficher/Masquer les colonnes
71

  
72
showhideTheRowPoints = Afficher/Masquer les lignes
73

  
74
wrongInput = Entrée erronée
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages.properties (revision 1522)
1
#TXM messages generated by the PluginMessagesManager class
2
#Thu Dec 06 15:02:43 CET 2018
3
coordColumnFormat=Coord column format
4
eigenvalues=Eigenvalues
5
showhidePointShapes=Show/Hide points
6
showhideTheRowPoints=Show/Hide row
7
contributionColumnFormat=Contribution column format
8
axesColon=Axes\: 
9
cosColumnFormat=Cos² column format
10
openingTheCorrespondenceAnalysisResults=Opening the correspondence analysis results
11
showTheColumns=Show columns
12
canNotComputeFactorialAnalysisWithOnlyP0PartsTheMinimumIs4Parts=** Can not compute factorial analysis with only {0} parts (the minimum is 4 parts).
13
showTheRows=Show rows
14
distanceColumnFormat=Distance column format
15
errorWhileOpeningCAEditorColonP0=** Error while opening the CA result window\: 
16
factPlan=Fact. plane
17
loadingCorrespondenceAnalysisResults=Loading correspondence analysis results…
18
computingCorrespondenceAnalysisOnP0WithPropertyP1=Computing Correspondence analysis of {0} with property {1}
19
error_opening=** Error\: can not open the CA result window with {0}
20
showhideTheColumnPoints=Show/Hide column
21
CorrespondanceAnalysisEditorInput_11=∑%
22
eigenvalue=Eigenvalue
23
canNotComputeCAOnLexicalTableWithLessThan4Columns=** Can not compute CA on lexical table with less than 4 columns in the table
24
chi=χ²
25
showPointShapes=Show points
26
CorrespondanceAnalysisEditorInput_4=\#
27
q=Q
28
error_cannot_compute_with_selection=** Error\: can not compute CA with current selection\={0} 
29
infosColonP0=Informations\: {0}
30
wrongInput=Wrong input
31
creatingCA=Creating the CA window
32
eigenvaluesHistogram=Eigenvalues bar chart
33
canNotComputeCAWithLessThan4RowsInTheTable=** Can not compute CA with less than 4 rows in the table
34
massColumnFormat=Mass column format
35
rowsInfos=Rows informations
36
error_cannot_compute_with=** Error\: can not compute CA with {0}
37
qualityColumnFormat=Quality column format
38
colsInfos=Columns information
39
lexicalTableCreatedWhenCalledFromAPartition=Lexical table (created when called from a partition)
1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
2
#TXM messages generated by the PluginMessagesManager class
3
#Thu Dec 06 15:02:43 CET 2018
4

  
5
CorrespondanceAnalysisEditorInput_11 = ∑%
6
CorrespondanceAnalysisEditorInput_4  = #
7

  
8
axesColon = Axes: 
9

  
10
canNotComputeCAOnLexicalTableWithLessThan4Columns = ** Can not compute CA on lexical table with less than 4 columns in the table
11

  
12
canNotComputeCAWithLessThan4RowsInTheTable = ** Can not compute CA with less than 4 rows in the table
13

  
14
canNotComputeFactorialAnalysisWithOnlyP0PartsTheMinimumIs4Parts = ** Can not compute factorial analysis with only {0} parts (the minimum is 4 parts).
15

  
16
chi = χ²
17

  
18
colsInfos = Columns information
19

  
20
computingCorrespondenceAnalysisOnP0WithPropertyP1 = Computing Correspondence analysis of {0} with property {1}
21

  
22
contributionColumnFormat = Contribution column format
23

  
24
coordColumnFormat = Coord column format
25

  
26
cosColumnFormat = Cos² column format
27

  
28
creatingCA = Creating the CA window
29

  
30
distanceColumnFormat = Distance column format
31

  
32
eigenvalue = Eigenvalue
33

  
34
eigenvalues = Eigenvalues
35

  
36
eigenvaluesBarChat = Eigenvalues bar chart
37

  
38
errorWhileOpeningCAEditorColonP0 = ** Error while opening the CA result window: 
39

  
40
error_cannot_compute_with           = ** Error: can not compute CA with {0}
41
error_cannot_compute_with_selection = ** Error: can not compute CA with current selection={0} 
42
error_opening                       = ** Error: can not open the CA result window with {0}
43

  
44
factPlan = Fact. plane
45

  
46
infosColonP0 = Informations: {0}
47

  
48
lexicalTableCreatedWhenCalledFromAPartition = Lexical table (created when called from a partition)
49

  
50
loadingCorrespondenceAnalysisResults = Loading correspondence analysis results…
51

  
52
massColumnFormat = Mass column format
53

  
54
openingTheCorrespondenceAnalysisResults = Opening the correspondence analysis results
55

  
56
q = Q
57

  
58
qualityColumnFormat = Quality column format
59

  
60
rowsInfos = Rows informations
61

  
62
showPointShapes = Show points
63

  
64
showTheColumns = Show columns
65

  
66
showTheRows = Show rows
67

  
68
showhidePointShapes = Show/Hide points
69

  
70
showhideTheColumnPoints = Show/Hide column
71

  
72
showhideTheRowPoints = Show/Hide row
73

  
74
wrongInput = Wrong input
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java (revision 1522)
27 27
//
28 28
package org.txm.ca.rcp.editors;
29 29

  
30
import java.awt.Component;
31
import java.awt.event.ComponentEvent;
32
import java.awt.event.ComponentListener;
33 30
import java.util.ArrayList;
34 31
import java.util.Arrays;
35
import java.util.List;
36 32

  
37 33
import org.eclipse.jface.viewers.ISelectionChangedListener;
38 34
import org.eclipse.jface.viewers.SelectionChangedEvent;
......
62 58
import org.txm.ca.rcp.messages.CAUIMessages;
63 59
import org.txm.chartsengine.rcp.editors.ChartEditor;
64 60
import org.txm.chartsengine.rcp.editors.ChartEditorInput;
65
import org.txm.core.results.TXMResult;
66 61
import org.txm.rcp.editors.SplitedGenericMultiPageEditor;
67 62
import org.txm.rcp.editors.TXMMultiPageEditor;
68 63
import org.txm.rcp.editors.TXMResultEditorInput;
69 64
import org.txm.rcp.messages.TXMUIMessages;
70 65

  
71
// TODO: Auto-generated Javadoc
72 66
/**
73
 * extends the GenericMultipage editor, and put the first tab next to the left
74
 * of the TabFolder
67
 * CA editor with a factorial map chart in the left area and a tabbed area on the right side with eigenvalues, rows and columns information.
68
 * 
75 69
 * @author mdecorde
76 70
 * @author sjacquot
77 71
 */
......
83 77
	 */
84 78
	private CA ca;
85 79

  
86
	//public static String SEPARATOR = "SEPARATOR"; //$NON-NLS-1$
87 80
	public static String SEPARATOR = ""; //$NON-NLS-1$
88 81

  
89 82
	public static String COL_TYPE = "Double"; //$NON-NLS-1$
90 83

  
91 84

  
92 85

  
93
	/* (non-Javadoc)
94
	 * @see org.txm.rcp.editors.GenericMultiPageEditor#createPages()
95
	 */
96 86
	@Override
97 87
	protected void createPages() {
98 88
		
89
		// Tabs titles
90
		this.names = Arrays.asList(new String[] {CAUIMessages.factPlan, CAUIMessages.rowsInfos, CAUIMessages.colsInfos, CAUIMessages.eigenvaluesBarChat, CAUIMessages.eigenvalues});
99 91
		
100
		/** The names. */
101
		this.names = Arrays.asList(new String[] {CAUIMessages.factPlan, CAUIMessages.eigenvalues, CAUIMessages.rowsInfos, CAUIMessages.colsInfos, CAUIMessages.eigenvaluesHistogram });
102

  
103
		
104 92
		Composite container = this.getContainer();
105 93
		final Composite parentContainer = container.getParent();
106 94

  
107
		// System.out.println("parent container layout : "+parentContainer.getLayout());
108

  
109 95
		parentContainer.setLayout(new FormLayout());// change layout
110 96
		final Sash sash = new Sash(parentContainer, SWT.VERTICAL);
111 97

  
......
144 130
		CAFactorialMapChartFormData.bottom = new FormAttachment(100, 0);
145 131
		mainEditorComposite.setLayoutData(CAFactorialMapChartFormData);// set new layout data
146 132
		mainEditorComposite.setLayout(new FillLayout());
147
		// /////////////////////
148 133

  
149 134

  
150 135
		editors = new ArrayList<EditorPart>();
......
155 140

  
156 141
		// Initialize the editor parts and editor inputs
157 142
		this.initCAFactorialMapEditor();
158
		this.initCASingularValuesTableEditor();
159 143
		this.initRowsTableEditor();
160 144
		this.initColumnsTableEditor();
161 145
		this.initCASingularValuesBarChartEditor();
146
		this.initCASingularValuesTableEditor();
162 147

  
163 148

  
164 149
		if (editors.size() != inputs.size()) {
......
195 180
	
196 181
			caFactorialMapEditorPart.compute(false);
197 182
			
198
			// to force the creation of the chart component and then add some listeners to it
199
			// FIXME: this code may be moved in CaFactorialMapChartEditor class
200
	//		caFactorialMapEditorPart.refresh(false);
201

  
202
			// Axis unit square ratio constraint
203
//			caFactorialMapEditorPart.getComposite().getChartComponent().setSquareOffEnabled(true);
204
//			caFactorialMapEditorPart.getComposite().getChartComponent().squareOff();
205
//			Component chartComponent = (Component) caFactorialMapEditorPart.getComposite().getChartComponent();
206
//			// Axis unit square ratio constraint on resize
207
//			chartComponent.addComponentListener(new ComponentListener() {
208
//
209
//				@Override
210
//				public void componentShown(ComponentEvent arg0) {
211
//					// TODO Auto-generated method stub
212
//				}
213
//
214
//				@Override
215
//				public void componentResized(ComponentEvent e) {
216
//					caFactorialMapEditorPart.getComposite().getChartComponent().squareOff();
217
//				}
218
//
219
//				@Override
220
//				public void componentMoved(ComponentEvent arg0) {
221
//					// TODO Auto-generated method stub
222
//				}
223
//
224
//				@Override
225
//				public void componentHidden(ComponentEvent arg0) {
226
//					// TODO Auto-generated method stub
227
//				}
228
//			});
229

  
230

  
231

  
232
			
233 183
		}
234 184
		catch (Exception e1) {
235 185
			org.txm.rcp.utils.Logger.printStackTrace(e1);
......
291 241

  
292 242

  
293 243
		// Sets the parent multi pages editor of the singular values barplot to activate it from the child editor
294
		((ChartEditor)editors.get(4)).setParentMultiPagesEditor(this);
244
		((ChartEditor)editors.get(3)).setParentMultiPagesEditor(this);
295 245

  
296 246

  
247
		// set the eigenvalues chart visible by default
248
		if(LAST_EDITOR_USED == 0)	{
249
			LAST_EDITOR_USED = 3;
250
		}
297 251
		this.setActivePage(LAST_EDITOR_USED);
298 252

  
299 253
		this.setPartName(this.getEditorInput().getName());
......
303 257
	 * Initializes CA factorial map editor.
304 258
	 */
305 259
	public void initCAFactorialMapEditor()	{
306

  
307
		// Editor part
308 260
		ChartEditor caFactorialMapEditorPart = new CAFactorialMapChartEditor(new ChartEditorInput<CA>(this.ca));
309
		//caFactorialMapEditorPart.compute(false);
310 261
		editors.add(caFactorialMapEditorPart);
311

  
312
		// Editor input
313 262
		inputs.add(caFactorialMapEditorPart.getEditorInput());
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff