Index: tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java
===================================================================
--- tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java	(revision 638)
+++ tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java	(revision 639)
@@ -136,7 +136,7 @@
 	 */
 	protected boolean renderChart() throws Exception {
 
-		this.subTask("Rendering chart.");
+		this.subTask("Rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + ".");
 
 		// FIXME: Debug
 		System.err.println("ChartResult.renderChart(): rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "...");
@@ -235,10 +235,10 @@
 	
 	/**
 	 * Clears the parameters used for last rendering.
-	 * Dedicated to force a chart recreation, eg. for cloning the chart result.
+	 * Dedicated to force a chart recreation, eg. for cloning the chart result or for dynamically changing the chart type .
 	 * @throws Exception
 	 */
-	protected void clearLastRenderingParameters() throws Exception {
+	protected void clearLastRenderingParameters() {
 		this.clearLastParameters(Parameter.RENDERING);
 	}
 	
@@ -331,10 +331,29 @@
 	 */
 	public void setChartType(String chartType) {
 		this.chartType = chartType;
+		// clear all last parameters to force a full recomputing
+		this.clearLastComputingParameters();
+		this.clearLastRenderingParameters();
 	}
 
+	/**
+	 * Sets the chart type as default.
+	 */
+	public void setDefaultChartType()	{
+		this.setChartType(ChartsEnginePreferences.DEFAULT_CHART_TYPE);
+	}
 
 	/**
+	 * Checks if the current chart type is the default one.
+	 * @return
+	 */
+	public boolean isDefaultChartType()	{
+		return ChartsEnginePreferences.DEFAULT_CHART_TYPE.equals(this.chartType);
+	}
+
+	
+	
+	/**
 	 * @return the chartDirty
 	 */
 	public boolean isChartDirty() {
@@ -492,6 +511,7 @@
 	}
 
 	
+	
 	// FIXME
 //	public Object createChart(IProgressMonitor monitor, String chartType)	{
 //		Object chart = null;
Index: tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java
===================================================================
--- tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java	(revision 638)
+++ tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java	(revision 639)
@@ -117,28 +117,44 @@
 	 * @param chartType
 	 * @return A chart creator if it exists otherwise <code>null</code>
 	 */
-	public ChartCreator getChartCreator(ChartResult result, String chartType)	{
+	public ChartCreator getChartCreator(ChartResult result, String chartType, boolean showLogWarning)	{
 		ChartCreator chartCreator = null;
 		HashMap<String, ChartCreator> map = this.chartCreators.get(result.getClass());
 		if(map != null)	{
 			chartCreator = map.get(chartType);
 		}
 		
-		if(chartCreator == null)	{
+		if(chartCreator == null && showLogWarning)	{
 			Log.warning(this.name + ": No chart creator can be found for result: " + result.getClass() + " and chart type: " + chartType);
 		}
 		return chartCreator;
 	}
 	
+	
+	public ChartCreator getChartCreator(ChartResult result, String chartType)	{
+		return this.getChartCreator(result, true);
+	}
+	
 	/**
 	 * Gets a chart creator for the specified result.
 	 * @param resultDataType
 	 * @return A chart creator if it exists otherwise <code>null</code>
 	 */
+	public ChartCreator getChartCreator(ChartResult result, boolean showLogWarning)	{
+		return this.getChartCreator(result, result.getChartType(), showLogWarning);
+	}
+
+	/**
+	 * Gets a chart creator for the specified result.
+	 * @param result
+	 * @param showLogWarning
+	 * @return
+	 */
 	public ChartCreator getChartCreator(ChartResult result)	{
 		return this.getChartCreator(result, result.getChartType());
 	}
 
+	
 	/**
 	 *  Gets a chart creator for the specified result data type.
 	 * @param resultDataType
@@ -163,7 +179,28 @@
 		return chartCreators;
 	}
 	
+
 	/**
+	 * Checks if the charts engine can create a chart according to the specified result data type and chart type.
+	 * @param resultDataType
+	 * @param chartType
+	 * @return <code>True</code> if a chart creator can be found, otherwise <code>false</code>
+	 */
+	public boolean canCreateChart(ChartResult result, String chartType)	{
+		return this.getChartCreator(result, chartType, false) != null;
+	}
+
+	/**
+	 * Checks if the charts engine can create a chart according to the specified result data type.
+	 * @param resultDataType
+	 * @return <code>True</code> if a chart creator can be found, otherwise <code>false</code>
+	 */
+	public boolean canCreateChart(ChartResult result)	{
+		return this.getChartCreator(result, false) != null;
+	}
+	
+	
+	/**
 	 * Adds a chart creator for the specified result data type and chart type.
 	 * @param resultDataType
 	 * @param chartCreator
@@ -202,25 +239,6 @@
 	}
 
 	/**
-	 * Checks if the charts engine can create a chart according to the specified result data type and chart type.
-	 * @param resultDataType
-	 * @param chartType
-	 * @return <code>True</code> if a chart creator can be found, otherwise <code>false</code>
-	 */
-	public boolean canCreateChart(ChartResult result, String chartType)	{
-		return this.getChartCreator(result, chartType) != null;
-	}
-
-	/**
-	 * Checks if the charts engine can create a chart according to the specified result data type.
-	 * @param resultDataType
-	 * @return <code>True</code> if a chart creator can be found, otherwise <code>false</code>
-	 */
-	public boolean canCreateChart(ChartResult result)	{
-		return this.getChartCreator(result) != null;
-	}
-	
-	/**
 	 * Creates and stores charts engines from installed extension contributions.
 	 * @param outputFormat
 	 */
@@ -395,6 +413,7 @@
 		}
 		catch (IOException e) {
 			Log.severe(ChartsEngineCoreMessages.error_cantCreateTmpChartFile + e);
+			Log.printStackTrace(e);
 		}
 
 		// TODO : old code, useful ? and/or return null instead of the file if canWrite() return false ?
Index: tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 638)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 639)
@@ -218,7 +218,7 @@
 	 * @param parameterType
 	 * @throws Exception
 	 */
-	protected void clearLastParameters(int parameterType) throws Exception {
+	protected void clearLastParameters(int parameterType) {
 		List<Field> fields = this.getAllFields();
 
 		for (Field f : fields) {
@@ -242,6 +242,16 @@
 	}
 
 
+	/**
+	 * Clears the parameters used for last computing.
+	 * Dedicated to force a full recomputing.
+	 * @throws Exception
+	 */
+	protected void clearLastComputingParameters() {
+		this.clearLastParameters(Parameter.COMPUTING);
+	}
+	
+	
 	public HashMap<String, Object> getLastParameters() {
 		return lastParameters;
 	}
@@ -757,7 +767,9 @@
 			targetField.setAccessible(true);
 			
 			// FIXME: debug
-			System.err.println("TXMResult.setParameter(): setting parameter " + key + " = " + value + " for " + this.getClass() + " (" + value.getClass() + ")");
+			if(value != null)	{
+				System.err.println("TXMResult.setParameter(): setting parameter " + key + " = " + value + " for " + this.getClass() + " (" + value.getClass() + ")");
+			}
 			
 			targetField.set(this, value);
 		}
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java	(revision 638)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java	(revision 639)
@@ -205,6 +205,29 @@
 	@Override
 	protected final void __updateEditorFromResult(boolean update) {
 		
+		
+		// check that the charts engine used for the result matches the SWT components provider otherwise fin a suitable components provider
+		ChartsEngine chartsEngine = ChartsEngine.getChartsEngine(this.getResult()); 
+		if(chartsEngine != this.getSWTChartsComponentsProvider().getChartsEngine())	{
+			this.getEditorInput().setSWTChartsComponentsProvider(SWTChartsComponentsProvider.getComponentsProvider(chartsEngine));
+			this.getSWTChartsComponentsProvider().setChartsEngine(chartsEngine);
+			System.err.println("ChartEditor.__updateEditorFromResult(): charts engine used to create the chart is not the current one. The SWT components provider has been changed to match it: " + this.getSWTChartsComponentsProvider() + ".");
+			
+			// recreating the chart composite
+			Composite parent = this.chartComposite.getParent();
+			this.chartComposite.dispose();
+			this.chartComposite = this.getSWTChartsComponentsProvider().createComposite(this, parent);
+			
+			GridData gd = new GridData(GridData.FILL_BOTH);
+//			gd.grabExcessVerticalSpace = true;
+//			gd.grabExcessHorizontalSpace = true;
+			//gd.horizontalSpan = 2; // 2 for match the command parameters toolbar AND the chart toolbar
+			this.chartComposite.setLayoutData(gd);
+			parent.layout();
+		}
+
+		
+		
 		// loading chart
 		this.getResult().subTask("Loading chart.");
 		this.loadChart();
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorInput.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorInput.java	(revision 638)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorInput.java	(revision 639)
@@ -70,12 +70,12 @@
 		this.swtChartsComponentsProvider = swtComponentsProvider;
 		this.chartContainer = chartContainer;
 		
-		// check that the charts engine used for the result matches the SWT components provider otherwise fin a suitable components provider
-		ChartsEngine chartsEngine = ChartsEngine.getChartsEngine(result); 
-		if(chartsEngine != swtComponentsProvider.getChartsEngine())	{
-			this.swtChartsComponentsProvider = SWTChartsComponentsProvider.getComponentsProvider(chartsEngine);
-			System.err.println("ChartEditorInput.ChartEditorInput(): charts engine used to create the chart is not the current one. The SWT components provider has been changed to match it: " + this.swtChartsComponentsProvider + ".");
-		}
+//		// check that the charts engine used for the result matches the SWT components provider otherwise fin a suitable components provider
+//		ChartsEngine chartsEngine = ChartsEngine.getChartsEngine(result); 
+//		if(chartsEngine != swtComponentsProvider.getChartsEngine())	{
+//			this.swtChartsComponentsProvider = SWTChartsComponentsProvider.getComponentsProvider(chartsEngine);
+//			System.err.println("ChartEditorInput.ChartEditorInput(): charts engine used to create the chart is not the current one. The SWT components provider has been changed to match it: " + this.swtChartsComponentsProvider + ".");
+//		}
 		
 	}
 
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionChartCreator.java	(revision 638)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionChartCreator.java	(revision 639)
@@ -1,197 +0,0 @@
-package org.txm.progression.core.chartsengine.r;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
-import org.txm.chartsengine.core.results.ChartResult;
-import org.txm.chartsengine.r.core.RChartCreator;
-import org.txm.chartsengine.r.core.themes.DefaultTheme;
-import org.txm.progression.core.chartsengine.base.ProgressionChartCreator;
-import org.txm.progression.core.chartsengine.base.Utils;
-import org.txm.progression.core.functions.Progression;
-import org.txm.progression.core.preferences.ProgressionPreferences;
-import org.txm.statsengine.r.core.RWorkspace;
-import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
-import org.txm.utils.logger.Log;
-
-/**
- * R progression chart creator.
- * @author mdecorde
- * @author sjacquot
- *
- */
-public class RProgressionChartCreator extends RChartCreator implements ProgressionChartCreator {
-
-
-	@Override
-	public File createChartFile(ChartResult result, File file) {
-
-		try {
-			
-			Progression progression = (Progression) result;
-			
-			// parameters
-			int renderingColorMode = result.getRenderingColorsMode();
-			
-			boolean cumulative = result.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE);
-			
-			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
-			rw.eval("library(textometry)");
-			// System.out.println("create list of positions");
-			
-			
-			List<int[]> allPositions = progression.getAllPositions();
-			String listString = "list("; //$NON-NLS-1$
-			for(int i = 0; i < allPositions.size(); i++) {
-				int[] positions = allPositions.get(i);
-				// System.out.println("add vector "+i);
-				rw.eval("rm(x" + i + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-				rw.addVectorToWorkspace("x" + i, positions); //$NON-NLS-1$
-				listString += "x" + i + ","; //$NON-NLS-1$ //$NON-NLS-2$
-			}
-			listString = listString.substring(0, listString.length() - 1) + ")"; //$NON-NLS-1$
-			// System.out.println("create positions");
-			rw.eval("rm(positions)"); //$NON-NLS-1$
-			rw.eval("positions <- " + listString); //$NON-NLS-1$
-
-			rw.eval("rm(structurepositions)"); //$NON-NLS-1$
-			rw.addVectorToWorkspace("structurepositions", progression.getStructurePositions()); //$NON-NLS-1$
-			rw.eval("rm(structurenames)"); //$NON-NLS-1$
-			// if (structurenames != null) structurenames = new
-			// String[structurepositions.length];
-			for(int i = 0; i < progression.getStructureNames().length; i++) { // Fix empty attribute values
-				if("".equals(progression.getStructureNames()[i]) || progression.getStructureNames()[i] == null) {  //$NON-NLS-1$
-					progression.getStructureNames()[i] = "--"; //$NON-NLS-1$
-				}
-			}
-			rw.addVectorToWorkspace("structurenames", progression.getStructureNames()); //$NON-NLS-1$
-			// System.out.println("create list positions");
-			// rw.getConnection().assign("positions",Rpositions);
-
-			this.getChartsEngine().setColors(renderingColorMode, progression.getQueries().size());
-			
-//			if(monochrome) {
-//				rw.addVectorToWorkspace("colors", DefaultTheme.monocolors); //$NON-NLS-1$
-//			}
-//			else {
-//				if(progression.getQueries().size() <= 5) {
-//					// System.out.println("uses colors5");
-//					
-//					
-//					rw.addVectorToWorkspace("colors", this.getChartsEngine().getTheme().getColorPaletteAsHexFor(5));
-//					
-//					
-//					//rw.addVectorToWorkspace("colors", DefaultTheme.colors5); //$NON-NLS-1$
-//				}
-//				else if(progression.getQueries().size() <= 10) {
-//					// System.out.println("uses colors10");
-//					rw.addVectorToWorkspace("colors", DefaultTheme.colors10); //$NON-NLS-1$
-//				}
-//				else {
-//					// System.out.println("uses colors16");
-//					rw.addVectorToWorkspace("colors", DefaultTheme.colors); //$NON-NLS-1$
-//				}
-//			}
-
-			// System.out.println("create styles vector");
-			rw.eval("rm(styles)"); //$NON-NLS-1$
-			if(progression.isMultipleLineStrokes()) {
-				rw.addVectorToWorkspace("styles", DefaultTheme.monostyles); //$NON-NLS-1$
-			}
-			else {
-				rw.addVectorToWorkspace("styles", DefaultTheme.styles); //$NON-NLS-1$
-			}
-
-			// System.out.println("create styles vector");
-			rw.eval("rm(widths)"); //$NON-NLS-1$
-			rw.addVectorToWorkspace("widths", DefaultTheme.monoWidths); //$NON-NLS-1$
-
-			// System.out.println("create names vector");
-			String[] queriesstring = new String[progression.getQueries().size()];
-			for(int i = 0; i < progression.getQueries().size(); i++) {
-				queriesstring[i] = progression.getQueries().get(i).getQueryString();
-			}
-			rw.eval("rm(names)"); //$NON-NLS-1$
-			rw.addVectorToWorkspace("names", queriesstring); //$NON-NLS-1$
-
-			String name = progression.getCorpus().getName();
-
-			// Create chart title
-			String title = "";
-			if(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_TITLE))	{
-				title = Utils.createProgressionChartTitle(progression, cumulative);
-			}
-
-			// Escape title string
-			title = StringEscapeUtils.escapeJava(title);
-
-			// System.out.println("BANDE="+bande);
-			
-			String cmd = "progression(positions, names, colors, styles, widths, \"" + name + "\"," + progression.getXminCorpus() + "," + progression.getXmaxCorpus() + ",\"" + cumulative + "\",structurepositions,structurenames, \"" + title + "\", " + progression.getBande() + ");\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
-
-			// FIXME: the grid must be plotted behind the chart and it is not possible with the current R progression object code
-			// Grid
-			if(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_GRID))	{
-				cmd += this.getChartsEngine().getGridPlotCmd();
-			}
-			
-			this.getChartsEngine().plot(file, cmd);
-
-			RWorkspace.getRWorkspaceInstance().eval(Progression.prefixR + Progression.norep + " <- list(positions=positions, names=names, xmin=" + progression.getXminCorpus() + ",xmax=" + progression.getXmaxCorpus() + ", structpositions=structurepositions, structnames=structurenames)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			Progression.norep++;
-		}
-		catch(RWorkspaceException e) {
-			// TODO Auto-generated catch block
-			org.txm.utils.logger.Log.printStackTrace(e);
-		}
-
-		return file;
-	}
-
-
-	@Override
-	public ArrayList<Integer> getSelectedPointPositions(Object chart) {
-		// FIXME: not implemented
-		Log.severe(this.getClass() + ".getProgressionChartSelectedPointPositions(): Not yet implemented."); //$NON-NLS-1$
-		return new ArrayList<Integer>(0);
-	}
-
-
-
-	@Override
-	public ArrayList<Integer> getSelectedSeries(Object chart) {
-		Log.severe(this.getClass() + ".getProgressionChartSelectedSeries(): Not yet implemented."); //$NON-NLS-1$
-		return new ArrayList<Integer>(0);
-	}
-
-
-	@Override
-	public ArrayList<Integer> getSelectedPointNumbers(Object chart) {
-		Log.severe(this.getClass() + ".getProgressionChartSelectedPointNumber(): Not yet implemented."); //$NON-NLS-1$
-		return new ArrayList<Integer>(0);
-	}
-
-
-	@Override
-	public int getLastSelectedSeries(Object chart) {
-		Log.severe(this.getClass() + ".getProgressionChartLastSelectedSeries(): Not yet implemented."); //$NON-NLS-1$
-		return -1;
-	}
-
-
-	@Override
-	public Class getResultDataClass() {
-		return Progression.class;
-	}
-
-	@Override
-	public ArrayList<ArrayList<Integer>> getAllPointPositionsBySeries(Object chart) {
-		Log.severe(this.getClass() + ".getAllPointPositionsBySeries(): Not yet implemented."); //$NON-NLS-1$
-		return null;
-	}
-
-
-}
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionCumulativeChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionCumulativeChartCreator.java	(revision 0)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionCumulativeChartCreator.java	(revision 639)
@@ -0,0 +1,197 @@
+package org.txm.progression.core.chartsengine.r;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
+import org.txm.chartsengine.core.results.ChartResult;
+import org.txm.chartsengine.r.core.RChartCreator;
+import org.txm.chartsengine.r.core.themes.DefaultTheme;
+import org.txm.progression.core.chartsengine.base.ProgressionChartCreator;
+import org.txm.progression.core.chartsengine.base.Utils;
+import org.txm.progression.core.functions.Progression;
+import org.txm.progression.core.preferences.ProgressionPreferences;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
+import org.txm.utils.logger.Log;
+
+/**
+ * R progression chart creator.
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class RProgressionCumulativeChartCreator extends RChartCreator implements ProgressionChartCreator {
+
+
+	@Override
+	public File createChartFile(ChartResult result, File file) {
+
+		try {
+			
+			Progression progression = (Progression) result;
+			
+			// parameters
+			int renderingColorMode = progression.getRenderingColorsMode();
+			
+			boolean cumulative = progression.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE);
+			
+			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+			rw.eval("library(textometry)");
+			// System.out.println("create list of positions");
+			
+			
+			List<int[]> allPositions = progression.getAllPositions();
+			String listString = "list("; //$NON-NLS-1$
+			for(int i = 0; i < allPositions.size(); i++) {
+				int[] positions = allPositions.get(i);
+				// System.out.println("add vector "+i);
+				rw.eval("rm(x" + i + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+				rw.addVectorToWorkspace("x" + i, positions); //$NON-NLS-1$
+				listString += "x" + i + ","; //$NON-NLS-1$ //$NON-NLS-2$
+			}
+			listString = listString.substring(0, listString.length() - 1) + ")"; //$NON-NLS-1$
+			// System.out.println("create positions");
+			rw.eval("rm(positions)"); //$NON-NLS-1$
+			rw.eval("positions <- " + listString); //$NON-NLS-1$
+
+			rw.eval("rm(structurepositions)"); //$NON-NLS-1$
+			rw.addVectorToWorkspace("structurepositions", progression.getStructurePositions()); //$NON-NLS-1$
+			rw.eval("rm(structurenames)"); //$NON-NLS-1$
+			// if (structurenames != null) structurenames = new
+			// String[structurepositions.length];
+			for(int i = 0; i < progression.getStructureNames().length; i++) { // Fix empty attribute values
+				if("".equals(progression.getStructureNames()[i]) || progression.getStructureNames()[i] == null) {  //$NON-NLS-1$
+					progression.getStructureNames()[i] = "--"; //$NON-NLS-1$
+				}
+			}
+			rw.addVectorToWorkspace("structurenames", progression.getStructureNames()); //$NON-NLS-1$
+			// System.out.println("create list positions");
+			// rw.getConnection().assign("positions",Rpositions);
+
+			this.getChartsEngine().setColors(renderingColorMode, progression.getQueries().size());
+			
+//			if(monochrome) {
+//				rw.addVectorToWorkspace("colors", DefaultTheme.monocolors); //$NON-NLS-1$
+//			}
+//			else {
+//				if(progression.getQueries().size() <= 5) {
+//					// System.out.println("uses colors5");
+//					
+//					
+//					rw.addVectorToWorkspace("colors", this.getChartsEngine().getTheme().getColorPaletteAsHexFor(5));
+//					
+//					
+//					//rw.addVectorToWorkspace("colors", DefaultTheme.colors5); //$NON-NLS-1$
+//				}
+//				else if(progression.getQueries().size() <= 10) {
+//					// System.out.println("uses colors10");
+//					rw.addVectorToWorkspace("colors", DefaultTheme.colors10); //$NON-NLS-1$
+//				}
+//				else {
+//					// System.out.println("uses colors16");
+//					rw.addVectorToWorkspace("colors", DefaultTheme.colors); //$NON-NLS-1$
+//				}
+//			}
+
+			// System.out.println("create styles vector");
+			rw.eval("rm(styles)"); //$NON-NLS-1$
+			if(progression.isMultipleLineStrokes()) {
+				rw.addVectorToWorkspace("styles", DefaultTheme.monostyles); //$NON-NLS-1$
+			}
+			else {
+				rw.addVectorToWorkspace("styles", DefaultTheme.styles); //$NON-NLS-1$
+			}
+
+			// System.out.println("create styles vector");
+			rw.eval("rm(widths)"); //$NON-NLS-1$
+			rw.addVectorToWorkspace("widths", DefaultTheme.monoWidths); //$NON-NLS-1$
+
+			// System.out.println("create names vector");
+			String[] queriesstring = new String[progression.getQueries().size()];
+			for(int i = 0; i < progression.getQueries().size(); i++) {
+				queriesstring[i] = progression.getQueries().get(i).getQueryString();
+			}
+			rw.eval("rm(names)"); //$NON-NLS-1$
+			rw.addVectorToWorkspace("names", queriesstring); //$NON-NLS-1$
+
+			String name = progression.getCorpus().getName();
+
+			// Create chart title
+			String title = "";
+			if(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_TITLE))	{
+				title = Utils.createProgressionChartTitle(progression, cumulative);
+			}
+
+			// Escape title string
+			title = StringEscapeUtils.escapeJava(title);
+
+			// System.out.println("BANDE="+bande);
+			
+			String cmd = "progression(positions, names, colors, styles, widths, \"" + name + "\"," + progression.getXminCorpus() + "," + progression.getXmaxCorpus() + ",\"" + cumulative + "\",structurepositions,structurenames, \"" + title + "\", " + progression.getBande() + ");\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+
+			// FIXME: the grid must be plotted behind the chart and it is not possible with the current R progression object code
+			// Grid
+			if(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_GRID))	{
+				cmd += this.getChartsEngine().getGridPlotCmd();
+			}
+			
+			this.getChartsEngine().plot(file, cmd);
+
+			RWorkspace.getRWorkspaceInstance().eval(Progression.prefixR + Progression.norep + " <- list(positions=positions, names=names, xmin=" + progression.getXminCorpus() + ",xmax=" + progression.getXmaxCorpus() + ", structpositions=structurepositions, structnames=structurenames)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			Progression.norep++;
+		}
+		catch(RWorkspaceException e) {
+			// TODO Auto-generated catch block
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+
+		return file;
+	}
+
+
+	@Override
+	public ArrayList<Integer> getSelectedPointPositions(Object chart) {
+		// FIXME: not implemented
+		Log.severe(this.getClass() + ".getProgressionChartSelectedPointPositions(): Not yet implemented."); //$NON-NLS-1$
+		return new ArrayList<Integer>(0);
+	}
+
+
+
+	@Override
+	public ArrayList<Integer> getSelectedSeries(Object chart) {
+		Log.severe(this.getClass() + ".getProgressionChartSelectedSeries(): Not yet implemented."); //$NON-NLS-1$
+		return new ArrayList<Integer>(0);
+	}
+
+
+	@Override
+	public ArrayList<Integer> getSelectedPointNumbers(Object chart) {
+		Log.severe(this.getClass() + ".getProgressionChartSelectedPointNumber(): Not yet implemented."); //$NON-NLS-1$
+		return new ArrayList<Integer>(0);
+	}
+
+
+	@Override
+	public int getLastSelectedSeries(Object chart) {
+		Log.severe(this.getClass() + ".getProgressionChartLastSelectedSeries(): Not yet implemented."); //$NON-NLS-1$
+		return -1;
+	}
+
+
+	@Override
+	public Class getResultDataClass() {
+		return Progression.class;
+	}
+
+	@Override
+	public ArrayList<ArrayList<Integer>> getAllPointPositionsBySeries(Object chart) {
+		Log.severe(this.getClass() + ".getAllPointPositionsBySeries(): Not yet implemented."); //$NON-NLS-1$
+		return null;
+	}
+
+
+}

Property changes on: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionCumulativeChartCreator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java	(revision 0)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java	(revision 639)
@@ -0,0 +1,197 @@
+package org.txm.progression.core.chartsengine.r;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
+import org.txm.chartsengine.core.results.ChartResult;
+import org.txm.chartsengine.r.core.RChartCreator;
+import org.txm.chartsengine.r.core.themes.DefaultTheme;
+import org.txm.progression.core.chartsengine.base.ProgressionChartCreator;
+import org.txm.progression.core.chartsengine.base.Utils;
+import org.txm.progression.core.functions.Progression;
+import org.txm.progression.core.preferences.ProgressionPreferences;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
+import org.txm.utils.logger.Log;
+
+/**
+ * R progression chart creator.
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class RProgressionDensityChartCreator extends RChartCreator implements ProgressionChartCreator {
+
+
+	@Override
+	public File createChartFile(ChartResult result, File file) {
+
+		try {
+			
+			Progression progression = (Progression) result;
+			
+			// parameters
+			int renderingColorMode = progression.getRenderingColorsMode();
+			
+			//boolean cumulative = progression.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE);
+			
+			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+			rw.eval("library(textometry)");
+			// System.out.println("create list of positions");
+			
+			
+			List<int[]> allPositions = progression.getAllPositions();
+			String listString = "list("; //$NON-NLS-1$
+			for(int i = 0; i < allPositions.size(); i++) {
+				int[] positions = allPositions.get(i);
+				// System.out.println("add vector "+i);
+				rw.eval("rm(x" + i + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+				rw.addVectorToWorkspace("x" + i, positions); //$NON-NLS-1$
+				listString += "x" + i + ","; //$NON-NLS-1$ //$NON-NLS-2$
+			}
+			listString = listString.substring(0, listString.length() - 1) + ")"; //$NON-NLS-1$
+			// System.out.println("create positions");
+			rw.eval("rm(positions)"); //$NON-NLS-1$
+			rw.eval("positions <- " + listString); //$NON-NLS-1$
+
+			rw.eval("rm(structurepositions)"); //$NON-NLS-1$
+			rw.addVectorToWorkspace("structurepositions", progression.getStructurePositions()); //$NON-NLS-1$
+			rw.eval("rm(structurenames)"); //$NON-NLS-1$
+			// if (structurenames != null) structurenames = new
+			// String[structurepositions.length];
+			for(int i = 0; i < progression.getStructureNames().length; i++) { // Fix empty attribute values
+				if("".equals(progression.getStructureNames()[i]) || progression.getStructureNames()[i] == null) {  //$NON-NLS-1$
+					progression.getStructureNames()[i] = "--"; //$NON-NLS-1$
+				}
+			}
+			rw.addVectorToWorkspace("structurenames", progression.getStructureNames()); //$NON-NLS-1$
+			// System.out.println("create list positions");
+			// rw.getConnection().assign("positions",Rpositions);
+
+			this.getChartsEngine().setColors(renderingColorMode, progression.getQueries().size());
+			
+//			if(monochrome) {
+//				rw.addVectorToWorkspace("colors", DefaultTheme.monocolors); //$NON-NLS-1$
+//			}
+//			else {
+//				if(progression.getQueries().size() <= 5) {
+//					// System.out.println("uses colors5");
+//					
+//					
+//					rw.addVectorToWorkspace("colors", this.getChartsEngine().getTheme().getColorPaletteAsHexFor(5));
+//					
+//					
+//					//rw.addVectorToWorkspace("colors", DefaultTheme.colors5); //$NON-NLS-1$
+//				}
+//				else if(progression.getQueries().size() <= 10) {
+//					// System.out.println("uses colors10");
+//					rw.addVectorToWorkspace("colors", DefaultTheme.colors10); //$NON-NLS-1$
+//				}
+//				else {
+//					// System.out.println("uses colors16");
+//					rw.addVectorToWorkspace("colors", DefaultTheme.colors); //$NON-NLS-1$
+//				}
+//			}
+
+			// System.out.println("create styles vector");
+			rw.eval("rm(styles)"); //$NON-NLS-1$
+			if(!progression.isMultipleLineStrokes()) {
+				rw.addVectorToWorkspace("styles", DefaultTheme.monostyles); //$NON-NLS-1$
+			}
+			else {
+				rw.addVectorToWorkspace("styles", DefaultTheme.styles); //$NON-NLS-1$
+			}
+
+			// System.out.println("create styles vector");
+			rw.eval("rm(widths)"); //$NON-NLS-1$
+			rw.addVectorToWorkspace("widths", DefaultTheme.monoWidths); //$NON-NLS-1$
+
+			// System.out.println("create names vector");
+			String[] queriesstring = new String[progression.getQueries().size()];
+			for(int i = 0; i < progression.getQueries().size(); i++) {
+				queriesstring[i] = progression.getQueries().get(i).getQueryString();
+			}
+			rw.eval("rm(names)"); //$NON-NLS-1$
+			rw.addVectorToWorkspace("names", queriesstring); //$NON-NLS-1$
+
+			String name = progression.getCorpus().getName();
+
+			// Create chart title
+			String title = "";
+			if(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_TITLE))	{
+				title = Utils.createProgressionChartTitle(progression, false);
+			}
+
+			// Escape title string
+			title = StringEscapeUtils.escapeJava(title);
+
+			// System.out.println("BANDE="+bande);
+			
+			String cmd = "progression(positions, names, colors, styles, widths, \"" + name + "\"," + progression.getXminCorpus() + "," + progression.getXmaxCorpus() + ",\"" + false + "\",structurepositions,structurenames, \"" + title + "\", " + progression.getBande() + ");\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+
+			// FIXME: the grid must be plotted behind the chart and it is not possible with the current R progression object code
+			// Grid
+			if(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_GRID))	{
+				cmd += this.getChartsEngine().getGridPlotCmd();
+			}
+			
+			this.getChartsEngine().plot(file, cmd);
+
+			RWorkspace.getRWorkspaceInstance().eval(Progression.prefixR + Progression.norep + " <- list(positions=positions, names=names, xmin=" + progression.getXminCorpus() + ",xmax=" + progression.getXmaxCorpus() + ", structpositions=structurepositions, structnames=structurenames)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			Progression.norep++;
+		}
+		catch(RWorkspaceException e) {
+			// TODO Auto-generated catch block
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+
+		return file;
+	}
+
+
+	@Override
+	public ArrayList<Integer> getSelectedPointPositions(Object chart) {
+		// FIXME: not implemented
+		Log.severe(this.getClass() + ".getProgressionChartSelectedPointPositions(): Not yet implemented."); //$NON-NLS-1$
+		return new ArrayList<Integer>(0);
+	}
+
+
+
+	@Override
+	public ArrayList<Integer> getSelectedSeries(Object chart) {
+		Log.severe(this.getClass() + ".getProgressionChartSelectedSeries(): Not yet implemented."); //$NON-NLS-1$
+		return new ArrayList<Integer>(0);
+	}
+
+
+	@Override
+	public ArrayList<Integer> getSelectedPointNumbers(Object chart) {
+		Log.severe(this.getClass() + ".getProgressionChartSelectedPointNumber(): Not yet implemented."); //$NON-NLS-1$
+		return new ArrayList<Integer>(0);
+	}
+
+
+	@Override
+	public int getLastSelectedSeries(Object chart) {
+		Log.severe(this.getClass() + ".getProgressionChartLastSelectedSeries(): Not yet implemented."); //$NON-NLS-1$
+		return -1;
+	}
+
+
+	@Override
+	public Class getResultDataClass() {
+		return Progression.class;
+	}
+
+	@Override
+	public ArrayList<ArrayList<Integer>> getAllPointPositionsBySeries(Object chart) {
+		Log.severe(this.getClass() + ".getAllPointPositionsBySeries(): Not yet implemented."); //$NON-NLS-1$
+		return null;
+	}
+
+
+}

Property changes on: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionDensityChartCreator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionChartCreator.java	(revision 638)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionChartCreator.java	(revision 639)
@@ -1,346 +0,0 @@
-package org.txm.progression.core.chartsengine.jfreechart;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.axis.NumberAxis;
-import org.jfree.chart.plot.Marker;
-import org.jfree.chart.plot.ValueMarker;
-import org.jfree.data.xy.XYDataset;
-import org.jfree.data.xy.XYSeries;
-import org.jfree.data.xy.XYSeriesCollection;
-import org.jfree.ui.RectangleAnchor;
-import org.jfree.ui.TextAnchor;
-import org.txm.chartsengine.core.ChartsEngine;
-import org.txm.chartsengine.core.results.ChartResult;
-import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
-import org.txm.chartsengine.jfreechart.core.renderers.MultipleItemsSelector;
-import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection;
-import org.txm.chartsengine.jfreechart.core.themes.base.ExtendedNumberAxis;
-import org.txm.progression.core.chartsengine.base.ProgressionChartCreator;
-import org.txm.progression.core.chartsengine.base.Utils;
-import org.txm.progression.core.chartsengine.jfreechart.themes.highcharts.renderers.ProgressionItemSelectionRenderer;
-import org.txm.progression.core.functions.Progression;
-import org.txm.progression.core.messages.ProgressionCoreMessages;
-import org.txm.progression.core.preferences.ProgressionPreferences;
-import org.txm.searchengine.cqp.corpus.query.Query;
-
-/**
- * JFC progression chart creator.
- * 
- * @author sjacquot
- *
- */
-public class JFCProgressionChartCreator extends JFCChartCreator implements ProgressionChartCreator {
-
-
-	@Override
-	public JFreeChart createChart(ChartResult result) {
-
-		
-		Progression progression = (Progression) result;
-		
-		// parameters
-		boolean cumulative = result.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE);
-		
-		
-		JFreeChart chart = null;
-
-		// Creates the empty dataset
-		XYSeriesCollection dataset = new XYSeriesCollection();
-		// Y axis label
-		String yAxisLabel;
-
-		
-		// Cumulative
-		if(cumulative)	{
-
-			// Create the chart
-			yAxisLabel = ProgressionCoreMessages.ChartsEngine_PROGRESSION_Y_AXIS_CUMULATIVE_LABEL;
-			chart = this.getChartsEngine().createXYStepChart(dataset, Utils.createProgressionChartTitle(progression, cumulative),
-					ProgressionCoreMessages.bind(ProgressionCoreMessages.ChartsEngine_PROGRESSION_X_AXIS_LABEL, progression.getXmaxCorpus()), yAxisLabel, true, true, true, true, true);
-
-
-			// Custom renderer
-			chart.getXYPlot().setRenderer(new ProgressionItemSelectionRenderer());
-
-		}
-		// FIXME : Density, to implement when textometry R package will store the result in the Progression class
-		// FIXME: put that in a new ChartCreator dedicated to the density progression chart
-		else	{
-
-			// FIXME : density not yet implemented
-			System.err.println("JFCProgressionChartCreator.createChart(): density mode not yet implemented.");
-
-//			for(int i = 0; i < progression.getAllpositions().size(); i++) {
-//				int[] liste = positions.get(i);
-//				Query query = queries.get(i);
-//				XYSeries series = new XYSeries(query.toString() + " " + liste.length);
-//
-//				for(int j = 0; j <  liste.length; j++) {
-//
-//					// FIXME : tests y
-//					// y <- c( c(0), y , c(y[[length(x)]]) ) // R code
-//					// FIXME : random Y value
-//					double y = progression.getAllpositions().get(i)[j] * Math.random();
-//	//				double y = progression.getAllpositions().get(i)[j];
-//					series.add(liste[j], y);
-//				}
-//				dataset.addSeries(series);
-//			}
-//
-//			// Create the chart
-//			yAxisLabel =  ProgressionCoreMessages.ChartsEngine_PROGRESSION_Y_AXIS_NOT_CUMULATIVE_LABEL;
-//			chart = this.getChartsEngine().createXYLineChart(dataset, Utils.createProgressionChartTitle(progression, cumulative),
-//					ProgressionCoreMessages.bind(ProgressionCoreMessages.ChartsEngine_PROGRESSION_X_AXIS_LABEL, progression.getXmaxCorpus()), yAxisLabel,
-//					true, true, true, false, true, false, true, null);
-		}
-
-
-
-        ((IRendererWithItemSelection) chart.getXYPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_PROGRESSION);
-        ((IRendererWithItemSelection) chart.getXYPlot().getRenderer()).getItemsSelector().setResultData(progression);
-
-		
-		return chart;
-		
-	}
-
-
-	@Override
-	public void updateChart(ChartResult result) {
-
-		Progression progression = (Progression) result;
-		JFreeChart chart = (JFreeChart) result.getChart();
-
-		// freeze rendering while computing
-		chart.setNotify(false);
-		
-		
-		// Fill the data set from the result
-		if(progression.hasParameterChanged(ProgressionPreferences.QUERIES))	{
-			XYSeriesCollection dataset = (XYSeriesCollection) chart.getXYPlot().getDataset();
-			dataset.removeAllSeries();
-			
-			List<int[]> positions = progression.getAllPositions();
-			List<Query> queries = progression.getQueries();
-			for(int i = 0; i < positions.size(); i++) {
-				int[] list = positions.get(i);
-				Query query = queries.get(i);
-				XYSeries series = new XYSeries(query.toString() + " " + list.length);
-				int c = 1;
-				for(int j = 0; j < list.length; j++) {
-					// add a first point to draw a vertical line
-					if(j == 0)	{
-						series.add(list[j], 0);
-					}
-					series.add(list[j], c++);
-				}
-	
-				// add a dummy point to draw horizontal line between last point and max X corpus
-				series.add(progression.getXmaxCorpus(), --c);
-				dataset.addSeries(series);
-			}
-			
-			// Custom domain axis for ticks drawing options
-			chart.getXYPlot().setDomainAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getDomainAxis(), true, true, progression.getXminCorpus(), progression.getXmaxCorpus()));
-
-			// Custom range axis for ticks drawing options
-			chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), false, true, 0, progression.getMaxY()));
-
-			// Match the X-axis origin value to the min x corpus (for subcorpus case)
-			chart.getXYPlot().getDomainAxis().setLowerBound(progression.getXminCorpus());
-		}
-		
-		
-		
-		// removes all existing domain marker
-		chart.getXYPlot().clearDomainMarkers();
-		
-		// Add the limit markers
-		BasicStroke dashedStroke = new BasicStroke(0.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f, new float[] {2f}, 0f);
-		Marker marker = new ValueMarker(progression.getXminCorpus());
-        marker.setPaint(Color.gray);
-        marker.setStroke(dashedStroke);
-        chart.getXYPlot().addDomainMarker(marker);
-		marker = new ValueMarker(progression.getXmaxCorpus());
-        marker.setPaint(Color.gray);
-        marker.setStroke(dashedStroke);
-        chart.getXYPlot().addDomainMarker(marker);
-
-
-//        // FIXME : limit with annotations rather than markers (marker height is dynamically adapted to the real chart height.
-        // Annotation have a fixed height)
-//        XYLineAnnotation annotation = new XYLineAnnotation(0, 0, 0, dataset.getRangeUpperBound(true), dashedStroke, Color.gray);
-//        chart.getXYPlot().addAnnotation(annotation, true);
-
-		// Add the part markers
-        String previousPartName = ""; //$NON-NLS-1$
-		if(progression.getStructuralUnit() != null && progression.getStructurePositions().length > 0 && 
-				(progression.hasParameterChanged(ProgressionPreferences.STRUCTURAL_UNIT) ||
-						progression.hasParameterChanged(ProgressionPreferences.STRUCTURAL_UNIT_PROPERTY) ||
-						progression.hasParameterChanged(ProgressionPreferences.REPEAT_SAME_VALUES) ||
-						progression.hasParameterChanged(ProgressionPreferences.PROPERTY_REGEX)
-						))	{
-			for(int i = 0; i < progression.getStructurePositions().length; i++) {
-				if(progression.getStructurePositions()[i] != 0)	{
-					
-					String currentPartName = progression.getStructureNames()[i];
-					
-					if(progression.isRepeatingValues() || !currentPartName.equals(previousPartName))	{
-					
-						marker = new ValueMarker(progression.getStructurePositions()[i]);
-				        marker.setPaint(Color.black);
-				        marker.setLabel(progression.getStructureNames()[i]);
-				        marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
-				        marker.setLabelTextAnchor(TextAnchor.HALF_ASCENT_LEFT);
-	
-	
-				        // FIXME: test of rotated annotations rather than using marker label. The problem with this is that the position of annotation is not adjusted when zooming/dezooming.
-				        // FIXME: the best approach is to redefine the drawing method of
-	////			        double start = marker.getStartValue();
-	////			        double end = TempIntervalMarker.getEndValue();
-	////			        double middle = (end - start)/2;
-	//			        XYTextAnnotation updateLabel = new XYTextAnnotation("Update", progression.getStructurePositions()[i], 0);
-	//			        updateLabel.setFont(new Font("Sans Serif", Font.BOLD, 10));
-	//			        updateLabel.setRotationAnchor(TextAnchor.BASELINE_CENTER);
-	//			        updateLabel.setTextAnchor(TextAnchor.BASELINE_CENTER);
-	//			        updateLabel.setRotationAngle(3.14 / 2);
-	//			        updateLabel.setPaint(Color.black);
-	//			        chart.getXYPlot().addAnnotation(updateLabel);
-	
-				        chart.getXYPlot().addDomainMarker(marker);
-					}
-					
-					previousPartName = currentPartName;
-				}
-			}
-		}
-		
-		chart.setTitle(Utils.createProgressionChartTitle(progression, true));
-		
-		super.updateChart(result);
-		
-	}
-
-	@Override
-	public ArrayList<Integer> getSelectedPointPositions(Object chart) {
-
-		MultipleItemsSelector selector = (MultipleItemsSelector) ((IRendererWithItemSelection)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector();
-		ArrayList<Integer> pointPositionsInCorpora = new ArrayList<Integer>();
-
-
-		// FIXME: returns all the point positions
-		XYDataset dataset = ((JFreeChart) chart).getXYPlot().getDataset();
-		for(int i = 0; i < selector.getSelectedSeries().length; i++) {
-			int selectedSeries = selector.getSelectedSeries()[i];
-			int[] selectedItemsInSeries = selector.getSelectedItems(selectedSeries) ;
-			for(int j = 0; j < selectedItemsInSeries.length; j++) {
-				// if it's the dummy last chart point, get the previous point position instead of ther last one
-				if(selectedItemsInSeries[j] == dataset.getItemCount(selectedSeries) - 1)	{
-					pointPositionsInCorpora.add((int) (dataset.getXValue(selectedSeries, selectedItemsInSeries[j] - 1)));
-				}
-				else	{
-					pointPositionsInCorpora.add((int) (dataset.getXValue(selectedSeries, selectedItemsInSeries[j])));
-				}
-			}
-			
-		}
-
-		// put the last selected point at the end of the list
-		if(selector.getLastSelectedSeries() != -1 && selector.getLastSelectedItem() != -1)	{
-			int item = selector.getLastSelectedItem();
-			// if it's the dummy last chart point, get the previous point position instead of ther last one
-			if(item == dataset.getItemCount(selector.getLastSelectedSeries()) - 1)	{
-				item--;
-			}
-			
-			Integer lastSelectedPointPosition = (int) (dataset.getXValue(selector.getLastSelectedSeries(), item));
-			pointPositionsInCorpora.remove(lastSelectedPointPosition);
-			pointPositionsInCorpora.add(lastSelectedPointPosition);
-		}
-		return pointPositionsInCorpora;
-	}
-
-	@Override
-	public ArrayList<Integer> getSelectedPointNumbers(Object chart) {
-
-		MultipleItemsSelector selector = (MultipleItemsSelector) ((IRendererWithItemSelection)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector();
-		ArrayList<Integer> pointNumbers = new ArrayList<Integer>();
-		XYDataset dataset = ((JFreeChart) chart).getXYPlot().getDataset();
-		
-		for(int i = 0; i < selector.getSelectedSeriesCount(); i++) {
-			int series = selector.getSelectedSeries()[i];
-			int[] items = selector.getSelectedItems(series);
-			int lastDummyItem = dataset.getItemCount(series) - 1; 
-			for(int j = 0; j < items.length; j++) {
-				int item = items[j];
-				// manage the first dummy point
-				if(item == 0)	{
-					item++;
-				}
-				// manage the last dummy point
-				else if(item == lastDummyItem)	 {
-					item--;
-				}
-				
-				pointNumbers.add(item);
-			}
-		}
-		
-		return pointNumbers;
-	}
-	
-
-	
-	@Override
-	public ArrayList<ArrayList<Integer>> getAllPointPositionsBySeries(Object chart) {
-
-		ArrayList<ArrayList<Integer>> pointPositionsBySeries = new ArrayList<ArrayList<Integer>>();
-		
-		XYDataset dataset = ((JFreeChart) chart).getXYPlot().getDataset();
-
-		for(int i = 0; i < dataset.getSeriesCount(); i++) {
-			ArrayList<Integer> pointPositionsInCorpora = new ArrayList<Integer>();
-			for(int j = 0; j < dataset.getItemCount(i) - 1; j++) { // -1 to skip the last dummy point of the step chart
-				pointPositionsInCorpora.add((int) dataset.getXValue(i, j));
-			}
-			pointPositionsBySeries.add(pointPositionsInCorpora);
-		}
-
-		return pointPositionsBySeries;
-	}
-
-	
-	
-	@Override
-	public ArrayList<Integer> getSelectedSeries(Object chart) {
-		ArrayList<Integer> selectedSeries = new ArrayList<Integer>();
-		MultipleItemsSelector selector = (MultipleItemsSelector) ((IRendererWithItemSelection)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector();
-		Integer[] multipleSelectedSeries = selector.getSelectedSeries();
-		for(int i = 0; i < multipleSelectedSeries.length; i++) {
-			selectedSeries.add(multipleSelectedSeries[i]);
-		}
-		return selectedSeries;
-	}
-
-
-	@Override
-	public int getLastSelectedSeries(Object chart) {
-		return ((MultipleItemsSelector) ((IRendererWithItemSelection)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector()).getLastSelectedSeries();
-	}
-
-	
-	
-	@Override
-	public Class getResultDataClass() {
-		return Progression.class;
-	}
-
-
-	
-
-}
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionCumulativeChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionCumulativeChartCreator.java	(revision 0)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionCumulativeChartCreator.java	(revision 639)
@@ -0,0 +1,346 @@
+package org.txm.progression.core.chartsengine.jfreechart;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.plot.Marker;
+import org.jfree.chart.plot.ValueMarker;
+import org.jfree.data.xy.XYDataset;
+import org.jfree.data.xy.XYSeries;
+import org.jfree.data.xy.XYSeriesCollection;
+import org.jfree.ui.RectangleAnchor;
+import org.jfree.ui.TextAnchor;
+import org.txm.chartsengine.core.ChartsEngine;
+import org.txm.chartsengine.core.results.ChartResult;
+import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
+import org.txm.chartsengine.jfreechart.core.renderers.MultipleItemsSelector;
+import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection;
+import org.txm.chartsengine.jfreechart.core.themes.base.ExtendedNumberAxis;
+import org.txm.progression.core.chartsengine.base.ProgressionChartCreator;
+import org.txm.progression.core.chartsengine.base.Utils;
+import org.txm.progression.core.chartsengine.jfreechart.themes.highcharts.renderers.ProgressionItemSelectionRenderer;
+import org.txm.progression.core.functions.Progression;
+import org.txm.progression.core.messages.ProgressionCoreMessages;
+import org.txm.progression.core.preferences.ProgressionPreferences;
+import org.txm.searchengine.cqp.corpus.query.Query;
+
+/**
+ * JFC progression chart creator.
+ * 
+ * @author sjacquot
+ *
+ */
+public class JFCProgressionCumulativeChartCreator extends JFCChartCreator implements ProgressionChartCreator {
+
+
+	@Override
+	public JFreeChart createChart(ChartResult result) {
+
+		
+		Progression progression = (Progression) result;
+		
+		// parameters
+		boolean cumulative = result.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE);
+		
+		
+		JFreeChart chart = null;
+
+		// Creates the empty dataset
+		XYSeriesCollection dataset = new XYSeriesCollection();
+		// Y axis label
+		String yAxisLabel;
+
+		
+		// Cumulative
+		if(cumulative)	{
+
+			// Create the chart
+			yAxisLabel = ProgressionCoreMessages.ChartsEngine_PROGRESSION_Y_AXIS_CUMULATIVE_LABEL;
+			chart = this.getChartsEngine().createXYStepChart(dataset, Utils.createProgressionChartTitle(progression, cumulative),
+					ProgressionCoreMessages.bind(ProgressionCoreMessages.ChartsEngine_PROGRESSION_X_AXIS_LABEL, progression.getXmaxCorpus()), yAxisLabel, true, true, true, true, true);
+
+
+			// Custom renderer
+			chart.getXYPlot().setRenderer(new ProgressionItemSelectionRenderer());
+
+		}
+		// FIXME : Density, to implement when textometry R package will store the result in the Progression class
+		// FIXME: put that in a new ChartCreator dedicated to the density progression chart
+		else	{
+
+			// FIXME : density not yet implemented
+			System.err.println("JFCProgressionCumulativeChartCreator.createChart(): density mode not yet implemented.");
+
+//			for(int i = 0; i < progression.getAllpositions().size(); i++) {
+//				int[] liste = positions.get(i);
+//				Query query = queries.get(i);
+//				XYSeries series = new XYSeries(query.toString() + " " + liste.length);
+//
+//				for(int j = 0; j <  liste.length; j++) {
+//
+//					// FIXME : tests y
+//					// y <- c( c(0), y , c(y[[length(x)]]) ) // R code
+//					// FIXME : random Y value
+//					double y = progression.getAllpositions().get(i)[j] * Math.random();
+//	//				double y = progression.getAllpositions().get(i)[j];
+//					series.add(liste[j], y);
+//				}
+//				dataset.addSeries(series);
+//			}
+//
+//			// Create the chart
+//			yAxisLabel =  ProgressionCoreMessages.ChartsEngine_PROGRESSION_Y_AXIS_NOT_CUMULATIVE_LABEL;
+//			chart = this.getChartsEngine().createXYLineChart(dataset, Utils.createProgressionChartTitle(progression, cumulative),
+//					ProgressionCoreMessages.bind(ProgressionCoreMessages.ChartsEngine_PROGRESSION_X_AXIS_LABEL, progression.getXmaxCorpus()), yAxisLabel,
+//					true, true, true, false, true, false, true, null);
+		}
+
+
+
+        ((IRendererWithItemSelection) chart.getXYPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_PROGRESSION);
+        ((IRendererWithItemSelection) chart.getXYPlot().getRenderer()).getItemsSelector().setResultData(progression);
+
+		
+		return chart;
+		
+	}
+
+
+	@Override
+	public void updateChart(ChartResult result) {
+
+		Progression progression = (Progression) result;
+		JFreeChart chart = (JFreeChart) result.getChart();
+
+		// freeze rendering while computing
+		chart.setNotify(false);
+		
+		
+		// Fill the data set from the result
+		if(progression.hasParameterChanged(ProgressionPreferences.QUERIES))	{
+			XYSeriesCollection dataset = (XYSeriesCollection) chart.getXYPlot().getDataset();
+			dataset.removeAllSeries();
+			
+			List<int[]> positions = progression.getAllPositions();
+			List<Query> queries = progression.getQueries();
+			for(int i = 0; i < positions.size(); i++) {
+				int[] list = positions.get(i);
+				Query query = queries.get(i);
+				XYSeries series = new XYSeries(query.toString() + " " + list.length);
+				int c = 1;
+				for(int j = 0; j < list.length; j++) {
+					// add a first point to draw a vertical line
+					if(j == 0)	{
+						series.add(list[j], 0);
+					}
+					series.add(list[j], c++);
+				}
+	
+				// add a dummy point to draw horizontal line between last point and max X corpus
+				series.add(progression.getXmaxCorpus(), --c);
+				dataset.addSeries(series);
+			}
+			
+			// Custom domain axis for ticks drawing options
+			chart.getXYPlot().setDomainAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getDomainAxis(), true, true, progression.getXminCorpus(), progression.getXmaxCorpus()));
+
+			// Custom range axis for ticks drawing options
+			chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), false, true, 0, progression.getMaxY()));
+
+			// Match the X-axis origin value to the min x corpus (for subcorpus case)
+			chart.getXYPlot().getDomainAxis().setLowerBound(progression.getXminCorpus());
+		}
+		
+		
+		
+		// removes all existing domain marker
+		chart.getXYPlot().clearDomainMarkers();
+		
+		// Add the limit markers
+		BasicStroke dashedStroke = new BasicStroke(0.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f, new float[] {2f}, 0f);
+		Marker marker = new ValueMarker(progression.getXminCorpus());
+        marker.setPaint(Color.gray);
+        marker.setStroke(dashedStroke);
+        chart.getXYPlot().addDomainMarker(marker);
+		marker = new ValueMarker(progression.getXmaxCorpus());
+        marker.setPaint(Color.gray);
+        marker.setStroke(dashedStroke);
+        chart.getXYPlot().addDomainMarker(marker);
+
+
+//        // FIXME : limit with annotations rather than markers (marker height is dynamically adapted to the real chart height.
+        // Annotation have a fixed height)
+//        XYLineAnnotation annotation = new XYLineAnnotation(0, 0, 0, dataset.getRangeUpperBound(true), dashedStroke, Color.gray);
+//        chart.getXYPlot().addAnnotation(annotation, true);
+
+		// Add the part markers
+        String previousPartName = ""; //$NON-NLS-1$
+		if(progression.getStructuralUnit() != null && progression.getStructurePositions().length > 0 && 
+				(progression.hasParameterChanged(ProgressionPreferences.STRUCTURAL_UNIT) ||
+						progression.hasParameterChanged(ProgressionPreferences.STRUCTURAL_UNIT_PROPERTY) ||
+						progression.hasParameterChanged(ProgressionPreferences.REPEAT_SAME_VALUES) ||
+						progression.hasParameterChanged(ProgressionPreferences.PROPERTY_REGEX)
+						))	{
+			for(int i = 0; i < progression.getStructurePositions().length; i++) {
+				if(progression.getStructurePositions()[i] != 0)	{
+					
+					String currentPartName = progression.getStructureNames()[i];
+					
+					if(progression.isRepeatingValues() || !currentPartName.equals(previousPartName))	{
+					
+						marker = new ValueMarker(progression.getStructurePositions()[i]);
+				        marker.setPaint(Color.black);
+				        marker.setLabel(progression.getStructureNames()[i]);
+				        marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
+				        marker.setLabelTextAnchor(TextAnchor.HALF_ASCENT_LEFT);
+	
+	
+				        // FIXME: test of rotated annotations rather than using marker label. The problem with this is that the position of annotation is not adjusted when zooming/dezooming.
+				        // FIXME: the best approach is to redefine the drawing method of
+	////			        double start = marker.getStartValue();
+	////			        double end = TempIntervalMarker.getEndValue();
+	////			        double middle = (end - start)/2;
+	//			        XYTextAnnotation updateLabel = new XYTextAnnotation("Update", progression.getStructurePositions()[i], 0);
+	//			        updateLabel.setFont(new Font("Sans Serif", Font.BOLD, 10));
+	//			        updateLabel.setRotationAnchor(TextAnchor.BASELINE_CENTER);
+	//			        updateLabel.setTextAnchor(TextAnchor.BASELINE_CENTER);
+	//			        updateLabel.setRotationAngle(3.14 / 2);
+	//			        updateLabel.setPaint(Color.black);
+	//			        chart.getXYPlot().addAnnotation(updateLabel);
+	
+				        chart.getXYPlot().addDomainMarker(marker);
+					}
+					
+					previousPartName = currentPartName;
+				}
+			}
+		}
+		
+		chart.setTitle(Utils.createProgressionChartTitle(progression, true));
+		
+		super.updateChart(result);
+		
+	}
+
+	@Override
+	public ArrayList<Integer> getSelectedPointPositions(Object chart) {
+
+		MultipleItemsSelector selector = (MultipleItemsSelector) ((IRendererWithItemSelection)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector();
+		ArrayList<Integer> pointPositionsInCorpora = new ArrayList<Integer>();
+
+
+		// FIXME: returns all the point positions
+		XYDataset dataset = ((JFreeChart) chart).getXYPlot().getDataset();
+		for(int i = 0; i < selector.getSelectedSeries().length; i++) {
+			int selectedSeries = selector.getSelectedSeries()[i];
+			int[] selectedItemsInSeries = selector.getSelectedItems(selectedSeries) ;
+			for(int j = 0; j < selectedItemsInSeries.length; j++) {
+				// if it's the dummy last chart point, get the previous point position instead of ther last one
+				if(selectedItemsInSeries[j] == dataset.getItemCount(selectedSeries) - 1)	{
+					pointPositionsInCorpora.add((int) (dataset.getXValue(selectedSeries, selectedItemsInSeries[j] - 1)));
+				}
+				else	{
+					pointPositionsInCorpora.add((int) (dataset.getXValue(selectedSeries, selectedItemsInSeries[j])));
+				}
+			}
+			
+		}
+
+		// put the last selected point at the end of the list
+		if(selector.getLastSelectedSeries() != -1 && selector.getLastSelectedItem() != -1)	{
+			int item = selector.getLastSelectedItem();
+			// if it's the dummy last chart point, get the previous point position instead of ther last one
+			if(item == dataset.getItemCount(selector.getLastSelectedSeries()) - 1)	{
+				item--;
+			}
+			
+			Integer lastSelectedPointPosition = (int) (dataset.getXValue(selector.getLastSelectedSeries(), item));
+			pointPositionsInCorpora.remove(lastSelectedPointPosition);
+			pointPositionsInCorpora.add(lastSelectedPointPosition);
+		}
+		return pointPositionsInCorpora;
+	}
+
+	@Override
+	public ArrayList<Integer> getSelectedPointNumbers(Object chart) {
+
+		MultipleItemsSelector selector = (MultipleItemsSelector) ((IRendererWithItemSelection)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector();
+		ArrayList<Integer> pointNumbers = new ArrayList<Integer>();
+		XYDataset dataset = ((JFreeChart) chart).getXYPlot().getDataset();
+		
+		for(int i = 0; i < selector.getSelectedSeriesCount(); i++) {
+			int series = selector.getSelectedSeries()[i];
+			int[] items = selector.getSelectedItems(series);
+			int lastDummyItem = dataset.getItemCount(series) - 1; 
+			for(int j = 0; j < items.length; j++) {
+				int item = items[j];
+				// manage the first dummy point
+				if(item == 0)	{
+					item++;
+				}
+				// manage the last dummy point
+				else if(item == lastDummyItem)	 {
+					item--;
+				}
+				
+				pointNumbers.add(item);
+			}
+		}
+		
+		return pointNumbers;
+	}
+	
+
+	
+	@Override
+	public ArrayList<ArrayList<Integer>> getAllPointPositionsBySeries(Object chart) {
+
+		ArrayList<ArrayList<Integer>> pointPositionsBySeries = new ArrayList<ArrayList<Integer>>();
+		
+		XYDataset dataset = ((JFreeChart) chart).getXYPlot().getDataset();
+
+		for(int i = 0; i < dataset.getSeriesCount(); i++) {
+			ArrayList<Integer> pointPositionsInCorpora = new ArrayList<Integer>();
+			for(int j = 0; j < dataset.getItemCount(i) - 1; j++) { // -1 to skip the last dummy point of the step chart
+				pointPositionsInCorpora.add((int) dataset.getXValue(i, j));
+			}
+			pointPositionsBySeries.add(pointPositionsInCorpora);
+		}
+
+		return pointPositionsBySeries;
+	}
+
+	
+	
+	@Override
+	public ArrayList<Integer> getSelectedSeries(Object chart) {
+		ArrayList<Integer> selectedSeries = new ArrayList<Integer>();
+		MultipleItemsSelector selector = (MultipleItemsSelector) ((IRendererWithItemSelection)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector();
+		Integer[] multipleSelectedSeries = selector.getSelectedSeries();
+		for(int i = 0; i < multipleSelectedSeries.length; i++) {
+			selectedSeries.add(multipleSelectedSeries[i]);
+		}
+		return selectedSeries;
+	}
+
+
+	@Override
+	public int getLastSelectedSeries(Object chart) {
+		return ((MultipleItemsSelector) ((IRendererWithItemSelection)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector()).getLastSelectedSeries();
+	}
+
+	
+	
+	@Override
+	public Class getResultDataClass() {
+		return Progression.class;
+	}
+
+
+	
+
+}

Property changes on: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionCumulativeChartCreator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.progression.core/plugin.xml
===================================================================
--- tmp/org.txm.progression.core/plugin.xml	(revision 638)
+++ tmp/org.txm.progression.core/plugin.xml	(revision 639)
@@ -5,14 +5,19 @@
          point="org.txm.chartsengine.chartcreator">
       <ChartCreator
             chartsEngineName="jfreechart_charts_engine"
-            class="org.txm.progression.core.chartsengine.jfreechart.JFCProgressionChartCreator"
-            fileNamePrefix="progression">
+            class="org.txm.progression.core.chartsengine.jfreechart.JFCProgressionCumulativeChartCreator"
+            fileNamePrefix="progression_cumulative">
       </ChartCreator>
       <ChartCreator
             chartsEngineName="r_charts_engine"
-            class="org.txm.progression.core.chartsengine.r.RProgressionChartCreator"
-            fileNamePrefix="progression">
+            class="org.txm.progression.core.chartsengine.r.RProgressionCumulativeChartCreator"
+            fileNamePrefix="progression_cumulative">
       </ChartCreator>
+      <ChartCreator
+            chartType="density"
+            class="org.txm.progression.core.chartsengine.r.RProgressionDensityChartCreator"
+            fileNamePrefix="progression_density">
+      </ChartCreator>
    </extension>
    <extension
          point="org.eclipse.core.runtime.preferences">
Index: tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGComposite.java
===================================================================
--- tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGComposite.java	(revision 638)
+++ tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGComposite.java	(revision 639)
@@ -92,6 +92,7 @@
 		}
 		catch(MalformedURLException e) {
 			Log.severe("Can't load SVG document from file: " + file + e);
+			Log.printStackTrace(e);
 		}
 	}
 
Index: tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages.properties
===================================================================
--- tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages.properties	(revision 638)
+++ tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages.properties	(revision 639)
@@ -25,7 +25,7 @@
 RWorkspace_11 = Last safeeval: 
 RWorkspace_2  = try : connect to R at 
 RWorkspace_21 = Full command: 
-RWorkspace_3  = Saving graphic in file 
+RWorkspace_3  = Saving chart in file 
 RWorkspace_6  = ** Failed to initialize file transfert: 
 RWorkspace_7  = Matrix is empty
 RWorkspace_8  = Failed to start RServe : 
Index: tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java
===================================================================
--- tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java	(revision 638)
+++ tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java	(revision 639)
@@ -68,7 +68,7 @@
 	Text bandeField;
 
 	/** The cumu button. */
-	Button cumuButton;
+	Button cumulativeButton;
 
 	/** The colors. */
 	String[] colors = DefaultTheme.colors;
@@ -195,14 +195,16 @@
 			typeLabel.setText(ProgressionUIMessages.ProgressionDialog_1);
 			typeLabel.setAlignment(SWT.CENTER);
 
-			cumuButton = new Button(paramPanel, SWT.RADIO);
-			cumuButton.setText(ProgressionUIMessages.ProgressionDialog_2);
-			cumuButton.setSelection(cumulative);
-			cumuButton.addSelectionListener(new SelectionListener() {
-				
+			cumulativeButton = new Button(paramPanel, SWT.RADIO);
+			cumulativeButton.setText(ProgressionUIMessages.ProgressionDialog_2);
+			cumulativeButton.setSelection(cumulative);
+			// listeners
+			cumulativeButton.addSelectionListener(new ComputeSelectionListener(this));
+			cumulativeButton.addSelectionListener(new SelectionListener() {
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					bandeField.setEnabled(densityButton.getSelection());
+					getResult().setDefaultChartType();
 				}
 				
 				@Override
@@ -212,11 +214,13 @@
 			densityButton = new Button(paramPanel, SWT.RADIO);
 			densityButton.setText(ProgressionUIMessages.ProgressionDialog_3);
 			densityButton.setSelection(!cumulative);
+			// listener
 			densityButton.addSelectionListener(new SelectionListener() {
 				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					bandeField.setEnabled(densityButton.getSelection());
+					getResult().setChartType("density");					
 				}
 				
 				@Override
@@ -446,7 +450,7 @@
 			}
 		}
 
-		cumulative = cumuButton.getSelection();
+		cumulative = cumulativeButton.getSelection();
 
 		String smultibande = bandeField.getText();
 		float bandeMultiplier = 1.0f;
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/listeners/BaseAbstractComputeListener.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/listeners/BaseAbstractComputeListener.java	(revision 638)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/listeners/BaseAbstractComputeListener.java	(revision 639)
@@ -3,7 +3,8 @@
  */
 package org.txm.rcp.editors.listeners;
 
-import org.eclipse.jface.viewers.SelectionChangedEvent;
+import java.util.EventObject;
+
 import org.eclipse.jface.viewers.Viewer;
 import org.txm.rcp.editors.TXMEditor;
 
@@ -35,7 +36,7 @@
 	 * @param event
 	 * @return
 	 */
-	public static boolean mustIgnoreEvent(SelectionChangedEvent event)	{
+	public static boolean mustIgnoreEvent(EventObject event)	{
 		// to skip programmatically setSelection() call
 		if(event.getSource() instanceof Viewer)	{
 			if(((Viewer)event.getSource()).getData("ignore") != null && (Boolean)((Viewer)event.getSource()).getData("ignore") == true)	{
@@ -44,5 +45,6 @@
 		}
 		return false;
 	}
+
 	
 }
