Index: tmp/org.txm.ca.rcp/.project
===================================================================
--- tmp/org.txm.ca.rcp/.project	(revision 0)
+++ tmp/org.txm.ca.rcp/.project	(revision 136)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.ca.rcp</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Property changes on: tmp/org.txm.ca.rcp/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/adapters/CAAdapterFactory.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/adapters/CAAdapterFactory.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/adapters/CAAdapterFactory.java	(revision 136)
@@ -0,0 +1,65 @@
+// Copyright © 2010-2013 ENS de Lyon.
+package org.txm.ca.rcp.adapters;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.FrameworkUtil;
+import org.txm.ca.core.functions.CA;
+import org.txm.rcp.adapters.BaseAdapterFactory;
+
+
+/**
+ * A factory for creating Adapter objects.
+ *  
+ * @author mdecorde
+ * @author sjacquot
+ */
+public class CAAdapterFactory extends BaseAdapterFactory {
+
+	
+	public static final ImageDescriptor ICON =
+			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(CAAdapterFactory.class).getSymbolicName(),
+					"platform:/plugin/"+ FrameworkUtil.getBundle(CAAdapterFactory.class).getSymbolicName() + "/icons/ca.png"); //$NON-NLS-1$
+	
+	/**
+	 * Gets the adapter.
+	 *
+	 * @param adaptableObject the adaptable object
+	 * @param adapterType the adapter type
+	 * @return the adapter
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	 */
+	@Override
+	public Object getAdapter(Object adaptableObject, Class adapterType) {
+		
+		if(adapterType == IWorkbenchAdapter.class)	{
+			if(adaptableObject instanceof CA)	{
+				return new IWorkbenchAdapter() {
+					@Override
+					public Object[] getChildren(Object o) {
+						return ((CA)o).getResults().toArray();
+					}
+
+					@Override
+					public ImageDescriptor getImageDescriptor(Object object) {
+						return ICON;
+					}
+
+					@Override
+					public String getLabel(Object o) {
+						return ""+((CA) o).getName(); //$NON-NLS-1$
+					}
+
+					@Override
+					public Object getParent(Object o) {
+						return ((CA) o).getParent();
+					}
+				};
+			}
+		}
+		return null;
+	}
+
+
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/adapters/CAAdapterFactory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_ru.properties
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_ru.properties	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_ru.properties	(revision 136)
@@ -0,0 +1,34 @@
+CAPreferencePage_0=Формат колонки Качество
+CAPreferencePage_1=Формат колонки Вклад
+CAPreferencePage_3=Показать колонки в графике факторного плана
+CAPreferencePage_4=Показать строчки в графике факторного плана
+CAPreferencePage_5=Формат колонки Масса
+CAPreferencePage_6=Формат колонки Дистанция
+CAPreferencePage_7=Формат колонки Cos²
+CAPreferencePage_8=Формат колонки Coord
+ComputeCorrespondanceAnalysis_0=Расчет факторного анализа соответствий
+ComputeCorrespondanceAnalysis_13=** Невозможно провести факторный анализ соответствий при наличии менее 4-х колонок
+ComputeCorrespondanceAnalysis_14=Открытие результатов факторного анализа соответствий
+ComputeCorrespondanceAnalysis_15=Создание окна ФАС
+ComputeCorrespondanceAnalysis_16=Создание словарной таблицы для ФАС
+ComputeCorrespondanceAnalysis_17=Расчет ФАС
+ComputeCorrespondanceAnalysis_1=** Невозможно провести факторный анализ соответствий при наличии менее 4-х колонок в таблице
+ComputeCorrespondanceAnalysis_3=** Ошибка
+ComputeCorrespondanceAnalysis_4=** Невозможно провести факторный анализ соответствий при наличии только 
+ComputeCorrespondanceAnalysis_6=ОК
+ComputeCorrespondanceAnalysis_8=Загрузка результатов факторного анализа
+ComputeCorrespondanceAnalysisDialog_0=Факторный анализ соответствий {0}
+ComputeCorrespondanceAnalysisDialog_1=Свойства: 
+ComputeCorrespondanceAnalysisDialog_2=Число строк:
+CorrespondanceAnalysisEditorInput_0=Собственные значения
+CorrespondanceAnalysisEditorInput_10=ФАС
+CorrespondanceAnalysisEditorInput_1=Факт. план
+CorrespondanceAnalysisEditorInput_26=Масса
+CorrespondanceAnalysisEditorInput_27=Дист
+CorrespondanceAnalysisEditorInput_29=Конт
+CorrespondanceAnalysisEditorInput_2=Гистограмма собственных значений propres
+CorrespondanceAnalysisEditorInput_30=Cos²
+CorrespondanceAnalysisEditorInput_3=Результат анализа соответствий не может быть пустым 
+CorrespondanceAnalysisEditorInput_4=Фактор
+CorrespondanceAnalysisEditorInput_8=Инф Строчки
+CorrespondanceAnalysisEditorInput_9=Инф Колонки
\ No newline at end of file

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_ru.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/CAUIMessages.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/CAUIMessages.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/CAUIMessages.java	(revision 136)
@@ -0,0 +1,69 @@
+package org.txm.ca.rcp.messages;
+
+import org.eclipse.osgi.util.NLS;
+import org.txm.core.messages.TXMCoreMessages;
+
+public class CAUIMessages extends NLS {
+
+	private static final String BUNDLE_NAME = "org.txm.ca.rcp.messages.messages"; //$NON-NLS-1$
+
+
+	public static String SWTChartsComponentProvider_CA_TOOLBAR_AXES_SELECTION_COMBO_BOX_LABEL;
+	public static String SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_LABEL;
+	public static String SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_TOOLTIP;
+	public static String SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_LABEL;
+	public static String SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_TOOLTIP;
+
+
+	public static String CAPreferencePage_0;
+	public static String CAPreferencePage_1;
+	public static String CAPreferencePage_2;
+	public static String CAPreferencePage_3;
+	public static String CAPreferencePage_4;
+	public static String CAPreferencePage_5;
+	public static String CAPreferencePage_6;
+	public static String CAPreferencePage_7;
+	public static String CAPreferencePage_8;
+
+	public static String ComputeCorrespondanceAnalysisDialog_0;
+	public static String ComputeCorrespondanceAnalysisDialog_1;
+	public static String ComputeCorrespondanceAnalysisDialog_2;
+
+	public static String ComputeCorrespondanceAnalysis_0;
+	public static String ComputeCorrespondanceAnalysis_1;
+	public static String ComputeCorrespondanceAnalysis_13;
+	public static String ComputeCorrespondanceAnalysis_14;
+	public static String ComputeCorrespondanceAnalysis_15;
+	public static String ComputeCorrespondanceAnalysis_16;
+	public static String ComputeCorrespondanceAnalysis_17;
+	public static String ComputeCorrespondanceAnalysis_2;
+	public static String ComputeCorrespondanceAnalysis_3;
+	public static String ComputeCorrespondanceAnalysis_4;
+	public static String ComputeCorrespondanceAnalysis_6;
+	public static String ComputeCorrespondanceAnalysis_8;
+
+	public static String CorrespondanceAnalysisEditorInput_0;
+	public static String CorrespondanceAnalysisEditorInput_1;
+	public static String CorrespondanceAnalysisEditorInput_11;
+	public static String CorrespondanceAnalysisEditorInput_10;
+	public static String CorrespondanceAnalysisEditorInput_2;
+	public static String CorrespondanceAnalysisEditorInput_26;
+	public static String CorrespondanceAnalysisEditorInput_27;
+	public static String CorrespondanceAnalysisEditorInput_29;
+	public static String CorrespondanceAnalysisEditorInput_3;
+	public static String CorrespondanceAnalysisEditorInput_30;
+	public static String CorrespondanceAnalysisEditorInput_4;
+	public static String CorrespondanceAnalysisEditorInput_5;
+	public static String CorrespondanceAnalysisEditorInput_8;
+	public static String CorrespondanceAnalysisEditorInput_9;
+
+	
+	
+	static {
+		// initialize resource bundle
+		TXMCoreMessages.initializeMessages(BUNDLE_NAME, CAUIMessages.class);
+	}
+
+	private CAUIMessages() {
+	}
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/CAUIMessages.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_fr.properties	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_fr.properties	(revision 136)
@@ -0,0 +1,40 @@
+CAPreferencePage_0=Format de la colonne Qualité
+CAPreferencePage_1=Format de la colonne Contribution
+CAPreferencePage_3=Afficher les colonnes
+CAPreferencePage_4=Afficher les lignes
+CAPreferencePage_5=Format de la colonne Masse
+CAPreferencePage_6=Format de la colonne Distance
+CAPreferencePage_7=Format de la colonne Cos²
+CAPreferencePage_8=Format de la colonne Coord
+ComputeCorrespondanceAnalysis_0=Calcul de l'analyse factorielle des correspondances
+ComputeCorrespondanceAnalysis_13=** Impossible de calculer l'analyse factorielle des correspondances avec moins de 4 colonnes 
+ComputeCorrespondanceAnalysis_14=Ouverture des résultats de l'analyse factorielle des correspondances
+ComputeCorrespondanceAnalysis_15=Création de la fen\u00EAtre de l'AFC
+ComputeCorrespondanceAnalysis_16=Création de la table lexicale pour l'AFC
+ComputeCorrespondanceAnalysis_17=Calcul de l'AFC
+ComputeCorrespondanceAnalysis_1=** Impossible de calculer l'analyse factorielle des correspondances avec moins de 4 colonnes dans la table
+ComputeCorrespondanceAnalysis_3=** Erreur
+ComputeCorrespondanceAnalysis_4=** Impossible de calculer l''analyse factorielle avec seulement {0} parties (minimum=4).
+ComputeCorrespondanceAnalysis_6=OK
+ComputeCorrespondanceAnalysis_8=Chargement des résultats de l'analyse factorielle
+ComputeCorrespondanceAnalysisDialog_0=Analyse factorielle des correspondances avec {0}
+ComputeCorrespondanceAnalysisDialog_1=Propriétés \: 
+ComputeCorrespondanceAnalysisDialog_2=Nombre de lignes \: 
+CorrespondanceAnalysisEditorInput_0=Valeurs propres
+CorrespondanceAnalysisEditorInput_10=AFC
+CorrespondanceAnalysisEditorInput_1=Plan fact.
+CorrespondanceAnalysisEditorInput_26=Mass
+CorrespondanceAnalysisEditorInput_27=Dist
+CorrespondanceAnalysisEditorInput_29=Cont
+CorrespondanceAnalysisEditorInput_2=Histogramme des valeurs propres
+CorrespondanceAnalysisEditorInput_30=Cos²
+CorrespondanceAnalysisEditorInput_3=Le résultat de l'analyse des correspondances ne peut \u00EAtre nul 
+CorrespondanceAnalysisEditorInput_4=#
+CorrespondanceAnalysisEditorInput_5=Valeur propre
+CorrespondanceAnalysisEditorInput_8=Info lignes
+CorrespondanceAnalysisEditorInput_9=Info colonnes
+SWTChartsComponentProvider_CA_TOOLBAR_AXES_SELECTION_COMBO_BOX_LABEL=Axes : 
+SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_LABEL=Afficher les colonnes
+SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_TOOLTIP=Afficher/masquer les points-colonnes
+SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_LABEL=Afficher les lignes
+SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_TOOLTIP=Afficher/masquer les points-lignes
\ No newline at end of file

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages.properties
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages.properties	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages.properties	(revision 136)
@@ -0,0 +1,43 @@
+CAPreferencePage_0=Quality column format
+CAPreferencePage_1=Contribution column format
+CAPreferencePage_2=Lexical table created when called from a partition
+CAPreferencePage_3=Show the columns
+CAPreferencePage_4=Show the rows
+CAPreferencePage_5=Mass column format
+CAPreferencePage_6=Distance column format
+CAPreferencePage_7=Cos² column format
+CAPreferencePage_8=Coord column format
+ComputeCorrespondanceAnalysis_0=Computing Correspondance analysis on {0} with property {1}
+ComputeCorrespondanceAnalysis_13=Can't compute CA on lexical table with less than 4 columns
+ComputeCorrespondanceAnalysis_14=Opening the Correspondance Analysis results
+ComputeCorrespondanceAnalysis_15=Create CA
+ComputeCorrespondanceAnalysis_16=Get LexicalTable CA
+ComputeCorrespondanceAnalysis_17=Compute CA
+ComputeCorrespondanceAnalysis_1=Cannot compute CA with less than 4 rows in the table
+ComputeCorrespondanceAnalysis_2=StatEngine is not ready. Canceling command.
+ComputeCorrespondanceAnalysis_3=** Error
+ComputeCorrespondanceAnalysis_4=Cannot compute factorial analysis with only {0} parts (the minimum is 4 parts).
+ComputeCorrespondanceAnalysis_6=OK
+ComputeCorrespondanceAnalysis_8=Loading correspondances analysis results...
+ComputeCorrespondanceAnalysisDialog_0=Correspondance analysis with {0}
+ComputeCorrespondanceAnalysisDialog_1=Property\:
+ComputeCorrespondanceAnalysisDialog_2=Number of lines\:
+CorrespondanceAnalysisEditorInput_0=Eigenvalues
+CorrespondanceAnalysisEditorInput_10=CA
+CorrespondanceAnalysisEditorInput_11=\u2211
+CorrespondanceAnalysisEditorInput_1=Fact. plan
+CorrespondanceAnalysisEditorInput_26=Mass
+CorrespondanceAnalysisEditorInput_27=Dist
+CorrespondanceAnalysisEditorInput_29=Cont
+CorrespondanceAnalysisEditorInput_2=Eigenvalues histogram
+CorrespondanceAnalysisEditorInput_30=Cos²
+CorrespondanceAnalysisEditorInput_3=Correspondance analysis result cannot be null
+CorrespondanceAnalysisEditorInput_4=#
+CorrespondanceAnalysisEditorInput_5=Eigenvalue
+CorrespondanceAnalysisEditorInput_8=Rows infos
+CorrespondanceAnalysisEditorInput_9=Cols infos
+SWTChartsComponentProvider_CA_TOOLBAR_AXES_SELECTION_COMBO_BOX_LABEL=Axes: 
+SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_LABEL=Show columns
+SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_TOOLTIP=Show/hide the column points
+SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_LABEL=Show rows
+SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_TOOLTIP=Show/hide the row points
\ No newline at end of file

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/messages/messages.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java	(revision 136)
@@ -0,0 +1,328 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.ca.rcp.editors;
+
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.txm.ca.core.chartsengine.base.Utils;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.rcp.chartsengine.events.CAPointSelectionCallBack;
+import org.txm.ca.rcp.chartsengine.events.CASelectionListener;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.chartsengine.rcp.editors.ChartEditorPart;
+import org.txm.chartsengine.rcp.events.EventCallBackHandler;
+import org.txm.rcpapplication.IImageKeys;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.commands.editor.CustomizableEditor;
+import org.txm.rcpapplication.editors.GenericMultiPageEditor;
+import org.txm.rcpapplication.editors.SVGGraphicEditor;
+import org.txm.rcpapplication.editors.input.IProvidingMultiPageEditorInput;
+import org.txm.searchengine.cqp.corpus.Corpus;
+
+// TODO: Auto-generated Javadoc
+/**
+ * extends the GenericMultipage editor, and put the first tab next to the left
+ * of the TabFolder
+ * @author mdecorde
+ * @author sjacquot
+ */
+public class CAEditor extends GenericMultiPageEditor implements CustomizableEditor{
+
+	/** The self. */
+	CAEditor self;
+
+	/** The ca. */
+	private CA ca;
+
+	/** The source. */
+	private Object source;
+	
+	
+	public CAEditor() {
+		super();
+	}
+	
+
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.editors.GenericMultiPageEditor#createPages()
+	 */
+	@Override
+	protected void createPages() {
+		self = this;
+		Composite container = this.getContainer();
+		final Composite parentContainer = container.getParent();
+
+		// System.out.println("parent container layout : "+parentContainer.getLayout());
+
+		parentContainer.setLayout(new FormLayout());// change layout
+		final Sash sash = new Sash(parentContainer, SWT.VERTICAL);
+
+		Composite AFCgraph = new Composite(parentContainer, SWT.NONE);
+
+		FormData containerData = new FormData();
+		containerData.left = new FormAttachment(sash, 0);
+		containerData.right = new FormAttachment(100, 0);
+		containerData.top = new FormAttachment(0, 0);
+		containerData.bottom = new FormAttachment(100, 0);
+		container.setLayoutData(containerData);// set new layout data
+
+		final FormData sashData = new FormData();
+		sashData.left = new FormAttachment(70, 0);
+		sashData.top = new FormAttachment(0, 0);
+		sashData.bottom = new FormAttachment(100, 0);
+		sash.setLayoutData(sashData);
+		sash.addListener(SWT.Selection, new Listener() {
+			@Override
+			public void handleEvent(Event e) {
+				Rectangle sashRect = sash.getBounds();
+				Rectangle shellRect = parentContainer.getClientArea();
+				int right = shellRect.width - sashRect.width;
+				e.x = Math.max(Math.min(e.x, right), 0);
+				if (e.x != sashRect.x) {
+					sashData.left = new FormAttachment(0, e.x);
+					parentContainer.layout();
+				}
+			}
+		});
+
+		FormData AFCgraphData = new FormData();
+		AFCgraphData.left = new FormAttachment(0, 0);
+		AFCgraphData.right = new FormAttachment(sash, 0);
+		AFCgraphData.top = new FormAttachment(0, 0);
+		AFCgraphData.bottom = new FormAttachment(100, 0);
+		AFCgraph.setLayoutData(AFCgraphData);// set new layout data
+		AFCgraph.setLayout(new FillLayout());
+		// /////////////////////
+
+		IEditorInput input = getEditorInput();
+		if (!(input instanceof IProvidingMultiPageEditorInput)) {
+			throw new IllegalArgumentException(NLS.bind(
+					Messages.GenericMultiPageEditor_1, input.getName()));
+		}
+
+		editors = ((IProvidingMultiPageEditorInput) input).getEditors();
+		inputs = ((IProvidingMultiPageEditorInput) input).getEditorInputs();
+		names = ((IProvidingMultiPageEditorInput) input).getNames();
+
+		if (editors.size() != inputs.size()) {
+			throw new IllegalArgumentException(NLS.bind(
+					Messages.GenericMultiPageEditor_3, editors.size(), inputs.size()));
+		}
+
+		// put first editor in the left panel
+		try {
+			
+			CAFactorialMapChartEditor caFactorialMapEditorPart = (CAFactorialMapChartEditor) editors.get(0); 
+			
+			IEditorSite site = createSite(caFactorialMapEditorPart);
+			// call init first so that if an exception is thrown, we have created no new widgets
+			caFactorialMapEditorPart.init(site, inputs.get(0));
+
+			// Set the parent multi pages editor of the CA factorial map editor to activate it from the child editor
+			caFactorialMapEditorPart.setParentMultiPagesEditor(this);
+
+			caFactorialMapEditorPart.createChart();
+			caFactorialMapEditorPart.createPartControl(AFCgraph); // must be called AFTER createChart() because the initItemListener checks if getChart() is null
+			caFactorialMapEditorPart.loadChart();
+
+			
+			
+			caFactorialMapEditorPart.addPropertyListener(new IPropertyListener() {
+				@Override
+				public void propertyChanged(Object source, int propertyId) {
+					self.handlePropertyChange(propertyId);
+				}
+			});
+			
+		}
+		catch (Exception e1) {
+			org.txm.rcpapplication.utils.Logger.printStackTrace(e1);
+			System.out.println(Messages.CaEditor_0+e1);
+			return;
+		}
+
+		for (int i = 1; i < editors.size(); i++) {
+			int editorIndex = 0;
+			try {
+				editorIndex = addPage(editors.get(i), inputs.get(i));
+			} catch (PartInitException e) {
+				org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+				System.out.println(Messages.CaEditor_0+e);
+				return;
+			}
+			setPageText(editorIndex, names.get(i));
+		}
+
+
+		// Add selection listener to rows table to link editor with factorial map chart
+		this.getRowsInfosEditor().getViewer().addSelectionChangedListener(new CASelectionListener(this.getChartEditor(), CASelectionListener.HIGHLIGHT_ROW_POINTS));
+		// Add selection listener to cols table to link editor with factorial map chart
+		this.getColsInfosEditor().getViewer().addSelectionChangedListener(new CASelectionListener(this.getChartEditor(), CASelectionListener.HIGHLIGHT_COLUMN_POINTS));
+
+		// Add listener to column to link chart items selection order with table sorting order
+		for(int i = 0; i < this.getRowsInfosEditor().getViewer().getTable().getColumnCount(); i++) {
+			this.getRowsInfosEditor().getViewer().getTable().getColumn(i).addSelectionListener(new CASelectionListener(this.getChartEditor(), CASelectionListener.SET_CHART_ITEMS_SELECTION_ORDER));
+		}
+		// Add listener to column to link chart items selection order with table sorting order
+		for(int i = 0; i < this.getColsInfosEditor().getViewer().getTable().getColumnCount(); i++) {
+			this.getColsInfosEditor().getViewer().getTable().getColumn(i).addSelectionListener(new CASelectionListener(this.getChartEditor(), CASelectionListener.SET_CHART_ITEMS_SELECTION_ORDER));
+		}
+
+		
+
+		// Sets the parent multi pages editor of the singular values barplot to activate it from the child editor
+		((ChartEditorPart)editors.get(4)).setParentMultiPagesEditor(this);
+
+		// initialize the default shared context menus as Export, etc. for the singular values barplot
+		SWTChartsComponentsProvider.initDefaultContextMenus(((ChartEditorPart)editors.get(4)).getComposite());
+
+		
+
+		CorrespondanceAnalysisEditorInput cainput = (CorrespondanceAnalysisEditorInput) getEditorInput();
+		this.ca = cainput.getCA();
+
+		if (cainput.getCA().getPartition() != null)	{
+			setPartName(cainput.getCA().getPartition().getName() + ":" //$NON-NLS-1$
+				+ cainput.getCA().getAnalysisProperty());
+		}
+
+		this.setActivePage(LAST_EDITOR_USED);
+	}
+
+	/**
+	 * Gets the cA.
+	 *
+	 * @return the cA
+	 */
+	public CA getCA() {
+		return this.ca;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.commands.editor.CustomizableEditor#setName(java.lang.String)
+	 */
+	@Override
+	public void setName(String name) {
+		this.setPartName(name);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.commands.editor.CustomizableEditor#setIcon(org.eclipse.swt.graphics.Image)
+	 */
+	@Override
+	public void setIcon(Image image) {
+		this.setTitleImage(image);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.commands.editor.CustomizableEditor#setSource(java.lang.Object)
+	 */
+	@Override
+	public void setSource(Object source)
+	{
+		this.source = source;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.commands.editor.CustomizableEditor#getSource()
+	 */
+	@Override
+	public Object getSource() {
+		return ca;
+	}
+	@Override
+	public Object toConcordance() { return null;}
+	@Override
+	public Object toIndex() { return null;}
+	@Override
+	public Object toProgression() { return null;}
+
+
+	/**
+	 * Gets the rows information editor.
+	 * @return
+	 */
+	public ColsRowsInfosEditor getRowsInfosEditor()	{
+		return (ColsRowsInfosEditor) this.editors.get(2);
+	}
+
+	/**
+	 * Gets the columns information editor.
+	 * @return
+	 */
+	public ColsRowsInfosEditor getColsInfosEditor()	{
+		return (ColsRowsInfosEditor) this.editors.get(3);
+	}
+
+	
+	/**
+	 * Gets the chart factorial map chart editor.
+	 * @return
+	 */
+	public ChartEditorPart getChartEditor()	{
+		return (ChartEditorPart) this.editors.get(0);
+	}
+	
+	
+
+	@Override
+	public void setFocus()	{
+		// Give the focus to the CA factorial map ChartEditorPart instead of the parent MultiPageEditorPart
+		editors.get(0).setFocus();
+		// FIXME: the problem here is that we need to give the focus to the singular values chart editor when clicking in it
+	//	System.err.println("CaEditor.setFocus(): " + this.getActivePage());
+//		editors.get(4).setFocus();
+	}
+	
+	@Override
+	public boolean usingCorpus(Corpus corpus) {
+		if (ca != null && ca.getCorpus() != null) 
+			return ca.getCorpus().getName().equals(corpus.getName());
+		return false;
+	}
+
+	@Override
+	public boolean updateCorpus(Corpus corpus) {
+		return false;
+	}
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/SingularValuesEditor.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/SingularValuesEditor.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/SingularValuesEditor.java	(revision 136)
@@ -0,0 +1,271 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.ca.rcp.editors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.rcpapplication.editors.Tablable;
+import org.txm.rcpapplication.editors.TableKeyListener;
+import org.txm.rcpapplication.editors.TableSorter;
+// TODO: Auto-generated Javadoc
+/**
+ * show the singular values and compute some stats.
+ *
+ * @author mdecorde
+ */
+public class SingularValuesEditor extends EditorPart {
+
+	/** The ID. */
+	static public String ID = "org.txm.rcpapplication.editors.TableEditor"; //$NON-NLS-1$
+
+	/** The viewer. */
+	private TableViewer viewer;
+
+	/** The i editor input. */
+	private IEditorInput iEditorInput;
+
+	/** The table input. */
+	private Tablable tableInput;
+
+	/** The columns. */
+	List<TableViewerColumn> columns = new ArrayList<TableViewerColumn>();
+
+	/** The table sorter. */
+	private TableSorter tableSorter;
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	@Override
+	public void doSave(IProgressMonitor monitor) {
+		// TODO Auto-generated method stub
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+	 */
+	@Override
+	public void doSaveAs() {
+		// TODO Auto-generated method stub
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+	 */
+	@Override
+	public void init(IEditorSite site, IEditorInput input)
+			throws PartInitException {
+		setSite(site);
+		setInput(input);
+		this.iEditorInput = input;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#isDirty()
+	 */
+	@Override
+	public boolean isDirty() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+	 */
+	@Override
+	public boolean isSaveAsAllowed() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	public void createPartControl(Composite parent) {
+		parent.setLayout(new FillLayout());
+
+		if (!(iEditorInput instanceof Tablable)) {
+			throw new IllegalArgumentException(Messages.SingularValuesEditor_0);
+		}
+		tableInput = (Tablable) iEditorInput;
+
+		viewer = new TableViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL
+				| SWT.MULTI | SWT.FULL_SELECTION);
+		viewer.getTable().addKeyListener(new TableKeyListener(viewer));
+
+		Table table = viewer.getTable();
+		table.setHeaderVisible(true);
+		table.setLinesVisible(true);
+
+		String[] titles = tableInput.getColumnTitles();
+
+		for (int i = 0; i < titles.length; i++) {
+			final int index = i;
+			final TableViewerColumn column;
+
+			int alignment = SWT.RIGHT;
+			// Align the bar plot to the left
+			if(i == 4)	{
+				alignment = SWT.LEFT;
+			}
+
+			column = new TableViewerColumn(viewer, alignment);
+
+			column.getColumn().setText(titles[i]);
+			column.getColumn().setWidth(100);
+			column.getColumn().setResizable(true);
+			column.getColumn().setMoveable(true);
+			columns.add(column);
+
+			column.getColumn().addSelectionListener(new SelectionAdapter() {
+				@Override
+				public void widgetSelected(SelectionEvent e)
+				{
+					StatusLine.setMessage(Messages.IndexEditor_36);
+					tableSorter.setColumn(index);
+					int dir = viewer.getTable().getSortDirection();
+					if (viewer.getTable().getSortColumn() == column.getColumn()) {
+						dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
+					} else {
+						dir = SWT.DOWN;
+					}
+					viewer.getTable().setSortDirection(dir);
+					viewer.getTable().setSortColumn(column.getColumn());
+					viewer.refresh();
+					StatusLine.setMessage(Messages.IndexEditor_37);
+				}
+			});
+		}
+
+
+		// To draw the bar plot column
+		viewer.getTable().addListener(SWT.EraseItem, new Listener() {
+		      public void handleEvent(Event event) {
+
+		    	   if(event.index == 4)	{
+		    		   int itemIndex = viewer.getTable().indexOf((TableItem)event.item);
+		    		   double percent = Double.parseDouble(((ArrayList)viewer.getElementAt(itemIndex)).get(2).toString().replaceAll(",",".")); // comma replacement according to the locale //$NON-NLS-1$ //$NON-NLS-2$
+
+		    		   int maxPercentItemIndex = 0;
+		    		   double maxPercent = Double.parseDouble(viewer.getTable().getItem(0).getText(2).replaceAll(",",".")); //$NON-NLS-1$ //$NON-NLS-2$
+		    		   double tmpMaxPercent;
+
+		    		   // Get the max percent despite of the current row sorting
+		    		   for(int i = 0; i < viewer.getTable().getItemCount(); i++) {
+		    			   tmpMaxPercent =  Double.parseDouble(viewer.getTable().getItem(i).getText(2).replaceAll(",",".")); //$NON-NLS-1$ //$NON-NLS-2$
+		    			   if(tmpMaxPercent > maxPercent)	{
+		    				   maxPercent = tmpMaxPercent;
+		    				   maxPercentItemIndex = i;
+		    			   }
+		    		   }
+
+		    		   event.gc.setBackground(viewer.getTable().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
+		    		   event.gc.fillRectangle(event.x, event.y, (int) (event.width * percent / Double.parseDouble(viewer.getTable().getItem(maxPercentItemIndex).getText(2).replaceAll(",","."))), event.height); //$NON-NLS-1$ //$NON-NLS-2$
+		    	   }
+		      }
+		    });
+
+
+
+		viewer.setContentProvider(tableInput.getContentProvider());
+		viewer.setLabelProvider(tableInput.getLabelProvider());
+		viewer.setInput(tableInput.getInput());
+
+		tableSorter = new TableSorter();
+		tableSorter.setColumnTypes(tableInput.getColumnTypes());
+		viewer.setSorter(tableSorter);
+
+		viewer.refresh();
+		createContextMenu(viewer);
+
+		tableSorter.setColumn(0);
+		int dir = viewer.getTable().getSortDirection();
+		if (viewer.getTable().getSortColumn() == columns.get(0).getColumn()) {
+			dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
+		} else {
+			dir = SWT.DOWN;
+		}
+		viewer.getTable().setSortDirection(dir);
+		viewer.getTable().setSortColumn(columns.get(0).getColumn());
+		viewer.refresh();
+
+		// Pack the columns except the bar plot column
+		for(int i = 0; i < viewer.getTable().getColumnCount(); i++)	{
+			if(i != 4)	{
+				viewer.getTable().getColumn(i).pack();
+			}
+		}
+	}
+
+	/**
+	 * Creates the context menu.
+	 *
+	 * @param tableViewer the table viewer
+	 */
+	private void createContextMenu(TableViewer tableViewer) {
+
+		MenuManager menuManager = new MenuManager();
+		Menu menu = menuManager.createContextMenu(tableViewer.getTable());
+
+		// Set the MenuManager
+		tableViewer.getTable().setMenu(menu);
+		getSite().registerContextMenu(menuManager, tableViewer);
+		// Make the selection available
+		getSite().setSelectionProvider(tableViewer);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+	 */
+	@Override
+	public void setFocus() {
+		viewer.getControl().setFocus();
+	}
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/SingularValuesEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java	(revision 136)
@@ -0,0 +1,201 @@
+package org.txm.ca.rcp.editors;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ToolItem;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.rcp.chartsengine.events.CAPointSelectionCallBack;
+import org.txm.ca.rcp.chartsengine.events.CASelectionListener;
+import org.txm.ca.rcp.messages.CAUIMessages;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.chartsengine.rcp.editors.ChartEditorInput;
+import org.txm.chartsengine.rcp.editors.ChartEditorPart;
+import org.txm.chartsengine.rcp.events.EventCallBackHandler;
+import org.txm.rcpapplication.IImageKeys;
+import org.txm.searchengine.cqp.corpus.Partition;
+
+/**
+ * Correspondence analysis factorial map chart editor.
+ * @author sjacquot
+ *
+ */
+public class CAFactorialMapChartEditor extends ChartEditorPart {
+
+
+	/**
+	 * The show/hide columns button.
+	 */
+	protected ToolItem showColumns;
+
+
+	/**
+	 * The show/hide rows button.
+	 */
+	protected ToolItem showRows;
+
+	/**
+	 * The factors selection combo box.
+	 */
+	protected Combo plans;
+
+	
+	public CAFactorialMapChartEditor() {
+		super();
+	}
+	
+	/**
+	 *
+	 * @param chartEditorInput
+	 */
+	public CAFactorialMapChartEditor(SWTChartsComponentsProvider swtComponentsProvider, ChartEditorInput chartEditorInput) {
+		super(swtComponentsProvider, chartEditorInput);
+		// Override the editor input name
+		Partition partition = this.getResultData().getPartition();
+		if (partition != null)
+			chartEditorInput.setName(partition.getName() + ":" + this.getResultData().getAnalysisProperty()); //$NON-NLS-1$
+		else {
+			chartEditorInput.setName(""+this.getResultData().getCorpus() + ":" + this.getResultData().getAnalysisProperty()); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+	}
+
+
+	@Override
+	public void createPartControl(Composite parent) {
+
+		super.createPartControl(parent);
+
+		// Extend the chart editor tool bar
+		ToolItem separator = new ToolItem(this.toolBar, SWT.SEPARATOR);
+
+		// Show/hide columns
+		this.showColumns = new ToolItem(this.toolBar, SWT.CHECK);
+		// FIXME: keep this for offering an option "large icons" with text in buttons ?
+		//this.showColumns.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_LABEL);
+		this.showColumns.setToolTipText(CAUIMessages.SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_TOOLTIP);
+		this.showColumns.setImage(IImageKeys.getImage(IImageKeys.CHARTS_CA_SHOW_COLUMNS));
+		// FIXME: this code should be restored when the charts rendering prefs will be moved outside of the CA object
+		//this.showColumns.setSelection(TxmPreferences.getBoolean(CAPreferencePage.SHOWINDIVIDUALS));
+		this.showColumns.setSelection(this.getResultData().isShowIndividuals());
+		this.showColumns.addSelectionListener(new CASelectionListener(this, CASelectionListener.SHOW_HIDE_COLUMNS));
+
+		// Show/hide rows
+		this.showRows = new ToolItem(this.toolBar, SWT.CHECK);
+		// FIXME: keep this for offering an option "large icons" with text in buttons ?
+		//this.showRows.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_LABEL);
+		this.showRows.setToolTipText(CAUIMessages.SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_TOOLTIP);
+		this.showRows.setImage(IImageKeys.getImage(IImageKeys.CHARTS_CA_SHOW_ROWS));
+		// FIXME: this code should be restored when the charts rendering prefs will be moved outside of the CA object
+		//this.showRows.setSelection(TxmPreferences.getBoolean(CAPreferencePage.SHOWVARIABLES));
+		this.showRows.setSelection(this.getResultData().isShowVariables());
+		this.showRows.addSelectionListener(new CASelectionListener(this, CASelectionListener.SHOW_HIDE_ROWS));
+
+//
+		// Factors selection
+		ToolItem itemSeparator = new ToolItem(this.toolBar, SWT.SEPARATOR);
+		CLabel factorsLabel = new CLabel(this.toolBar, SWT.CENTER);
+		factorsLabel.setText(CAUIMessages.SWTChartsComponentProvider_CA_TOOLBAR_AXES_SELECTION_COMBO_BOX_LABEL);
+		factorsLabel.pack();
+		itemSeparator.setWidth(factorsLabel.getBounds().width);
+	    itemSeparator.setControl(factorsLabel);
+
+		this.plans = new Combo(this.toolBar, SWT.READ_ONLY);
+
+		// FIXME: commented because the infos panel is not ready to manage more axes
+//		ArrayList<String> planes = null;
+//		try {
+//			int nbsv = ((CA) editorPart.getResultData()).getSingularValues().length;
+//			planes = new ArrayList<String>();
+//			for(int i = 1 ; i < nbsv ; i ++)	{
+//				for(int j = i ; j < nbsv ; j++)	{
+//					if(i != j)	{
+//						planes.add("("+i+","+j+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+//					}
+//				}
+//			}
+//		}
+//		catch (StatException e1) {
+//			// TODO Auto-generated catch block
+//			org.txm.rcpapplication.utils.Logger.printStackTrace(e1);
+//		}
+//		String [] items = planes.toArray(new String[planes.size()]);
+
+		String items[] = { "(1,2)", "(1,3)", "(2,3)" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+		// TODO : commented because the infos panel is not ready to manage more axes
+		//		if(couples != null && couples.size() > 3)	{
+		//			items = couples.toArray(new String[couples.size()]);
+		//}
+
+
+		this.plans.setItems(items);
+
+		// Preselect the plan from the CA data
+		if(this.getResultData().getFirstDimension() == 2)	{
+			this.plans.select(2);
+		}
+		else if(this.getResultData().getSecondDimension() == 3)	{
+			this.plans.select(1);
+		}
+		else	{
+			this.plans.select(0);
+		}
+
+
+		ToolItem comboItem = new ToolItem(this.toolBar, SWT.SEPARATOR);
+		comboItem.setControl(this.plans);
+		this.plans.pack();
+		comboItem.setWidth(this.plans.getBounds().width);
+		this.plans.addSelectionListener(new CASelectionListener(this, CASelectionListener.CHANGE_FACTORS));
+		
+		
+		// Initialize the default chart items selection order on descendant label order
+//		Utils.getChartCreator(this.getChartEditor().getChartsEngine()).updateChartCAFactorialMapSetLabelItemsSelectionOrder(this.getChartEditor().getChart(),
+//				this.getRowsInfosEditor().getOrdererLabels(), this.getColsInfosEditor().getOrdererLabels());
+		
+		
+//		// Registers mouse handling call backs
+//		EventCallBackHandler mouseHandler = this.getComposite().getMouseCallBackHandler();
+//		if(mouseHandler != null)	 {
+//			// Register mouse single click call back handler to manage the selection of SWT table rows from the charts engine TBX level
+//			mouseHandler.registerEventCallBack(new CAPointSelectionCallBack(this, this.getRowsInfosEditor().getViewer(), this.getColsInfosEditor().getViewer()));
+//		}
+//		
+//		// Registers keyboard handling call backs
+//		EventCallBackHandler keyHandler = this.getComposite().getKeyCallBackHandler();
+//		if(keyHandler != null)	 {
+//			// Register mouse single click call back handler to manage the selection of SWT table rows from the charts engine TBX level
+//			keyHandler.registerEventCallBack(new CAPointSelectionCallBack(this, this.getRowsInfosEditor().getViewer(), this.getColsInfosEditor().getViewer()));
+//		}
+
+		
+		// initialize the default shared context menus as Export, etc.
+		//SWTChartsComponentsProvider.initDefaultContextMenus(this.getComposite());
+	}
+
+
+
+	@Override
+	public CA getResultData()	{
+		return (CA) super.getResultData();
+	}
+
+
+	/**
+	 * @return the showColumns
+	 */
+	public ToolItem getShowColumns() {
+		return showColumns;
+	}
+
+
+	/**
+	 * @return the showRows
+	 */
+	public ToolItem getShowRows() {
+		return showRows;
+	}
+
+
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColRowInfosLabelProvider.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColRowInfosLabelProvider.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColRowInfosLabelProvider.java	(revision 136)
@@ -0,0 +1,156 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.ca.rcp.editors;
+
+import java.text.DecimalFormat;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.txm.ca.core.preferences.CAPreferences;
+import org.txm.ca.rcp.messages.CAUIMessages;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.rcpapplication.Messages;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ColRowInfosLabelProvider.
+ */
+public class ColRowInfosLabelProvider extends LabelProvider implements
+		ITableLabelProvider {
+
+	/** The names. */
+	String[] names;
+
+	/** The qualitypattern. */
+	DecimalFormat qualitypattern = new DecimalFormat("0.00"); //$NON-NLS-1$
+
+	/** The masspattern. */
+	DecimalFormat masspattern = new DecimalFormat("0.00");//%% //$NON-NLS-1$
+
+	/** The distpattern. */
+	DecimalFormat distpattern = new DecimalFormat("0.00"); //$NON-NLS-1$
+
+	/** The chipattern. */
+	DecimalFormat chipattern = new DecimalFormat("0.00"); //$NON-NLS-1$
+
+	/** The contribpattern. */
+	DecimalFormat contribpattern = new DecimalFormat("0.00"); //$NON-NLS-1$
+
+	/** The cos2pattern. */
+	DecimalFormat cos2pattern = new DecimalFormat("0.00"); //$NON-NLS-1$
+
+	/** The coordpattern. */
+	DecimalFormat coordpattern = new DecimalFormat("0.00"); //$NON-NLS-1$
+
+	/**
+	 * Instantiates a new col row infos label provider.
+	 *
+	 * @param names the names
+	 */
+	public ColRowInfosLabelProvider(String[] names) {
+		super();
+		this.names = names;
+		for (int i = 0; i < names.length; i++) {
+			if (names[i].startsWith(CAUIMessages.CorrespondanceAnalysisEditorInput_26)) {
+				String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.MASS_DISPLAY_FORMAT);
+			if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$
+					masspattern = new DecimalFormat(pattern);
+			} else if (names[i].startsWith(Messages.ColRowInfosLabelProvider_9)) {
+				String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.CHI_DISPLAY_FORMAT);
+				if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$
+					chipattern = new DecimalFormat(pattern);
+			} else if (names[i].startsWith(CAUIMessages.CorrespondanceAnalysisEditorInput_27)) {
+				String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.DIST_DISPLAY_FORMAT);
+				if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$
+					distpattern = new DecimalFormat(pattern);
+			} else if (names[i].startsWith(CAUIMessages.CorrespondanceAnalysisEditorInput_30)) {
+				String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.COS2_DISPLAY_FORMAT);
+				if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$
+					cos2pattern = new DecimalFormat(pattern);
+			} else if (names[i].startsWith("c") && names[i].length() == 2) //$NON-NLS-1$
+			{
+				String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.COORD_DISPLAY_FORMAT);
+				if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$
+					coordpattern = new DecimalFormat(pattern);
+			} else if (names[i].startsWith(CAUIMessages.CorrespondanceAnalysisEditorInput_29)) {
+				String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.CONTRIB_DISPLAY_FORMAT);
+				if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$
+					contribpattern = new DecimalFormat(pattern);
+			} else if (names[i].startsWith(Messages.ColRowInfosLabelProvider_19) && names[i].length() == 3) {
+				String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.QUALITY_DISPLAY_FORMAT);
+				if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$
+					qualitypattern = new DecimalFormat(pattern);
+			}
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+	 */
+	@Override
+	public Image getColumnImage(Object element, int columnIndex) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+	 */
+	@Override
+	@SuppressWarnings("unchecked") //$NON-NLS-1$
+	public String getColumnText(Object element, int columnIndex) {
+		// names[columnIndex] = Rows,Q12,Q13,Q23,Mass,Chi²,Contrib,Cos²,c1,c2,c3
+
+		Object o = ((List<Object>) element).get(columnIndex);
+		if (o instanceof Double || o instanceof Float) {
+			DecimalFormat f;
+			String name = names[columnIndex];
+			f = new DecimalFormat("###.00"); //$NON-NLS-1$
+			if (name.startsWith(CAUIMessages.CorrespondanceAnalysisEditorInput_26)) {
+				f = masspattern;
+			} else if (name.startsWith(Messages.ColRowInfosLabelProvider_9)) {
+				f = chipattern;
+			} else if (name.startsWith(CAUIMessages.CorrespondanceAnalysisEditorInput_27)) {
+				f = distpattern;
+			} else if (name.startsWith(CAUIMessages.CorrespondanceAnalysisEditorInput_30)) {
+				f = cos2pattern;
+			} else if (name.startsWith("c") && name.length() == 2) //$NON-NLS-1$
+			{
+				f = coordpattern;
+			} else if (name.startsWith(CAUIMessages.CorrespondanceAnalysisEditorInput_29)) {
+				f = contribpattern;
+			} else if (name.startsWith(Messages.ColRowInfosLabelProvider_19)
+					&& name.length() == 3) {
+				f = qualitypattern;
+			}
+			return f.format(o);
+		} else
+			return o.toString();
+	}
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColRowInfosLabelProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CorrespondanceAnalysisEditorInput.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CorrespondanceAnalysisEditorInput.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CorrespondanceAnalysisEditorInput.java	(revision 136)
@@ -0,0 +1,616 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.ca.rcp.editors;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.preferences.CAPreferences;
+import org.txm.ca.rcp.messages.CAUIMessages;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.chartsengine.rcp.editors.ChartEditorInput;
+import org.txm.chartsengine.rcp.editors.ChartEditorPart;
+import org.txm.rcpapplication.Application;
+import org.txm.rcpapplication.IImageKeys;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.editors.Tablable;
+import org.txm.rcpapplication.editors.input.AbstractTablable;
+import org.txm.rcpapplication.editors.input.FrequencyListContentProvider;
+import org.txm.rcpapplication.editors.input.FrequencyListLabelProvider;
+import org.txm.rcpapplication.editors.input.IProvidingMultiPageEditorInput;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.searchengine.cqp.corpus.Property;
+
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class CorrespondanceAnalysisEditorInput.
+ *
+ * @author sloiseau
+ */
+public class CorrespondanceAnalysisEditorInput implements IEditorInput, IProvidingMultiPageEditorInput {
+
+	/** The ca. */
+	private CA ca;
+	private static String SEPARATOR = "SEPARATOR"; //$NON-NLS-1$
+
+	private static String COL_TYPE = "Double"; //$NON-NLS-1$
+	
+	/** The property. */
+	private Property property;
+
+	/** The editors. */
+	private List<EditorPart> editors;
+
+	/** The inputs. */
+	private List<IEditorInput> inputs;
+
+	/** The names. */
+	private List<String> names = Arrays.asList(new String[] {
+			CAUIMessages.CorrespondanceAnalysisEditorInput_1,
+			CAUIMessages.CorrespondanceAnalysisEditorInput_0,
+			CAUIMessages.CorrespondanceAnalysisEditorInput_8,
+			CAUIMessages.CorrespondanceAnalysisEditorInput_9,
+			CAUIMessages.CorrespondanceAnalysisEditorInput_2 });
+
+	/**
+	 * The Class CASingularValueLabelProvider.
+	 */
+	private class CASingularValueLabelProvider extends LabelProvider implements	ITableLabelProvider {
+
+
+		/**
+		 * Percent values number format.
+		 */
+		protected DecimalFormat percentValuesNumberFormat = new DecimalFormat(new String("0.00")); //$NON-NLS-1$
+
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+		 */
+		@Override
+		public Image getColumnImage(Object element, int columnIndex) {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+		 */
+		@Override
+		@SuppressWarnings("unchecked") //$NON-NLS-1$
+		public String getColumnText(Object element, int columnIndex) {
+			DecimalFormat f;
+			Object o = ((List<Object>) element).get(columnIndex);
+			switch (columnIndex) {
+				case 0: // factor
+					return o.toString();
+				case 1: // eigenvalue
+					if ((Double) o < 1) {
+						if ((Double) o < 0.0001)
+							f = new DecimalFormat("0.0000E00"); //$NON-NLS-1$
+						else
+							f = new DecimalFormat("0.0000"); //$NON-NLS-1$
+					} else {
+						f = new DecimalFormat("##########0.0000"); //$NON-NLS-1$
+					}
+					// FIXME: printf syntax tests
+					//return String.format("%.4f", o);
+					return f.format(o);
+				case 2: // percent
+				case 3: // cumul
+					return percentValuesNumberFormat.format(o);
+				default:
+					return ""; //$NON-NLS-1$
+			}
+		}
+	}
+
+	/**
+	 * Instantiates a new correspondence analysis editor input.
+	 *
+	 * @param ca the ca
+	 * @param partition the partition
+	 * @param property the property
+	 */
+	public CorrespondanceAnalysisEditorInput(final CA ca, Partition partition, Property property) {
+		super();
+		this.ca = ca;
+		this.property = property;
+
+		if(ca == null)	{
+			throw new IllegalArgumentException(CAUIMessages.CorrespondanceAnalysisEditorInput_3);
+		}
+
+		// Create the tab-editor
+		editors = new ArrayList<EditorPart>();
+
+		// Create the input for each tab-editor
+		inputs = new ArrayList<IEditorInput>();
+
+		// Initialize the editor parts and editor inputs
+		this.initCAFactorialMapEditor();
+		this.initCASingularValuesTableEditor();
+		this.initRowsTableEditor();
+		this.initColumnsTableEditor();
+		this.initCASingularValuesBarChartEditor();
+	}
+
+
+	/**
+	 * Initializes CA factorial map editor.
+	 */
+	public void initCAFactorialMapEditor()	{
+
+		// Editor part
+		ChartEditorPart caFactorialMapEditorPart = new CAFactorialMapChartEditor(SWTChartsComponentsProvider.getCurrent(), new ChartEditorInput(ca, CAPreferences.PREFERENCES_NODE));
+		editors.add(caFactorialMapEditorPart);
+
+		// Editor input
+		inputs.add(caFactorialMapEditorPart.getEditorInput());
+
+	}
+
+	
+
+	/**
+	 * Initializes CA singular values bar chart editor.
+	 */
+	public void initCASingularValuesBarChartEditor()	{
+		
+		// Editor part
+		EditorPart caSingularValuesEditorPart = SWTChartsComponentsProvider.getCurrent().createChartEditor(ca, CAPreferences.PREFERENCES_NODE, "Singular Values"); //$NON-NLS-1$
+		editors.add(caSingularValuesEditorPart);
+
+		// Editor input
+		inputs.add(caSingularValuesEditorPart.getEditorInput());
+	}
+
+	
+	/**
+	 * Initializes CA singular values table editor.
+	 */
+	public void initCASingularValuesTableEditor()	{
+		// Editor part
+		editors.add(new SingularValuesEditor());
+
+		// Editor input
+		Tablable table = new AbstractTablable() {
+			@Override
+			public String[] getColumnTitles() {
+				return new String[] {
+						CAUIMessages.CorrespondanceAnalysisEditorInput_4,
+						CAUIMessages.CorrespondanceAnalysisEditorInput_5,
+						"%", CAUIMessages.CorrespondanceAnalysisEditorInput_11 + "%", "", ""}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+			}
+
+			@Override
+			public String[] getColumnTypes() {
+				return new String[] {
+						Messages.FrequencyListEditorInput_6,
+						COL_TYPE,
+						COL_TYPE,
+						COL_TYPE,
+						COL_TYPE,
+						SEPARATOR};
+			}
+
+			@Override
+			public IStructuredContentProvider getContentProvider() {
+				return new IStructuredContentProvider() {
+					@Override
+					public Object[] getElements(Object inputElement) {
+						CA ca = (CA) inputElement;
+						List<List<Object>> tabledata = ca.getSingularValuesInfos();
+						return tabledata.toArray();
+					}
+
+					@Override
+					public void dispose() {
+						// TODO Auto-generated method stub
+					}
+
+					@Override
+					public void inputChanged(Viewer viewer, Object oldInput,
+							Object newInput) {
+						// TODO Auto-generated method stub
+					}
+				};
+			}
+
+			@Override
+			public Object getInput() {
+				return ca;
+			}
+
+			@Override
+			public LabelProvider getLabelProvider() {
+				return new CASingularValueLabelProvider();
+			}
+		};
+
+		inputs.add(table);
+	}
+
+
+
+	/**
+	 * Initializes rows data table editor.
+	 */
+	public void initRowsTableEditor()	{
+		// Editor part
+		editors.add(new ColsRowsInfosEditor());
+
+		// Editor input
+		Tablable table = new AbstractTablable() {
+
+			List<String> coltypes;
+			@Override
+			public String[] getColumnTitles() {
+				return ca.getRowInfosTitles();
+				// new String[]{"Rows"," ","Quality","Mass", "Dist", "Inertia"};
+			}
+
+			@Override
+			public String[] getColumnTypes() {
+				coltypes = new ArrayList<String>();
+				coltypes.add(Messages.FrequencyListEditorInput_6);
+				coltypes.add(SEPARATOR);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				for (int c = 0; c < 3; c++)// seulement les 3 premiers axes
+				{
+					coltypes.add(SEPARATOR);
+					coltypes.add(COL_TYPE);
+					coltypes.add(COL_TYPE);
+				}
+				coltypes.add(SEPARATOR);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(SEPARATOR);
+				return coltypes.toArray(new String[] {});
+				// new String[]{Messages.FrequencyListEditorInput_6,
+				// Messages.SpecificitiesResultEditorInput_11,
+				// Messages.SpecificitiesResultEditorInput_11,
+				// Messages.SpecificitiesResultEditorInput_11};
+			}
+
+			@Override
+			public IStructuredContentProvider getContentProvider() {
+
+				return new IStructuredContentProvider() {
+					@Override
+					public Object[] getElements(Object inputElement) {
+
+						CA ca = (CA) inputElement;
+						return ca.getRowInfos();
+					}
+
+					@Override
+					public void dispose() {
+						// TODO Auto-generated method stub
+					}
+
+					@Override
+					public void inputChanged(Viewer viewer, Object oldInput,
+							Object newInput) {
+						// TODO Auto-generated method stub
+					}
+				};
+			}
+
+			@Override
+			public Object getInput() {
+				return ca;
+			}
+
+			@Override
+			public LabelProvider getLabelProvider() {
+				return new ColRowInfosLabelProvider(this.getColumnTitles());
+			}
+		};
+		inputs.add(table);
+	}
+
+
+	/**
+	 * Initializes columns data table editor.
+	 */
+	public void initColumnsTableEditor()	{
+		// Editor part
+		editors.add(new ColsRowsInfosEditor());
+
+		// Editor input
+		Tablable table = new AbstractTablable() {
+
+			List<String> colnames = new ArrayList<String>();
+			List<String> coltypes = new ArrayList<String>();
+			boolean firstInit = true;
+
+			@Override
+			public String[] getColumnTitles() {
+//				colnames = new ArrayList<String>();
+//				colnames.add(Messages.ComputeClassification_5);
+//				colnames.add(" "); //$NON-NLS-1$
+//				colnames.add(Messages.CorrespondanceAnalysisEditorInput_46);
+//				colnames.add(Messages.CorrespondanceAnalysisEditorInput_47);
+//				colnames.add(Messages.CorrespondanceAnalysisEditorInput_25);
+//				colnames.add(Messages.CorrespondanceAnalysisEditorInput_26);
+//				colnames.add(Messages.CorrespondanceAnalysisEditorInput_27);
+//				for (int c = 0; c < 3; c++)// seulement les 3 premiers axes
+//				{
+//					colnames.add(" "); //$NON-NLS-1$
+//					colnames.add(Messages.CorrespondanceAnalysisEditorInput_29
+//							+ (c + 1));
+//					colnames.add(Messages.CorrespondanceAnalysisEditorInput_30
+//							+ (c + 1));
+//				}
+//				colnames.add(" "); //$NON-NLS-1$
+//				colnames.add(Messages.CorrespondanceAnalysisEditorInput_32);
+//				colnames.add(Messages.CorrespondanceAnalysisEditorInput_33);
+//				colnames.add(Messages.CorrespondanceAnalysisEditorInput_34);
+//				colnames.add(""); //$NON-NLS-1$
+//				String[] titles = colnames.toArray(new String[] {});
+//				return titles;
+				return ca.getColInfosTitles();
+				// new String[]{"Rows"," ","Quality","Mass", "Dist", "Inertia"};
+			}
+
+			@Override
+			public String[] getColumnTypes() {
+				coltypes = new ArrayList<String>();
+				coltypes.add(Messages.FrequencyListEditorInput_6);
+				coltypes.add(SEPARATOR);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				for (int c = 0; c < 3; c++) {
+					coltypes.add(SEPARATOR);
+					coltypes.add(COL_TYPE);
+					coltypes.add(COL_TYPE);
+				}
+				coltypes.add(SEPARATOR);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(COL_TYPE);
+				coltypes.add(SEPARATOR);
+				return coltypes.toArray(new String[] {});
+				// new String[]{Messages.FrequencyListEditorInput_6,
+				// COL_TYPE,
+				// COL_TYPE,
+				// COL_TYPE};
+			}
+
+			@Override
+			public IStructuredContentProvider getContentProvider() {
+
+				return new IStructuredContentProvider() {
+					@Override
+					public Object[] getElements(Object inputElement) {
+						CA ca = (CA) inputElement;
+						return ca.getColInfos();
+					}
+
+					@Override
+					public void dispose() {
+						// TODO Auto-generated method stub
+					}
+
+					@Override
+					public void inputChanged(Viewer viewer, Object oldInput,
+							Object newInput) {
+						// TODO Auto-generated method stub
+					}
+				};
+			}
+
+			@Override
+			public Object getInput() {
+				return ca;
+			}
+
+			@Override
+			public LabelProvider getLabelProvider() {
+				return new ColRowInfosLabelProvider(this.getColumnTitles());
+			}
+		};
+		inputs.add(table);
+	}
+
+
+
+	/**
+	 * Exists.
+	 *
+	 * @return true, if successful
+	 * @see org.eclipse.ui.IEditorInput#exists()
+	 */
+	@Override
+	public boolean exists() {
+		return false;
+	}
+
+	/**
+	 * Gets the image descriptor.
+	 *
+	 * @return the image descriptor
+	 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+	 */
+	@Override
+	public ImageDescriptor getImageDescriptor() {
+		return AbstractUIPlugin.imageDescriptorFromPlugin(
+				Application.PLUGIN_ID,
+				IImageKeys.ACTION_CORRESPONDANCE_ANALYSIS);
+	}
+
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 * @see org.eclipse.ui.IEditorInput#getName()
+	 */
+	@Override
+	public String getName() {
+		return CAUIMessages.CorrespondanceAnalysisEditorInput_10;
+	}
+
+	/**
+	 * Gets the persistable.
+	 *
+	 * @return the persistable
+	 * @see org.eclipse.ui.IEditorInput#getPersistable()
+	 */
+	@Override
+	public IPersistableElement getPersistable() {
+		return null;
+	}
+
+	/**
+	 * Gets the tool tip text.
+	 *
+	 * @return the tool tip text
+	 * @see org.eclipse.ui.IEditorInput#getToolTipText()
+	 */
+	@Override
+	public String getToolTipText() {
+		return getName();
+	}
+
+	/**
+	 * Gets the adapter.
+	 *
+	 * @param arg0 the arg0
+	 * @return the adapter
+	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+	 */
+	@Override
+	@SuppressWarnings("unchecked") //$NON-NLS-1$
+	public Object getAdapter(Class arg0) {
+		return null;
+	}
+
+	/**
+	 * Gets the cA.
+	 *
+	 * @return the Correspondance analysis underlying object
+	 */
+	public CA getCA() {
+		return ca;
+	}
+
+	/**
+	 * Gets the property.
+	 *
+	 * @return the property
+	 */
+	public Property getProperty() {
+		return property;
+	}
+
+	/**
+	 * Gets the content provider.
+	 *
+	 * @return the content provider
+	 */
+	public IStructuredContentProvider getContentProvider() {
+		return new FrequencyListContentProvider();
+	}
+
+	/**
+	 * Gets the input.
+	 *
+	 * @return the input
+	 */
+	public Object getInput() {
+		return ca;
+	}
+
+	/**
+	 * Gets the label provider.
+	 *
+	 * @return the label provider
+	 */
+	public LabelProvider getLabelProvider() {
+		return new FrequencyListLabelProvider();
+	}
+
+	/**
+	 * Gets the column titles.
+	 *
+	 * @return the column titles
+	 */
+	public String[] getColumnTitles() {
+		return new String[] { Messages.FrequencyListEditorInput_9,
+				Messages.FrequencyListEditorInput_4 };
+	}
+
+	// Implementing IProvidingMultiPageEditorInput
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.editors.input.IProvidingMultiPageEditorInput#getEditorInputs()
+	 */
+	@Override
+	public List<IEditorInput> getEditorInputs() {
+		return inputs;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.editors.input.IProvidingMultiPageEditorInput#getEditors()
+	 */
+	@Override
+	public List<EditorPart> getEditors() {
+		return editors;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.editors.input.IProvidingMultiPageEditorInput#getNames()
+	 */
+	@Override
+	public List<String> getNames() {
+		return names;
+	}
+
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CorrespondanceAnalysisEditorInput.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColsRowsInfosEditor.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColsRowsInfosEditor.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColsRowsInfosEditor.java	(revision 136)
@@ -0,0 +1,236 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.ca.rcp.editors;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.rcpapplication.editors.Tablable;
+import org.txm.rcpapplication.editors.TableKeyListener;
+import org.txm.rcpapplication.editors.TableSorter;
+// TODO: Auto-generated Javadoc
+/**
+ * Used to display rows and cols informations such as contribution, inertia,
+ * mass, coord... @ author mdecorde
+ * 
+ */
+public class ColsRowsInfosEditor extends EditorPart {
+	
+	/** The ID. */
+	static public String ID = "org.txm.rcpapplication.editors.ca.ColsrowsInfosEditor"; //$NON-NLS-1$
+
+	/** The viewer. */
+	private TableViewer viewer;
+	
+	/** The i editor input. */
+	private IEditorInput iEditorInput;
+	
+	/** The table input. */
+	private Tablable tableInput;
+
+	/** The table sorter. */
+	private TableSorter tableSorter;
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	@Override
+	public void doSave(IProgressMonitor monitor) {
+		// TODO Auto-generated method stub
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+	 */
+	@Override
+	public void doSaveAs() {
+		// TODO Auto-generated method stub
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+	 */
+	@Override
+	public void init(IEditorSite site, IEditorInput input)
+			throws PartInitException {
+		setSite(site);
+		setInput(input);
+		this.iEditorInput = input;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#isDirty()
+	 */
+	@Override
+	public boolean isDirty() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+	 */
+	@Override
+	public boolean isSaveAsAllowed() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	public void createPartControl(Composite parent) {
+		parent.setLayout(new FillLayout());
+
+		if (!(iEditorInput instanceof Tablable)) {
+			throw new IllegalArgumentException(Messages.ColsRowsInfosEditor_0);
+		}
+		tableInput = (Tablable) iEditorInput;
+		viewer = new TableViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL
+				| SWT.MULTI | SWT.FULL_SELECTION);
+		viewer.getTable().addKeyListener(new TableKeyListener(viewer));
+		Table table = viewer.getTable();
+		table.setHeaderVisible(true);
+		table.setLinesVisible(true);
+
+		String[] titles = tableInput.getColumnTitles();
+		String[] types = tableInput.getColumnTypes();
+		for (int i = 0; i < titles.length; i++) {
+			final int index = i;
+			final TableViewerColumn column;
+			if (index == 0)
+				column = new TableViewerColumn(viewer, SWT.LEFT);
+			else
+				column = new TableViewerColumn(viewer, SWT.RIGHT);
+			column.getColumn().setText(titles[i]);
+			if (types[i].equals("SEPARATOR")) //$NON-NLS-1$
+				column.getColumn().setResizable(false);
+			else
+				column.getColumn().setResizable(true);
+
+			// column.getColumn().setMoveable(true);
+
+			column.getColumn().addSelectionListener(new SelectionAdapter() {
+				@Override
+				public void widgetSelected(SelectionEvent e) {
+					StatusLine.setMessage(Messages.IndexEditor_36 );
+					tableSorter.setColumn(index);
+					int dir = viewer.getTable().getSortDirection();
+					if (viewer.getTable().getSortColumn() == column.getColumn()) {
+						dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
+					} else {
+						dir = SWT.DOWN;
+					}
+					viewer.getTable().setSortDirection(dir);
+					viewer.getTable().setSortColumn(column.getColumn());
+					viewer.refresh();
+					StatusLine.setMessage(Messages.IndexEditor_37);
+				}
+			});
+		}
+
+		viewer.setContentProvider(tableInput.getContentProvider());
+		viewer.setLabelProvider(tableInput.getLabelProvider());
+		viewer.setInput(tableInput.getInput());
+
+		tableSorter = new TableSorter();
+		tableSorter.setColumnTypes(tableInput.getColumnTypes());
+		viewer.setSorter(tableSorter);
+
+		this.setContentDescription(NLS.bind(Messages.ColsRowsInfosEditor_2, titles[0]));
+		createContextMenu(viewer);
+		viewer.refresh();
+		for (TableColumn col : viewer.getTable().getColumns())
+			col.pack();
+	}
+
+	/**
+	 * Gets the ordered labels according to the current table sort.
+	 * @return
+	 */
+	public String[] getOrdererLabels()	{
+		
+		TableItem[] items = this.viewer.getTable().getItems();
+		String[] labels = new String[items.length];
+		for(int i = 0; i < items.length; i++) {
+			labels[i] = items[i].getText();
+		}
+		
+		return labels;
+	}
+	
+	/**
+	 * Creates the context menu.
+	 *
+	 * @param tableViewer the table viewer
+	 */
+	private void createContextMenu(TableViewer tableViewer) {
+
+		MenuManager menuManager = new MenuManager();
+		Menu menu = menuManager.createContextMenu(tableViewer.getTable());
+
+		// Set the MenuManager
+		tableViewer.getTable().setMenu(menu);
+		getSite().registerContextMenu(menuManager, tableViewer);
+		// Make the selection available
+		getSite().setSelectionProvider(tableViewer);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+	 */
+	@Override
+	public void setFocus() {
+		viewer.getControl().setFocus();
+	}
+
+	/**
+	 * @return the viewer
+	 */
+	public TableViewer getViewer() {
+		return viewer;
+	}
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColsRowsInfosEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/chartsengine/events/CASelectionListener.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/chartsengine/events/CASelectionListener.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/chartsengine/events/CASelectionListener.java	(revision 136)
@@ -0,0 +1,135 @@
+package org.txm.ca.rcp.chartsengine.events;
+
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.ToolItem;
+import org.txm.ca.core.chartsengine.base.Utils;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.preferences.CAPreferences;
+import org.txm.ca.rcp.editors.CAFactorialMapChartEditor;
+import org.txm.ca.rcp.editors.CAEditor;
+import org.txm.chartsengine.rcp.editors.ChartEditorPart;
+import org.txm.chartsengine.rcp.events.BaseSelectionListener;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.utils.logger.Log;
+
+/**
+ * Mixed SWT/JFace CA selection listener shared by chart tool bar and extra data SWT tables.
+ * @author sjacquot
+ *
+ */
+public class CASelectionListener extends BaseSelectionListener implements ISelectionChangedListener {
+
+
+	/**
+	 * Command constants.
+	 */
+	public final static int SHOW_HIDE_COLUMNS = 0, SHOW_HIDE_ROWS = 1, CHANGE_FACTORS = 2, HIGHLIGHT_ROW_POINTS = 3, HIGHLIGHT_COLUMN_POINTS = 4, SET_CHART_ITEMS_SELECTION_ORDER = 5;
+
+
+	/**
+	 *
+	 * @param chartEditor
+	 * @param commandId
+	 */
+	public CASelectionListener(ChartEditorPart chartEditor, int commandId) {
+		super(chartEditor, commandId);
+	}
+
+
+	@Override
+	public void widgetSelected(SelectionEvent e) {
+
+		boolean giveFocusToChart = true;
+		
+		//Show/hide columns
+		if(this.commandId == CASelectionListener.SHOW_HIDE_COLUMNS)	{
+
+			// Cancel the event and do nothing if only columns are currently displayed
+			if(!((ToolItem) e.getSource()).getSelection() && !((CAFactorialMapChartEditor)this.chartEditor).getShowRows().getSelection())	{
+				((ToolItem) e.getSource()).setSelection(true);
+				return;
+			}
+
+			TXMPreferences.putLocalBoolean(this.chartEditor.getResultData(), CAPreferences.SHOW_VARIABLES, ((ToolItem) e.getSource()).getSelection());
+		}
+		//Show/hide rows
+		else if(this.commandId == CASelectionListener.SHOW_HIDE_ROWS)	{
+
+			// Cancel the event and do nothing if only rows are currently displayed
+			if(!((ToolItem) e.getSource()).getSelection() && !((CAFactorialMapChartEditor)this.chartEditor).getShowColumns().getSelection())	{
+				((ToolItem) e.getSource()).setSelection(true);
+				return;
+			}
+			
+			TXMPreferences.putLocalBoolean(this.chartEditor.getResultData(), CAPreferences.SHOW_INDIVIDUALS, ((ToolItem) e.getSource()).getSelection());
+		}
+		// Change factors
+		else if(this.commandId == CASelectionListener.CHANGE_FACTORS)	{
+
+			Combo plans = (Combo) e.getSource();
+
+			int dimension1 = 1;
+			int dimension2 = 2;
+
+			String str = plans.getItem(plans.getSelectionIndex());
+			str = str.substring(1, str.length() -1); // remove ( and )
+			String[] split = str.split(","); // 2 items //$NON-NLS-1$
+			// FIXME: this case should never happens
+			if(split.length != 2)	{
+				Log.severe("** Internal error: CA plan selection error"); //$NON-NLS-1$
+				return;
+			}
+			dimension1 = Integer.parseInt(split[0]);
+			dimension2 = Integer.parseInt(split[1]);
+
+			((CA) this.chartEditor.getResultData()).setDimensions(dimension1, dimension2);
+
+			this.chartEditor.resetView();
+		}
+		// Change chart items selection order
+		else if(this.commandId == CASelectionListener.SET_CHART_ITEMS_SELECTION_ORDER)	{
+
+			CAEditor editor = (CAEditor)this.chartEditor.getParentMultiPagesEditor(); 
+			Utils.getChartCreator(this.chartEditor.getChartsEngine()).updateChartCAFactorialMapSetLabelItemsSelectionOrder(this.chartEditor.getChart(), editor.getRowsInfosEditor().getOrdererLabels(), editor.getColsInfosEditor().getOrdererLabels());
+			
+			giveFocusToChart = false;
+			
+		}
+		
+
+		this.chartEditor.loadChart(); // needed for file based implementations of charts engine that modify the external existing chart file
+		
+		if(giveFocusToChart)	{
+			this.chartEditor.forceFocus();
+		}
+
+	}
+
+
+	@Override
+	public void selectionChanged(SelectionChangedEvent event) {
+
+		// Highlight points from table rows
+		if(this.commandId == CASelectionListener.HIGHLIGHT_ROW_POINTS || this.commandId == CASelectionListener.HIGHLIGHT_COLUMN_POINTS)	{
+
+			Table table = (Table) ((TableViewer) event.getSource()).getTable();
+	        String[] selectedLabels = new String[table.getSelectionCount()];
+	        TableItem[] selection = table.getSelection();
+
+	        for (int i = 0; i < selection.length; i++)	{
+	        	selectedLabels[i] = selection[i].getText();
+	        }
+
+	        Utils.getChartCreator(this.chartEditor.getChartsEngine()).updateChartCAFactorialMapHighlightPoints(this.chartEditor.getChart(), (this.commandId == CASelectionListener.HIGHLIGHT_ROW_POINTS), selectedLabels);
+		}
+
+	}
+
+
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/chartsengine/events/CASelectionListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/chartsengine/events/CAPointSelectionCallBack.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/chartsengine/events/CAPointSelectionCallBack.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/chartsengine/events/CAPointSelectionCallBack.java	(revision 136)
@@ -0,0 +1,67 @@
+package org.txm.ca.rcp.chartsengine.events;
+
+import java.awt.AWTEvent;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.txm.ca.core.chartsengine.base.Utils;
+import org.txm.ca.rcp.editors.CAEditor;
+import org.txm.chartsengine.rcp.events.EventCallBack;
+
+/**
+ * CA chart point selection call back shared by mouse and keyboard events.
+ * @author sjacquot
+ *
+ */
+public class CAPointSelectionCallBack extends EventCallBack {
+
+
+	@Override
+	public void processEvent(AWTEvent event, int eventArea, Object o) {
+
+		if(eventArea == EventCallBack.AREA_ITEM || event instanceof KeyEvent)	{
+			
+			final TableViewer rowsInfoViewer = ((CAEditor) chartEditor.getParentMultiPagesEditor()).getRowsInfosEditor().getViewer();
+			final TableViewer columnsInfoViewer = ((CAEditor) chartEditor.getParentMultiPagesEditor()).getColsInfosEditor().getViewer();
+
+		
+			// Need to run this in the SWT UI thread because it's called from the AWT UI thread in TBX charts engine layer
+			chartEditor.getComposite().getDisplay().asyncExec(new Runnable () {
+				public void run() {
+	
+					ArrayList<String> rowLabels = Utils.getChartCreator(chartEditor.getChartsEngine()).getCAFactorialMapChartSelectedPoints(chartEditor.getChart(), 0);
+					ArrayList<String> columnLabels = Utils.getChartCreator(chartEditor.getChartsEngine()).getCAFactorialMapChartSelectedPoints(chartEditor.getChart(), 1);
+	
+			        // Update the selected lines in the row and column information tables
+					for(int i = 0; i < rowsInfoViewer.getTable().getItemCount(); i++) {
+						if(rowLabels.contains(rowsInfoViewer.getTable().getItem(i).getText()))	{
+							rowsInfoViewer.getTable().select(i);
+							// Scroll to the last selected point
+							if(rowsInfoViewer.getTable().getItem(i).getText().equals(rowLabels.get(rowLabels.size() - 1)))	{
+								rowsInfoViewer.getTable().setTopIndex(i);
+							}
+						}
+						else	{
+							rowsInfoViewer.getTable().deselect(i);
+						}
+					}
+					for(int i = 0; i < columnsInfoViewer.getTable().getItemCount(); i++) {
+						if(columnLabels.contains(columnsInfoViewer.getTable().getItem(i).getText()))	{
+							columnsInfoViewer.getTable().select(i);
+							// Scroll to the last selected point
+							if(columnsInfoViewer.getTable().getItem(i).getText().equals(columnLabels.get(columnLabels.size() - 1)))	{
+								columnsInfoViewer.getTable().setTopIndex(i);
+							}
+						}
+						else	{
+							columnsInfoViewer.getTable().deselect(i);
+						}
+					}
+				}
+			});
+		}
+
+	}
+
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/chartsengine/events/CAPointSelectionCallBack.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCorrespondanceAnalysis.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCorrespondanceAnalysis.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCorrespondanceAnalysis.java	(revision 136)
@@ -0,0 +1,276 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.ca.rcp.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.Toolbox;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.functions.ICAComputable;
+import org.txm.ca.core.preferences.CAPreferences;
+import org.txm.ca.rcp.editors.CorrespondanceAnalysisEditorInput;
+import org.txm.ca.rcp.messages.CAUIMessages;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.rcpapplication.JobsTimer;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.rcpapplication.actions.LexicalTableDialog;
+import org.txm.rcpapplication.utils.JobHandler;
+import org.txm.rcpapplication.views.CorporaView;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.stat.data.LexicalTable;
+import org.txm.utils.logger.MessageBox;
+
+/**
+ * if the selection is a lexical table : computes the CA if the selection is a
+ * partition : ask the user which property used and which threshold used then
+ * open the CaEditor
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ */
+public class ComputeCorrespondanceAnalysis extends AbstractHandler {
+
+	/** The window. */
+	private IWorkbenchWindow window;
+
+	/** The selection. */
+	private IStructuredSelection selection;
+
+	/** The ca. */
+	private CA ca;
+
+	/** The property. */
+	private Property property;
+
+	/** The fmin. */
+	private int fmin;
+
+	/** The vmax. */
+	private int vmax;
+
+	/** The partition. */
+	private Partition partition;
+	private Corpus corpus;
+
+	/** The lexicaltable. */
+	private LexicalTable lexicaltable;
+
+	
+	
+	// FIXME: should be put in an Activator? or better in an extension point loaded by the corpora view? or in a method called here as initTreeDoubleClickListener(Class resultDataType, String commandId)?
+	// adds a double click listener to the Corpus View
+	static	{
+		CorporaView.addDoubleClickListener(CA.class, "ComputeCorrespondanceAnalysis"); //$NON-NLS-1$
+	}
+	
+	
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		
+		if (!Toolbox.isStatEngineInitialized()) {
+			System.out.println(CAUIMessages.ComputeCorrespondanceAnalysis_2);
+			return null;
+		}
+		
+		window = HandlerUtil.getActiveWorkbenchWindow(event);
+		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		int code = 0;
+		if (selection.getFirstElement() instanceof Partition) {
+			partition = (Partition) selection.getFirstElement();
+			corpus = partition.getCorpus();
+			//warning to few parts
+			if (partition.getNPart() < 4) {
+				MessageDialog d = new MessageDialog(
+						window.getShell(),
+						CAUIMessages.ComputeCorrespondanceAnalysis_3,
+						null,
+						NLS.bind(CAUIMessages.ComputeCorrespondanceAnalysis_4, partition.getNPart()),
+						0,
+						new String[] { CAUIMessages.ComputeCorrespondanceAnalysis_6 },
+						0);
+				d.open();
+				return null;
+			}
+			//ask property and Fmins and Vmax
+			String title = Messages.bind(CAUIMessages.ComputeCorrespondanceAnalysisDialog_0, partition.getName());
+			LexicalTableDialog d = new LexicalTableDialog(
+					window.getShell(), partition.getCorpus(), title);
+			code = d.open();
+			if (code == Window.OK) {
+				property = d.getProperty();
+				fmin = d.getFmin();
+				vmax = d.getMaxLines();
+			}
+		} else if (selection.getFirstElement() instanceof LexicalTable) {
+			lexicaltable = (LexicalTable) selection.getFirstElement();
+			property = lexicaltable.getProperty();
+			partition = lexicaltable.getPartition();
+			if (partition != null)
+				corpus = partition.getCorpus();
+			if (lexicaltable.getNColumns() < 4) {
+				MessageBox.error(CAUIMessages.ComputeCorrespondanceAnalysis_13);
+				return null;
+			}
+			if (lexicaltable.getNRows() < 4) {
+				MessageBox.error(CAUIMessages.ComputeCorrespondanceAnalysis_1);
+				return null;
+			}
+			code = Window.OK;
+		} else  if (selection.getFirstElement() instanceof ICAComputable) {
+			corpus = ((ICAComputable) selection.getFirstElement()).getCorpus();
+			partition = ((ICAComputable) selection.getFirstElement()).getPartition();
+		}
+
+		if (code == Window.OK) {
+			// final Property property = d.getProperty();
+			String statusmessage;
+			if (partition != null)
+				statusmessage = NLS.bind(CAUIMessages.ComputeCorrespondanceAnalysis_0, partition.getName(), property);
+			else
+				statusmessage = NLS.bind(CAUIMessages.ComputeCorrespondanceAnalysis_0, selection, "<none>"); //$NON-NLS-1$
+			
+			System.out.println(statusmessage);
+			JobHandler jobhandler = new JobHandler(statusmessage) {
+				@Override
+				protected IStatus run(IProgressMonitor monitor) {
+					this.runInit(monitor);
+					try {
+						JobsTimer.start();
+						monitor.beginTask("", 100); //$NON-NLS-1$
+						monitor.subTask(CAUIMessages.ComputeCorrespondanceAnalysis_15);
+
+						if (selection.getFirstElement() instanceof Partition)
+							ca = new CA(partition, property, fmin, vmax);
+						else if (selection.getFirstElement() instanceof LexicalTable)
+							ca = new CA(lexicaltable);
+						else if (selection.getFirstElement() instanceof ICAComputable)
+							ca = ((ICAComputable) selection.getFirstElement()).toCA();
+
+
+						if (selection.getFirstElement() instanceof Partition) {
+							if (monitor.isCanceled()) return Status.CANCEL_STATUS;
+							monitor.subTask(CAUIMessages.ComputeCorrespondanceAnalysis_16);
+							
+							this.acquireSemaphore();
+							ca.stepLexicalTable();
+							this.releaseSemaphore();
+							
+							this.acquireSemaphore();
+							ca.stepSortTableLexical();
+							this.releaseSemaphore();
+						}
+
+						monitor.worked(20);
+
+						if (monitor.isCanceled()) return Status.CANCEL_STATUS;
+
+						monitor.subTask(CAUIMessages.ComputeCorrespondanceAnalysis_17);
+						this.acquireSemaphore();
+						ca.stepCompute();
+						this.releaseSemaphore();
+						
+						boolean variables = TXMPreferences.getBoolean(CAPreferences.PREFERENCES_NODE, CAPreferences.SHOW_VARIABLES);
+						boolean individuals = TXMPreferences.getBoolean(CAPreferences.PREFERENCES_NODE, CAPreferences.SHOW_INDIVIDUALS);
+						
+						
+						ca.setShown(individuals, variables);
+
+						ca.getLexicalTable().storeResult(ca);
+//						if (partition != null) {
+//							partition.storeResult(ca);
+//						} else {
+//							corpus.storeResult(ca);
+//						}
+						
+						monitor.worked(20);
+						monitor.subTask(CAUIMessages.ComputeCorrespondanceAnalysis_8);
+
+						syncExec(new Runnable() {
+							@Override
+							public void run() {
+								if (ca == null) return;
+								IWorkbenchPage page = window.getActivePage();
+								CorrespondanceAnalysisEditorInput editorInput = new CorrespondanceAnalysisEditorInput(ca, partition, property);
+
+								try {
+									StatusLine.setMessage(CAUIMessages.ComputeCorrespondanceAnalysis_14);
+									IEditorPart editor = page.openEditor(editorInput, "CAEditor"); //$NON-NLS-1$
+									StatusLine.setMessage(CAUIMessages.ComputeCorrespondanceAnalysis_14);
+								} catch (Exception e) {
+									org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+								} 
+
+							}
+						});
+						monitor.worked(50);
+
+						monitor.subTask(Messages.CreatePartition_9);
+						syncExec(new Runnable() {
+							@Override
+							public void run() {
+								CorporaView.refresh();
+								CorporaView.expand(ca.getParent());
+							}
+						});
+
+						monitor.worked(100);
+					} catch (ThreadDeath td) {
+						return Status.CANCEL_STATUS;
+					} catch (Exception e) {
+						org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+					} finally {
+						monitor.done();
+						JobsTimer.stopAndPrint();
+					}
+					return Status.OK_STATUS;
+				}
+			};
+			jobhandler.startJob();
+		}
+		return null;
+	}
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCorrespondanceAnalysis.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/preferences/CAPreferencePage.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/preferences/CAPreferencePage.java	(revision 0)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/preferences/CAPreferencePage.java	(revision 136)
@@ -0,0 +1,190 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.ca.rcp.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.IWorkbench;
+import org.txm.ca.core.preferences.CAPreferences;
+import org.txm.ca.rcp.adapters.CAAdapterFactory;
+import org.txm.ca.rcp.messages.CAUIMessages;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.rcp.preferences.TXMPreferencePage;
+import org.txm.rcp.preferences.TXMPreferenceStore;
+import org.txm.rcpapplication.Messages;
+// TODO: Auto-generated Javadoc
+/**
+ * This class represents a preference page that is contributed to the
+ * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows us to create a page
+ * that is small and knows how to save, restore and apply itself.
+ * <p>
+ * This page is used to modif y preferences only. They are stored in the
+ * preference store that belongs to the main plug-in class. That way,
+ * preferences can be accessed directly via the preference store.
+ */
+
+public class CAPreferencePage extends TXMPreferencePage {
+
+
+
+	/**
+	 * Creates the field editors. Field editors are abstractions of the common
+	 * GUI blocks needed to manipulate various types of preferences. Each field
+	 * editor knows how to save and restore itself.
+	 */
+	@Override
+	public void createFieldEditors() {
+
+		Group ltGroup = new Group(getFieldEditorParent(), SWT.NONE);
+		ltGroup.setText(CAUIMessages.CAPreferencePage_2);
+		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
+		gridData.horizontalSpan = 2;
+		gridData.verticalIndent = 10;
+		ltGroup.setLayoutData(gridData);
+
+		this.addField(new IntegerFieldEditor(CAPreferences.F_MIN, Messages.LexicalTablePreferencePage_1, ltGroup));
+		this.addField(new IntegerFieldEditor(CAPreferences.V_MAX, Messages.LexicalTableEditor_8, ltGroup));
+		this.addField(new StringFieldEditor(CAPreferences.QUALITY_DISPLAY_FORMAT, CAUIMessages.CAPreferencePage_0, this.getFieldEditorParent()));
+		this.addField(new StringFieldEditor(CAPreferences.CONTRIB_DISPLAY_FORMAT, CAUIMessages.CAPreferencePage_1, this.getFieldEditorParent()));
+		this.addField(new StringFieldEditor(CAPreferences.MASS_DISPLAY_FORMAT, CAUIMessages.CAPreferencePage_5, this.getFieldEditorParent()));
+		this.addField(new StringFieldEditor(CAPreferences.DIST_DISPLAY_FORMAT, CAUIMessages.CAPreferencePage_6, this.getFieldEditorParent()));
+		this.addField(new StringFieldEditor(CAPreferences.COS2_DISPLAY_FORMAT, CAUIMessages.CAPreferencePage_7, this.getFieldEditorParent()));
+		this.addField(new StringFieldEditor(CAPreferences.COORD_DISPLAY_FORMAT, CAUIMessages.CAPreferencePage_8, this.getFieldEditorParent()));
+
+		// Charts rendering
+		Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent());
+
+		this.addField(new BooleanFieldEditor(CAPreferences.SHOW_INDIVIDUALS, CAUIMessages.CAPreferencePage_3, chartsTab));
+		this.addField(new BooleanFieldEditor(CAPreferences.SHOW_VARIABLES, CAUIMessages.CAPreferencePage_4, chartsTab));
+		
+		// other shared preferences
+		SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab);
+
+
+	}
+
+	
+//	@Override
+//	public void createFieldEditors() {
+//
+//		
+//		// FIXME: tabbed preferences page test
+//		
+//		TabFolder tabFolder = new TabFolder(this.getFieldEditorParent(), SWT.TOP);
+//		tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+//		
+//		TabItem tabItem = new TabItem(tabFolder, SWT.NULL);
+//		tabItem.setText("Table lexicale");
+//		Composite composite1 = new Composite(tabFolder, SWT.NULL);
+//		tabItem.setControl(composite1);
+//		fmin = new IntegerFieldEditor(FMIN, Messages.LexicalTablePreferencePage_1, composite1);
+//		addField(fmin);
+//		vmax = new IntegerFieldEditor(VMAX, Messages.LexicalTableEditor_8, composite1);
+//		addField(vmax);
+//
+//		
+//		TabItem tabItem2 = new TabItem(tabFolder, SWT.NULL);
+//		tabItem2.setText("Calcul");
+//		Composite composite2 = new Composite(tabFolder, SWT.NULL);
+//		tabItem2.setControl(composite2);
+//		qualityDisplay = new StringFieldEditor(QUALITYDISPLAY,
+//				Messages.CAPreferencePage_0, composite2);
+//		addField(qualityDisplay);
+//
+//		contribDisplay = new StringFieldEditor(CONTRIBDISPLAY,
+//				Messages.CAPreferencePage_1, composite2);
+//		addField(contribDisplay);
+//
+//		massDisplay = new StringFieldEditor(MASSDISPLAY,
+//				Messages.CAPreferencePage_5, composite2);
+//		addField(massDisplay);
+//
+//		distDisplay = new StringFieldEditor(DISTDISPLAY,
+//				Messages.CAPreferencePage_6, composite2);
+//		addField(distDisplay);
+//
+//		cos2Display = new StringFieldEditor(COS2DISPLAY,
+//				Messages.CAPreferencePage_7, composite2);
+//		addField(cos2Display);
+//
+//		coordDisplay = new StringFieldEditor(COORDDISPLAY,
+//				Messages.CAPreferencePage_8, composite2);
+//		addField(coordDisplay);
+//
+//
+//		// Charts rendering
+//		TabItem tabItem3 = new TabItem(tabFolder, SWT.NULL);
+//		tabItem3.setText("Graphiques");
+//		Composite composite3 = new Composite(tabFolder, SWT.NULL);
+//		tabItem3.setControl(composite3);
+//
+//		// FIXME : these 2 preferences should be renamed and moved to charts engine preference level (associated messages too)
+//		showIndividuals = new BooleanFieldEditor(SHOWINDIVIDUALS, Messages.CAPreferencePage_3, composite3);
+//		addField(showIndividuals);
+//
+//		showVariables = new BooleanFieldEditor(SHOWVARIABLES, Messages.CAPreferencePage_4, composite3);
+//		addField(showVariables);
+//
+//	}
+
+	
+
+	
+	
+	
+	
+	
+	/*
+	 * (non-Javadoc)
+	 *
+	 * @see
+	 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	@Override
+	public void init(IWorkbench workbench) {
+		this.setPreferenceStore(new TXMPreferenceStore(CAPreferences.PREFERENCES_NODE));
+		//this.setDescription(Messages.CorrespondanceAnalysisEditorInput_10);
+		this.setTitle(CAUIMessages.CorrespondanceAnalysisEditorInput_10);
+		this.setImageDescriptor(CAAdapterFactory.ICON);
+
+		// FIXME: useless?
+//		if (TxmPreferences.getInt(FMIN, -1) <= 0)
+//			TxmPreferences.set(FMIN, 10);
+//		if (TxmPreferences.getInt(VMAX, -1) <= 0)
+//			TxmPreferences.set(VMAX,200);
+
+	}
+
+	
+}

Property changes on: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/preferences/CAPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/build.properties
===================================================================
--- tmp/org.txm.ca.rcp/build.properties	(revision 0)
+++ tmp/org.txm.ca.rcp/build.properties	(revision 136)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

Property changes on: tmp/org.txm.ca.rcp/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle.properties	(revision 0)
+++ tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle.properties	(revision 136)
@@ -0,0 +1,5 @@
+Bundle-Name=CA
+command.name=CA
+command.tooltip=CA
+editor.name=CA
+page.name=CA
\ No newline at end of file

Property changes on: tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle_ru.properties
===================================================================
--- tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 0)
+++ tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 136)
@@ -0,0 +1,5 @@
+Bundle-Name=ФАС
+command.name=ФАС
+command.tooltip=ФАК
+editor.name=ФАК
+page.name=ФАК
\ No newline at end of file

Property changes on: tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle_ru.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 0)
+++ tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 136)
@@ -0,0 +1,5 @@
+Bundle-Name=AFC
+command.name=AFC
+command.tooltip=Calculer l'Analyse Factorielle des Correspondances
+editor.name=AFC
+page.name=AFC
\ No newline at end of file

Property changes on: tmp/org.txm.ca.rcp/OSGI-INF/l10n/bundle_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/icons/ca.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.ca.rcp/icons/ca.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.ca.rcp/plugin.xml
===================================================================
--- tmp/org.txm.ca.rcp/plugin.xml	(revision 0)
+++ tmp/org.txm.ca.rcp/plugin.xml	(revision 136)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.txm.chartsengine.eventcallback">
+      <EventCallBack
+            class="org.txm.ca.rcp.chartsengine.events.CAPointSelectionCallBack"
+            resultDataClass="org.txm.ca.core.functions.CA">
+      </EventCallBack>
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            allPopups="false"
+            locationURI="toolbar:org.txm.rcpapplication.toolbartools">
+         <command
+               commandId="ComputeCorrespondanceAnalysis"
+               icon="icons/ca.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneLexicalTableSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneICAComputableSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
+         <command
+               commandId="ComputeCorrespondanceAnalysis"
+               icon="icons/ca.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneLexicalTableSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneICAComputableSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:menu.tools">
+         <command
+               commandId="ComputeCorrespondanceAnalysis"
+               icon="icons/ca.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneLexicalTableSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneICAComputableSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            categoryId="org.txm.rcpapplication.category.txm"
+            defaultHandler="org.txm.ca.rcp.handlers.ComputeCorrespondanceAnalysis"
+            id="ComputeCorrespondanceAnalysis"
+            name="%command.name">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.editors">
+      <editor
+            class="org.txm.ca.rcp.editors.CAEditor"
+            default="false"
+            icon="icons/ca.png"
+            id="CAEditor"
+            name="%editor.name">
+      </editor>
+      <editor
+            class="org.txm.ca.rcp.editors.CAFactorialMapChartEditor"
+            default="false"
+            icon="icons/ca.png"
+            id="org.txm.ca.core.functions.CA"
+            name="CA Factorial Map editor">
+      </editor>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.adapters">
+      <factory
+            adaptableType="org.txm.ca.core.functions.CA"
+            class="org.txm.ca.rcp.adapters.CAAdapterFactory">
+         <adapter
+               type="org.eclipse.ui.model.IWorkbenchAdapter">
+         </adapter>
+      </factory>
+   </extension>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            category="org.txm.rcpapplication.preferences.UserPreferencePage"
+            class="org.txm.ca.rcp.preferences.CAPreferencePage"
+            id="org.txm.ca.rcp.preferences.CAPreferencePage"
+            name="%page.name">
+      </page>
+   </extension>
+
+</plugin>

Property changes on: tmp/org.txm.ca.rcp/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.ca.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.ca.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 136)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

Property changes on: tmp/org.txm.ca.rcp/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/.classpath
===================================================================
--- tmp/org.txm.ca.rcp/.classpath	(revision 0)
+++ tmp/org.txm.ca.rcp/.classpath	(revision 136)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tmp/org.txm.ca.rcp/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.ca.rcp/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.ca.rcp/META-INF/MANIFEST.MF	(revision 136)
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CA RCP
+Bundle-SymbolicName: org.txm.ca.rcp;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.txm.ca.core;bundle-version="1.0.0",
+ org.txm.chartsengine.rcp,
+ org.txm.core;bundle-version="0.7.0",
+ org.txm.rcp,
+ org.eclipse.ui;bundle-version="3.106.1",
+ org.eclipse.core.runtime;bundle-version="3.10.0"
+Export-Package: org.txm.ca.rcp.adapters,
+ org.txm.ca.rcp.chartsengine.events,
+ org.txm.ca.rcp.editors,
+ org.txm.ca.rcp.handlers,
+ org.txm.ca.rcp.messages,
+ org.txm.ca.rcp.preferences

Property changes on: tmp/org.txm.ca.rcp/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/plugin.xml
===================================================================
--- tmp/org.txm.ca.core/plugin.xml	(revision 0)
+++ tmp/org.txm.ca.core/plugin.xml	(revision 136)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.txm.ca.core.preferences.CAPreferences">
+      </initializer>
+   </extension>
+   <extension
+         point="org.txm.chartsengine.chartcreator">
+      <ChartCreator
+            class="org.txm.ca.core.chartsengine.jfreechart.JFCCAChartCreator"
+            fileNamePrefix="ca">
+      </ChartCreator>
+      <ChartCreator
+            chartType="Singular Values"
+            class="org.txm.ca.core.chartsengine.jfreechart.JFCSingularValueChartCreator"
+            fileNamePrefix="singular_values">
+      </ChartCreator>
+      <ChartCreator
+            class="org.txm.ca.core.chartsengine.r.RCAChartCreator"
+            fileNamePrefix="ca">
+      </ChartCreator>
+      <ChartCreator
+            chartType="SingularValues"
+            class="org.txm.ca.core.chartsengine.r.RSingularValuesChartCreator"
+            fileNamePrefix="singular_values">
+      </ChartCreator>
+   </extension>
+
+</plugin>

Property changes on: tmp/org.txm.ca.core/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.ca.core/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.ca.core/.settings/org.eclipse.jdt.core.prefs	(revision 136)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

Property changes on: tmp/org.txm.ca.core/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/.classpath
===================================================================
--- tmp/org.txm.ca.core/.classpath	(revision 0)
+++ tmp/org.txm.ca.core/.classpath	(revision 136)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tmp/org.txm.ca.core/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.ca.core/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.ca.core/META-INF/MANIFEST.MF	(revision 136)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CA Core
+Bundle-SymbolicName: org.txm.ca.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.txm.chartsengine.core;bundle-version="1.0.0",
+ org.txm.core;bundle-version="0.7.0",
+ org.eclipse.core.runtime;bundle-version="3.10.0",
+ org.txm.chartsengine.r.core;bundle-version="1.0.0",
+ org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0"
+Export-Package: org.txm.ca.core.chartsengine.base,
+ org.txm.ca.core.chartsengine.jfreechart,
+ org.txm.ca.core.chartsengine.jfreechart.datasets,
+ org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers,
+ org.txm.ca.core.chartsengine.r,
+ org.txm.ca.core.functions,
+ org.txm.ca.core.messages,
+ org.txm.ca.core.preferences,
+ org.txm.ca.core.statsengine.r.functions

Property changes on: tmp/org.txm.ca.core/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/.project
===================================================================
--- tmp/org.txm.ca.core/.project	(revision 0)
+++ tmp/org.txm.ca.core/.project	(revision 136)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.ca.core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Property changes on: tmp/org.txm.ca.core/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages.properties
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages.properties	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages.properties	(revision 136)
@@ -0,0 +1,17 @@
+ChartsEngine_CA_FACTORIAL_MAP_AXIS_LABEL_PREFIX=Axis
+ChartsEngine_CA_FACTORIAL_MAP_LEGEND_COLUMNS_LABEL=Columns
+ChartsEngine_CA_FACTORIAL_MAP_LEGEND_ROWS_LABEL=Rows
+ChartsEngine_CA_FACTORIAL_MAP_TITLE=Correspondence analysis factorial map\n of the {0} partition in the {1} corpus
+ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_COLS_LABEL=t
+ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_COORDINATES=Coordinates
+ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_ROWS_LABEL=Frequency
+ChartsEngine_CA_SINGULAR_VALUES_CANT_CREATE_CHART=Can't create bar chart of the CA singular values
+ChartsEngine_CA_SINGULAR_VALUES_TITLE=Eigenvalues
+ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_PERCENT=%
+ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_SUM=\u2211
+ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_Y_LABEL=Eigenvalue
+ChartsEngine_CA_SINGULAR_VALUES_X_AXIS_LABEL=Axis
+ChartsEngine_CA_SINGULAR_VALUES_X_LABELS_PREFIX=
+ChartsEngine_CA_SINGULAR_VALUES_Y_AXIS_LABEL=Eigenvalue
+ChartsEngine_CANT_CREATE_CA_FILE_CHART=Can''t create CA chart file (charts engine: {0})
+ChartsEngine_CANT_CREATE_CA_SINGULAR_VALUES_FILE_CHART=Can''t create CA singular values chart file (charts engine: {0})
\ No newline at end of file

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/messages/CACoreMessages.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/messages/CACoreMessages.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/messages/CACoreMessages.java	(revision 136)
@@ -0,0 +1,40 @@
+package org.txm.ca.core.messages;
+
+import org.eclipse.osgi.util.NLS;
+import org.txm.core.messages.TXMCoreMessages;
+
+public class CACoreMessages extends NLS {
+
+	private static final String BUNDLE_NAME = "org.txm.ca.core.messages.messages"; //$NON-NLS-1$
+
+	
+	public static String ChartsEngine_CANT_CREATE_CA_FILE_CHART;
+	public static String ChartsEngine_CANT_CREATE_CA_SINGULAR_VALUES_FILE_CHART;
+	
+	public static String ChartsEngine_CA_FACTORIAL_MAP_TITLE;
+	public static String ChartsEngine_CA_FACTORIAL_MAP_LEGEND_COLUMNS_LABEL;
+	public static String ChartsEngine_CA_FACTORIAL_MAP_LEGEND_ROWS_LABEL;
+	public static String ChartsEngine_CA_FACTORIAL_MAP_AXIS_LABEL_PREFIX;
+	public static String ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_ROWS_LABEL;
+	public static String ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_COLS_LABEL;
+	public static String ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_COORDINATES;
+
+	public static String ChartsEngine_CA_SINGULAR_VALUES_CANT_CREATE_CHART;
+	public static String ChartsEngine_CA_SINGULAR_VALUES_TITLE;
+	public static String ChartsEngine_CA_SINGULAR_VALUES_X_AXIS_LABEL;
+	public static String ChartsEngine_CA_SINGULAR_VALUES_X_LABELS_PREFIX;
+	public static String ChartsEngine_CA_SINGULAR_VALUES_Y_AXIS_LABEL;
+	public static String ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_Y_LABEL;
+	public static String ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_PERCENT;
+	public static String ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_SUM;
+
+
+	
+	static {
+		// initialize resource bundle
+		TXMCoreMessages.initializeMessages(BUNDLE_NAME, CACoreMessages.class);
+	}
+
+	private CACoreMessages() {
+	}
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/messages/CACoreMessages.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages_ru.properties
===================================================================

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages_ru.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages_fr.properties	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages_fr.properties	(revision 136)
@@ -0,0 +1,16 @@
+ChartsEngine_CA_FACTORIAL_MAP_AXIS_LABEL_PREFIX=Axe
+ChartsEngine_CA_FACTORIAL_MAP_LEGEND_COLUMNS_LABEL=Colonnes
+ChartsEngine_CA_FACTORIAL_MAP_LEGEND_ROWS_LABEL=Lignes
+ChartsEngine_CA_FACTORIAL_MAP_TITLE=Plan factoriel de l''analyse des correspondances\nsur la partition {0} du corpus {1}
+ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_COLS_LABEL=t
+ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_COORDINATES=Coordonn�es
+ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_ROWS_LABEL=Fr�quence
+ChartsEngine_CA_SINGULAR_VALUES_CANT_CREATE_CHART=Impossible de cr�er l'histogramme des valeurs propres de l'AFC
+ChartsEngine_CA_SINGULAR_VALUES_TITLE=Valeurs propres
+ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_PERCENT=%
+ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_Y_LABEL=Valeur propre
+ChartsEngine_CA_SINGULAR_VALUES_X_AXIS_LABEL=Axe
+ChartsEngine_CA_SINGULAR_VALUES_X_LABELS_PREFIX=
+ChartsEngine_CA_SINGULAR_VALUES_Y_AXIS_LABEL=Valeur propre
+ChartsEngine_CANT_CREATE_CA_FILE_CHART=Impossible de créer le fichier du graphique du plan factoriel de l'AFC (moteur de production de graphiques: {0})
+ChartsEngine_CANT_CREATE_CA_SINGULAR_VALUES_FILE_CHART=Impossible de créer le fichier du graphique des valeurs singulières de l''AFC (moteur de production de graphiques: {0})
\ No newline at end of file

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/messages/messages_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/functions/package.html
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/functions/package.html	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/functions/package.html	(revision 136)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Correspondance analysis.</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/functions/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java	(revision 136)
@@ -0,0 +1,1038 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-09-19 10:31:00 +0200 (Mon, 19 Sep 2016) $
+// $LastChangedRevision: 3298 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.ca.core.functions;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.txm.HasResults;
+import org.txm.Messages;
+import org.txm.ca.core.statsengine.r.functions.FactoMineRCA;
+import org.txm.ca.core.statsengine.r.functions.ICA;
+import org.txm.functions.Function;
+import org.txm.functions.TXMResult;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.stat.StatException;
+import org.txm.stat.data.LexicalTable;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Correspondance Analysis of a lexical table.
+ *
+ * @author sloiseau, mdecorde
+ */
+public class CA extends Function implements TXMResult, HasResults {
+
+	/** The use facto mine r. */
+	boolean useFactoMineR = true;
+
+	/** The ca. */
+	private ICA ca;
+
+	/** The partition. */
+	private Partition partition;
+	private Corpus corpus;
+
+	/** The analysis property. */
+	private Property analysisProperty;
+
+	/** The table. */
+	LexicalTable table;
+
+	/** The first dim. */
+	int firstDim = 1;
+
+	/** The second dim. */
+	int secondDim = 2;
+
+	/** The show individuals. */
+	@Deprecated
+	// FIXME : charts rendering preferences should be moved outside of the data class
+	boolean showIndividuals = true;
+
+	/** The show variables. */
+	@Deprecated
+	// FIXME : charts rendering preferences should be moved outside of the data class
+	boolean showVariables = false;
+
+	String colfilter="cos2 0.0", rowfilter="cos2 0.0";
+	float cex = 0.7f;
+
+	/** The fmin. */
+	private int fmin;
+
+	/** The vmax. */
+	private int vmax;
+
+	/** The coltabledata. */
+	private ArrayList<List<Object>> coltabledata;
+
+	/** The rowtabledata. */
+	private List<List<Object>> rowtabledata;
+
+	/** The rownames. */
+	String[] rownames = null;
+
+	/** The colnames. */
+	String[] colnames = null;
+
+	/** The rowtitles. */
+	String[] rowtitles; // of the rowinfo table
+
+	/** The coltitles. */
+	String[] coltitles; // of the colinfo table
+
+	/**
+	 * Instantiates a new cA.
+	 *
+	 * @param lexicaltable the lexicaltable
+	 * @throws StatException the stat exception
+	 */
+	public CA(LexicalTable lexicaltable) throws StatException {
+		this.partition = lexicaltable.getPartition();
+		this.corpus = lexicaltable.getCorpus();
+		this.analysisProperty = lexicaltable.getProperty();
+		this.table = lexicaltable;
+		this.fmin = table.getFmin();
+
+		if (useFactoMineR)
+			ca = new FactoMineRCA(table);
+		else
+			ca = new org.txm.ca.core.statsengine.r.functions.CA(table);
+	}
+
+	public void setPartition(Partition p) {
+		this.partition = p;
+	}
+	public void setCorpus(Corpus c) {
+		this.corpus = c;
+	}
+	public void setFMin(int fmin) {
+		this.fmin = fmin;
+	}
+	public void setAnalysisProperty(Property p) {
+		this.analysisProperty = p;
+	}
+
+	/**
+	 * Instantiates a new cA.
+	 *
+	 * @param partition the partition
+	 * @param analysisProperty the analysis property
+	 * @throws StatException the stat exception
+	 * @throws CqiClientException the cqi client exception
+	 */
+	public CA(Partition partition, Property analysisProperty)
+	throws StatException, CqiClientException {
+		this.partition = partition;
+		this.corpus = partition.getCorpus();
+		this.analysisProperty = analysisProperty;
+
+		table = partition.getLexicalTable(analysisProperty, 1);
+		partition.storeResult(table);
+		if (useFactoMineR)
+			ca = new FactoMineRCA(table);
+		else
+			ca = new org.txm.ca.core.statsengine.r.functions.CA(table);
+	}
+
+
+
+	/**
+	 * Instantiates a new cA.
+	 *
+	 * @param partition the partition
+	 * @param analysisProperty the analysis property
+	 * @param fmin the fmin
+	 * @param vmax the vmax
+	 * @throws StatException the stat exception
+	 * @throws CqiClientException the cqi client exception
+	 */
+	public CA(Partition partition, Property analysisProperty, int fmin, int vmax)
+	throws StatException, CqiClientException {
+		this.partition = partition;
+		this.corpus = partition.getCorpus();
+		this.analysisProperty = analysisProperty;
+		this.fmin = fmin;
+		this.vmax = vmax;
+
+		//cal steps here
+		/*table = partition.getLexicalTable(analysisProperty, fmin);
+		List<Integer> freqs = table.getFreqs();
+		table.filter(freqs, vmax, fmin);
+		partition.storeResult(table);
+		ca = new org.txm.stat.engine.r.function.CA(table);*/
+	}
+
+	/**
+	 * Export columns infos into a CSV FILE.
+	 *
+	 * @param file the CSV file
+	 * @param encoding the encoding
+	 * @param colseparator the column separator
+	 * @param textseparator the text separator
+	 */
+	public boolean exportColInfos(File file, String encoding, String colseparator, String textseparator)
+	{
+		try {
+			Writer writer = new OutputStreamWriter(new FileOutputStream(file), encoding);
+			String[] titles =  getColInfosTitles();
+			for (int i  = 0 ; i < titles.length ; i++) {
+				String title = titles[i];
+				if (i < titles.length -1)
+					writer.write(textseparator+ title + textseparator+ colseparator);
+				else
+					writer.write(textseparator+ title + textseparator+ colseparator);
+			}
+			writer.write("\n"); //$NON-NLS-1$
+			Object[] infos = getColInfos();
+			for(int i  = 0 ; i < infos.length ; i++) {
+				List<Object> list = (List<Object>) infos[i];
+				writer.write(textseparator + list.get(0) + textseparator + colseparator);
+				for(int j = 1 ; j < list.size() ; j++)
+					writer.write(list.get(j) + colseparator);
+				writer.write("\n"); //$NON-NLS-1$
+			}
+			writer.flush();
+			writer.close();
+		} catch (UnsupportedEncodingException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		} catch (FileNotFoundException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		} catch (IOException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Export row infos into a CSV file.
+	 *
+	 * @param file the CSV File
+	 * @param encoding the encoding
+	 * @param colseparator the column separator
+	 * @param textseparator the text separator
+	 */
+	public void exportRowInfos(File file, String encoding, String colseparator, String textseparator)
+	{
+		try {
+			Writer writer = new OutputStreamWriter(new FileOutputStream(file), encoding);
+			String[] titles =  getRowInfosTitles();
+			for (int i  = 0 ; i < titles.length ; i++) {
+				String title = titles[i];
+				if (i < titles.length -1)
+					writer.write(textseparator+ title + textseparator+ colseparator);
+				else
+					writer.write(textseparator+ title + textseparator+ colseparator);
+			}
+			writer.write("\n"); //$NON-NLS-1$
+			Object[] infos = getRowInfos();
+			for (int i  = 0 ; i < infos.length ; i++) {
+				List<Object> list = (List<Object>) infos[i];
+				writer.write(textseparator + list.get(0) + textseparator + colseparator);
+				for(int j = 1 ; j < list.size() ; j++)
+					writer.write(list.get(j) + colseparator);
+				writer.write("\n"); //$NON-NLS-1$
+			}
+			writer.flush();
+			writer.close();
+		} catch (UnsupportedEncodingException e) {
+			// TODO Auto-generated catch block
+			org.txm.utils.logger.Log.printStackTrace(e);
+		} catch (FileNotFoundException e) {
+			// TODO Auto-generated catch block
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+		catch (IOException e) {
+			// TODO Auto-generated catch block
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+	}
+
+	public String getColFilter() {
+		return colfilter;
+	}
+
+	public String getRowFilter() {
+		return rowfilter;
+	}
+
+	public float getCex() {
+		return cex;
+	}
+
+	/**
+	 * Gets the analysis property.
+	 *
+	 * @return the analysis property
+	 */
+	public Property getAnalysisProperty() {
+		return analysisProperty;
+	}
+
+	/**
+	 * Gets the CA R object.
+	 *
+	 * @return the ca
+	 */
+	public org.txm.ca.core.statsengine.r.functions.ICA getCa() {
+		return ca;
+	}
+
+	/**
+	 * Get the columns contributions as array.
+	 *
+	 * @return the col contrib
+	 */
+	public double[] getColContrib()
+	{
+		return null;
+	}
+
+	/**
+	 * Get the columns cos2 as array.
+	 *
+	 * @return the col cos2
+	 */
+	public double[] getColCos2()
+	{
+		return null;
+	}
+
+	/**
+	 * Get the col all infos as Array of arrays.
+	 *
+	 * @return the col infos
+	 */
+	public Object[] getColInfos() {
+
+		if (coltabledata != null)
+			return coltabledata.toArray();
+
+
+		double[] sv = null;
+		double[] mass = null;
+		double[][] colcoords = null;
+		double[][] colcontribs = null;
+		double[][] colcos2s = null;
+		double[] coldist = null;
+
+		try {
+			sv = getValeursPropres();
+			mass = ca.getColsMass();
+			colcoords = ca.getColsCoords();
+			colcontribs = ca.getColContrib();
+			colcos2s = ca.getColCos2();
+			coldist = ca.getColDist();
+			//add dist
+			getColNames();
+		} catch (StatException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return null;
+		}
+
+		coltabledata = new ArrayList<List<Object>>(colnames.length);
+
+		double[] cos2 = new double[3];
+		for (int i = 0; i < colnames.length; i++) {
+			List<Object> entry = new ArrayList<Object>(4);
+
+			cos2[0] = colcos2s[i][0];
+			cos2[1] = colcos2s[i][1];
+			cos2[2] = colcos2s[i][2];
+
+			entry.add(colnames[i]); // Factor
+			entry.add(""); //separator //$NON-NLS-1$
+			entry.add(new Double(cos2[0] + cos2[1])); // Q12
+			entry.add(new Double(cos2[0] + cos2[2])); // Q23
+			entry.add(new Double(cos2[2] + cos2[1])); // Q13
+			entry.add(new Double(mass[i] * 100.0)); // mass
+
+			entry.add(coldist[i]); // dist
+
+			for (int c = 0; c < 3; c++) // 3 first axis
+			{
+				entry.add(""); //separator //$NON-NLS-1$
+				entry.add(colcontribs[i][c]); // contrib
+				entry.add(cos2[c]); // cos²
+			}
+			entry.add(""); //separator //$NON-NLS-1$
+			for (int c = 0; c < 3; c++) // 3 first axis
+			{
+				entry.add(colcoords[i][c]); // coords
+			}
+			entry.add("");//separator //$NON-NLS-1$
+			coltabledata.add(entry);
+		}
+
+		return coltabledata.toArray();
+	}
+
+	/**
+	 * Get the column infos titles array.
+	 *
+	 * @return the col infos titles
+	 */
+	public String[] getColInfosTitles()
+	{
+		if (coltitles == null) {
+			List<String> colnames = new ArrayList<String>();
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_22); // entry
+			colnames.add(" "); //$NON-NLS-1$
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_23); // Q12
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_24); // Q13
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_25); // Q23
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_26); // Mass
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_27); // Dist
+			for (int c = 0; c < 3; c++)// seulement les 3 premiers axes
+			{
+				colnames.add(" "); // separator //$NON-NLS-1$
+				colnames.add(Messages.CorrespondanceAnalysisEditorInput_29+ (c + 1)); // ContribN
+				colnames.add(Messages.CorrespondanceAnalysisEditorInput_30+ (c + 1)); // Cos²N
+			}
+			colnames.add(" "); // separator //$NON-NLS-1$
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_32); // coord axis 1
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_33); // coord axis 2
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_34); // coord axis 3
+			colnames.add(""); //$NON-NLS-1$
+
+			coltitles = colnames.toArray(new String[] {});
+		}
+		return coltitles;
+	}
+
+	/**
+	 * Get the column names as array.
+	 *
+	 * @return the col names
+	 * @throws StatException the stat exception
+	 */
+	public String[] getColNames() throws StatException
+	{
+		if (colnames == null)
+			colnames = getLexicalTable().getColNames().asStringsArray();
+		return colnames;
+	}
+
+	/**
+	 * Get the columns coordinates as array.
+	 *
+	 * @return the cols coords
+	 */
+	public double[][] getColsCoords() {
+		return this.ca.getColsCoords();
+	}
+
+	/**
+	 * Get the columns distances as array.
+	 *
+	 * @return the cols dist
+	 * @throws StatException the stat exception
+	 */
+	public double[] getColsDist() throws StatException {
+		return this.ca.getColDist();
+	}
+
+	/**
+	 * Get the columns inertia as array.
+	 *
+	 * @return the cols inertia
+	 * @throws StatException the stat exception
+	 */
+	public double[] getColsInertia() throws StatException {
+		return this.ca.getColsInertia();
+	}
+
+	/**
+	 * Gets the cols mass.
+	 *
+	 * @return the cols mass
+	 * @throws StatException the stat exception
+	 */
+	public double[] getColsMass() throws StatException {
+		return this.ca.getColsMass();
+	}
+
+	/**
+	 * Get the lexical table used to compute the CA.
+	 *
+	 * @return the lexical table
+	 */
+	public LexicalTable getLexicalTable() {
+		return table;
+	}
+
+
+	/**
+	 * Get the CA name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return analysisProperty.getName();
+	}
+
+	/**
+	 * Get the partition used to compute the CA, may be null.
+	 *
+	 * @return the partition
+	 */
+	public Partition getPartition() {
+		return partition;
+	}
+
+	/**
+	 *  Get the corpus
+	 *
+	 * @return
+	 */
+	public Corpus getCorpus() {
+		return corpus;
+	}
+
+	/**
+	 * Get the row contributions as array.
+	 *
+	 * @return the row contrib
+	 * @throws StatException 
+	 */
+	public double[][] getRowContrib() throws StatException
+	{
+		return ca.getRowContrib();
+	}
+
+	/**
+	 * Get the row cos2 as array.
+	 *
+	 * @return the row cos2
+	 * @throws StatException 
+	 */
+	public double[][] getRowCos2() throws StatException
+	{
+		return ca.getRowCos2();
+	}
+
+	/**
+	 * Get the row informations as array of arrays.
+	 *
+	 * @return the row infos
+	 */
+	public Object[] getRowInfos() {
+
+		if (rowtabledata != null)
+			return rowtabledata.toArray();
+
+		double[] mass = null;
+		double[] dist = null;
+		double[][] rowcoords = null;
+		double[][] rowcontribs = null;
+		double[][] rowcos2s = null;
+
+		try {
+			mass = ca.getRowsMass();
+			rowcoords = ca.getRowsCoords();
+			rowcontribs = ca.getRowContrib();
+			rowcos2s = ca.getRowCos2();
+			dist = ca.getRowDist();
+			getRowNames();
+		} catch (StatException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return null;
+		}
+
+		rowtabledata = new ArrayList<List<Object>>(rownames.length);
+
+		double[] cos2 = new double[3];
+		for (int i = 0; i < rownames.length; i++) {
+			double distt = dist[i];
+
+			cos2[0] = rowcos2s[i][0];
+			cos2[1] = rowcos2s[i][1];
+			cos2[2] = rowcos2s[i][2];
+
+			List<Object> entry = new ArrayList<Object>(4);
+			entry.add(rownames[i]); // Factor
+			entry.add(""); // separator //$NON-NLS-1$
+			entry.add(new Double(cos2[0] + cos2[1])); // Q12
+			entry.add(new Double(cos2[0] + cos2[2])); // Q23
+			entry.add(new Double(cos2[2] + cos2[1])); // Q13
+
+			entry.add(new Double(mass[i]) * 100.0); // mass
+
+			entry.add(distt); // dist
+			for (int c = 0; c < 3; c++) // 3 first axis
+			{
+				entry.add(""); // separator //$NON-NLS-1$
+				entry.add(rowcontribs[i][c] * 100.0); // contrib
+				entry.add(cos2[c]); // cos²
+			}
+			entry.add(""); //separator //$NON-NLS-1$
+			for (int c = 0; c < 3; c++) // 3 first axis
+			{
+				entry.add(rowcoords[i][c]); // coords
+			}
+			entry.add("");// separator //$NON-NLS-1$
+			rowtabledata.add(entry);
+		}
+
+		return rowtabledata.toArray();
+	}
+
+	/**
+	 * Get the row infos titles as array.
+	 *
+	 * @return the row infos titles
+	 */
+	public String[] getRowInfosTitles() {
+		if (rowtitles == null) {
+			List<String> colnames = new ArrayList<String>();
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_21); // entry
+			colnames.add(" "); //$NON-NLS-1$
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_23); // Q12
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_24); // Q13
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_25); // Q23
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_26); // Mass
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_27); // Dist
+			for (int c = 0; c < 3; c++)// seulement les 3 premiers axes
+			{
+				colnames.add(" "); // separator //$NON-NLS-1$
+				colnames.add(Messages.CorrespondanceAnalysisEditorInput_29+ (c + 1)); // ContribN
+				colnames.add(Messages.CorrespondanceAnalysisEditorInput_30+ (c + 1)); // Cos²N
+			}
+			colnames.add(" "); // separator //$NON-NLS-1$
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_32); // coord axis 1
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_33); // coord axis 2
+			colnames.add(Messages.CorrespondanceAnalysisEditorInput_34); // coord axis 3
+			colnames.add(""); //$NON-NLS-1$
+
+			rowtitles = colnames.toArray(new String[] {});
+		}
+		return rowtitles;
+	}
+
+	/**
+	 * Get the row names as array.
+	 *
+	 * @return the row names
+	 * @throws StatException the stat exception
+	 */
+	public String[] getRowNames() throws StatException {
+		if (rownames == null)
+			rownames = getLexicalTable().getRowNames().asStringsArray();
+		return rownames;
+	}
+
+	/**
+	 * Get the rows coordinates as array of arrays
+	 *
+	 * @return the rows coords
+	 */
+	public double[][] getRowsCoords() {
+		return this.ca.getRowsCoords();
+	}
+
+	/**
+	 * Get the rows distances as array.
+	 *
+	 * @return the rows dist
+	 * @throws StatException the stat exception
+	 */
+	public double[] getRowsDist() throws StatException {
+		return this.ca.getRowDist();
+	}
+
+	/**
+	 * Get the rows inertia as array.
+	 *
+	 * @return the rows inertia
+	 * @throws StatException the stat exception
+	 */
+	public double[] getRowsInertia() throws StatException {
+		return this.ca.getRowsInertia();
+	}
+
+	/**
+	 * Get the rows mass as array.
+	 *
+	 * @return the rows mass
+	 * @throws StatException the stat exception
+	 */
+	public double[] getRowsMass() throws StatException {
+		return this.ca.getRowsMass();
+	}
+
+	/**
+	 * Get the singular values as array.
+	 *
+	 * @return the singular values
+	 * @throws StatException the stat exception
+	 */
+	public double[] getSingularValues() throws StatException {
+		return ca.getSingularValues();
+	}
+
+	/**
+	 * Get the singular values infos as List of Lists
+	 *
+	 * @return the singular values infos
+	 */
+	public List<List<Object>> getSingularValuesInfos()
+	{
+		List<List<Object>> svtabledata = new ArrayList<List<Object>>();
+
+		double[] sv = null;
+		try {
+			sv = getValeursPropres();
+		} catch (StatException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return svtabledata;
+		}
+
+		double sigmaVp;
+		try {
+			sigmaVp = getValeursPropresSum();
+		} catch (StatException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return svtabledata;
+		}
+
+		double cumul = 0;
+		double percent = 0;
+
+		for (int i = 0; i < sv.length; i++) {
+			percent = 100 * sv[i] / sigmaVp;
+			cumul += percent;
+
+			List<Object> entry = new ArrayList<Object>(4);
+			entry.add(new Integer(i + 1));	// Factor
+			entry.add(new Double(sv[i]));	// Singular value
+			entry.add(percent);				// Percent
+			entry.add(cumul);				// Cumul
+			entry.add(percent);				// For bar plot direct drawing in the table
+
+			entry.add(""); // add an empty column to fix a display bug in table in Linux
+
+			svtabledata.add(entry);
+		}
+
+		return svtabledata;
+	}
+
+	/**
+	 * Gets the symbol.
+	 *
+	 * @return the R symbol of the CA result
+	 */
+	public String getSymbol() {
+		return ca.getSymbol();
+	}
+
+	/**
+	 * Gets the sqrt of singular values as array.
+	 *
+	 * @return the valeurs propres
+	 * @throws StatException the stat exception
+	 */
+	public double[] getValeursPropres() throws StatException {
+
+		return ca.getValeursPropres();
+	}
+
+	/**
+	 * Gets the 'valeurs propres' sum.
+	 *
+	 * @return the valeurs propres sum
+	 * @throws StatException the stat exception
+	 */
+	public double getValeursPropresSum() throws StatException
+	{
+		double sum = 0;
+		for(double d : getValeursPropres())
+			sum += d;
+		return sum;
+	}
+
+	/**
+	 * Checks if CA is showing individuals.
+	 *
+	 * @return true, if is show individuals
+	 */
+	// FIXME : charts rendering preferences should be moved outside of the data class
+	@Deprecated
+	public boolean isShowIndividuals() {
+		return showIndividuals;
+	}
+
+	/**
+	 * Checks if CA is showing variables.
+	 *
+	 * @return true, if is show variables
+	 */
+	// FIXME : charts rendering preferences should be moved outside of the data class
+	@Deprecated
+	public boolean isShowVariables() {
+		return showVariables;
+	}
+
+	/**
+	 * Use this function to start CA process from a Partition.
+	 *
+	 * @throws StatException the stat exception
+	 * @throws CqiClientException the cqi client exception
+	 */
+	public void process() throws StatException, CqiClientException
+	{
+		stepLexicalTable();
+		stepSortTableLexical();
+		stepCompute();
+	}
+
+	/**
+	 * Use this function to start CA process from a LexicalTable.
+	 *
+	 * @throws StatException the stat exception
+	 * @throws CqiClientException the cqi client exception
+	 */
+	public void processFromTable() throws StatException, CqiClientException
+	{
+		stepCompute();
+	}
+
+	/**
+	 * Sets the axis to see.
+	 *
+	 * @param first the first
+	 * @param second the second
+	 */
+	// FIXME : charts rendering preferences should be moved outside of the data class
+	@Deprecated
+	public void setDimensions(int first, int second) {
+		if (first >= 1 && second >= 1 && first != second) {
+			// System.out.println("set dims "+first+" ; "+second);
+			this.firstDim = first;
+			this.secondDim = second;
+		}
+	}
+
+	/**
+	 * Sets the shown elements.
+	 *
+	 * @param individuals the individuals
+	 * @param variables the variables
+	 */
+	// FIXME : charts rendering preferences should be moved outside of the data class
+	@Deprecated
+	public void setShown(boolean individuals, boolean variables) {
+		showIndividuals = individuals;
+		showVariables = variables;
+		if (!(showIndividuals || showVariables))
+			showIndividuals = true;
+
+	}
+
+	String pattern = "(cos2|contrib) (([0-9]+\\.[0-9]+)|([0-9]+))";
+
+	public void displayOptions(String col, String row, float cex) {
+		this.cex = Math.abs(cex);
+		if (col.matches(pattern))
+			this.colfilter = col;
+		else
+			System.out.println("Col filter malformed follow this pattern "+pattern);
+		if (row.matches(pattern))
+			this.rowfilter = row;
+		else
+			System.out.println("Row filter malformed follow this pattern "+pattern);
+	}
+
+	/**
+	 * final step.
+	 *
+	 * @throws StatException the stat exception
+	 */
+	public void stepCompute() throws StatException
+	{
+		if (useFactoMineR)
+			ca = new FactoMineRCA(table);
+		else
+			ca = new org.txm.ca.core.statsengine.r.functions.CA(table);
+		getColNames(); // in case the lexical table changes
+		getRowNames(); // in case the lexical table changes
+	}
+
+	/**
+	 * step 1.
+	 *
+	 * @throws StatException the stat exception
+	 * @throws CqiClientException the cqi client exception
+	 */
+	public void stepLexicalTable() throws StatException, CqiClientException
+	{
+		table = partition.getLexicalTable(analysisProperty, fmin);
+		partition.storeResult(table);
+	}
+
+	/**
+	 * step 2.
+	 */
+	public void stepSortTableLexical()
+	{
+		try {
+			table.filter(vmax, fmin);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+	}
+
+	/**
+	 * Exports CA R data to a file
+	 *
+	 * @param outfile the outfile
+	 * @param encoding the encoding
+	 * @return true, if successful
+	 */
+	public boolean toTxt(File outfile, String encoding) {
+		return toTxt(outfile, encoding, "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/**
+	 * Exports CA R data to a file
+	 *
+	 * @param outfile the outfile
+	 * @param encoding the encoding
+	 * @param colseparator the colseparator
+	 * @param txtseparator the txtseparator
+	 * @return true, if successful
+	 */
+	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
+		acquireSemaphore();
+		boolean rez = ca.toTxt(outfile, encoding, colseparator, txtseparator);
+		releaseSemaphore();
+
+		return rez;
+	}
+
+	@Override
+	public void clean() {
+
+	}
+
+	/**
+	 * Checks if the CA uses the FactoMineR R package.
+	 * @return <code>true</code> if the CA uses the FactoMineR R package otherwise <code>false</code>
+	 */
+	public boolean useFactoMineR() {
+		return useFactoMineR;
+	}
+
+	/**
+	 * Gets the first dimension.
+	 * @return the first dimension
+	 */
+	public int getFirstDimension() {
+		return firstDim;
+	}
+
+	/**
+	 * Gets the second dimension.
+	 * @return the second dimension
+	 */
+	public int getSecondDimension() {
+		return secondDim;
+	}
+
+	/**
+	 * Gets the number of rows.
+	 * @return the number of rows
+	 */
+	public int getRowsCount()	{
+		return this.ca.getRowsCount();
+	}
+
+
+	/**
+	 * Gets the number of columns.
+	 * @return the number of columns
+	 */
+	public int getColumnsCount()	{
+		return this.ca.getColumnsCount();
+	}
+
+
+	@Override
+	public boolean delete() {
+		return getParent().removeResult(this);
+	}
+
+	@Override
+	public String[] getExportTXTExtensions() {
+		return new String[]{"*.txt"};
+	}
+
+	@Override
+	public HasResults getParent() {
+		return table;
+//		if (partition != null)
+//			return partition;
+//		return corpus;
+	}
+
+	ArrayList<Object> results = new ArrayList<Object>();
+	@Override
+	public List<Object> getResults() {
+		return results;
+	}
+
+	@Override
+	public boolean removeResult(Object result) {
+		return results.remove(result);
+	}
+
+	@Override
+	public List<HasResults> getSubHasResults() {
+		return new ArrayList<HasResults>();
+	}
+
+	@Override
+	public void storeResult(Object result) {
+		results.add(result);
+	}
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/functions/ICAComputable.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/functions/ICAComputable.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/functions/ICAComputable.java	(revision 136)
@@ -0,0 +1,11 @@
+package org.txm.ca.core.functions;
+
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.stat.StatException;
+
+public interface ICAComputable {
+	public CA toCA() throws StatException;
+	public Corpus getCorpus();
+	public Partition getPartition();
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/functions/ICAComputable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/base/CAChartCreator.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/base/CAChartCreator.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/base/CAChartCreator.java	(revision 136)
@@ -0,0 +1,52 @@
+/**
+ * 
+ */
+package org.txm.ca.core.chartsengine.base;
+
+import java.util.ArrayList;
+
+import org.txm.ca.core.functions.CA;
+
+/**
+ * Progression chart creator interface.
+ * @author sjacquot
+ *
+ */
+public interface CAChartCreator {
+
+
+	/**
+	 * Gets the currently selected item in the specified series in the chart.
+	 * @param chart
+	 * @param series
+	 * @return
+	 */
+	public ArrayList<String> getCAFactorialMapChartSelectedPoints(Object chart, int series);
+
+
+	/**
+	 * Highlights points in the CA factorial map chart according to the specified labels.
+	 * @param chart
+	 * @param rows
+	 * @param labels
+	 */
+	public abstract void updateChartCAFactorialMapHighlightPoints(Object chart, boolean rows, String[] labels);
+
+	/**
+	 * Sets the items selection order on label.
+	 * @param chart
+	 * @param itemsSelectionOrder
+	 */
+	public abstract void updateChartCAFactorialMapSetLabelItemsSelectionOrder(Object chart, String[] rowLabels, String[] colLabels);
+	
+	
+	/**
+	 * Sets the CA factorial map dimensions.
+	 * @param editorPart
+	 * @param dimension1
+	 * @param dimension2
+	 */
+	public abstract void updateChartCAFactorialMapSetDimensions(Object chart, CA ca, int dimension1, int dimension2);
+	
+
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/base/CAChartCreator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/base/Utils.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/base/Utils.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/base/Utils.java	(revision 136)
@@ -0,0 +1,55 @@
+package org.txm.ca.core.chartsengine.base;
+
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.messages.CACoreMessages;
+import org.txm.chartsengine.core.ChartsEngine;
+import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages;
+
+/**
+ * CA chart utility class.
+ * @author sjacquot
+ *
+ */
+public abstract class Utils {
+
+	public Utils() {
+		// TODO Auto-generated constructor stub
+	}
+
+
+	/**
+	 * Creates a string title, shared by charts engine implementations, for the CA factorial map chart from the specified result.
+	 * @param ca
+	 * @return
+	 */
+	public static String createCAFactorialMapChartTitle(CA ca)	{
+
+		String partitionName;
+		if (ca.getPartition() == null) {
+			partitionName = "<no partition>";
+		}
+		else	{
+			partitionName = ca.getPartition().getName();
+		}
+
+		String corpusName;
+		if (ca.getCorpus() == null) {
+			corpusName = "<no corpus>";
+		}
+		else	{
+			corpusName = ca.getCorpus().getName();
+		}
+
+		return ChartsEngineCoreMessages.bind(CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_TITLE, partitionName, corpusName);
+	}
+
+	/**
+	 * Gets a chart creator from the specified charts engine.
+	 * @param chartsEngine
+	 * @return
+	 */
+	public static CAChartCreator getChartCreator(ChartsEngine chartsEngine)	{
+		return (CAChartCreator) chartsEngine.getChartCreator(CA.class);
+	}
+	
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/base/Utils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/CASingularValuesItemSelectionRenderer.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/CASingularValuesItemSelectionRenderer.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/CASingularValuesItemSelectionRenderer.java	(revision 136)
@@ -0,0 +1,80 @@
+package org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers;
+
+import java.awt.Color;
+import java.text.DecimalFormat;
+import java.util.List;
+
+import org.jfree.chart.labels.CategoryToolTipGenerator;
+import org.jfree.data.category.CategoryDataset;
+import org.jfree.data.category.DefaultCategoryDataset;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.messages.CACoreMessages;
+import org.txm.chartsengine.core.ChartsEngine;
+import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages;
+import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IItemSelectionRenderer;
+import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.renderers.ItemSelectionCategoryBarRenderer;
+import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.swing.CustomHTMLToolTip;
+
+
+/**
+ * Renderer providing item selection system and drawing features for selected item and custom rendering for CA singular values bar charts.
+ * @author sjacquot
+ *
+ */
+public class CASingularValuesItemSelectionRenderer extends ItemSelectionCategoryBarRenderer {
+
+
+
+
+	/**
+	 * Percent values number format.
+	 */
+	protected DecimalFormat percentValuesNumberFormat;
+
+
+	/**
+	 * Creates a renderer dedicated to CA charts.
+	 */
+	public CASingularValuesItemSelectionRenderer() {
+		super();
+		this.setChartType(ChartsEngine.CHART_TYPE_CA_SINGULAR_VALUES);
+
+		this.percentValuesNumberFormat = new DecimalFormat("#.00");
+	}
+
+
+
+	@Override
+	public void initToolTipGenerator(final IItemSelectionRenderer renderer)	{
+		this.setBaseToolTipGenerator(new CategoryToolTipGenerator() {
+
+			@Override
+			public String generateToolTip(CategoryDataset dataset, int row, int column) {
+
+				// Hexadecimal color
+				Color color = (Color) getSeriesPaint(row);
+				String hex = "#" + Integer.toHexString(color.getRGB()).substring(2);
+
+				DefaultCategoryDataset catDataset = (DefaultCategoryDataset) dataset;
+				Number value = catDataset.getValue(row, column);
+
+
+				CA ca = (CA) getItemsSelector().getResultData();
+				List<List<Object>> singularValuesData = ca.getSingularValuesInfos();
+
+				return CustomHTMLToolTip.getDefaultHTMLBody(renderer, hex) + "<p>#" + catDataset.getColumnKey(column) + "</p>"
+						+ "<p><span style=\"color: " + hex + ";\">" + catDataset.getRowKey(row) + ChartsEngineCoreMessages.ChartsEngine_LABEL_VALUE_SEPARATORS
+							+ " </span><b>" + valuesNumberFormat.format(value) + "</b></p>"
+						+ "<p><span style=\"color: " + hex + ";\">" + CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_PERCENT + ChartsEngineCoreMessages.ChartsEngine_LABEL_VALUE_SEPARATORS
+							+ " </span><b>" + percentValuesNumberFormat.format(singularValuesData.get(column).get(2)) + "</b></p>"
+						+ "<p><span style=\"color: " + hex + ";\">" + CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_SUM + CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_PERCENT
+							+ ChartsEngineCoreMessages.ChartsEngine_LABEL_VALUE_SEPARATORS
+							+ " </span><b>" + percentValuesNumberFormat.format(singularValuesData.get(column).get(3)) + "</b></p>"
+						+ "</body><html>";
+			}
+		});
+	}
+
+
+
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/CASingularValuesItemSelectionRenderer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/FCAItemSelectionRenderer.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/FCAItemSelectionRenderer.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/FCAItemSelectionRenderer.java	(revision 136)
@@ -0,0 +1,185 @@
+package org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Paint;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Area;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+
+import org.jfree.chart.ChartPanel;
+import org.jfree.chart.labels.XYItemLabelGenerator;
+import org.jfree.chart.labels.XYToolTipGenerator;
+import org.jfree.data.xy.XYDataset;
+import org.txm.ca.core.chartsengine.jfreechart.datasets.FCAXYDataset;
+import org.txm.ca.core.messages.CACoreMessages;
+import org.txm.chartsengine.core.ChartsEngine;
+import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages;
+import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IItemSelectionRenderer;
+import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.renderers.ItemSelectionXYLineAndShapeRenderer;
+import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.swing.CustomHTMLToolTip;
+
+/**
+ * Renderer providing item selection system and drawing features for selected item and custom rendering for CA charts.
+ * @author sjacquot
+ *
+ */
+public class FCAItemSelectionRenderer extends ItemSelectionXYLineAndShapeRenderer {
+
+
+	/**
+	 * Stack to store selected items to draw at last, over other items.
+	 */
+	protected ArrayList itemsToDrawAtLast; 
+	
+
+	/**
+	 * Creates a renderer dedicated to CA charts.
+	 */
+	public FCAItemSelectionRenderer() {
+		super();
+		this.setChartType(ChartsEngine.CHART_TYPE_CA_FACTORIAL_MAP);
+	}
+
+
+
+	@Override
+	public void initToolTipGenerator(final IItemSelectionRenderer renderer)	{
+		// Rows
+		this.setSeriesToolTipGenerator(0, new XYToolTipGenerator() {
+
+			@Override
+			public String generateToolTip(XYDataset dataset, int series, int item) {
+
+				// Coordinates format
+				String pattern = new String("#.##");
+				DecimalFormat format = new DecimalFormat(pattern);
+
+				// Hexadecimal color
+				Color color = (Color) getSeriesPaint(series);
+				String hex = "#" + Integer.toHexString(color.getRGB()).substring(2);
+
+				FCAXYDataset caDataset = (FCAXYDataset) dataset;
+				return CustomHTMLToolTip.getDefaultHTMLBody(renderer, hex) + "<p style=\"color: " + hex + "\"><b>" + caDataset.getLabel(series, item) + "</b></p><p>"
+						+ CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_ROWS_LABEL + ChartsEngineCoreMessages.ChartsEngine_LABEL_VALUE_SEPARATORS + " <b>" + caDataset.getFrequency(series, item).replace("-", "") + "</b></p>"
+				+ "<p>" +  CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_COORDINATES + ChartsEngineCoreMessages.ChartsEngine_LABEL_VALUE_SEPARATORS + " <b>[" + format.format(caDataset.getX(series, item)) + ":" + format.format(caDataset.getY(series, item)) + "]</b></p></body><html>";
+			}
+		});
+
+		// Columns
+		this.setSeriesToolTipGenerator(1, new XYToolTipGenerator() {
+
+			@Override
+			public String generateToolTip(XYDataset dataset, int series, int item) {
+
+				// Coordinates format
+				String pattern = new String("#.##");
+				DecimalFormat format = new DecimalFormat(pattern);
+
+				// Hexadecimal color
+				Color color = (Color) getSeriesPaint(series);
+				String hex = "#" + Integer.toHexString(color.getRGB()).substring(2);
+
+				FCAXYDataset caDataset = (FCAXYDataset) dataset;
+				// FIXME: to disable tool tip we can return null here or in other renderers generateToolTip methods
+//				return null;
+				return CustomHTMLToolTip.getDefaultHTMLBody(renderer, hex) + "<p style=\"color: " + hex + "\"><b>" + caDataset.getLabel(series, item) + "</b></p><p>"
+					+ CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_COLS_LABEL + ChartsEngineCoreMessages.ChartsEngine_LABEL_VALUE_SEPARATORS + " <b>" + caDataset.getFrequency(series, item).replace("-", "") + "</b></p>"
+				+ "<p>" + CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_TOOLTIP_COORDINATES + ChartsEngineCoreMessages.ChartsEngine_LABEL_VALUE_SEPARATORS + " <b>[" + format.format(caDataset.getX(series, item)) + ":" + format.format(caDataset.getY(series, item)) + "]</b></p></body><html>";
+			}
+		});
+
+	}
+
+
+	@Override
+	public void initItemLabelGenerator()	{
+		XYItemLabelGenerator generator = new XYItemLabelGenerator() {
+
+			@Override
+			public String generateLabel(XYDataset dataset, int series, int item) {
+				FCAXYDataset caDataset = (FCAXYDataset) dataset;
+				return caDataset.getLabel(series, item);
+			}
+		};
+
+		this.setBaseItemLabelGenerator(generator);
+		this.setBaseItemLabelsVisible(true);
+	}
+
+
+
+	@Override
+	public Shape getItemShape(int series, int item) {
+
+		// Scale selected item shape
+		Shape s = super.getItemShape(series, item);
+
+		// Highlight selected item
+		if(this.multipleItemsSelector.isMouseOverItem(series, item) || this.multipleItemsSelector.isSelectedItem(series, item)) {
+
+			// Add a background rectangle to the label selected item
+			String label = ((FCAXYDataset) this.getPlot().getDataset()).getLabel(series, item);
+
+			Font font = this.getItemLabelFont(series, item);
+			Rectangle2D bounds = font.getStringBounds(label, ((Graphics2D) this.multipleItemsSelector.getChartPanel().getGraphics()).getFontRenderContext());
+
+			// FIXME : not rounded rectangle version
+//			Shape labelBackground = new Rectangle2D.Double(-bounds.getWidth() / 2, -s.getBounds2D().getHeight() / 2 + 1, bounds.getWidth() + 4, bounds.getHeight() / 2 + 8);
+
+			Shape labelBackground = new RoundRectangle2D.Double(-(bounds.getWidth() + 4) / 2, -s.getBounds2D().getHeight() / 2 + 1, bounds.getWidth() + 8, bounds.getHeight() / 2 + 10, 5, 5);
+
+			AffineTransform t = new AffineTransform();
+			t.setToTranslation(0,  bounds.getCenterY() - 2 - bounds.getHeight() / 2);
+			labelBackground = t.createTransformedShape(labelBackground);
+			
+			Area a = new Area(s);
+			a.add(new Area(labelBackground));
+
+			// FIXME : test de tooltip text à la main
+//			Shape tooltip = new Rectangle2D.Double(10, 10, 50, 50);
+//			GlyphVector text =  this.getBaseItemLabelFont().createGlyphVector(((Graphics2D) this.chartPanel.getGraphics()).getFontRenderContext(), "testteezrezrzerzerzerzerze");
+////			t.setToTranslation(-100,  -200);
+//			Shape textShape = t.createTransformedShape(text.getOutline());
+//			a.add(new Area(tooltip));
+//			a.add(new Area(textShape));
+
+			return a;
+		}
+		return s;
+	}
+
+
+	@Override
+	public Paint getItemPaint(int series, int item) {
+
+		Color color = (Color) super.getItemPaint(series, item);
+
+		// Change selected item shape color, reducing transparency
+		if(this.multipleItemsSelector.isMouseOverItem(series, item)) {
+			return new Color(color.getRed(), color.getGreen(), color.getBlue(), 195);
+		}
+		// Multiple item selection
+		else if(this.multipleItemsSelector.isSelectedItem(series, item))	{
+			// FIXME: rendering tests
+			//return new Color(255, 255, 255, 195);
+			return new Color(color.getRed(), color.getGreen(), color.getBlue(), 140);
+		}
+		return color;
+	}
+
+
+	
+	@Override
+	public void updateDatasetForDrawingSelectedItemAsLast() {
+		this.multipleItemsSelector.setItemDrawnAtLast(this);
+	}
+
+
+
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/themes/highcharts/renderers/FCAItemSelectionRenderer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/JFCSingularValueChartCreator.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/JFCSingularValueChartCreator.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/JFCSingularValueChartCreator.java	(revision 136)
@@ -0,0 +1,75 @@
+package org.txm.ca.core.chartsengine.jfreechart;
+
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.axis.NumberAxis;
+import org.jfree.data.category.DefaultCategoryDataset;
+import org.jfree.data.general.DatasetUtilities;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.messages.CACoreMessages;
+import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
+import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IItemSelectionRenderer;
+import org.txm.chartsengine.jfreechart.core.themes.base.ExtendedNumberAxis;
+import org.txm.stat.StatException;
+import org.txm.utils.logger.Log;
+
+/**
+ * JFC progression chart creator.
+ * 
+ * @author sjacquot
+ *
+ */
+public class JFCSingularValueChartCreator extends JFCChartCreator {
+
+	public JFCSingularValueChartCreator() {
+		// TODO Auto-generated constructor stub
+	}
+
+
+
+
+	@Override
+	public Object createChart(Object resultData, String preferencesNode) {
+		
+		
+		CA ca = (CA) resultData;
+
+		JFreeChart chart = null;
+
+		try {
+			// Creating the data set from the CA result
+			DefaultCategoryDataset dataset = new DefaultCategoryDataset();
+			double[] singularValues = ca.getValeursPropres();
+
+			for(int i = 0; i < singularValues.length; i++) {
+				dataset.setValue(singularValues[i], CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_TOOLTIP_Y_LABEL, CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_X_LABELS_PREFIX + String.valueOf(i + 1));
+			}
+
+			// Create the chart
+			chart = this.getChartsEngine().createCategoryBarChart(dataset, CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_TITLE, CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_X_AXIS_LABEL, CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_Y_AXIS_LABEL, false, false, false);
+
+			// Custom renderer
+			chart.getCategoryPlot().setRenderer(this.getChartsEngine().getTheme().createCASingularValuesRenderer());
+	        ((IItemSelectionRenderer) chart.getCategoryPlot().getRenderer()).getItemsSelector().setResultData(ca);
+
+	        // Custom range axis for ticks drawing options
+	        chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue()));
+
+		}
+		catch(StatException e) {
+			Log.severe(CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_CANT_CREATE_CHART + e);
+		}
+
+
+		return chart;
+	}
+
+	
+	@Override
+	public Class getResultDataClass() {
+		return CA.class;
+	}
+
+
+	
+
+}

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

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/JFCCAChartCreator.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/JFCCAChartCreator.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/JFCCAChartCreator.java	(revision 136)
@@ -0,0 +1,313 @@
+package org.txm.ca.core.chartsengine.jfreechart;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+
+import org.jfree.chart.ChartFactory;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.annotations.XYAnnotation;
+import org.jfree.chart.annotations.XYLineAnnotation;
+import org.jfree.chart.plot.PlotOrientation;
+import org.jfree.chart.plot.XYPlot;
+import org.txm.ca.core.chartsengine.base.CAChartCreator;
+import org.txm.ca.core.chartsengine.base.Utils;
+import org.txm.ca.core.chartsengine.jfreechart.datasets.FCAXYDataset;
+import org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers.FCAItemSelectionRenderer;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.messages.CACoreMessages;
+import org.txm.ca.core.preferences.CAPreferences;
+import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
+import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
+import org.txm.chartsengine.jfreechart.core.renderers.MultipleItemsSelector;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.stat.StatException;
+import org.txm.utils.logger.Log;
+
+/**
+ * JFC progression chart creator.
+ * 
+ * @author sjacquot
+ *
+ */
+public class JFCCAChartCreator extends JFCChartCreator implements CAChartCreator {
+
+	public JFCCAChartCreator() {
+		// TODO Auto-generated constructor stub
+	}
+
+	
+	/**
+	 * Add some borders to the limits of the specified XY plot.
+	 * @param plot
+	 */
+	public void createCAFactorialMapChartLimitsBorder(JFreeChart chart)	{
+
+		XYPlot plot = chart.getXYPlot();
+
+		// Remove all existent annotations
+		for(int i = plot.getAnnotations().size() - 1; i >= 0; i--) {
+			plot.removeAnnotation((XYAnnotation) plot.getAnnotations().get(i));
+		}
+
+
+        // Gets the extreme coordinates values
+		double minX = 0, maxX = 0, minY = 0, maxY = 0;
+
+		// FIXME: new version
+//		minX = plot.getDataRange(plot.getDomainAxis()).getLowerBound();
+//		maxX = plot.getDataRange(plot.getDomainAxis()).getUpperBound();
+//
+//		minY = plot.getDataRange(plot.getRangeAxis()).getLowerBound();
+//		maxY = plot.getDataRange(plot.getRangeAxis()).getUpperBound();
+
+		// FIXME: old version, to remove when new version will be validated
+		// Rows
+		if(plot.getRenderer().isSeriesVisible(0))	{
+			minX = ((FCAXYDataset)plot.getDataset()).getMinX(0);
+		}
+		// Cols
+		if(plot.getRenderer().isSeriesVisible(1))	{
+			double tmpMinX = ((FCAXYDataset)plot.getDataset()).getMinX(1);
+			if(tmpMinX < minX)	{
+				minX = tmpMinX;
+			}
+		}
+
+		// Rows
+		if(plot.getRenderer().isSeriesVisible(0))	{
+			maxX = ((FCAXYDataset)plot.getDataset()).getMaxX(0);
+		}
+		// Cols
+		if(plot.getRenderer().isSeriesVisible(1))	{
+			double tmpMaxX = ((FCAXYDataset)plot.getDataset()).getMaxX(1);
+			if(tmpMaxX > maxX)	{
+				maxX = tmpMaxX;
+			}
+		}
+
+		// Rows
+		if(plot.getRenderer().isSeriesVisible(0))	{
+			minY = ((FCAXYDataset)plot.getDataset()).getMinY(0);
+		}
+		// Cols
+		if(plot.getRenderer().isSeriesVisible(1))	{
+			double tmpMinY = ((FCAXYDataset)plot.getDataset()).getMinY(1);
+			if(tmpMinY < minY)	{
+				minY = tmpMinY;
+			}
+		}
+
+		// Rows
+		if(plot.getRenderer().isSeriesVisible(0))	{
+			maxY = ((FCAXYDataset)plot.getDataset()).getMaxY(0);
+		}
+		// Cols
+		if(plot.getRenderer().isSeriesVisible(1))	{
+			double tmpMaxY = ((FCAXYDataset)plot.getDataset()).getMaxY(1);
+			if(tmpMaxY > maxY)	{
+				maxY = tmpMaxY;
+			}
+		}
+
+		// Add some margins to the border
+		// FIXME : to compute according to the real series shape dimensions
+		// The code below doesn't work
+//		double shapeHalfWidth = chart.getXYPlot().getRenderer().getSeriesShape(0).getBounds2D().getWidth() / 2;
+		double shapeHalfWidth = 0.02;
+		minX -= shapeHalfWidth;
+		maxX += shapeHalfWidth;
+		minY -= shapeHalfWidth;
+		maxY += shapeHalfWidth;
+
+
+		// Create the border
+		BasicStroke dashedStroke = new BasicStroke(0.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f, new float[] {2f}, 0f);
+		XYLineAnnotation annotation;
+		Color borderColor = Color.GRAY;
+
+		// Left border
+		annotation = new XYLineAnnotation(minX, minY, minX, maxY, dashedStroke, borderColor);
+        plot.addAnnotation(annotation);
+
+        // Right border
+		annotation = new XYLineAnnotation(maxX, minY, maxX, maxY, dashedStroke, borderColor);
+        plot.addAnnotation(annotation);
+
+		// Bottom border
+		annotation = new XYLineAnnotation(minX, minY, maxX, minY, dashedStroke, borderColor);
+        plot.addAnnotation(annotation);
+
+        // Top border
+		annotation = new XYLineAnnotation(minX, maxY, maxX, maxY, dashedStroke, borderColor);
+        plot.addAnnotation(annotation);
+
+	}
+
+	@Override
+	public void updateChartCAFactorialMapSetDimensions(Object chart, CA ca, int dimension1, int dimension2)	{
+		 //super.updateChartCAFactorialMapSetDimensions(chart, ca, dimension1, dimension2);
+
+		 // Modify data set
+		 ((FCAXYDataset) ((JFreeChart) chart).getXYPlot().getDataset()).setAxis1(dimension1);
+		 ((FCAXYDataset) ((JFreeChart) chart).getXYPlot().getDataset()).setAxis2(dimension2);
+
+		 // Update axis labels
+		 // FIXME : create a method in CA to directly get a singular value as percent ?
+		 try {
+			 double sinuglarValuesSum = ca.getValeursPropresSum();
+			 DecimalFormat f = new DecimalFormat("###.00"); //$NON-NLS-1$
+			 ((JFreeChart) chart).getXYPlot().getDomainAxis().setLabel(CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_AXIS_LABEL_PREFIX + " " + dimension1 + " (" + f.format(100 * ca.getValeursPropres()[dimension1 - 1] / sinuglarValuesSum) + "%)");
+			 ((JFreeChart) chart).getXYPlot().getRangeAxis().setLabel(CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_AXIS_LABEL_PREFIX + " " + dimension2 + " (" + f.format(100 * ca.getValeursPropres()[dimension2 - 1] / sinuglarValuesSum) + "%)");
+
+			 // Refresh data set
+			 // FIXME : any way to fire a data set event rather than reassign the same data set ?
+			 ((JFreeChart) chart).getXYPlot().setDataset(((JFreeChart) chart).getXYPlot().getDataset());
+			// the code below doesn't neither center the view nor update the axes ticks of the new chart, continue tests
+			//((JFreeChart) chart).setNotify(true);
+
+
+			// Update the limits border
+			this.createCAFactorialMapChartLimitsBorder((JFreeChart) chart);
+
+		}
+		catch(StatException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	 }
+
+
+	@Override
+	public void updateChartCAFactorialMapHighlightPoints(Object chart, boolean rows, String[] labels) {
+
+		MultipleItemsSelector selector = (MultipleItemsSelector) ((FCAItemSelectionRenderer)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector();
+
+		// Rows
+		int series = 0;
+		// Columns
+		if(!rows)	{
+			series = 1;
+		}
+		selector.removeAllSelectedItems(series);
+		int[] items = ((FCAXYDataset)((JFreeChart) chart).getXYPlot().getDataset()).getLabelIndices(series, labels);
+
+		for(int i = 0; i < items.length; i++) {
+			selector.addSelectedItem(series, items[i]);
+		}
+
+		((JFreeChart) chart).setNotify(true);
+	}
+
+
+
+	
+	/**
+	 * Creates a FCA scatter plot from the specified dataset.
+	 * @param dataset
+	 * @return the JFreeChart chart
+	 */
+	public JFreeChart createCAFactorialMapChart(FCAXYDataset dataset, String title, String xAxisLabel, String yAxisLabel) {
+
+		JFreeChart chart = ChartFactory.createScatterPlot(title, xAxisLabel, yAxisLabel, dataset, PlotOrientation.VERTICAL, TXMPreferences.getBoolean(CAPreferences.PREFERENCES_NODE, ChartsEnginePreferences.SHOW_LEGEND), false, false);
+
+		// Add some borders to the limits of the CA
+		this.createCAFactorialMapChartLimitsBorder(chart);
+
+		// Custom renderer
+		chart.getXYPlot().setRenderer(this.getChartsEngine().getTheme().createFCARenderer());
+
+		return chart;
+	}
+
+
+	@Override
+	public void updateChart(Object chart, Object resultData, String preferencesNode) {
+		((JFreeChart)chart).getXYPlot().getRenderer().setSeriesVisible(0, TXMPreferences.getBoolean(CAPreferences.PREFERENCES_NODE, CAPreferences.SHOW_VARIABLES));
+		((JFreeChart)chart).getXYPlot().getRenderer().setSeriesVisible(1, TXMPreferences.getBoolean(CAPreferences.PREFERENCES_NODE, CAPreferences.SHOW_INDIVIDUALS));
+		
+		super.updateChart(chart, resultData, preferencesNode);
+		
+		// Update the limits border
+		this.createCAFactorialMapChartLimitsBorder((JFreeChart) chart);
+
+	}
+
+
+	
+	@Override
+	public JFreeChart createChart(Object resultData, String preferencesNode) {
+
+		
+		CA ca = (CA) resultData;
+		
+		// parameters
+//		boolean monochrome = (TXMPreferences.getInt(preferencesNode, resultData, ChartsEnginePreferences.RENDERING_COLORS_MODE, ChartsEnginePreferences.PREFERENCES_NODE)
+//				== ChartsEngine.RENDERING_MONOCHROME_MODE);
+//		boolean monostyle = TXMPreferences.getBoolean(preferencesNode, resultData, CAPreferences.CHART_MONO_STYLE);
+//		boolean cumulative = TXMPreferences.getBoolean(preferencesNode, resultData, CAPreferences.CHART_CUMULATIVE);
+		
+		
+		JFreeChart chart  = null;
+
+		try {
+			FCAXYDataset dataset = new FCAXYDataset(ca);
+
+			DecimalFormat f = new DecimalFormat("###.00"); //$NON-NLS-1$
+			double singularValuesSum = ca.getValeursPropresSum();
+
+			String percent1 = f.format(100 * ca.getValeursPropres()[ca.getFirstDimension() - 1] / singularValuesSum);
+			String axis1 = CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_AXIS_LABEL_PREFIX + " " + ca.getFirstDimension() + " (" + percent1 + "%)";
+			String percent2 = f.format(100 * ca.getValeursPropres()[ca.getSecondDimension() - 1] / singularValuesSum);
+			String axis2 = CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_AXIS_LABEL_PREFIX  + " " + ca.getSecondDimension() + " (" + percent2 + "%)";
+			chart = this.createCAFactorialMapChart(dataset, Utils.createCAFactorialMapChartTitle(ca), axis1, axis2);
+
+		}
+		catch(StatException e) {
+			Log.severe("Can't create CA factorial map scatter plot" + e);
+		}
+
+
+		return chart;		
+		
+	}
+
+	@Override
+	public ArrayList<String> getCAFactorialMapChartSelectedPoints(Object chart, int series) {
+
+		MultipleItemsSelector selector = (MultipleItemsSelector) ((FCAItemSelectionRenderer)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector();
+		ArrayList<String> pointLabels = new ArrayList<String>(selector.getSelectedItemsCount(series));
+
+		if(selector.getSelectedItemsCount(series) > 0)	{
+
+			FCAXYDataset dataset = (FCAXYDataset) ((JFreeChart) chart).getXYPlot().getDataset();
+			int[] selectedItems = selector.getSelectedItems(series);
+
+			for(int i = 0; i < selectedItems.length; i++) {
+				pointLabels.add(dataset.getLabel(series, selectedItems[i]));
+			}
+		}
+		return pointLabels;
+	}
+	
+
+
+
+	@Override
+	public void updateChartCAFactorialMapSetLabelItemsSelectionOrder(Object chart, String[] rowLabels, String[] colLabels) {
+		
+		MultipleItemsSelector selector = (MultipleItemsSelector) ((FCAItemSelectionRenderer)((JFreeChart) chart).getXYPlot().getRenderer()).getItemsSelector();
+		selector.setCyclicItemsOrder(selector.getItemsAndSeriesOrderedByLabels((FCAXYDataset)((JFreeChart) chart).getXYPlot().getDataset(), rowLabels, colLabels)); 
+	}
+
+
+	@Override
+	public Class getResultDataClass() {
+		return CA.class;
+	}
+
+
+	
+
+}

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

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/datasets/FCAXYDataset.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/datasets/FCAXYDataset.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/jfreechart/datasets/FCAXYDataset.java	(revision 136)
@@ -0,0 +1,369 @@
+package org.txm.ca.core.chartsengine.jfreechart.datasets;
+
+import org.jfree.data.xy.AbstractXYDataset;
+import org.jfree.data.xy.XYDataset;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.messages.CACoreMessages;
+import org.txm.stat.StatException;
+
+/**
+ * XY data set for storing coordinates and frequencies of CA plots.  
+ * @author sjacquot
+ *
+ */
+// TODO: some CA data are duplicated in this data set. We could directly use the CA methods here
+// rather than copy some data but the performances due off access may be altered, however we would gain memory.
+public class FCAXYDataset extends AbstractXYDataset implements XYDataset { 
+
+	/**
+	 * The row labels.
+	 */
+	protected String[] rowLabels;
+	
+	/**
+	 * The column labels.
+	 */
+	protected String[] columnLabels;
+	
+	
+	/**
+	 * The row coordinates. 
+	 */
+	protected double rowCoordinates[][];
+	
+	/**
+	 * The column coordinates.
+	 */
+	protected double columnCoordinates[][];
+	
+	
+	/**
+	 * The row frequencies.	
+	 */
+	protected int[] rowFrequencies;
+	
+	
+	/**
+	 * The column frequencies. 
+	 */
+	protected int[] columnFrequencies;
+
+	/**
+	 * First axis for point coordinates.
+	 */
+	protected int axis1;
+
+	/**
+	 * Second axis for point coordinates.
+	 */
+	protected int axis2;
+
+
+	/**
+	 * 
+	 */
+	public FCAXYDataset() {
+	}
+
+	/**
+	 * Creates a data set from the specified CA result.
+	 * @param ca
+	 * @throws StatException 
+	 */
+	public FCAXYDataset(CA ca) throws StatException {
+
+		// Axis/dimensions
+		this.axis1 = ca.getFirstDimension() - 1;
+		this.axis2 = ca.getSecondDimension() - 1;
+		
+		// Labels
+		this.rowLabels = ca.getRowNames();
+		this.columnLabels = ca.getColNames();
+
+		// Coordinates
+		this.rowCoordinates = ca.getRowsCoords();
+		this.columnCoordinates = ca.getColsCoords();
+
+		// Frequencies
+		this.rowFrequencies = ca.getLexicalTable().getRowMarginsVector().asIntArray();
+		this.columnFrequencies = ca.getLexicalTable().getColMarginsVector().asIntArray();
+
+	}
+
+
+	@Override
+	public Number getX(int series, int item) {
+		if(item == -1)	{
+			System.out.println("FCAXYDataset.getX()");
+		}
+		// Rows
+		if(series == 0) {
+			return this.rowCoordinates[item][this.axis1];
+		}
+		// Cols
+		else {
+			return this.columnCoordinates[item][this.axis1];
+		}
+	}
+
+	@Override
+	public Number getY(int series, int item) {
+		// Rows
+		if(series == 0) {
+			return this.rowCoordinates[item][this.axis2];
+		}
+		// Cols
+		else {
+			return this.columnCoordinates[item][this.axis2];
+		}
+
+	}
+
+
+	/**
+	 * Gets the maximum X coordinates value in the specified series.
+	 * @param series
+	 * @return
+	 */
+	public double getMaxX(int series)	{
+		return this.getMaxValue(series, this.axis1);
+	}
+	
+
+	/**
+	 * Gets the maximum Y coordinates value in the specified series.
+	 * @param series
+	 * @return
+	 */
+	public double getMaxY(int series)	{
+		return this.getMaxValue(series, this.axis2);
+	}
+
+
+	/**
+	 * Gets the maximum value in the specified series according to the specified axis.
+	 * @param series
+	 * @param axis
+	 * @return
+	 */
+	public double getMaxValue(int series, int axis)	{
+
+		double maxValue = 0;
+		double tmpMaxValue;
+
+		double[][] coordinates = this.rowCoordinates;
+		if(series != 0)	{
+			coordinates = this.columnCoordinates;
+		}
+		
+		for(int i = 0; i < coordinates.length; i++) {
+			tmpMaxValue = coordinates[i][axis];
+			if(tmpMaxValue > maxValue)	{
+				maxValue = tmpMaxValue;
+			}
+		}
+
+		return maxValue;
+	}
+	
+	
+	
+	/**
+	 * Gets the minimum X coordinates value in the specified series.
+	 * @param series
+	 * @return
+	 */
+	public double getMinX(int series)	{
+		return this.getMinValue(series, this.axis1);
+	}
+	
+
+	/**
+	 * Gets the minimum Y coordinates value in the specified series.
+	 * @param series
+	 * @return
+	 */
+	public double getMinY(int series)	{
+		return this.getMinValue(series, this.axis2);
+	}
+
+	
+	/**
+	 * Gets the minimum value in the specified series according to the specified axis.
+	 * @param series
+	 * @param axis
+	 * @return
+	 */
+	public double getMinValue(int series, int axis)	{
+
+		double minValue = 0;
+		double tmpMinValue;
+
+		double[][] coordinates = this.rowCoordinates;
+		if(series != 0)	{
+			coordinates = this.columnCoordinates;
+		}
+		
+		for(int i = 0; i < coordinates.length; i++) {
+			tmpMinValue = coordinates[i][axis];
+			if(tmpMinValue < minValue)	{
+				minValue = tmpMinValue;
+			}
+		}
+
+		return minValue;
+	}
+	
+	
+	@Override
+	public int getSeriesCount() {
+		return 2;
+	}
+
+	@Override
+	public int getItemCount(int series) {
+		// Rows
+		if(series == 0) {
+			return this.rowCoordinates.length;
+		}
+		// Cols
+		else {
+			return this.columnCoordinates.length;
+		}
+	}
+
+	/**
+	 * Gets the key of the specified series.
+	 */
+	public Comparable getSeriesKey(int series) {
+		// Rows
+		if(series == 0) {
+			return CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_LEGEND_ROWS_LABEL;
+		}
+		// Cols
+		else {
+			return CACoreMessages.ChartsEngine_CA_FACTORIAL_MAP_LEGEND_COLUMNS_LABEL;
+		}
+	}
+
+	/**
+	 * Gets the label of a point.
+	 * @param series
+	 * @param item
+	 * @return
+	 */
+	public String getLabel(int series, int item) {
+		// Rows
+		if(series == 0) {
+			return this.rowLabels[item];
+		}
+		// Cols
+		else {
+			return this.columnLabels[item];
+		}
+	}
+
+	
+	/**
+	 * Gets the indices of point from their labels.
+	 * @param series
+	 * @param label
+	 * @return
+	 */
+	public int[] getLabelIndices(int series, String[] labels)	{
+		int[] indices = new int[labels.length];
+	
+		// Rows
+		if(series == 0) {
+			for(int i = 0, j = 0; i < this.rowLabels.length; i++) {
+				for(int k = 0; k < labels.length; k++) {
+					if(this.rowLabels[i].equals(labels[k]))	{
+						indices[j++] = i;
+					}
+				}
+			}
+		}
+		// Cols
+		else {
+			for(int i = 0, j = 0; i < this.columnLabels.length; i++) {
+				for(int k = 0; k < labels.length; k++) {
+					if(this.columnLabels[i].equals(labels[k]))	{
+						indices[j++] = i;
+					}
+				}
+			}
+		}
+		
+		return indices;
+	}
+	
+	/**
+	 * Gets the indices of point from their labels keeping the specified label order.
+	 * @param series
+	 * @param labels
+	 * @return
+	 */
+	public int[] getOrderedLabelIndices(int series, String[] labels)	{
+		int[] indices = new int[labels.length];
+		
+		// Rows
+		if(series == 0) {
+			for(int i = 0, k = 0; i < labels.length; i++) {
+				for(int j = 0; j < this.rowLabels.length; j++) {
+					if(this.rowLabels[j].equals(labels[i]))	{
+						indices[k++] = j;
+						continue;
+					}
+				}
+			}
+		}
+		// Cols
+		else {
+			for(int i = 0, k = 0; i < labels.length; i++) {
+				for(int j = 0; j < this.columnLabels.length; j++) {
+					if(this.columnLabels[j].equals(labels[i]))	{
+						indices[k++] = j;
+						continue;
+					}
+				}
+			}
+		}
+		
+		return indices;
+	}
+	
+	
+	
+	/**
+	 * Gets the frequency of the specified series and items.
+	 * If <code>series</code> is equal to 0, the method returns the frequency of the specified row, otherwise the sum of the occurrences of the specified column.
+	 * @param series
+	 * @param item
+	 * @return
+	 */
+	public String getFrequency(int series, int item) {
+		// Rows
+		if(series == 0) {
+			return String.valueOf(this.rowFrequencies[item]);
+		}
+		// Columns
+		else {
+			return String.valueOf(this.columnFrequencies[item]);
+		}
+	}
+
+	/**
+	 * @param axis1 the axis1 to set
+	 */
+	public void setAxis1(int axis1) {
+		this.axis1 = axis1 - 1;
+	}
+
+	/**
+	 * @param axis2 the axis2 to set
+	 */
+	public void setAxis2(int axis2) {
+		this.axis2 = axis2 - 1;
+	}
+
+}
\ No newline at end of file

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

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RSingularValuesChartCreator.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RSingularValuesChartCreator.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RSingularValuesChartCreator.java	(revision 136)
@@ -0,0 +1,97 @@
+package org.txm.ca.core.chartsengine.r;
+
+import java.io.File;
+
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.messages.CACoreMessages;
+import org.txm.ca.core.statsengine.r.functions.FactoMineRCA;
+import org.txm.chartsengine.r.core.RChartCreator;
+
+/**
+ * R progression chart creator.
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class RSingularValuesChartCreator extends RChartCreator {
+
+	public RSingularValuesChartCreator() {
+		// TODO Auto-generated constructor stub
+	}
+
+
+	@Override
+	public Class getResultDataClass() {
+		return CA.class;
+	}
+
+
+	@Override
+	public Object createChart(Object resultData, String preferencesNode) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+
+	@Override
+	public File createChartFile(Object resultData, File file, String preferencesNode) {
+
+		CA ca = (CA) resultData;
+		
+		// FactoMineR R package
+		if(ca.useFactoMineR())	{
+			return this.createSingularValuesBarPlot((FactoMineRCA) ca.getCa(), file);
+		}
+		// CA R package
+		else	{
+			return this.createSingularValuesBarPlot((org.txm.ca.core.statsengine.r.functions.CA) ca.getCa(), file);
+		}
+
+	}
+
+
+	/**
+	 * Creates a bar plot with singular values of the specified CA result from "FactoMineR" R package.
+	 * @param ca
+	 * @param file
+	 * @return the singular values bar plot object
+	 */
+	public File createSingularValuesBarPlot(FactoMineRCA ca, File file) {
+		
+		// Create the X axis labels with custom prefix
+		StringBuilder xLabels = new StringBuilder(30);
+		xLabels.append("c("); //$NON-NLS-1$
+		for(int i = 0, c = ca.getColumnsCount() - 1; i < c; i++) {
+			if(i > 0)	 {
+				xLabels.append(", "); //$NON-NLS-1$
+			}
+			xLabels.append("\"" + CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_X_LABELS_PREFIX + (i + 1) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+		xLabels.append(")"); //$NON-NLS-1$
+
+		String cmd = "tmpY <- " + ca.getSymbol() + "$eig$eigenvalue[1:length(" + ca.getSymbol() + "$eig$eigenvalue) - 1];\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		cmd += "barplot(tmpY, main=\"" //$NON-NLS-1$
+				+ CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_TITLE + "\", ylab=\"" + //$NON-NLS-1$
+				CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_Y_AXIS_LABEL + "\", xlab=\"" + //$NON-NLS-1$
+				CACoreMessages.ChartsEngine_CA_SINGULAR_VALUES_X_AXIS_LABEL + "\", names.arg=" + xLabels + ");\n"; //$NON-NLS-1$ //$NON-NLS-2$
+
+		this.getChartsEngine().plot(file, cmd);
+
+		return file;
+	}
+
+
+	/**
+	 * Creates a bar plot with singular values of the specified CA result from "CA" R package.
+	 * @param ca
+	 * @param file
+	 * @return the singular values bar plot object
+	 */
+	public File createSingularValuesBarPlot(org.txm.ca.core.statsengine.r.functions.CA ca, File file) {
+		this.getChartsEngine().plot(file, "barplot(" +  ca.getSymbol() + "$sv)"); //$NON-NLS-1$ //$NON-NLS-2$
+		return file;
+	}
+
+
+
+}

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

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RCAChartCreator.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RCAChartCreator.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/chartsengine/r/RCAChartCreator.java	(revision 136)
@@ -0,0 +1,191 @@
+package org.txm.ca.core.chartsengine.r;
+
+import java.io.File;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+
+import org.txm.ca.core.chartsengine.base.CAChartCreator;
+import org.txm.ca.core.chartsengine.base.Utils;
+import org.txm.ca.core.functions.CA;
+import org.txm.ca.core.messages.CACoreMessages;
+import org.txm.ca.core.statsengine.r.functions.FactoMineRCA;
+import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages;
+import org.txm.chartsengine.r.core.RChartCreator;
+import org.txm.chartsengine.r.core.RChartsEngine;
+import org.txm.utils.logger.Log;
+
+/**
+ * R progression chart creator.
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class RCAChartCreator extends RChartCreator implements CAChartCreator {
+
+	public RCAChartCreator() {
+		// TODO Auto-generated constructor stub
+	}
+
+	
+	/**
+	 * Creates a factorial map chart from the specified CA result from "FactoMineR" R package and writes it in the specified file.
+	 * @param ca
+	 * @param destFile
+	 * @param showIndividuals
+	 * @param showVariables
+	 * @param firstDimension
+	 * @param secondDimension
+	 * @return the generated file containing the chart
+	 */
+	public File createFactorialMapChart(FactoMineRCA ca, File destFile, boolean showIndividuals, boolean showVariables, int firstDimension, int secondDimension, String title)	{
+
+		try {
+
+			String label = ""; //$NON-NLS-1$
+			String invisible = ""; //$NON-NLS-1$
+			if (showIndividuals)
+				label +=", \"col\""; //$NON-NLS-1$
+			else
+				invisible +=", \"col\""; //$NON-NLS-1$
+
+			if (showVariables)
+				label +=", \"row\""; //$NON-NLS-1$
+			else
+				invisible +=", \"row\""; //$NON-NLS-1$
+
+			if (label.length() > 0)
+				label = "c("+label.substring(1)+")"; //$NON-NLS-1$ //$NON-NLS-2$
+			else
+				label = "c(\"all\")"; //$NON-NLS-1$
+
+			if (invisible.length() > 0)
+				invisible = "c("+invisible.substring(1)+")"; //$NON-NLS-1$ //$NON-NLS-2$
+			else
+				invisible = "c()"; //$NON-NLS-1$
+
+			String axes = "c(" + firstDimension + ", " + secondDimension + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+			String cmd = "plot.CA("+ ca.getSymbol() +", label=" + label + ", invisible=" + invisible + ", axes=" + axes + ", title=\"" + title + "\", cex=.8)"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+			
+			this.getChartsEngine().plot(destFile, cmd);
+			
+		}
+		catch(Exception e) {
+			Log.severe(CACoreMessages.bind(CACoreMessages.ChartsEngine_CANT_CREATE_CA_FILE_CHART + " - FactoMineR package", RChartsEngine.DESCRIPTION) + e); //$NON-NLS-1$
+		}
+
+		return destFile;
+	}
+
+
+	/**
+	 * Creates a factorial map chart from the specified CA result from "CA" R package and writes it in the specified file.
+	 * @param ca
+	 * @param destFile
+	 * @param showIndividuals
+	 * @param showVariables
+	 * @param firstDimension
+	 * @param secondDimension
+	 * @return the generated file containing the chart
+	 */
+	public File createFactorialMapChart(org.txm.ca.core.statsengine.r.functions.CA ca, File destFile, boolean showIndividuals, boolean showVariables, int firstDimension, int secondDimension)	{
+
+		try {
+
+			double[] sv = ca.getValeursPropres();
+			double tot = 0;
+			DecimalFormat f = new DecimalFormat("###.00"); //$NON-NLS-1$
+			for (int i = 0; i < sv.length; i++)
+				tot += (sv[i]);
+
+			double inertie1 = (((sv[firstDimension - 1] * sv[firstDimension - 1]) / tot) * 100.0);
+			double inertie2 = (((sv[secondDimension - 1] * sv[secondDimension - 1]) / tot) * 100.0);
+			String contrib1 = "axis(" + firstDimension + "): inertia=" + f.format(inertie1) + "%"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			String contrib2 = "axis(" + secondDimension + "): inertia=" + f.format(inertie2) + "%"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			String cmd = "plot(" + ca.getSymbol() + ", dim=c(" + firstDimension + ", " + secondDimension + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+			cmd += ", what=c(" + (showVariables ? "\"all\"" : "\"none\"") + ", " + (showIndividuals ? "\"all\"" : "\"none\"") + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+			// cmd +=
+			// ", mass = c(TRUE, TRUE), contrib = c(\"relative\", \"relative\")";
+			cmd += ", col = c(\"#0000FF\", \"#FF0000\")"; //$NON-NLS-1$
+			cmd += ", cex=.5);"; //$NON-NLS-1$
+			cmd += "mtext(\"" + contrib1 + "\", side = 1, line = 2);"; //$NON-NLS-1$ //$NON-NLS-2$
+			cmd += "mtext(\"" + contrib2 + "\", side = 2, line = 2);"; //$NON-NLS-1$ //$NON-NLS-2$
+
+			this.getChartsEngine().plot(destFile, cmd);
+		}
+		catch(Exception e) {
+			Log.severe(CACoreMessages.bind(CACoreMessages.ChartsEngine_CANT_CREATE_CA_FILE_CHART + " - CA package", RChartsEngine.DESCRIPTION) + e); //$NON-NLS-1$
+		}
+
+		return destFile;
+	}
+	
+	@Override
+	public Object createChart(Object resultData, String preferencesNode) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public File createChartFile(Object resultData, File file, String preferencesNode) {
+
+		CA ca = (CA) resultData;
+		
+		// parameters
+//		boolean monochrome = (TXMPreferences.getInt(preferencesNode, resultData, ChartsEnginePreferences.RENDERING_COLORS_MODE) == ChartsEngine.RENDERING_MONOCHROME_MODE);
+//		
+//		boolean monostyle = TXMPreferences.getBoolean(preferencesNode, ProgressionPreferences.CHART_MONO_STYLE);
+//		boolean cumulative = TXMPreferences.getBoolean(preferencesNode, ProgressionPreferences.CHART_CUMULATIVE);
+		
+	
+		// FactoMineR R package
+		if(ca.useFactoMineR())	{
+			return this.createFactorialMapChart((FactoMineRCA) ca.getCa(), file, ca.isShowIndividuals(), ca.isShowVariables(), ca.getFirstDimension(), ca.getSecondDimension(), Utils.createCAFactorialMapChartTitle(ca));
+		}
+		// CA R package
+		else	{
+			return this.createFactorialMapChart((org.txm.ca.core.statsengine.r.functions.CA) ca.getCa(), file, ca.isShowIndividuals(), ca.isShowVariables(), ca.getFirstDimension(), ca.getSecondDimension());
+		}
+	}
+
+
+	@Override
+	public Class getResultDataClass() {
+		return CA.class;
+	}
+
+
+
+	@Override
+	public ArrayList<String> getCAFactorialMapChartSelectedPoints(Object chart, int series) {
+		// FIXME: not implemented
+		Log.severe(this.getClass() + ".getCAFactorialMapChartSelectedPoints(): Not yet implemented."); //$NON-NLS-1$
+		return new ArrayList<String>(0);
+	}
+
+
+	@Override
+	public void updateChartCAFactorialMapHighlightPoints(Object chart, boolean rows, String[] labels) {
+		// FIXME: not implemented
+		Log.severe(this.getClass() + ".updateChartCAFactorialMapHighlightPoints(): Not yet implemented."); //$NON-NLS-1$
+	}
+
+
+	@Override
+	public void updateChartCAFactorialMapSetLabelItemsSelectionOrder(Object chart, String[] rowLabels, String[] colLabels) {
+		// FIXME: not implemented
+		Log.severe(this.getClass() + ".updateChartCAFactorialMapSetLabelItemsSelectionOrder(): Not yet implemented."); //$NON-NLS-1$
+	}
+
+
+	@Override
+	public void updateChartCAFactorialMapSetDimensions(Object chart, CA ca, int dimension1, int dimension2) {
+		// FIXME: not implemented
+		Log.severe(this.getClass() + ".updateChartCAFactorialMapSetDimensions(): Not yet implemented."); //$NON-NLS-1$
+	}
+
+
+
+
+
+}

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

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/preferences/CAPreferences.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/preferences/CAPreferences.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/preferences/CAPreferences.java	(revision 136)
@@ -0,0 +1,89 @@
+package org.txm.ca.core.preferences;
+
+
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.service.prefs.Preferences;
+import org.txm.core.preferences.TXMPreferences;
+
+/**
+ * Default preferences initializer.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class CAPreferences extends TXMPreferences {
+
+
+	// auto populate the preference node qualifier from the current bundle id
+	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(CAPreferences.class).getSymbolicName();
+
+	
+	public static final String PREFERENCES_PREFIX = "ca_"; //$NON-NLS-1$
+	
+	
+	
+	/** Lexical table FMIN. */
+	public static final String F_MIN = PREFERENCES_PREFIX + "lt_fmin"; //$NON-NLS-1$
+	/** Lexical table VMAX. */
+	public static final String V_MAX = PREFERENCES_PREFIX + "lt_vmax"; //$NON-NLS-1$
+
+	/** The Constant SHOWINDIVIDUALS. */
+	public static final String SHOW_INDIVIDUALS = PREFERENCES_PREFIX + "chart_show_individuals"; //$NON-NLS-1$
+
+	/** The Constant SHOWVARIABLES. */
+	public static final String SHOW_VARIABLES = PREFERENCES_PREFIX + "chart_show_variables"; //$NON-NLS-1$
+
+	/** The Constant QUALITYDISPLAY. */
+	public static final String QUALITY_DISPLAY_FORMAT = PREFERENCES_PREFIX + "quality_display_format"; //$NON-NLS-1$
+
+	/** The Constant CONTRIBDISPLAY. */
+	public static final String CONTRIB_DISPLAY_FORMAT = PREFERENCES_PREFIX + "contrib_display_format"; //$NON-NLS-1$
+
+	/** The Constant MASSDISPLAY. */
+	public static final String MASS_DISPLAY_FORMAT = PREFERENCES_PREFIX + "mass_display_format"; //$NON-NLS-1$
+
+	public static final String CHI_DISPLAY_FORMAT = PREFERENCES_PREFIX + "chi_display_format"; //$NON-NLS-1$
+	
+	/** The Constant DISTDISPLAY. */
+	public static final String DIST_DISPLAY_FORMAT = PREFERENCES_PREFIX + "dist_display_format"; //$NON-NLS-1$
+
+	/** The Constant COS2DISPLAY. */
+	public static final String COS2_DISPLAY_FORMAT = PREFERENCES_PREFIX + "cos2_display_format"; //$NON-NLS-1$
+
+	/** The Constant COORDDISPLAY. */
+	public static final String COORD_DISPLAY_FORMAT = PREFERENCES_PREFIX + "coord_display_format"; //$NON-NLS-1$
+
+	/**
+	 * 
+	 */
+	public CAPreferences() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public void initializeDefaultPreferences() {
+		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
+		
+		preferences.putInt(F_MIN, 10);
+		preferences.putInt(V_MAX, 200);
+
+		String defaultFormat = "0.00"; //$NON-NLS-1$
+		preferences.put(QUALITY_DISPLAY_FORMAT, defaultFormat);
+		preferences.put(CONTRIB_DISPLAY_FORMAT, defaultFormat);
+		preferences.put(MASS_DISPLAY_FORMAT, defaultFormat);
+		preferences.put(CHI_DISPLAY_FORMAT, defaultFormat);
+		preferences.put(DIST_DISPLAY_FORMAT, defaultFormat);
+		preferences.put(COS2_DISPLAY_FORMAT, defaultFormat);
+		preferences.put(COORD_DISPLAY_FORMAT, defaultFormat);
+
+		
+		preferences.putBoolean(SHOW_INDIVIDUALS, true);
+		preferences.putBoolean(SHOW_VARIABLES, true);
+
+		// shared charts rendering preferences
+		super.initializeChartsEngineSharedPreferences(preferences);
+	}
+	
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/preferences/CAPreferences.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/CA.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/CA.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/CA.java	(revision 136)
@@ -0,0 +1,505 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2014-06-10 15:10:24 +0200 (Tue, 10 Jun 2014) $
+// $LastChangedRevision: 2771 $
+// $LastChangedBy: sjacquot $ 
+//
+package org.txm.ca.core.statsengine.r.functions;
+
+import java.io.File;
+
+import org.rosuda.REngine.REXP;
+import org.txm.Messages;
+import org.txm.stat.StatException;
+import org.txm.stat.data.LexicalTable;
+import org.txm.stat.engine.r.RWorkspace;
+import org.txm.stat.engine.r.RWorkspaceException;
+import org.txm.stat.engine.r.data.QuantitativeDataStructureImpl;
+
+/**
+ * Access to the R implementation of the Correspondance Analysis.
+ *
+ * @author sloiseau, mdecorde, sjacquot
+ */
+public class CA implements ICA	{
+
+	/** The singular values. */
+	private double[] singularValues = null;
+	
+	/** The singular values2. */
+	private double[] singularValues2 = null;
+	
+	/** The rowmass. */
+	private double[] rowmass = null;
+	
+	/** The rowdist. */
+	private double[] rowdist = null;
+	
+	/** The rowinertia. */
+	private double[] rowinertia = null;
+	
+	/** The rowcos2. */
+	private double[][] rowcos2 = null;
+	
+	/** The rowcontrib. */
+	private double[][] rowcontrib = null;
+
+	/** The colmass. */
+	private double[] colmass = null;
+	
+	/** The coldist. */
+	private double[] coldist = null;
+	
+	/** The colinertia. */
+	private double[] colinertia = null;
+	
+	/** The colcos2. */
+	private double[][] colcos2 = null;
+	
+	/** The colcontrib. */
+	private double[][] colcontrib = null;
+
+	/** The rw. */
+	private final RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+	
+	/** The symbol. */
+	private final String symbol = QuantitativeDataStructureImpl.createSymbole(CA.class);
+
+	/** The rowscoords. */
+	private double[][] rowscoords;
+
+	/** The colscoords. */
+	private double[][] colscoords;
+	
+	/**
+	 * The lexical table.
+	 */
+	private LexicalTable table;
+	
+	/**
+	 * Create a correspondance analysis on the given table. The correspondance
+	 * analysis is computed as soon as the object is created.
+	 *
+	 * @param table the table
+	 * @throws StatException the stat exception
+	 */
+	public CA(LexicalTable table) throws StatException {
+
+		
+		
+		if (!rw.containsVariable(table.getSymbol())) {
+			throw new StatException(Messages.CA_0);
+		}
+
+		loadLibrary();
+		this.table = table;
+		
+		try {
+			rw.callFunctionAndAffect(
+					"ca", new String[] { table.getSymbol() }, symbol); //$NON-NLS-1$
+		} catch (RWorkspaceException e) {
+			throw new StatException(Messages.CA_2 + e.getMessage(), e);
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getColContrib()
+	 */
+	@Override
+	public double[][] getColContrib() throws StatException {
+
+		double[][] colcoords = getColsCoords();
+		double[] sv = this.getValeursPropres();
+		double[] mass = this.getColsMass();
+
+		colcontrib = new double[colcoords.length][3];
+
+		for (int i = 0; i < colcoords.length; i++) {
+			for(int c = 0 ; c < 3 ; c++)
+			{
+				colcontrib[i][c] = 100.0 * mass[i] * (colcoords[i][c] * colcoords[i][c]) / (sv[c]);
+			}
+		}
+		return colcontrib;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getColCos2()
+	 */
+	@Override
+	public double[][] getColCos2() {
+		if (colcos2 == null)
+		{
+			double[][] colcoords = getColsCoords();
+			double[] dist = getColDist();
+			colcos2 = new double[colcoords.length][3];
+
+			for (int i = 0; i < colcoords.length; i++) {
+
+				double distt = dist[i];
+
+				colcos2[i][0] = Math.pow(colcoords[i][0], 2) / distt;
+				colcos2[i][1] = Math.pow(colcoords[i][1], 2) / distt;
+				colcos2[i][2] = Math.pow(colcoords[i][2], 2) / distt;
+			}
+		}
+		return colcos2;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getColDist()
+	 */
+	@Override
+	public double[] getColDist() {
+		if (coldist == null)
+		{
+			double[][] colcoords = getColsCoords();
+			coldist = new double[colcoords.length];
+			for (int i = 0; i < colcoords.length; i++)
+				for (int c = 0; c < colcoords[i].length; c++)
+					coldist[i] += Math.pow(colcoords[i][c], 2);
+		}
+		return coldist;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getColsCoords()
+	 */
+	@Override
+	public double[][] getColsCoords() {
+		if (colscoords == null) {
+			try {
+				REXP exp = rw.extractItemFromListByName(symbol, "colcoord"); //$NON-NLS-1$
+				colscoords = exp.asDoubleMatrix();
+
+				// multiply coords by sv
+				this.getSingularValues();
+				for (int i = 0; i < colscoords.length; i++)
+					for (int c = 0; c < colscoords[i].length; c++)
+						colscoords[i][c] = colscoords[i][c] * singularValues[c];
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				org.txm.utils.logger.Log.printStackTrace(e);
+			}
+		}
+		return colscoords;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the cols dist
+	 * @throws StatException the stat exception
+	 */
+	public double[] getColsDist() throws StatException {
+		if (coldist == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "coldist"); //$NON-NLS-1$
+				coldist = RWorkspace.toDouble(sv);
+				// Arrays.sort(coldist);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return coldist;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the cols inertia
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getColsInertia() throws StatException {
+		if (colinertia == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "colinertia"); //$NON-NLS-1$
+				colinertia = RWorkspace.toDouble(sv);
+				// Arrays.sort(colinertia);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return colinertia;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the cols mass
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getColsMass() throws StatException {
+		if (colmass == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "colmass"); //$NON-NLS-1$
+				colmass = RWorkspace.toDouble(sv);
+				// Arrays.sort(colmass);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return colmass;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getRowContrib()
+	 */
+	@Override
+	public double[][] getRowContrib() throws StatException {
+		if (rowcontrib != null)
+			return rowcontrib;
+
+		double[][] rowcoords = getRowsCoords();
+		double[] sv = this.getValeursPropres();
+		double[] mass = this.getRowsMass();
+
+		rowcontrib = new double[rowcoords.length][3];
+
+		for (int i = 0; i < rowcoords.length; i++) {
+			for(int c = 0 ; c <3 ; c++)
+			{
+				rowcontrib[i][c] = 100.0 * mass[i] * (rowcoords[i][c] * rowcoords[i][c]) / (sv[c]);
+			}
+		}
+		return rowcontrib;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getRowCos2()
+	 */
+	@Override
+	public double[][] getRowCos2() {
+		if (rowcos2 == null)
+		{
+			double[][] rowcoords = getRowsCoords();
+			double[] dist = getRowDist();
+
+			rowcos2 = new double[rowcoords.length][3];
+
+			for (int i = 0; i < rowcoords.length; i++) {
+
+				double distt = dist[i];
+
+				rowcos2[i][0] = Math.pow(rowcoords[i][0], 2) / distt;
+				rowcos2[i][1] = Math.pow(rowcoords[i][1], 2) / distt;
+				rowcos2[i][2] = Math.pow(rowcoords[i][2], 2) / distt;
+			}
+		}
+		return rowcos2;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getRowDist()
+	 */
+	@Override
+	public double[] getRowDist() {
+		if (rowdist == null)
+		{
+			double[][] rowcoords = getRowsCoords();
+			rowdist = new double[rowcoords.length];
+			for (int i = 0; i < rowcoords.length; i++)
+				for (int c = 0; c < rowcoords[i].length; c++)
+					rowdist[i] += Math.pow(rowcoords[i][c], 2);
+		}
+		return rowdist;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getRowsCoords()
+	 */
+	@Override
+	public double[][] getRowsCoords() {
+		if (rowscoords == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "rowcoord"); //$NON-NLS-1$
+				rowscoords = sv.asDoubleMatrix();
+
+				this.getSingularValues();
+				for (int i = 0; i < rowscoords.length; i++)
+					for (int c = 0; c < rowscoords[i].length; c++)
+						rowscoords[i][c] = rowscoords[i][c] * singularValues[c];
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				org.txm.utils.logger.Log.printStackTrace(e);
+			}
+		}
+		return rowscoords;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the rows dist
+	 * @throws StatException the stat exception
+	 */
+	public double[] getRowsDist() throws StatException {
+		if (rowdist == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "rowdist"); //$NON-NLS-1$
+				rowdist = RWorkspace.toDouble(sv);
+				// Arrays.sort(rowdist);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return rowdist;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the rows inertia
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getRowsInertia() throws StatException {
+		if (rowinertia == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "rowinertia"); //$NON-NLS-1$
+				rowinertia = RWorkspace.toDouble(sv);
+				// Arrays.sort(rowinertia);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return rowinertia;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the rows mass
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getRowsMass() throws StatException {
+		if (rowmass == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "rowmass"); //$NON-NLS-1$
+				rowmass = RWorkspace.toDouble(sv);
+				// Arrays.sort(rowmass);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return rowmass;
+	}
+
+	/**
+	 * Get the singular values.
+	 *
+	 * @return the singular values
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getSingularValues() throws StatException {
+		if (singularValues == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "sv"); //$NON-NLS-1$
+				singularValues = RWorkspace.toDouble(sv);
+				// Arrays.sort(singularValues);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return singularValues;
+	}
+	
+	/**
+	 * Gets the valeurs propres.
+	 *
+	 * @return the singular valeurs pow 2
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getValeursPropres() throws StatException {
+		if (singularValues2 == null) {
+			getSingularValues();
+			singularValues2 = new double[singularValues.length];
+			for(int i = 0 ; i < singularValues.length ; i++)
+				singularValues2[i] = Math.pow(singularValues[i], 2);
+		}
+		return singularValues2;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getSymbol()
+	 */
+	@Override
+	public String getSymbol() {
+		return symbol;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#loadLibrary()
+	 */
+	@Override
+	public boolean loadLibrary() {
+		try {
+			rw.voidEval("library(ca)"); //$NON-NLS-1$
+		} catch (RWorkspaceException e) {
+			System.out.println(Messages.CA_16 + e);
+			return false;
+		}
+		return true;
+	}
+
+
+
+	/**
+	 * Draw in the given file a plot of the factorial map.
+	 *
+	 * @param file the file
+	 * @param encoding the encoding
+	 * @param colseparator the colseparator
+	 * @param txtseparator the txtseparator
+	 * @return true, if successful
+	 */
+	@Override
+	public boolean toTxt(File file, String encoding, String colseparator, String txtseparator) {
+		try {
+			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+			rw.eval("sink(file=\"" + file.getAbsolutePath().replace("\\", "\\\\")+"\")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+			rw.eval("print("+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
+			rw.eval("sink()"); //$NON-NLS-1$
+		} catch (StatException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+		return true;
+	}
+
+	@Override
+	public int getRowsCount() {
+		return this.table.getRowsCount();
+	}
+
+	@Override
+	public int getColumnsCount() {
+		return this.table.getColumnsCount();
+	}
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/CA.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/FactoMineRCA.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/FactoMineRCA.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/FactoMineRCA.java	(revision 136)
@@ -0,0 +1,518 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.ca.core.statsengine.r.functions;
+
+import java.io.File;
+import java.util.Arrays;
+
+import org.rosuda.REngine.REXP;
+import org.rosuda.REngine.REXPMismatchException;
+import org.txm.Messages;
+import org.txm.stat.StatException;
+import org.txm.stat.data.LexicalTable;
+import org.txm.stat.engine.r.RWorkspace;
+import org.txm.stat.engine.r.RWorkspaceException;
+import org.txm.stat.engine.r.data.QuantitativeDataStructureImpl;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Access to the R implementation of the Correspondance Analysis.
+ *
+ * @author mdecorde
+ */
+public class FactoMineRCA implements ICA {
+
+	/** The singular values. */
+	private double[] valeursPropres = null;
+	
+	/** The singular values2. */
+	private double[] singularValues = null;
+
+	/** The rowmass. */
+	private double[] rowmass = null;
+	
+	/** The rowdist. */
+	private double[] rowdist = null;
+	
+	/** The rowinertia. */
+	private double[] rowinertia = null;
+	
+	/** The colmass. */
+	private double[] colmass = null;
+	
+	/** The coldist. */
+	private double[] coldist = null;
+	
+	/** The colinertia. */
+	private double[] colinertia = null;
+
+	/** The rowcos2. */
+	private double[][] rowcos2 = null;
+	
+	/** The rowcontrib. */
+	private double[][] rowcontrib = null;
+	
+	/** The colcos2. */
+	private double[][] colcos2 = null;
+	
+	/** The colcontrib. */
+	private double[][] colcontrib = null;
+
+	/** The rw. */
+	private final RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+	
+	/** The symbol. */
+	private final String symbol = QuantitativeDataStructureImpl.createSymbole(FactoMineRCA.class);
+
+	/** The rowscoords. */
+	private double[][] rowscoords;
+
+	/** The colscoords. */
+	private double[][] colscoords;
+
+	private LexicalTable table;
+	
+	/**
+	 * Create a correspondance analysis on the given table. The correspondance
+	 * analysis is computed as soon as the object is created.
+	 *
+	 * @param table the table
+	 * @throws StatException the stat exception
+	 */
+	public FactoMineRCA(LexicalTable table) throws StatException {
+
+		if (!rw.containsVariable(table.getSymbol())) {
+			throw new StatException(Messages.CA_0);
+		}
+
+		loadLibrary();
+
+		this.table = table;
+		try {
+			//rw.callFunctionAndAffect("FactoMineR:CA", new String[] { table.getSymbol() }, symbol); //$NON-NLS-1$
+			rw.eval(symbol+" <- FactoMineR::CA("+table.getSymbol()+", graph=FALSE)"); //$NON-NLS-1$ //$NON-NLS-2$
+		} catch (RWorkspaceException e) {
+			throw new StatException(Messages.CA_2 + e.getMessage(), e);
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getColContrib()
+	 */
+	@Override
+	public double[][] getColContrib() throws StatException {
+		if (colcontrib == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "col$contrib"); //$NON-NLS-1$
+				colcontrib = sv.asDoubleMatrix();
+				// Arrays.sort(rowdist);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.FactoMineRCA_2 + e.getMessage(), e);
+			} catch (REXPMismatchException e) {
+				// TODO Auto-generated catch block
+				org.txm.utils.logger.Log.printStackTrace(e);
+			}
+		}
+		return colcontrib;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getColCos2()
+	 */
+	@Override
+	public double[][] getColCos2() throws StatException {
+		if (colcos2 == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "col$cos2"); //$NON-NLS-1$
+				colcos2 = sv.asDoubleMatrix();
+				// Arrays.sort(rowdist);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.FactoMineRCA_3 + e.getMessage(), e);
+			} catch (REXPMismatchException e) {
+				// TODO Auto-generated catch block
+				org.txm.utils.logger.Log.printStackTrace(e);
+			}
+		}
+		return colcos2;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the col dist
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getColDist() throws StatException {
+		if (coldist == null) 
+		{
+			double[][] colcoords = getColsCoords();
+			coldist = new double[colcoords.length];
+			for (int i = 0; i < colcoords.length; i++)
+				for (int c = 0; c < colcoords[i].length; c++)
+					coldist[i] += Math.pow(colcoords[i][c], 2);
+		}
+		return coldist;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getColsCoords()
+	 */
+	@Override
+	public double[][] getColsCoords() {
+		if (colscoords == null) {
+			try {
+				REXP exp = rw.extractItemFromListByName(symbol, "col$coord"); //$NON-NLS-1$
+				colscoords = exp.asDoubleMatrix();
+
+				//System.out.println("Avant:");
+//				for (int i = 0; i < colscoords.length; i++)
+//				{
+//					for (int c = 0; c < colscoords[i].length; c++)
+//					{
+//						System.out.println(" "+colscoords[i][c]);
+//					}
+//					System.out.println();
+//				}
+				
+				// multiply coords by sv
+//				this.getSingularValues();
+//				for (int i = 0; i < colscoords.length; i++)
+//					for (int c = 0; c < colscoords[i].length; c++)
+//						colscoords[i][c] = colscoords[i][c] * singularValues[c];
+//				
+//				System.out.println("Apres:");
+//				for (int i = 0; i < colscoords.length; i++)
+//				{
+//					for (int c = 0; c < colscoords[i].length; c++)
+//					{
+//						System.out.println(" "+colscoords[i][c]);
+//					}
+//					System.out.println();
+//				}
+						
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				org.txm.utils.logger.Log.printStackTrace(e);
+			}
+		}
+		return colscoords;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the cols inertia
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getColsInertia() throws StatException {
+		if (colinertia == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "col$contrib"); //$NON-NLS-1$
+				colinertia = RWorkspace.toDouble(sv);
+				// Arrays.sort(colinertia);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return colinertia;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the cols mass
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getColsMass() throws StatException {
+		if (colmass == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "call$marge.col"); //$NON-NLS-1$
+				colmass = RWorkspace.toDouble(sv);
+				// Arrays.sort(colmass);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return colmass;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getRowContrib()
+	 */
+	@Override
+	public double[][] getRowContrib() throws StatException {
+		//System.out.println("FACTO: getRowContrib");
+		if (rowcontrib == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "row$contrib"); //$NON-NLS-1$
+				rowcontrib = sv.asDoubleMatrix();
+				for (int i = 0 ; i < rowcontrib.length ; i++)
+					for (int j = 0 ; j < rowcontrib[i].length ; j++)
+						rowcontrib[i][j] = rowcontrib[i][j] / 100.0; 
+				// Arrays.sort(rowdist);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.FactoMineRCA_4 + e.getMessage(), e);
+			} catch (REXPMismatchException e) {
+				// TODO Auto-generated catch block
+				org.txm.utils.logger.Log.printStackTrace(e);
+			}
+		}
+		return rowcontrib;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getRowCos2()
+	 */
+	@Override
+	public double[][] getRowCos2() throws StatException {
+		if (rowcos2 == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "row$cos2"); //$NON-NLS-1$
+				rowcos2 = sv.asDoubleMatrix();
+				// Arrays.sort(rowdist);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.FactoMineRCA_5 + e.getMessage(), e);
+			} catch (REXPMismatchException e) {
+				// TODO Auto-generated catch block
+				org.txm.utils.logger.Log.printStackTrace(e);
+			}
+		}
+		return rowcos2;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the row dist
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getRowDist() throws StatException {
+		if (rowdist == null)
+		{
+			double[][] rowcoords = getRowsCoords();
+			rowdist = new double[rowcoords.length];
+			for (int i = 0; i < rowcoords.length; i++)
+				for (int c = 0; c < rowcoords[i].length; c++)
+					rowdist[i] += Math.pow(rowcoords[i][c], 2);
+		}
+		return rowdist;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getRowsCoords()
+	 */
+	@Override
+	public double[][] getRowsCoords() {
+		if (rowscoords == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "row$coord"); //$NON-NLS-1$
+				rowscoords = sv.asDoubleMatrix();
+				
+//				this.getSingularValues();
+//				//System.out.println("Apres:");
+//				for (int i = 0; i < rowscoords.length; i++)
+//				{
+//					for (int c = 0; c < rowscoords[i].length; c++)
+//					{
+//						rowscoords[i][c] = rowscoords[i][c] * singularValues[c];
+//				//		System.out.println(" "+rowscoords[i][c]);
+//					}
+//					//System.out.println();
+//				}
+						
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				org.txm.utils.logger.Log.printStackTrace(e);
+			}
+		}
+		return rowscoords;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the rows inertia
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getRowsInertia() throws StatException {
+		if (rowinertia == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "row$contrib"); //$NON-NLS-1$
+				rowinertia = RWorkspace.toDouble(sv);
+				// Arrays.sort(rowinertia);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return rowinertia;
+	}
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the rows mass
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getRowsMass() throws StatException {
+		if (rowmass == null) {
+			try {
+				REXP sv = rw.extractItemFromListByName(symbol, "call$marge.row"); //$NON-NLS-1$
+				rowmass = RWorkspace.toDouble(sv);
+				// Arrays.sort(rowmass);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return rowmass;
+	}
+
+	/**
+	 * Get the singular values.
+	 *
+	 * @return the singular values
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getSingularValues() throws StatException {
+		if (singularValues == null) {
+			getValeursPropres();
+			singularValues = new double[valeursPropres.length];
+			for(int i = 0 ; i < valeursPropres.length ; i++)
+				singularValues[i] = Math.pow(valeursPropres[i], 0.5);
+		}
+		return singularValues;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#getSymbol()
+	 */
+	@Override
+	public String getSymbol() {
+		return symbol;
+	}
+
+	/**
+	 * Gets the valeurs propres.
+	 *
+	 * @return the singular values pow 2
+	 * @throws StatException the stat exception
+	 */
+	@Override
+	public double[] getValeursPropres() throws StatException {
+		if (valeursPropres == null) {
+			try {
+				REXP sv = rw.eval(symbol+"$eig$eigenvalue"); //$NON-NLS-1$
+				valeursPropres = RWorkspace.toDouble(sv);
+				// remove last singular value
+				if (valeursPropres.length == table.getNColumns())
+					valeursPropres = Arrays.copyOfRange(valeursPropres, 0, valeursPropres.length -1);
+				// Arrays.sort(singularValues);
+			} catch (RWorkspaceException e) {
+				throw new StatException(Messages.CA_4 + e.getMessage(), e);
+			}
+		}
+		return valeursPropres;
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.stat.engine.r.function.ICA#loadLibrary()
+	 */
+	@Override
+	public boolean loadLibrary(){
+		try {
+			rw.voidEval("library(FactoMineR)"); //$NON-NLS-1$
+		} catch (RWorkspaceException e) {
+			System.out.println(Messages.CA_16+ e);
+			return false;
+		}
+		return true;
+	}
+
+
+	/**
+	 * Draw in the given file a plot of the factorial map.
+	 *
+	 * @param file the file
+	 * @param encoding the encoding
+	 * @param colseparator the colseparator
+	 * @param txtseparator the txtseparator
+	 * @return true, if successful
+	 */
+	@Override
+	public boolean toTxt(File file, String encoding, String colseparator, String txtseparator) {
+		try {
+			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+			rw.eval("sink(file=\"" + file.getAbsolutePath().replace("\\", "\\\\")+"\")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+			rw.eval("print("+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			rw.eval("print("+symbol+"$eig)"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			rw.eval("print("+symbol+"$col)"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			rw.eval("print("+symbol+"$col$coord)"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			rw.eval("print("+symbol+"$col$cos2)"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			rw.eval("print("+symbol+"$col$contrib)"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			rw.eval("print("+symbol+"$row)"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			rw.eval("print("+symbol+"$row$coord)"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			rw.eval("print("+symbol+"$row$cos2)"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			rw.eval("print("+symbol+"$row$contrib)"); //$NON-NLS-1$ //$NON-NLS-2$
+//			rw.eval("print("+symbol+"$call)"); //$NON-NLS-1$ //$NON-NLS-2$
+//			rw.eval("print("+symbol+"$call$marge.col)"); //$NON-NLS-1$ //$NON-NLS-2$
+//			rw.eval("print("+symbol+"$call$marge.row)"); //$NON-NLS-1$ //$NON-NLS-2$
+			rw.eval("sink()"); //$NON-NLS-1$
+		} catch (StatException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+		return true;
+	}
+	
+	
+	@Override
+	public int getRowsCount() {
+		return this.table.getRowsCount();
+	}
+
+	@Override
+	public int getColumnsCount() {
+		return this.table.getColumnsCount();
+	}
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/FactoMineRCA.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/ICA.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/ICA.java	(revision 0)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/ICA.java	(revision 136)
@@ -0,0 +1,191 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.ca.core.statsengine.r.functions;
+
+import java.io.File;
+
+import org.txm.stat.StatException;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Interface ICA.
+ */
+public interface ICA {
+	
+	/**
+	 * Gets the col contrib.
+	 *
+	 * @return the col contrib
+	 * @throws StatException the stat exception
+	 */
+	public double[][] getColContrib() throws StatException;
+
+	/**
+	 * Gets the col cos2.
+	 *
+	 * @return the col cos2
+	 * @throws StatException the stat exception
+	 */
+	public double[][] getColCos2() throws StatException;
+
+	/**
+	 * Gets the col dist.
+	 *
+	 * @return the col dist
+	 * @throws StatException the stat exception
+	 */
+	public double[] getColDist() throws StatException;
+
+	/**
+	 * Gets the cols coords.
+	 *
+	 * @return the cols coords
+	 */
+	public double[][] getColsCoords();
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the cols inertia
+	 * @throws StatException the stat exception
+	 */
+	public double[] getColsInertia() throws StatException;
+
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the cols mass
+	 * @throws StatException the stat exception
+	 */
+	public double[] getColsMass() throws StatException;
+
+	/**
+	 * Gets the row contrib.
+	 *
+	 * @return the row contrib
+	 * @throws StatException the stat exception
+	 */
+	public double[][] getRowContrib() throws StatException;
+
+	/**
+	 * Gets the row cos2.
+	 *
+	 * @return the row cos2
+	 * @throws StatException the stat exception
+	 */
+	public double[][] getRowCos2() throws StatException;
+	
+	/**
+	 * Gets the row dist.
+	 *
+	 * @return the row dist
+	 * @throws StatException the stat exception
+	 */
+	public double[] getRowDist() throws StatException;
+	
+	/**
+	 * Gets the rows coords.
+	 *
+	 * @return the rows coords
+	 */
+	public double[][] getRowsCoords();
+	
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the rows inertia
+	 * @throws StatException the stat exception
+	 */
+	public double[] getRowsInertia() throws StatException;
+	
+	/**
+	 * Get the rows mass.
+	 *
+	 * @return the rows mass
+	 * @throws StatException the stat exception
+	 */
+	public double[] getRowsMass() throws StatException;
+	
+	/**
+	 * Get the singular values.
+	 *
+	 * @return the singular values
+	 * @throws StatException the stat exception
+	 */
+	public double[] getSingularValues() throws StatException;
+	
+	
+	/**
+	 * Gets the number of rows.
+	 * @return the number of rows
+	 */
+	public int getRowsCount();
+
+	
+	/**
+	 * Gets the number of columns.
+	 * @return the number of columns
+	 */
+	public int getColumnsCount();
+
+	
+	/**
+	 * Gets the symbol.
+	 *
+	 * @return the symbol
+	 */
+	public String getSymbol();
+
+	/**
+	 * Gets the valeurs propres.
+	 *
+	 * @return the valeurs propres
+	 * @throws StatException the stat exception
+	 */
+	public double[] getValeursPropres() throws StatException;
+
+	/**
+	 * Load library.
+	 *
+	 * @return true, if successful
+	 */
+	public boolean loadLibrary();
+
+
+
+	/**
+	 * Draw in the given file a plot of the factorial map.
+	 *
+	 * @param file the file
+	 * @param encoding the encoding
+	 * @param colseparator the colseparator
+	 * @param txtseparator the txtseparator
+	 * @return true, if successful
+	 */
+	public boolean toTxt(File file, String encoding, String colseparator, String txtseparator);
+}

Property changes on: tmp/org.txm.ca.core/src/org/txm/ca/core/statsengine/r/functions/ICA.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.ca.core/build.properties
===================================================================
--- tmp/org.txm.ca.core/build.properties	(revision 0)
+++ tmp/org.txm.ca.core/build.properties	(revision 136)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

Property changes on: tmp/org.txm.ca.core/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

