Révision 1165

tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/listeners/ComputeSelectionListener.java (revision 1165)
35 35
	@Override
36 36
	public void widgetDefaultSelected(SelectionEvent e) {
37 37
		// TODO Auto-generated method stub
38
		if((e.getSource() instanceof Spinner) || e.stateMask != 0)	{
39
			this.editor.compute(true);	
40
		}
38
//		if((e.getSource() instanceof Spinner) || e.stateMask != 0)	{
39
//			this.editor.compute(true);	
40
//		}
41 41
	}
42 42

  
43 43
	@Override
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java (revision 1165)
329 329
		fMin.setIncrement(1);
330 330
		fMin.setPageIncrement(100);
331 331
		fMin.addSelectionListener(computeSelectionListener);
332
		fMin.addKeyListener(computeKeyListener);
332 333

  
333 334
		label = new Label(filtercontrols, SWT.NONE);
334 335
		label.setText(CooccurrenceUIMessages.CooccurrencesEditor_5);
......
338 339
		cMin.setIncrement(1);
339 340
		cMin.setPageIncrement(100);
340 341
		cMin.addSelectionListener(computeSelectionListener);
342
		cMin.addKeyListener(computeKeyListener);
341 343

  
342 344
		label = new Label(filtercontrols, SWT.NONE);
343 345
		label.setText(CooccurrenceUIMessages.CooccurrencesEditor_6);
344 346
		minScore = new FloatSpinner(filtercontrols, SWT.BORDER);
345
		minScore.addSelectionListener(new ComputeSelectionListener(this));
347
		minScore.addSelectionListener(computeSelectionListener);
346 348
		minScore.addKeyListener(computeKeyListener);
347 349
		
348 350
		// empant
......
355 357
		empantLayoutData.right = new FormAttachment(100);
356 358
		empantPanel.setLayoutData(empantLayoutData);
357 359
		empantPanel.addSelectionListener(computeSelectionListener);
360
		empantPanel.addMinMaxKeyListener(computeKeyListener);
358 361
		
359
		
360 362
		// result area
361 363
		Composite resultArea = this.getResultArea();
362 364
		// FIXME: became useless?
tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/EmpantWidget.java (revision 1165)
28 28
package org.txm.cooccurrence.rcp.editors;
29 29

  
30 30
import org.eclipse.swt.SWT;
31
import org.eclipse.swt.events.KeyListener;
31 32
import org.eclipse.swt.events.SelectionEvent;
32 33
import org.eclipse.swt.events.SelectionListener;
33 34
import org.eclipse.swt.layout.GridData;
......
487 488
		checkLeft.removeSelectionListener(listener);
488 489
		checkRight.removeSelectionListener(listener);
489 490
	}
491
	
492
	public void addMinMaxKeyListener(KeyListener listener)	{
493
		maxLeft.addKeyListener(listener);
494
		maxRight.addKeyListener(listener);
495
		minRight.addKeyListener(listener);
496
		minLeft.addKeyListener(listener);
497
	}
490 498

  
491 499
}
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java (revision 1165)
142 142
	@Override
143 143
	public void setDirty() {
144 144
		super.setDirty();
145
		this.chart = null;
145
		//this.chart = null;
146 146
		this.setChartDirty();
147 147
	}
148 148

  
......
157 157
	@Override
158 158
	public void setNeedsFullRecomputing(boolean needsFullRecomputing) {
159 159
		super.setNeedsFullRecomputing(needsFullRecomputing);
160
		this.chart = null;
160
		//this.chart = null;
161 161
	}
162 162
	
163 163
	@Override
164 164
	public boolean compute(IProgressMonitor monitor) {
165 165

  
166 166
		try {
167
			Log.finest("ChartResult.compute(): computing result of type " + this.getClass() + "...");
167
			Log.finest("*** ChartResult.compute(): " + this.getClass().getSimpleName() + ": starting computing process...");
168 168

  
169 169
			// compute the result if needed
170 170
			if(super.compute(monitor, true))	{
......
193 193

  
194 194
		this.subTask("Rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + ".");
195 195

  
196
		Log.finest("ChartResult.renderChart(): rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "..."); //$NON-NLS-1$
196
		Log.finest("*** ChartResult.renderChart(): rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "..."); //$NON-NLS-1$
197 197

  
198 198
		if (!this.chartDirty && !this.isChartDirtyFromHistory()) {
199
			Log.finest("ChartResult.renderChart(): chart rendering parameters have not changed since last rendering, rendering skipped."); //$NON-NLS-1$
199
			Log.finest("--- ChartResult.renderChart(): chart rendering parameters have not changed since last rendering, rendering skipped."); //$NON-NLS-1$
200 200
			return true;
201 201
		}
202 202
		else if (!this.chartDirty) {
203
			Log.finest("ChartResult.renderChart(): chart is not dirty, rendering skipped."); //$NON-NLS-1$
203
			Log.finest("--- ChartResult.renderChart(): chart is not dirty, rendering skipped."); //$NON-NLS-1$
204 204
			return true;
205 205
		}
206 206

  
......
215 215
				}
216 216
				chartCreator = ChartsEngine.getChartsEngines().get(i).getChartCreator(this);
217 217
				if(chartCreator != null)	{
218
					Log.finest("ChartResult.renderChart(): another suitable chart creator has been found in charts engine: " + ChartsEngine.getChartsEngines().get(i) + "."); //$NON-NLS-1$
218
					Log.severe("ChartResult.renderChart(): another suitable chart creator has been found in charts engine: " + ChartsEngine.getChartsEngines().get(i) + "."); //$NON-NLS-1$
219 219
					this.chartsEngine = ChartsEngine.getChartsEngines().get(i);
220 220
					break;
221 221
				}
......
231 231
			// - the chart has never been created
232 232
			// - the chart type has been changed, e.g. to dynamically change the type of chart or the current charts engine
233 233
			if (this.chart == null || this.hasParameterChanged(ChartsEnginePreferences.CHART_TYPE)) {
234
				Log.finest("ChartResult.renderChart(): creating chart."); //$NON-NLS-1$
234
				Log.finest("+++ ChartResult.renderChart(): creating chart."); //$NON-NLS-1$
235 235

  
236 236
				this.chart = chartCreator.createChart(this);
237 237
			}
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 1165)
734 734
			this.updateDirty(previousValue, newValue);
735 735
			if (this.dirty) {
736 736
				// FIXME: debug
737
				Log.finest("TXMResult.isDirtyFromHistory(): parameter " + name + " has changed.");
737
				Log.finest("TXMResult.isDirtyFromHistory(): " + this.getClass().getSimpleName() + ": parameter " + name + " has changed.");
738 738
				return this.dirty; // no need to go further
739 739
			}
740 740
		}
......
1610 1610
	 * @return the current name
1611 1611
	 */
1612 1612
	public String getCurrentName() {
1613
		if (this.userName.length() > 0) {
1613
		if (!this.userName.isEmpty()) {
1614 1614
			return this.userName;
1615 1615
		}
1616
		else if (this.lazyName != null) {
1616
		else if (this.lazyName != null && !this.lazyName.isEmpty()) {
1617 1617
			return this.lazyName;
1618 1618
		}
1619 1619
		else {
......
1811 1811
		try {
1812 1812
			
1813 1813
			
1814
			Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": starting computing process...");
1814
			Log.finest("*** TXMResult.compute(): " + this.getClass().getSimpleName() + ": starting computing process...");
1815 1815
			
1816 1816
			// FIXME: see if this skipComputing tests is still useful? is it possible to directly return instead?
1817 1817
			// en fait voir ChartResult.compute() if(super.compute(monitor, true, false)), je pense que le prob vient du fait que si on retourne false dans TXMResult.compute() alors renderChart() ne sera pas appelé 
......
1839 1839
			boolean d1 = this.needsFullRecomputing; // FIXME: SJ: need to try again to stop to use this parameter
1840 1840
			boolean d2 = this.isDirtyFromHistory();
1841 1841
			boolean d3 = this.isDirty();
1842
			if (!d1 && !d2 && !d3) {
1842
			if (
1843
					!d1 &&
1844
					
1845
					!d2 && !d3) {
1843 1846
				// needsFullRecomputing == true && isDirtyFromHistory == true && isDirty == true
1844
				Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": result parameters have not changed since last computing, computing skipped.");
1847
				Log.finest("--- TXMResult.compute(): " + this.getClass().getSimpleName() + ": result parameters have not changed since last computing, computing skipped.");
1845 1848
				skipComputing = true;
1846 1849
			}
1847 1850

  
1848 1851
			if(!skipComputing)	{
1849 1852

  
1850 1853
				// FIXME: Debug
1851
				Log.finest("TXMResult.compute(): " + this.getClass().getSimpleName() + ": computing result of type " + this.getClass() + "...");
1854
				Log.finest("+++ TXMResult.compute(): " + this.getClass().getSimpleName() + ": computing result of type " + this.getClass() + "...");
1852 1855

  
1853 1856
				// TODO THIS IS FUCKING LAZY LINE CODES OH YEAH YOU MAD BRO
1854 1857
				// TODO where do we put this parent compute ? :o
tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java (revision 1165)
213 213
	public boolean canCompute() {
214 214

  
215 215
		// null or empty queries
216
		if (this.queries == null || this.queries.size() == 0)	{
216
		if (this.queries == null || this.queries.isEmpty())	{
217 217
			Log.severe("Progression.canCompute(): can not compute with no query."); //$NON-NLS-1$
218 218
			return false;
219 219
		}
tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionCumulativeChartCreator.java (revision 1165)
120 120
		
121 121
		
122 122
		// Fill the data set from the result
123
		if(progression.hasParameterChanged(TXMPreferences.QUERIES))	{
123
		if(progression.hasParameterChanged(TXMPreferences.QUERIES, true))	{
124 124
			XYSeriesCollection dataset = (XYSeriesCollection) chart.getXYPlot().getDataset();
125 125
			dataset.removeAllSeries();
126 126
			
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java (revision 1165)
499 499
	public static final double[] toDouble(REXP rexp) throws RWorkspaceException {
500 500
		try {
501 501
			return rexp.asDoubles();
502
		} catch (REXPMismatchException e) {
502
		} catch (Exception e) {
503 503
			throw new RWorkspaceException(e);
504 504
		}
505 505
	}
......
669 669
		// try {
670 670
		// m = new
671 671
		// DenseDoubleMatrix2D(connection.eval(variableName).asDoubleMatrix());
672
		// } catch (REXPMismatchException e) {
672
		// } catch (Exception e) {
673 673
		// // TODO Auto-generated catch block
674 674
		// org.txm.utils.logger.Log.printStackTrace(e);
675 675
		// } catch (RserveException e) {
......
715 715
	 * of column in every row.
716 716
	 * @throws RWorkspaceException the r workspace exception
717 717
	 */
718
	public void addMatrixToWorkspace(String variableName, int[][] matrix)
719
			throws RWorkspaceException {
718
	public void addMatrixToWorkspace(String variableName, int[][] matrix) throws RWorkspaceException {
720 719
		int ncol = 0;
721 720
		if (matrix.length == 0) {
722 721
			ncol = 0;
723
		} else {
722
		}
723
		else {
724 724
			ncol = matrix[0].length;
725 725
		}
726 726
		int nrow = matrix.length;
......
737 737
			} catch (RserveException e) {
738 738
				throw new RWorkspaceException(e);
739 739
			}
740
		} else {
740
		}
741
		else {
741 742
			comm.assign(variableName, vector, nrow, ncol);
742 743
		}
743 744
		Log.finest("MATRIX_ADDED_TO_WORKSPACE" + new Object[] { nrow, ncol, variableName }); //$NON-NLS-1$
......
750 751
	 * @param vector the vector
751 752
	 * @throws RWorkspaceException the r workspace exception
752 753
	 */
753
	public void addVectorToWorkspace(String variableName, double[] vector)
754
			throws RWorkspaceException {
754
	public void addVectorToWorkspace(String variableName, double[] vector) throws RWorkspaceException {
755 755
		if (filecommunication) {
756 756
			comm.assign(variableName, vector);
757
		} else {
757
		}
758
		else {
758 759
			try {
759 760
				connection.assign(variableName, vector);
760 761
			} catch (REngineException e) {
......
772 773
	 * @param vector the vector
773 774
	 * @throws RWorkspaceException the r workspace exception
774 775
	 */
775
	public void addVectorToWorkspace(String variableName, DoubleArrayList vector)
776
			throws RWorkspaceException {
776
	public void addVectorToWorkspace(String variableName, DoubleArrayList vector) throws RWorkspaceException {
777 777

  
778 778
		vector.trimToSize();
779 779
		double[] vald = vector.elements();
780 780
		if (filecommunication) {
781 781
			comm.assign(variableName, vald);
782
		} else {
782
		}
783
		else {
783 784
			try {
784 785
				connection.assign(variableName, vald);
785 786
			} catch (REngineException e) {
......
796 797
	 * @param vector the vector
797 798
	 * @throws RWorkspaceException the r workspace exception
798 799
	 */
799
	public void addVectorToWorkspace(String variableName, int[] vector)
800
			throws RWorkspaceException {
800
	public void addVectorToWorkspace(String variableName, int[] vector) throws RWorkspaceException {
801 801
		//checkForDuplicateVariable(variableName);
802 802
		if (filecommunication) {
803 803
			comm.assign(variableName, vector);
804
		} else {
804
		}
805
		else {
805 806
			try {
806 807
				connection.assign(variableName, vector);
807 808
			} catch (REngineException e) {
......
819 820
	 * @param vector the vector
820 821
	 * @throws RWorkspaceException the r workspace exception
821 822
	 */
822
	public void addVectorToWorkspace(String variableName, IntArrayList vector)
823
			throws RWorkspaceException {
823
	public void addVectorToWorkspace(String variableName, IntArrayList vector) throws RWorkspaceException {
824 824
		vector.trimToSize();
825 825
		int[] vald = vector.elements();
826 826
		if (filecommunication) {
......
845 845
	 * @param vector the vector
846 846
	 * @throws RWorkspaceException the r workspace exception
847 847
	 */
848
	public void addVectorToWorkspace(String variableName, String[] vector)
849
			throws RWorkspaceException {
848
	public void addVectorToWorkspace(String variableName, String[] vector) throws RWorkspaceException {
850 849

  
851 850
		try {
852 851
			connection.assign(variableName, vector);
......
1073 1072
		} catch (RserveException e) {
1074 1073
			RWorkspace.printLastSafeEvalExpr();
1075 1074
			throw new RWorkspaceException(e);
1076
		} catch (REXPMismatchException e) {
1075
		} catch (Exception e) {
1077 1076
			throw new RException(exp + "; " + e.getMessage(), e); //$NON-NLS-1$
1078 1077
		}
1079 1078
//		if(this.isLoggingEvalCommandLines())	{
......
1093 1092
		double[] res = null;
1094 1093
		try {
1095 1094
			res = eval(exp).asDoubles();
1096
		} catch (REXPMismatchException e) {
1095
		} catch (Exception e) {
1097 1096
			throw new RWorkspaceException(e);
1098 1097
		}
1099 1098
		return res;
......
1117 1116
		double[][] res = null;
1118 1117
		try {
1119 1118
			res = eval(exp).asDoubleMatrix();
1120
		} catch (REXPMismatchException e) {
1119
		} catch (Exception e) {
1121 1120
			throw new RWorkspaceException(e);
1122 1121
		}
1123 1122
		return res;
......
1145 1144
					res[j][i] = tmp[c++];
1146 1145
				}
1147 1146
			}
1148
		} catch (REXPMismatchException e) {
1147
		} catch (Exception e) {
1149 1148
			throw new RWorkspaceException(e);
1150 1149
		}
1151 1150
		return res;
......
1162 1161
		String[] res = null;
1163 1162
		try {
1164 1163
			res = eval(exp).asStrings();
1165
		} catch (REXPMismatchException e) {
1164
		} catch (Exception e) {
1166 1165
			throw new RWorkspaceException(e);
1167 1166
		}
1168 1167
		return res;
......
1176 1175
	 * @return the rEXP
1177 1176
	 * @throws RWorkspaceException the r workspace exception
1178 1177
	 */
1179
	public REXP extractItemFromListByName(REXP list, String item_name)
1180
			throws RWorkspaceException {
1178
	public REXP extractItemFromListByName(REXP list, String item_name) throws RWorkspaceException {
1181 1179
		try {
1182 1180
			return list.asList().at(item_name);
1183
		} catch (REXPMismatchException e) {
1181
		} catch (Exception e) {
1184 1182
			throw new RWorkspaceException(RCoreMessages.error_errorDuringItemsListExtraction
1185 1183
					+ e.getMessage()); 
1186 1184
		}
......
1194 1192
	 * @return the rEXP
1195 1193
	 * @throws RWorkspaceException the r workspace exception
1196 1194
	 */
1197
	public REXP extractItemFromListByName(String list_symbol, String item_name)
1198
			throws RWorkspaceException {
1195
	public REXP extractItemFromListByName(String list_symbol, String item_name) throws RWorkspaceException {
1199 1196
		return eval(list_symbol + RConstant.LIST_EXTRACTOR + item_name);
1200 1197
	}
1201 1198

  
......
1229 1226
		}
1230 1227
		try {
1231 1228
			return res.asStrings();
1232
		} catch (REXPMismatchException e) {
1229
		} catch (Exception e) {
1233 1230
			throw new RWorkspaceException(e);
1234 1231
		}
1235 1232
	}
......
1387 1384
	 * @param variableName the variable name
1388 1385
	 * @throws RWorkspaceException the r workspace exception
1389 1386
	 */
1390
	public void removeVariableFromWorkspace(String variableName)
1391
			throws RWorkspaceException {
1387
	public void removeVariableFromWorkspace(String variableName) throws RWorkspaceException {
1392 1388
		try {
1393 1389
			connection.voidEval("rm(" + variableName + ")"); //$NON-NLS-1$ //$NON-NLS-2$
1394 1390
		} catch (RserveException e) {
......
1406 1402
	 * @throws RException the r exception
1407 1403
	 * @throws REXPMismatchException the rEXP mismatch exception
1408 1404
	 */
1409
	public synchronized REXP safeEval(String expr) throws RserveException, RException,
1410
	REXPMismatchException {
1405
	public synchronized REXP safeEval(String expr) throws RserveException, RException, REXPMismatchException {
1411 1406
		if (logging && inputLogger != null ) inputLogger.printMessage(expr); //$NON-NLS-1$
1412 1407
		lastSafeevalExpr = expr;
1413 1408
		
......
1520 1515
				out =  "result: "+ret;
1521 1516
			}
1522 1517
			
1523
		} catch (REXPMismatchException e) {
1524
			System.out.println("REXPMismatchException: "+e);
1525
			Log.printStackTrace(e);
1526 1518
		} catch (RserveException e) {
1527 1519
			System.out.println(NLS.bind(RCoreMessages.error_evaluationError, e.getMessage(), exp));
1528 1520
			Log.printStackTrace(e);
1521
		} catch (Exception e) {
1522
			System.out.println("REXPMismatchException: "+e);
1523
			Log.printStackTrace(e);
1529 1524
		}
1530

  
1531 1525
		if(this.isLoggingEvalCommandLines())	{
1532 1526
			Log.finest("EVALUATED_EXPRESSION: " + exp ); //$NON-NLS-1$
1533 1527
		}
......
1552 1546
			safeEval(exp);
1553 1547
		} catch (RserveException e) {
1554 1548
			org.txm.utils.logger.Log.printStackTrace(e);
1555
		} catch (REXPMismatchException e) {
1549
		} catch (Exception e) {
1556 1550
			org.txm.utils.logger.Log.printStackTrace(e);
1557 1551
		}
1558 1552

  
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionXYLineAndShapeRenderer.java (revision 1165)
15 15
import org.jfree.chart.axis.SymbolAxis;
16 16
import org.jfree.chart.axis.ValueAxis;
17 17
import org.jfree.chart.labels.XYToolTipGenerator;
18
import org.jfree.chart.plot.CategoryPlot;
18 19
import org.jfree.chart.plot.CrosshairState;
19 20
import org.jfree.chart.plot.PlotRenderingInfo;
20 21
import org.jfree.chart.plot.XYPlot;
......
73 74

  
74 75
		this.multipleItemsSelector = new MultipleItemsSelector(this);
75 76
		this.multipleItemsSelector.setResult(result);
77

  
78
//		// FIXME: test to recycle the existing chart panel to fix a null pointer exception in the renderer
79
//		if(result.getChart() != null)	{
80
//			JFreeChart existingChart = (JFreeChart) result.getChart();
81
//			if(existingChart.getPlot() instanceof XYPlot && existingChart.getXYPlot().getRenderer() instanceof IRendererWithItemSelection)	{
82
//				this.multipleItemsSelector.setChartPanel(((IRendererWithItemSelection) existingChart.getXYPlot().getRenderer()).getItemsSelector().getChartPanel());
83
//			}
84
//			else if(existingChart.getPlot() instanceof CategoryPlot && existingChart.getCategoryPlot().getRenderer() instanceof IRendererWithItemSelection)	{
85
//				this.multipleItemsSelector.setChartPanel(((IRendererWithItemSelection) existingChart.getCategoryPlot().getRenderer()).getItemsSelector().getChartPanel());
86
//			}
87
//		}
76 88
		
77 89
		this.chart = chart;
78 90
		
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/renderers/MouseOverItemSelector.java (revision 1165)
6 6
import java.util.Map;
7 7

  
8 8
import org.jfree.chart.ChartPanel;
9
import org.jfree.chart.JFreeChart;
9 10
import org.jfree.chart.event.RendererChangeEvent;
11
import org.jfree.chart.plot.CategoryPlot;
12
import org.jfree.chart.plot.XYPlot;
10 13
import org.txm.chartsengine.core.results.ChartResult;
11 14
import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection;
12 15
import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.renderers.ItemSelectionXYLineAndShapeRenderer;
......
213 216
	 */
214 217
	public void setResult(ChartResult result) {
215 218
		this.result = result;
219
		
220
		// FIXME: test to recycle the existing chart panel to fix a null pointer exception in the renderer
221
		if(result.getChart() != null)	{
222
			JFreeChart existingChart = (JFreeChart) result.getChart();
223
			if(existingChart.getPlot() instanceof XYPlot && existingChart.getXYPlot().getRenderer() instanceof IRendererWithItemSelection)	{
224
				this.setChartPanel(((IRendererWithItemSelection) existingChart.getXYPlot().getRenderer()).getItemsSelector().getChartPanel());
225
			}
226
			else if(existingChart.getPlot() instanceof CategoryPlot && existingChart.getCategoryPlot().getRenderer() instanceof IRendererWithItemSelection)	{
227
				this.setChartPanel(((IRendererWithItemSelection) existingChart.getCategoryPlot().getRenderer()).getItemsSelector().getChartPanel());
228
			}
229
		}
230

  
216 231
	}
217 232

  
218 233

  
......
331 346
	 * @return the chartPanel
332 347
	 */
333 348
	public ChartPanel getChartPanel() {
334
		return chartPanel;
349
		return this.chartPanel;
335 350
	}
336 351

  
337 352

  
tmp/org.txm.ahc.rcp/src/org/txm/ahc/rcp/editors/AHCChartEditor.java (revision 1165)
11 11
import org.txm.chartsengine.rcp.editors.ChartEditor;
12 12
import org.txm.core.results.Parameter;
13 13
import org.txm.rcp.IImageKeys;
14
import org.txm.rcp.editors.listeners.ComputeKeyListener;
14 15
import org.txm.rcp.editors.listeners.ComputeSelectionListener;
15 16

  
16 17
/**
......
69 70
		// Extend the chart editor tool bar
70 71
		new ToolItem(this.chartToolBar, SWT.SEPARATOR);
71 72

  
73
		
74
		// Computing listeners
75
		ComputeSelectionListener computeSelectionListener = new ComputeSelectionListener(this);
76
		ComputeKeyListener computeKeyListener = new ComputeKeyListener(this);
77
		
72 78
		// Number of clusters
73 79
	    CLabel clustersLabel = new CLabel(this.chartToolBar, SWT.CENTER);
74 80
		clustersLabel.setText(AHCUIMessages.toolbars_numberOfClusters);
......
78 84
	    this.numberOfClusters.setMinimum(2);
79 85
	    this.numberOfClusters.setIncrement(1);
80 86
	    this.chartToolBar.addControl(this.numberOfClusters);
81
	    this.numberOfClusters.addSelectionListener(new ComputeSelectionListener(this));
87
	    this.numberOfClusters.addSelectionListener(computeSelectionListener);
88
	    this.numberOfClusters.addKeyListener(computeKeyListener);
82 89

  
83 90

  
84 91
		// Columns
85 92
		this.columnsComputing = new ToolItem(this.chartToolBar, SWT.RADIO);
86 93
		this.columnsComputing.setToolTipText(AHCUIMessages.tooltips_computeColumns);
87 94
		this.columnsComputing.setImage(IImageKeys.getImage(AHCChartEditor.class, "icons/compute_columns.png")); //$NON-NLS-1$
88
		this.columnsComputing.addSelectionListener(new ComputeSelectionListener(this));
95
		this.columnsComputing.addSelectionListener(computeSelectionListener);
89 96

  
90 97
		// Rows
91 98
		this.rowsComputing = new ToolItem(this.chartToolBar, SWT.RADIO);
......
97 104
		this.rendering2D = new Button(this.chartToolBar, SWT.CHECK);
98 105
		this.rendering2D.setText("2D");//$NON-NLS-1$
99 106
		this.chartToolBar.addControl(this.rendering2D);
100
		this.rendering2D.addSelectionListener(new ComputeSelectionListener(this));
107
		this.rendering2D.addSelectionListener(computeSelectionListener);
101 108

  
102 109
	}
103 110

  
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 1165)
944 944
			//voc.toTxt(new File("/home/mdecorde/TEMP/before.tsv"), "UTF-8", "\t", "");
945 945
			try {
946 946
				index.alterFrequencies(referenceCorpus);
947
			} catch (REXPMismatchException e) {
947
			} catch (Exception e) {
948 948
				// TODO Auto-generated catch block
949 949
				org.txm.utils.logger.Log.printStackTrace(e);
950 950
				return false;
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java (revision 1165)
154 154
			System.out.println("length ltnames: "+rw.eval("length(ltnames)").asInteger());
155 155
			System.out.println("ncol: "+rw.eval("ncol("+symbol+")").asInteger());
156 156
			System.out.println("nrow: "+rw.eval("nrow("+symbol+")").asInteger());
157
		} catch (REXPMismatchException e) {
157
		} catch (Exception e) {
158 158
			// TODO Auto-generated catch block
159 159
			e.printStackTrace();
160 160
		}
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java (revision 1165)
513 513
	/**
514 514
	 * Creates the chart container component from the chart object stored into the composite.
515 515
	 */
516
	public void createChartContainer()	{
517
		this.getSWTChartsComponentsProvider().createChartContainer(this.getEditorInput());
518
	}
516
	// FIXME: became useless?
517
//	public void createChartContainer()	{
518
//		this.getSWTChartsComponentsProvider().createChartContainer(this.getEditorInput());
519
//	}
519 520
	
520 521
	/**
521 522
	 * Disposes the editor.
......
546 547
	
547 548

  
548 549
	/**
549
	 * 
550
	 * Gets the chart type. A same result can be drawn as multiple chart types (eg. pie, bar, etc.).
550 551
	 * @return
551 552
	 */
552 553
	public String getChartType()	{
tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/CAItemSelectionRenderer.java (revision 1165)
42 42
	 */
43 43
	public CAItemSelectionRenderer(CA ca, JFreeChart chart) {
44 44
		super(ca, chart);
45
		this.multipleItemsSelector.setResult(ca);
46 45
	}
47 46

  
48 47

  
......
179 178

  
180 179
		Shape s;
181 180

  
181
//		String label = ((CAXYDataset) this.getPlot().getDataset()).getLabel(series, item);
182
//		Font font = this.getItemLabelFont(series, item);
183
//		Rectangle2D bounds = font.getStringBounds(label, ((Graphics2D) this.multipleItemsSelector.getChartPanel().getGraphics()).getFontRenderContext());
184
		
185
		
182 186
		// visible shapes mode
183 187
		if(((CA) this.multipleItemsSelector.getResult()).isShowPointShapes())	{
184 188

  
......
189 193
			if(this.multipleItemsSelector.isMouseOverItem(series, item) || this.multipleItemsSelector.isSelectedItem(series, item)) {
190 194

  
191 195
				// Add a background rectangle to the label selected item
192
				String label2 = ((CAXYDataset) this.getPlot().getDataset()).getLabel(series, item);
196
				String label = ((CAXYDataset) this.getPlot().getDataset()).getLabel(series, item);
197
				Font font = this.getItemLabelFont(series, item);
198
				Rectangle2D bounds = font.getStringBounds(label, ((Graphics2D) this.multipleItemsSelector.getChartPanel().getGraphics()).getFontRenderContext());
193 199

  
194
				Font font2 = this.getItemLabelFont(series, item);
195
				Rectangle2D bounds2 = font2.getStringBounds(label2, ((Graphics2D) this.multipleItemsSelector.getChartPanel().getGraphics()).getFontRenderContext());
196

  
197 200
				// FIXME : not rounded rectangle version
198 201
//				Shape labelBackground = new Rectangle2D.Double(-bounds.getWidth() / 2, -s.getBounds2D().getHeight() / 2 + 1, bounds.getWidth() + 4, bounds.getHeight() / 2 + 8);
199 202

  
200
				Shape labelBackground = new RoundRectangle2D.Double(-(bounds2.getWidth() + 4) / 2, -s.getBounds2D().getHeight() / 2 + 1, bounds2.getWidth() + 8, bounds2.getHeight() / 2 + 10, 5, 5);
203
				Shape labelBackground = new RoundRectangle2D.Double(-(bounds.getWidth() + 4) / 2, -s.getBounds2D().getHeight() / 2 + 1, bounds.getWidth() + 8, bounds.getHeight() / 2 + 10, 5, 5);
201 204

  
202 205
				AffineTransform t = new AffineTransform();
203
				t.setToTranslation(0,  bounds2.getCenterY() - 2 - bounds2.getHeight() / 2);
206
				t.setToTranslation(0,  bounds.getCenterY() - 2 - bounds.getHeight() / 2);
204 207
				labelBackground = t.createTransformedShape(labelBackground);
205 208
				
206 209
				Area a = new Area(s);
......
218 221
			}
219 222

  
220 223
		}
221
		// non visible shapes mode, sets the shape as bounding box of the item label
224
		// non visible shapes mode, sets the shape as bounding box of the item label (essentially for the mouse selection purpose)
222 225
		else	{
226
//			String label = ((CAXYDataset) this.getPlot().getDataset()).getLabel(series, item);
227
//			Font font = this.getItemLabelFont(series, item);
228
//			Rectangle2D bounds = font.
229
//					getStringBounds(label
230
//							, ((Graphics2D) this.multipleItemsSelector.
231
//									getChartPanel().
232
//									getGraphics()).
233
//							getFontRenderContext());
234
			
235
			
223 236
			String label = ((CAXYDataset) this.getPlot().getDataset()).getLabel(series, item);
237
			Font font = this.getItemLabelFont(series, item);
238
			Rectangle2D bounds = font.getStringBounds(label, ((Graphics2D) this.multipleItemsSelector
239
					.getChartPanel()
240
					.getGraphics())
241
					.getFontRenderContext());
224 242

  
225
			Font font = this.getItemLabelFont(series, item);
226
			Rectangle2D bounds = font.
227
					getStringBounds(label
228
							, ((Graphics2D) this.multipleItemsSelector.getChartPanel().getGraphics()).getFontRenderContext());
243
			
229 244
			s = new RoundRectangle2D.Double(-(bounds.getWidth()) / 2, -bounds.getHeight() / 2, bounds.getWidth(), bounds.getHeight() - 2 , 5, 5);
230 245
			
231 246
			// Highlight selected item
tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/FactoMineRCA.java (revision 1165)
133 133
				// Arrays.sort(rowdist);
134 134
			} catch (RWorkspaceException e) {
135 135
				throw new StatException(CACoreMessages.error_failedToGetContributionColumn + e.getMessage(), e);
136
			} catch (REXPMismatchException e) {
136
			} catch (Exception e) {
137 137
				// TODO Auto-generated catch block
138 138
				org.txm.utils.logger.Log.printStackTrace(e);
139 139
			}
......
153 153
				// Arrays.sort(rowdist);
154 154
			} catch (RWorkspaceException e) {
155 155
				throw new StatException(CACoreMessages.error_failedToGetCos2Column + e.getMessage(), e);
156
			} catch (REXPMismatchException e) {
156
			} catch (Exception e) {
157 157
				// TODO Auto-generated catch block
158 158
				org.txm.utils.logger.Log.printStackTrace(e);
159 159
			}
......
280 280
				// Arrays.sort(rowdist);
281 281
			} catch (RWorkspaceException e) {
282 282
				throw new StatException(CACoreMessages.error_failedToGetConstributionRow + e.getMessage(), e);
283
			} catch (REXPMismatchException e) {
283
			} catch (Exception e) {
284 284
				// TODO Auto-generated catch block
285 285
				org.txm.utils.logger.Log.printStackTrace(e);
286 286
			}
......
300 300
				// Arrays.sort(rowdist);
301 301
			} catch (RWorkspaceException e) {
302 302
				throw new StatException(CACoreMessages.error_failedToGetCos2Row + e.getMessage(), e);
303
			} catch (REXPMismatchException e) {
303
			} catch (Exception e) {
304 304
				// TODO Auto-generated catch block
305 305
				org.txm.utils.logger.Log.printStackTrace(e);
306 306
			}
tmp/org.txm.specificities.core/src/org/txm/specificities/core/statsengine/r/function/SpecificitiesR.java (revision 1165)
138 138
		double[][] res;
139 139
		try {
140 140
			res = r.asDoubleMatrix();
141
		} catch (REXPMismatchException e) {
141
		} catch (Exception e) {
142 142
			throw new StatException(SpecificitiesCoreMessages.ComputeError_FAILED_TO_GET_SPECIFICITIES + e.getMessage(), e);
143 143
		}
144 144
		Log.finest((res.length * res[0].length) + SpecificitiesCoreMessages.Specificites_2);

Formats disponibles : Unified diff