Index: tmp/org.txm.wordcloud.core/.project
===================================================================
--- tmp/org.txm.wordcloud.core/.project	(revision 0)
+++ tmp/org.txm.wordcloud.core/.project	(revision 88)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.wordcloud.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.wordcloud.core/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/messages/messages.properties
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/messages/messages.properties	(revision 0)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/messages/messages.properties	(revision 88)
@@ -0,0 +1,11 @@
+ComputeWordCloud_3=The {0} R package was not installed. Reason: {1}.
+ComputeWordCloud_7=Operation canceled by user.
+Log_Aborting=Aborting WordCloud.
+Log_Could_not_install_R_package=Could not install the {0} package.
+Log_Installing_R_package=Installing {0} R package...
+Log_Loading_R_package=Loading package:
+Log_R_Packages_installation_failed=The necessary R packages have not been installed properly, it is not possible to complete the installation of the WordCloud command.\nSee instructions at https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud 
+Log_R_Packages_loaded=R packages loaded. Now running WordCloud.
+Log_Stats_Engine_not_ready=StatEngine is not ready. Canceling command.
+StatusBar_Opening_result=Opening WordCloud results.
+WordCloudTitle=WordCloud
\ No newline at end of file

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

Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/messages/TBXWordCloudMessages.java
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/messages/TBXWordCloudMessages.java	(revision 0)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/messages/TBXWordCloudMessages.java	(revision 88)
@@ -0,0 +1,28 @@
+package org.txm.wordcloud.core.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class TBXWordCloudMessages extends NLS {
+	
+	private static final String BUNDLE_NAME = "org.txm.wordcloud.core.messages.messages"; //$NON-NLS-1$
+
+	public static String ComputeWordCloud_3;
+	public static String ComputeWordCloud_7;
+	public static String Log_Aborting;
+	public static String Log_Could_not_install_R_package;
+	public static String Log_Installing_R_package;
+	public static String Log_Loading_R_package;
+	public static String Log_R_Packages_installation_failed;
+	public static String Log_R_Packages_loaded;
+	public static String Log_Stats_Engine_not_ready;
+	public static String StatusBar_Opening_result;
+	public static String WordCloudTitle;
+
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(BUNDLE_NAME, TBXWordCloudMessages.class);
+	}
+
+	private TBXWordCloudMessages() {
+	}
+}

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

Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/messages/messages_fr.properties	(revision 0)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/messages/messages_fr.properties	(revision 88)
@@ -0,0 +1,11 @@
+ComputeWordCloud_6=Echec de l'installation du package {0}.
+ComputeWordCloud_7=Annulation par l'utilisateur.
+Log_Aborting=Abandon du calcul.
+Log_Could_not_install_R_package=Le package R {0} n'a pas pu �tre install�. Raison : {1}. 
+Log_Installing_R_package=Installation du package R {0}...
+Log_Loading_R_package=Chargement du package : 
+Log_R_Packages_installation_failed=Les packages n�c�ssaires au fonctionnement de la fonctionnalit� n'ont pas pu �tre install�s. Voir les instructions pour installation manuelle � l'adresse https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud
+Log_R_Packages_loaded=Les packages R ont �t� charg�s. Lancement du calcul.
+Log_Stats_Engine_not_ready=Le moteur de statistique n'est pas pr�t. Abandon.
+StatusBar_Opening_result=Ouverture du r�sultat.
+WordCloudTitle=Nuage de mots
\ No newline at end of file

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

Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java	(revision 0)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java	(revision 88)
@@ -0,0 +1,275 @@
+package org.txm.wordcloud.core.functions;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.txm.HasResults;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.functions.Function;
+import org.txm.functions.TXMResult;
+import org.txm.functions.index.Index;
+import org.txm.functions.index.Line;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Lexicon;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.query.Query;
+import org.txm.searchengine.cqp.serverException.CqiServerError;
+import org.txm.stat.engine.r.RWorkspace;
+import org.txm.stat.engine.r.RWorkspaceException;
+import org.txm.utils.logger.Log;
+import org.txm.wordcloud.core.messages.TBXWordCloudMessages;
+import org.txm.wordcloud.core.preferences.WordCloudPreferences;
+
+public class WordCloud extends Function implements TXMResult {
+	
+	//TODO: test rw.setStringEncoding("UTF-8"); // or connection
+	private int[] freqs;
+	private String[] labels;
+	private Corpus corpus;
+	private Object source;
+	
+	public WordCloud(Lexicon lex) {
+		//List<Line> lines = voc.getAllLines();
+		corpus = lex.getCorpus();
+		source = lex;
+		this.freqs = lex.getFreq();
+		this.labels = lex.getForms();
+		
+		//removeDiacritics();
+	}
+	
+//	public WordCloud(LexicalTable table) throws RWorkspaceException, REXPMismatchException {
+//		parent = table.getPartition();
+//		if (parent == null) parent = table.getCorpus();
+//		
+//		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+//		this.labels = rw.evalToString("rownames("+table.getSymbol()+")");
+//		this.freqs = rw.eval("rowSums("+table.getSymbol()+")").asIntegers();
+//		
+//		removeDiacritics();
+//	}
+
+	/**
+	 * 
+	 * @param voc
+	 */
+	public WordCloud(Index voc) {
+		initWith(voc);
+		//removeDiacritics();
+	}
+	
+	/**
+	 * 
+	 * @param voc
+	 */
+	private void initWith(Index voc) {
+		corpus = voc.getCorpus();
+		source = voc;
+		List<Line> lines = voc.getAllLines();
+		this.freqs = new int[lines.size()];
+		this.labels = new String[lines.size()];
+		
+		int i = 0;
+		for (Line line : lines) {
+			freqs[i] = line.getFrequency();
+			labels[i] = line.toString("_"); //$NON-NLS-1$
+			i++;
+		}
+	}
+	
+	/**
+	 * 
+	 * @param corpus
+	 * @throws CqiClientException
+	 * @throws IOException
+	 * @throws CqiServerError
+	 */
+	public WordCloud(Corpus corpus) throws CqiClientException, IOException, CqiServerError {
+		Query query;
+		String lang = corpus.getLang();
+		if (corpus.getProperty(lang+"pos") != null) {
+			query = new Query(getQueryForLang(lang));
+		} else {
+			query = new Query("[]");
+		}
+		
+		System.out.println("Used query: "+query);
+		
+		ArrayList<Property> props = new ArrayList<Property>();
+		props.add(corpus.getProperty("word"));
+		Index voc = new Index(corpus, query, props);
+		if (!query.toString().equals("[]")) {
+			corpus.storeResult(voc);
+		}
+		List<Line> lines = voc.getAllLines();
+		if (lines != null && lines.size() > 0) {
+			this.initWith(voc);
+		} else {
+			Log.severe("Error: Could not build a  word selection with this corpus");
+			throw new IllegalArgumentException("Error: Index failed with corpus "+corpus+" with lang "+lang+" and query "+query);
+		}
+		
+	}
+	
+//	public WordCloud(QueryIndex qindex) {
+//		parent = qindex.getCorpus();
+//		source = qindex;
+//		Collection<QueryIndexLine> lines = qindex.getLines();
+//		this.freqs = new int[lines.size()];
+//		this.labels = new String[lines.size()];
+//		
+//		int i = 0;
+//		for (QueryIndexLine line : lines) {
+//			freqs[i] = line.getFrequency();
+//			labels[i] = line.getName();
+//		}
+//		//removeDiacritics();
+//	}
+	
+	
+	
+	private String getQueryForLang(String lang) {
+		if ("fr".equals(lang)) {
+			return "[frpos=\"NOM|NAM|ADJ|VER.*\"  & frlemma!=\"être|avoir|faire|pouvoir|devoir|vouloir|falloir|aller|dire|savoir\"]"; // requete de Serge pour le français TT
+		} else if ("en".equals(lang)) {
+			return "[enpos=\"N.*|JJ.*|V.*\"  & enlemma!=\"be|have|do|say|go|make|other\"]"; // requete de Serge pour l'anglais TT
+		} else {
+			return ".*";
+		}
+	}
+	
+	public Corpus getCorpus() {
+		return corpus;
+	}
+	
+	public Object getSource() {
+		return source;
+	}
+	
+	private void removeDiacritics() {
+		//for (int i = 0; i < labels.length ; i++)
+		//	labels[i] = AsciiUtils.convertNonAscii(labels[i]);
+	}
+
+	/**
+	 * 
+	 * @return
+	 */
+	public String getName() {
+		return "WordCloud (" + TXMPreferences.getInt(WordCloudPreferences.PREFERENCES_NODE, this, WordCloudPreferences.FMIN)
+				+ " / "
+				+ TXMPreferences.getInt(WordCloudPreferences.PREFERENCES_NODE, this, WordCloudPreferences.MAX_WORDS)
+				+ ")";
+	}
+	
+
+	
+	/**
+	 * Check and init R packages.
+	 * @return
+	 */
+	// FIXME: to factorize and move to RWorkspace 
+	public static boolean initPackages()	{
+		String[] packages = {"Rcpp", "RColorBrewer", "wordcloud"}; //$NON-NLS-1$ //$NON-NLS-2$
+		try {
+			if (!loadAndInstallNeededPackages(RWorkspace.getRWorkspaceInstance(), packages)) {
+				System.out.println(TBXWordCloudMessages.Log_Aborting);
+				return false;
+			}
+		} catch (RWorkspaceException e) {
+			System.out.println(TBXWordCloudMessages.Log_Stats_Engine_not_ready);
+			Log.printStackTrace(e);
+			return false;
+		}
+		return true;
+	}
+	
+
+
+	
+	/**
+	 * 
+	 * @param rw
+	 * @param packages
+	 * @return
+	 */
+	// FIXME: to factorize and move to RWorkspace
+	public static boolean loadAndInstallNeededPackages(RWorkspace rw, String[] packages) {
+		boolean installFailed = false;
+		for (String p : packages) {
+			try {
+				Log.severe(TBXWordCloudMessages.bind(TBXWordCloudMessages.Log_Loading_R_package, p));
+				loadPackage(rw, p);
+			} catch(Exception e) {
+				//Log.severe(Messages.bind(Messages.ComputeWordCloud_3,p,e));
+				System.out.println(TBXWordCloudMessages.bind(TBXWordCloudMessages.Log_Installing_R_package, p));
+				try {
+					rw.eval("install.packages(\""+p+"\", dependencies=TRUE, repos=\"http://cran.rstudio.com\");"); //$NON-NLS-1$ //$NON-NLS-2$
+					rw.eval("library(\""+p+"\")"); //$NON-NLS-1$ //$NON-NLS-2$
+				} catch(Exception e2) {
+					System.out.println(TBXWordCloudMessages.bind(TBXWordCloudMessages.Log_Could_not_install_R_package, p));
+					Log.printStackTrace(e2);
+					installFailed = true;
+				}
+			}
+		}
+
+		if (installFailed) {
+			System.out.println(TBXWordCloudMessages.Log_R_Packages_installation_failed);
+			return false;
+		} else {
+			Log.info(TBXWordCloudMessages.Log_R_Packages_loaded);
+			return true;
+		}
+	}
+	
+	/**
+	 * 
+	 * @param rw
+	 * @param p
+	 * @throws RWorkspaceException
+	 */
+	// FIXME: to factorize and move to RWorkspace
+	public static void loadPackage(RWorkspace rw, String p) throws RWorkspaceException {
+		rw.eval("library(\""+p+"\")"); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/**
+	 * @return the freqs
+	 */
+	public int[] getFreqs() {
+		return freqs;
+	}
+
+	/**
+	 * @return the labels
+	 */
+	public String[] getLabels() {
+		return labels;
+	}
+
+	@Override
+	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public void clean() {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public boolean delete() {
+		return this.corpus.removeResult(this);
+	}
+
+	@Override
+	public HasResults getParent() {
+		return this.corpus;
+	}
+}

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

Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/chartsengine/jfreechart/JFCWordCloudChartCreator.java
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/chartsengine/jfreechart/JFCWordCloudChartCreator.java	(revision 0)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/chartsengine/jfreechart/JFCWordCloudChartCreator.java	(revision 88)
@@ -0,0 +1,75 @@
+package org.txm.wordcloud.core.chartsengine.jfreechart;
+
+import org.jfree.chart.JFreeChart;
+import org.jfree.data.xy.XYSeriesCollection;
+import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
+import org.txm.wordcloud.core.functions.WordCloud;
+
+public class JFCWordCloudChartCreator extends JFCChartCreator {
+
+	public JFCWordCloudChartCreator() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public JFreeChart createChart(Object resultData, String preferencesNode) {
+
+		// TODO Auto-generated method stub
+		System.err.println("JFCWordCloudChartCreator.createChart(): Not yet implemented");
+		
+		WordCloud wordCloud = (WordCloud) resultData;
+		
+		
+		
+		JFreeChart chart = null;
+
+		XYSeriesCollection dataset = new XYSeriesCollection();
+
+//		XYSeries series = new XYSeries("test wordcloud");
+//		dataset.addSeries(series);
+
+        String[] xAxisSymbols = new String[0];
+
+
+//		for (int i = 0 ; i < 0 ; i++) {
+//			//series.add(i, Math.random());
+//
+//			// Add X axis symbol
+//			xAxisSymbols[i] = "test " + i;
+//		}
+
+		// Create chart title
+		String title = "";
+
+		// Create the chart
+        chart = this.getChartsEngine().createXYBarChart(dataset, title, "", "", false, true, false, xAxisSymbols);
+        //((IItemSelectionRenderer) chart.getXYPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_PARTITION_DIMENSIONS);
+
+        chart.getPlot().setNoDataMessage("JFCWordCloudChartCreator.createChart(): Not yet implemented in JFreeChart charts engine.");
+        
+
+        // Custom range axis for ticks drawing options
+        //chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getXYPlot().getDataset()).doubleValue()));
+
+        //this.getChartsEngine().getTheme().apply(chart);
+
+
+		return chart;
+		
+	}
+
+	@Override
+	// FIXME: to not load the chart creator, to remove when implemented 
+	public Class getChartsEngineClass() {
+		return null;
+	}
+
+
+	@Override
+	public Class getResultDataClass() {
+		return WordCloud.class;
+	}
+	
+	
+
+}

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

Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/chartsengine/r/RWordCloudChartCreator.java
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/chartsengine/r/RWordCloudChartCreator.java	(revision 0)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/chartsengine/r/RWordCloudChartCreator.java	(revision 88)
@@ -0,0 +1,106 @@
+package org.txm.wordcloud.core.chartsengine.r;
+
+import java.io.File;
+
+import org.txm.chartsengine.r.core.RChartCreator;
+import org.txm.chartsengine.r.core.RChartsEngine;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.stat.StatException;
+import org.txm.stat.engine.r.RWorkspace;
+import org.txm.stat.engine.r.RWorkspaceException;
+import org.txm.wordcloud.core.functions.WordCloud;
+import org.txm.wordcloud.core.preferences.WordCloudPreferences;
+
+public class RWordCloudChartCreator extends RChartCreator {
+
+	public RWordCloudChartCreator() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@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) {
+		
+		try {
+			WordCloud wordCloud = (WordCloud) resultData;
+			
+			
+			// parameters
+			int maxWords = TXMPreferences.getInt(preferencesNode, resultData, WordCloudPreferences.MAX_WORDS);
+			int minFreq = TXMPreferences.getInt(preferencesNode, resultData, WordCloudPreferences.FMIN);
+			float rotPer = TXMPreferences.getFloat(preferencesNode, resultData, WordCloudPreferences.ROT);
+			boolean randomOrder = TXMPreferences.getBoolean(preferencesNode, resultData, WordCloudPreferences.RANDOM_POSITION);
+			
+			
+			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+//	System.out.println("load wordcloud...");
+			rw.eval("library(wordcloud)"); //$NON-NLS-1$
+			//System.out.println("tmpfreqs...");
+			rw.addVectorToWorkspace("tmpfreqs", wordCloud.getFreqs()); //$NON-NLS-1$
+			//System.out.println("tmplabels...");
+			rw.addVectorToWorkspace("tmplabels", wordCloud.getLabels()); //$NON-NLS-1$
+			
+			//wordcloud(words,freq,
+			// scale : A vector of length 2 indicating the range of the size of the words.
+			// min.freq:  words with frequency below min.freq will not be plotted
+			// max.words : Maximum number of words to be plotted. least frequent terms dropped
+			// random.order : plot words in random order. If false, they will be plotted in decreasing frequency
+			// random.color : choose colors randomly from the colors. If false, the color is chosen based on the frequency
+			// rot.per : proportion words with 90 degree rotation
+			// colors : color words from least to most frequent
+			// ordered.colors : if true, then colors are assigned to words in order
+			//System.out.println("wordcloud...");
+			String cmd = "wordcloud(tmplabels, tmpfreqs, random.color=FALSE, colors=brewer.pal(10,\"Dark2\")"; //$NON-NLS-1$
+			
+			if (randomOrder == false)
+				cmd += ", random.order=FALSE"; //$NON-NLS-1$
+			
+			if (maxWords > 0) {
+				cmd += ", max.words="+maxWords; //$NON-NLS-1$
+			} else {
+				cmd += ", max.words=Inf"; //$NON-NLS-1$
+			}
+			
+			if (minFreq > 0) {
+				cmd += ", min.freq="+minFreq; //$NON-NLS-1$
+			}
+			
+			if (rotPer >= 0 && rotPer <= 1) {
+				cmd += ", rot.per="+rotPer; //$NON-NLS-1$
+			}
+			cmd +=");"; //$NON-NLS-1$
+//System.out.println("ploting...");
+			//rw.plot(svgFile, cmd, device);
+
+			((RChartsEngine) this.chartsEngine).plot(file, cmd);
+				
+				
+				//System.out.println("cleaning");
+				rw.eval("rm(tmplabels)"); //$NON-NLS-1$
+				rw.eval("rm(tmpfreqs)"); //$NON-NLS-1$
+		}
+		catch(RWorkspaceException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		catch(StatException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		return file;
+	}
+
+	@Override
+	public Class getResultDataClass() {
+		return WordCloud.class;
+	}
+
+
+
+}

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

Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/preferences/WordCloudPreferences.java
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/preferences/WordCloudPreferences.java	(revision 0)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/preferences/WordCloudPreferences.java	(revision 88)
@@ -0,0 +1,48 @@
+package org.txm.wordcloud.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;
+
+/**
+ * Preferences initializer and manager.
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class WordCloudPreferences extends TXMPreferences {
+
+
+	// auto populate the preference node qualifier from the current bundle id
+	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(WordCloudPreferences.class).getSymbolicName();
+	
+	
+	public static final String PREFERENCES_PREFIX = "wordcloud_";
+	
+	
+	public static final String MAX_WORDS = PREFERENCES_PREFIX + "max_words"; //$NON-NLS-1$
+	public static final String FMIN = PREFERENCES_PREFIX + "f_min"; //$NON-NLS-1$
+	public static final String ROT = PREFERENCES_PREFIX + "rotation_percent"; //$NON-NLS-1$
+	public static final String RANDOM_POSITION = PREFERENCES_PREFIX + "random_positions"; //$NON-NLS-1$
+	
+	
+	public WordCloudPreferences() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public void initializeDefaultPreferences() {
+	
+		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
+		preferences.putInt(MAX_WORDS, 50);
+		preferences.putInt(FMIN, 20);
+		preferences.putInt(ROT, 10);
+		preferences.putBoolean(RANDOM_POSITION, false);
+
+		// shared charts rendering preferences
+		super.initializeChartsEngineSharedPreferences(preferences);
+	}
+	
+}

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

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

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

Index: tmp/org.txm.wordcloud.core/plugin.xml
===================================================================
--- tmp/org.txm.wordcloud.core/plugin.xml	(revision 0)
+++ tmp/org.txm.wordcloud.core/plugin.xml	(revision 88)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.txm.chartsengine.chartcreator">
+      <ChartCreator
+            chartsEngineName="TMP_jfreechart_charts_engine"
+            class="org.txm.wordcloud.core.chartsengine.jfreechart.JFCWordCloudChartCreator"
+            fileNamePrefix="wordcloud">
+      </ChartCreator>
+      <ChartCreator
+            chartsEngineName="r_charts_engine"
+            class="org.txm.wordcloud.core.chartsengine.r.RWordCloudChartCreator"
+            fileNamePrefix="wordcloud">
+      </ChartCreator>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.txm.wordcloud.core.preferences.WordCloudPreferences">
+      </initializer>
+   </extension>
+
+</plugin>

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

Index: tmp/org.txm.wordcloud.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.wordcloud.core/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.wordcloud.core/.settings/org.eclipse.jdt.core.prefs	(revision 88)
@@ -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.wordcloud.core/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.core/.classpath
===================================================================
--- tmp/org.txm.wordcloud.core/.classpath	(revision 0)
+++ tmp/org.txm.wordcloud.core/.classpath	(revision 88)
@@ -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.wordcloud.core/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.wordcloud.core/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.wordcloud.core/META-INF/MANIFEST.MF	(revision 88)
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: WordCloud TBX
+Bundle-SymbolicName: org.txm.wordcloud.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.10.0",
+ org.txm.core;bundle-version="0.7.0",
+ org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0",
+ org.txm.chartsengine.r.core;bundle-version="1.0.0"
+Export-Package: org.txm.wordcloud.core.chartsengine.jfreechart,
+ org.txm.wordcloud.core.chartsengine.r,
+ org.txm.wordcloud.core.functions,
+ org.txm.wordcloud.core.messages,
+ org.txm.wordcloud.core.preferences
+Import-Package: org.txm.chartsengine.core
+Bundle-Vendor: TXM

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

Index: tmp/org.txm.wordcloud.feature/.project
===================================================================
--- tmp/org.txm.wordcloud.feature/.project	(revision 0)
+++ tmp/org.txm.wordcloud.feature/.project	(revision 88)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.wordcloud.feature</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.FeatureBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.FeatureNature</nature>
+	</natures>
+</projectDescription>

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

Index: tmp/org.txm.wordcloud.feature/build.properties
===================================================================
--- tmp/org.txm.wordcloud.feature/build.properties	(revision 0)
+++ tmp/org.txm.wordcloud.feature/build.properties	(revision 88)
@@ -0,0 +1 @@
+bin.includes = feature.xml

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

Index: tmp/org.txm.wordcloud.feature/feature.xml
===================================================================
--- tmp/org.txm.wordcloud.feature/feature.xml	(revision 0)
+++ tmp/org.txm.wordcloud.feature/feature.xml	(revision 88)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="WordCloudFeature"
+      label="WordCloud"
+      version="1.0.0.qualifier">
+
+   <description url="http://www.example.com/description">
+      Additional WordCloud command to build a visual representation of a hierarchical index or lexicon as a cloud of words.
+   </description>
+
+   <copyright url="http://www.example.com/copyright">
+      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
+   </copyright>
+
+   <license url="">
+      &lt;TXM Software User Agreement&gt;
+
+TXM 0.7.8 Copyright © 2010-2016 ENS de Lyon, University of Franche-Comté, CNRS
+
+&lt;English version below&gt;
+
+EN ACCEPTANT CETTE MISE À JOUR ET EN UTILISANT TXM, VOUS VOUS ENGAGEZ À CITER L&apos;ARTICLE DE RÉFÉRENCE DE LA PLATEFORME* DANS VOS PUBLICATIONS DE RÉSULTATS OBTENUS À PARTIR D&apos;ELLE. CELA EST ESSENTIEL POUR NOUS PERMETTRE DE JUSTIFIER LE BESOIN DE PÉRENNISATION DE CET INSTRUMENT DE TRAVAIL POUR LA COMMUNAUTÉ SCIENTIFIQUE.
+
+Le logiciel TXM est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier suivant les termes de la Licence publique générale GNU telle que publiée par la Free Software Foundation, soit la version 2 de cette License, soit une version ultérieure.
+
+Le logiciel TXM est distribué dans l&apos;espoir qu&apos;il sera utile, mais sans aucune garantie, y compris mais non de façon limitative les garanties implicites de qualité marchande et de convenance à un usage particulier. Consultez la version 2 et la version 3 de la Licence publique générale GNU pour plus de détails.
+
+Vous devriez avoir reçu une copie de la Licence publique générale GNU en accompagnement du logiciel TXM ; si ce n&apos;est pas le cas, veuillez consulter la page http://www.gnu.org/licenses/gpl-2.0.html.
+_______________
+* Serge Heiden, Jean-Philippe Magué, Bénédicte Pincemin.
+TXM : Une plateforme logicielle open-source pour la textométrie - conception et développement. Sergio Bolasco, Isabella Chiari, Luca Giuliano. 10th International Conference on the Statistical Analysis of Textual Data - JADT 2010, Jun 2010, Rome, Italie.
+Edizioni Universitarie di Lettere Economia Diritto, 2 (3), pp.1021-1032, 2010. &lt;halshs-00549779&gt;
+
+
+ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH
+
+
+By accepting this update and by using TXM, you agree to cite the TXM platform reference article** in your publications of results obtained from it. That is essential for us to justify the need for sustainability of this instrument for the scientific community.
+
+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/gpl-2.0.html.
+_______________
+** Serge Heiden. The TXM Platform: Building Open-Source Textual
+Analysis Software Compatible with the TEI Encoding Scheme. Ryo Otoguro, Kiyoshi Ishikawa, Hiroshi Umemoto, Kei Yoshimoto and Yasunari Harada. 24th Pacific Asia Conference on Language, Information and Computation, Nov 2010, Sendai, Japan. Institute for Digital Enhancement of Cognitive Development, Waseda University, pp.389-398, 2010. &lt;halshs-00549764&gt;
+   </license>
+
+   <requires>
+      <import plugin="org.eclipse.core.runtime"/>
+      <import plugin="org.eclipse.ui"/>
+      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.rcp" version="0.7.5" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.core.expressions" version="3.4.500" match="greaterOrEqual"/>
+      <import plugin="org.txm.wordcloud.rcp"/>
+      <import plugin="org.txm.wordcloud.tbx"/>
+   </requires>
+
+   <plugin
+         id="WordCloudRCP"
+         download-size="0"
+         install-size="0"
+         version="1.0.0.qualifier"
+         unpack="false"/>
+
+</feature>

Property changes on: tmp/org.txm.wordcloud.feature/feature.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/src/synopticeditor/messages_fr.properties
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/synopticeditor/messages_fr.properties	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/synopticeditor/messages_fr.properties	(revision 88)
@@ -0,0 +1,34 @@
+BackToText_0=Ouverture avec la premi�re �dition (pas de d�faut) : 
+BackToText_1=Abandon : la s�lection courante n''est pas une ligne de concordance : 
+BackToText_2=Abandon : erreur de s�lection
+BackToText_3=Abandon : erreur pendant la r�cup�ration des identifiants de mot.
+BackToText_4=Pas d'�dition disponible.
+BackToText_5=Ouverture de l'�dition par d�faut : 
+EditionPanel_0=Pas d''�dition trouv�e pour le texte : 
+EditionPanel_1=�chec de la r�cup�ration de la premi�re page d'�dition
+EditionPanel_2=\ pour le texte  
+EditionPanel_5=\ �dition=
+EditionPanel_6=Pas d''�dition nomm�e   
+EditionPanel_7=\ disponible pour le texte  
+EditionSelectorDialog_0=�ditions
+EditionSelectorDialog_1=S�lectionner une ou plusieurs �ditions.
+OpenEdition_0=Ouverture avec la premi�re �dition (pas de d�faut) : 
+OpenEdition_1=Pas d'�dition disponible.
+OpenEdition_10=Erreur lors de l''ouverture de l''�diteur : 
+OpenEdition_2=Pas d''�dition trouv�e 
+OpenEdition_3=Ouverture de l'�dition par d�faut : 
+OpenEdition_4=Erreur lors de l''ouverture de l''�dition : 
+OpenEdition_7=\ dans le corpus
+OpenEdition_9=Abandon : la s�lection n''est pas un corpus
+SynopticEditionEditor_0=Premier texte du corpus
+SynopticEditionEditor_1=Texte pr�c�dent
+SynopticEditionEditor_10=Texte suivant
+SynopticEditionEditor_11=Dernier texte du corpus
+SynopticEditionEditor_2=�ditions...
+SynopticEditionEditor_3=Premi�re page du texte
+SynopticEditionEditor_4=Page pr�c�dente
+SynopticEditionEditor_5=Pas d''�dition trouv�e 
+SynopticEditionEditor_6=Erreur lors de la r�cup�ration des �ditions disponibles : 
+SynopticEditionEditor_7=Page suivante
+SynopticEditionEditor_8=Derni�re page du texte
+SynopticEditionEditor_9=Attention: �chec de la r�cup�ration de l''�dition  
\ No newline at end of file

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

Index: tmp/org.txm.synopticeditor.rcp/src/synopticeditor/Activator.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/synopticeditor/Activator.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/synopticeditor/Activator.java	(revision 88)
@@ -0,0 +1,50 @@
+package synopticeditor;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "SynopticEditor"; //$NON-NLS-1$
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+}

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

Index: tmp/org.txm.synopticeditor.rcp/src/synopticeditor/SynopticMessages.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/synopticeditor/SynopticMessages.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/synopticeditor/SynopticMessages.java	(revision 88)
@@ -0,0 +1,48 @@
+package synopticeditor;
+
+import org.eclipse.osgi.util.NLS;
+
+public class SynopticMessages extends NLS {
+	private static final String BUNDLE_NAME = "synopticeditor.messages"; //$NON-NLS-1$
+	public static String BackToText_0;
+	public static String BackToText_1;
+	public static String BackToText_2;
+	public static String BackToText_3;
+	public static String BackToText_4;
+	public static String BackToText_5;
+	public static String EditionPanel_0;
+	public static String EditionPanel_1;
+	public static String EditionPanel_2;
+	public static String EditionPanel_5;
+	public static String EditionPanel_6;
+	public static String EditionPanel_7;
+	public static String EditionSelectorDialog_0;
+	public static String EditionSelectorDialog_1;
+	public static String OpenEdition_0;
+	public static String OpenEdition_1;
+	public static String OpenEdition_10;
+	public static String OpenEdition_2;
+	public static String OpenEdition_3;
+	public static String OpenEdition_4;
+	public static String OpenEdition_7;
+	public static String OpenEdition_9;
+	public static String SynopticEditionEditor_0;
+	public static String SynopticEditionEditor_1;
+	public static String SynopticEditionEditor_10;
+	public static String SynopticEditionEditor_11;
+	public static String SynopticEditionEditor_2;
+	public static String SynopticEditionEditor_3;
+	public static String SynopticEditionEditor_4;
+	public static String SynopticEditionEditor_5;
+	public static String SynopticEditionEditor_6;
+	public static String SynopticEditionEditor_7;
+	public static String SynopticEditionEditor_8;
+	public static String SynopticEditionEditor_9;
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(BUNDLE_NAME, SynopticMessages.class);
+	}
+
+	private SynopticMessages() {
+	}
+}

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

Index: tmp/org.txm.synopticeditor.rcp/src/synopticeditor/messages.properties
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/synopticeditor/messages.properties	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/synopticeditor/messages.properties	(revision 88)
@@ -0,0 +1,34 @@
+BackToText_0=Opening with first edition (no default edition set): 
+BackToText_1=Aborting: selection is not a concordance line: 
+BackToText_2=Aborting: error during selection.
+BackToText_3=Error: could not retrieve line word ids. Aborting back to text.
+BackToText_4=No edition to open.
+BackToText_5=Opening default editions: 
+EditionPanel_0=No edition found for text=
+EditionPanel_1=Fail to retrieve first page of edition 
+EditionPanel_2=\ and text 
+EditionPanel_5=\ edition=
+EditionPanel_6=No edition with name 
+EditionPanel_7=\ available for text 
+EditionSelectorDialog_0=Editions
+EditionSelectorDialog_1=Select one or more editions
+OpenEdition_0=Opening with first edition (no default edition set): 
+OpenEdition_1=No edition to open.
+OpenEdition_10=Error while opening editor: 
+OpenEdition_2=No edition found
+OpenEdition_3=Opening default editions: 
+OpenEdition_4=Error while opening edition: 
+OpenEdition_7=\ in the corpus
+OpenEdition_9=Aborting: selection is not a corpus
+SynopticEditionEditor_0=First text of the corpus
+SynopticEditionEditor_1=Previous text
+SynopticEditionEditor_10=Next text
+SynopticEditionEditor_11=Last text of the corpus
+SynopticEditionEditor_2=Editions...
+SynopticEditionEditor_3=First page of the text
+SynopticEditionEditor_4=Previous page
+SynopticEditionEditor_5=No edition found
+SynopticEditionEditor_6=Error while getting available editions: 
+SynopticEditionEditor_7=Next page
+SynopticEditionEditor_8=Last page of the text
+SynopticEditionEditor_9=Warning: could not find edition for name: 
\ No newline at end of file

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

Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/commands/BackToText.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/commands/BackToText.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/commands/BackToText.java	(revision 88)
@@ -0,0 +1,268 @@
+// 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.rcp.synoptic.commands;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+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.functions.concordances.Concordance;
+import org.txm.functions.concordances.Line;
+import org.txm.objects.Text;
+import org.txm.rcp.synoptic.editor.EditionPanel.RGBA;
+import org.txm.rcp.synoptic.editor.SynopticEditionEditor;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.rcpapplication.commands.BackToTextCommand;
+import org.txm.rcpapplication.editors.concordances.ConcordancesEditor;
+import org.txm.rcpapplication.utils.SWTEditorsUtils;
+import org.txm.searchengine.cqp.AbstractCqiClient;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.utils.logger.Log;
+
+import synopticeditor.SynopticMessages;
+import cern.colt.Arrays;
+
+/**
+ * Open a text edition from: a concordance Line 
+ * @author mdecorde.
+ */
+public class BackToText extends BackToTextCommand {
+
+	/** The Constant ID. */
+	public final static String ID = "org.txm.rcp.synoptic.commands.BackToText"; //$NON-NLS-1$
+	public final static RGBA lightred = new RGBA(249,208,208);
+	public final static RGBA red = new RGBA(249, 160, 160);
+	private static HashMap<ConcordancesEditor, SynopticEditionEditor> associatedEditors = new HashMap<ConcordancesEditor, SynopticEditionEditor>();
+	private static HashMap<ConcordancesEditor, List<String>> associatedEditorsPreviousOtherWordIDs = new HashMap<ConcordancesEditor, List<String>>();
+	private static HashMap<ConcordancesEditor, List<String>> associatedEditorsPreviousLineids = new HashMap<ConcordancesEditor, List<String>>();
+
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IWorkbenchWindow wb = HandlerUtil.getActiveWorkbenchWindow(event);
+		IEditorPart ieditor = wb.getActivePage().getActiveEditor();
+		if (!(ieditor instanceof ConcordancesEditor)) {
+			return null;
+		}
+		ConcordancesEditor concordanceEditor = (ConcordancesEditor)ieditor;
+		ISelection sel = wb.getSelectionService().getSelection();
+		if (sel instanceof IStructuredSelection) {
+			IStructuredSelection selection = (IStructuredSelection) sel;
+			if (selection.getFirstElement() instanceof Line) {
+				backToText(concordanceEditor, (Line)(selection.getFirstElement()));
+			} else {
+				System.out.println(SynopticMessages.BackToText_1+selection);
+			}
+		} else {
+			System.out.println(SynopticMessages.BackToText_2);
+		}
+		return null;
+	}
+
+	/**
+	 * Open edition.
+	 *
+	 * @param corpus the corpus
+	 * @return the object
+	 */
+	@Override
+	public boolean backToText(ConcordancesEditor editor, Line line) {
+		Concordance conc = line.getConcordance();
+		Corpus corpus = conc.getCorpus();
+
+		try {
+			if (line == null) return false;
+
+			StructuralUnit textS = null;
+			String textid = ""; //$NON-NLS-1$
+			String baseid = ""; //$NON-NLS-1$
+			
+			Property xProperty = corpus.getProperty("x"), yProperty, wProperty, hProperty;
+			String x="0",y="0",w="0",h="0";
+			int[] pos = null;
+			if (xProperty != null) {
+				yProperty = corpus.getProperty("y");
+				if (yProperty != null) {
+					wProperty = corpus.getProperty("w");
+					if (wProperty != null) {
+						AbstractCqiClient CQI = Toolbox.getCqiClient();
+						int[] cpos = {line.getMatch().getStart()};
+						hProperty = corpus.getProperty("h");
+						if (hProperty != null) {
+							x = CQI.cpos2Str(xProperty.getQualifiedName(), cpos)[0];
+							y = CQI.cpos2Str(yProperty.getQualifiedName(), cpos)[0];
+							w = CQI.cpos2Str(wProperty.getQualifiedName(), cpos)[0];
+							h = CQI.cpos2Str(hProperty.getQualifiedName(), cpos)[0];
+							
+							pos = new int[4];
+							pos[0] = Integer.parseInt(x);
+							pos[1] = Integer.parseInt(y);
+							pos[2] = Integer.parseInt(w);
+							pos[3] = Integer.parseInt(h);
+						}
+					}
+				}
+			}
+			
+			
+			String projectid = ""; //$NON-NLS-1$
+			try {
+				textS = corpus.getStructuralUnit("text"); //$NON-NLS-1$
+				Property textP = textS.getProperty("id"); //$NON-NLS-1$
+				textid = line.getMatch().getValueForProperty(textP);// get text via text struct property id
+			} catch (Exception e2) {
+				System.out.println("The corpus has no text_id property" + e2); //$NON-NLS-1$
+				org.txm.rcpapplication.utils.Logger.printStackTrace(e2);
+				return false;
+			}
+
+			Log.info("Loading line informations..."); //$NON-NLS-1$
+
+			SynopticEditionEditor attachedBrowserEditor = associatedEditors.get(editor);
+			if (attachedBrowserEditor!= null && attachedBrowserEditor.isDisposed()) {
+				associatedEditorsPreviousOtherWordIDs.put(editor, new ArrayList<String>());
+				associatedEditorsPreviousLineids.put(editor, new ArrayList<String>());
+			}
+			List<String> previousOtherWordIDs = associatedEditorsPreviousOtherWordIDs.get(editor);
+			List<String> previousLineids = associatedEditorsPreviousLineids.get(editor);
+			
+			if (attachedBrowserEditor == null || attachedBrowserEditor.isDisposed()) {
+				String[] editionsToOpen = OpenEdition.getDefaultEditions(corpus);
+
+				if (editionsToOpen.length == 0) { // the defaultEdition parameter is not set
+					ArrayList<String> editionNames = corpus.getEditionNames();
+					if (editionNames.size() > 0) { // use the first edition declared
+						editionsToOpen = new String[1];
+						editionsToOpen[0] = editionNames.get(0);
+						Log.info(SynopticMessages.BackToText_0+editionNames.get(0));
+					} else { // no edition in the corpus
+						Log.info(SynopticMessages.BackToText_4);
+						editionsToOpen = new String[0];
+						return false;
+					}
+				} else {
+					Log.info(SynopticMessages.BackToText_5+Arrays.toString(editionsToOpen));
+				}
+
+				attachedBrowserEditor = OpenEdition.openEdition(corpus, editionsToOpen);
+				associatedEditors.put(editor, attachedBrowserEditor);
+				SWTEditorsUtils.addEditor(editor, attachedBrowserEditor, EModelService.ABOVE);
+			}
+			
+			// remove previous highlighted words
+			if (previousOtherWordIDs != null) {
+				//System.out.println("remove previousOtherWordIDs="+previousOtherWordIDs);
+				attachedBrowserEditor.removeHighlightWordsById(lightred, previousOtherWordIDs);
+				associatedEditorsPreviousOtherWordIDs.remove(editor); // free mem
+			}
+			if (previousLineids != null) {
+				//System.out.println("remove previousLineids="+previousLineids);
+				attachedBrowserEditor.removeHighlightWordsById(red, previousLineids);
+				associatedEditorsPreviousLineids.remove(editor); // free mem
+			}
+			
+			//System.out.println("getKeywordsId from "+editor.getTopLine()+" to "+editor.getBottomLine() + 1);
+			List<String> otherWordIDs = conc.getKeywordsId(textid, editor.getTopLine(), editor.getBottomLine() + 1);
+			//System.out.println("getKeywordsId="+otherWordIDs);
+			List<String> lineids = null;
+			try {
+				lineids = line.getMatch().getValuesForProperty(corpus.getProperty("id")); //$NON-NLS-1$
+			} catch (Exception e1) {
+				org.txm.rcpapplication.utils.Logger.printStackTrace(e1);
+				return false;
+			}
+			Log.info(NLS.bind("Project id {0} Corpus (Base) id {1} Text id {2}",  //$NON-NLS-1$
+					new Object[]{projectid, baseid, textid}));
+			
+			otherWordIDs.removeAll(lineids); // remove the pivot from others words 
+			
+			Text text = corpus.getMainCorpus().getText(textid);
+			if (text == null) {
+				System.out.println(NLS.bind("BackToText: Text {0} is missing", textid)); //$NON-NLS-1$
+				StatusLine.setMessage(NLS.bind("BackToText: Text {0} is missing", textid)); //$NON-NLS-1$
+				Log.severe(NLS.bind("BackToText: Text {0} is missing", textid)); //$NON-NLS-1$
+				return false;
+			}
+
+			String line_wordid = lineids.get(0);
+			if (line_wordid == null) {
+				System.out.println(SynopticMessages.BackToText_3);
+				return false;				
+			}
+			
+			
+			String focusid = null;
+			if (lineids.size() > 0) focusid = lineids.get(0);
+				
+			//System.out.println("add otherWordIDs="+otherWordIDs);
+			attachedBrowserEditor.addHighlightWordsById(lightred, otherWordIDs);
+			
+			//System.out.println("add linesids="+lineids);
+			attachedBrowserEditor.addHighlightWordsById(red, lineids);
+			
+			associatedEditorsPreviousOtherWordIDs.put(editor, otherWordIDs);
+			associatedEditorsPreviousLineids.put(editor, lineids);
+			
+			attachedBrowserEditor.setFocusedWordID(focusid);
+			
+			HashSet<int[]> posses = new HashSet<int[]>();
+			posses.add(pos);
+			attachedBrowserEditor.setHighlightedArea(posses);
+
+			// reload the page and styles
+			attachedBrowserEditor.backToText(text, line_wordid);// open the page(S) containing the word with id=line_wordid
+			
+			IWorkbenchPage attachedPage = attachedBrowserEditor.getEditorSite().getPage();
+			attachedPage.activate(attachedBrowserEditor);
+
+			return true;
+
+		} catch (Exception err) {
+			Log.severe(NLS.bind("Full text display failed: {0}", err)); //$NON-NLS-1$
+			Log.printStackTrace(err);
+		}
+		return false;
+	}
+}

Property changes on: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/commands/BackToText.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/commands/OpenEdition.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/commands/OpenEdition.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/commands/OpenEdition.java	(revision 88)
@@ -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.rcp.synoptic.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.objects.BaseParameters;
+import org.txm.objects.Text;
+import org.txm.rcp.synoptic.editor.EditionSelectorDialog;
+import org.txm.rcp.synoptic.editor.SynopticEditionEditor;
+import org.txm.rcp.synoptic.editor.SynopticEditorInput;
+import org.txm.rcpapplication.Messages;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.searchengine.cqp.corpus.Subcorpus;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.utils.logger.Log;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import cern.colt.Arrays;
+import synopticeditor.SynopticMessages;
+// TODO: Auto-generated Javadoc
+/**
+ * Open a text edition from: a main corpus : the first text of the maincorpus a
+ * sub-corpus : the first text of the subcorpus a partition : the user must
+ * choose one of the text used in the partition @ author mdecorde.
+ */
+public class OpenEdition extends AbstractHandler {
+
+	/** The Constant ID. */
+	public final static String ID = "org.txm.rcp.synoptic.commands.OpenEdition"; //$NON-NLS-1$
+
+	/** The lastopenedfile. */
+	public static String lastopenedfile;
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		if (selection.getFirstElement() instanceof Corpus) {
+			try {
+				Corpus c = (Corpus) selection.getFirstElement();
+				Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
+
+				EditionSelectorDialog d = new EditionSelectorDialog(shell, c, null);
+				SynopticEditionEditor editor = null;
+				//				if (c.getEditionNames().size() > 1 && d.open() == Window.OK) {
+				//					Object[] rez = d.getResult();
+				//					String[] rezS = new String[rez.length];
+				//					for (int i =0 ; i < rez.length ; i++) rezS[i] = rez[i].toString();
+				//					editor = openEdition(c, rezS);
+				//				} else 
+				String[] editionsToOpen = getDefaultEditions(c);
+
+				if (editionsToOpen.length == 0) { // the defaultEdition parameter is not set
+					ArrayList<String> editionNames = c.getEditionNames();
+					if (editionNames.size() > 0) { // use the first edition declared
+						editionsToOpen = new String[1];
+						editionsToOpen[0] = editionNames.get(0);
+						Log.info(SynopticMessages.OpenEdition_0+editionNames.get(0));
+					} else { // no edition in the corpus
+						Log.info(SynopticMessages.OpenEdition_1);
+						editionsToOpen = new String[0];
+						return false;
+					}
+				} else {
+					Log.info(SynopticMessages.OpenEdition_3+Arrays.toString(editionsToOpen));
+				}
+
+				editor = openEdition(c, editionsToOpen);
+
+				if (editor != null)
+					editor.firstPage();
+
+			} catch (Exception e) {
+				System.out.println(SynopticMessages.OpenEdition_4+e);
+				org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+			}
+		} else {
+			System.out.println(SynopticMessages.OpenEdition_9);
+		}
+		return null;
+	}
+	public static String[] getDefaultEditions(Corpus c) {
+		BaseParameters params = c.getBase().getBaseParameters();
+		Element editionsElement = params.getEditionsElement(params.getCorpusElement());
+		return editionsElement.getAttribute("default").split(","); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/**
+	 * Open edition, but don't show a page 
+	 *
+	 * @param corpus the corpus
+	 * @return the object
+	 */
+	public static SynopticEditionEditor openEdition(Corpus corpus, String[] editions) {
+		String textid = null;
+
+		System.out.println("Opening edition of "+corpus); //$NON-NLS-1$
+		try {
+			Text text = null;
+			if (corpus instanceof Subcorpus) {
+				Subcorpus sub = (Subcorpus)corpus;
+				List<Match> matches = sub.getMatches();
+				if (matches.size() > 0) {
+					StructuralUnit text_su = corpus.getStructuralUnit("text"); //$NON-NLS-1$
+					Property text_id = text_su.getProperty("id"); //$NON-NLS-1$
+
+					textid = matches.get(0).getValueForProperty(text_id);
+					if (textid != null) text = corpus.getMainCorpus().getText(textid);
+				}
+			}
+			//			QueryResult result = corpus.query(new Query("<text> []"), "get_edition", false); //$NON-NLS-1$ //$NON-NLS-2$ 
+			//			StructuralUnit text_su = corpus.getStructuralUnit("text"); //$NON-NLS-1$
+			//			Property text_id = text_su.getProperty("id"); //$NON-NLS-1$
+
+			// 			if (result.getNMatch() > 0) textid = result.getMatches(0, 1).get(0).getValueForProperty(text_id);
+			MainCorpus maincorpus = corpus.getMainCorpus();
+
+			//			if (textid != null) text = maincorpus.getText(textid);
+
+			if (text == null) {
+				text = maincorpus.getFirstText();
+
+				if (text == null) {
+					System.out.println("** Could not find first text of ID "+textid+SynopticMessages.OpenEdition_7); //$NON-NLS-1$ //$NON-NLS-1$
+					return null;
+				}
+
+				textid = text.getName();
+			}
+
+			//String[] editions = {maincorpus.getDefaultEdition()};
+			IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+			IWorkbenchPage page = window.getActivePage();
+
+			SynopticEditorInput editorInput = new SynopticEditorInput(corpus, text.getName(), editions);
+			SynopticEditionEditor editor = (SynopticEditionEditor) page.openEditor(editorInput,
+					SynopticEditionEditor.ID, true);
+
+			return editor;
+
+		} catch (Exception e) {
+			Log.printStackTrace(e);
+			System.out.println(SynopticMessages.OpenEdition_10+e);
+			return null;
+		}
+	}
+}

Property changes on: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/commands/OpenEdition.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/preferences/EditionPreferencePage.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/preferences/EditionPreferencePage.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/preferences/EditionPreferencePage.java	(revision 88)
@@ -0,0 +1,35 @@
+package org.txm.rcp.synoptic.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.txm.rcpapplication.Application;
+
+public class EditionPreferencePage  extends FieldEditorPreferencePage
+implements IWorkbenchPreferencePage {
+	ScopedPreferenceStore preferences;
+
+	private BooleanFieldEditor slow_highlight;
+	
+	public static String SLOW_HIGHLIGHT = "org.txm.rcp.synoptic.slow_highlight";
+	
+	public EditionPreferencePage() {
+		super();
+		preferences = new ScopedPreferenceStore(org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE,
+				Application.PLUGIN_ID);
+		setPreferenceStore(preferences);
+		setTitle("Analec");
+	}
+	
+	@Override
+	public void init(IWorkbench workbench) { }
+
+	@Override
+	protected void createFieldEditors() {
+		slow_highlight = new BooleanFieldEditor(SLOW_HIGHLIGHT,
+				"Enable slow but robust word highlight", getFieldEditorParent());
+		addField(slow_highlight);
+	}
+}

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

Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/EditionPanel.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/EditionPanel.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/EditionPanel.java	(revision 88)
@@ -0,0 +1,929 @@
+package org.txm.rcp.synoptic.editor;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+
+import org.apache.batik.bridge.CSSUtilities;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.ProgressEvent;
+import org.eclipse.swt.browser.ProgressListener;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.internal.browser.BrowserViewer;
+import org.txm.objects.Corpus;
+import org.txm.objects.Edition;
+import org.txm.objects.Page;
+import org.txm.objects.Text;
+import org.txm.rcp.synoptic.preferences.EditionPreferencePage;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.rcpapplication.TxmPreferences;
+import org.txm.rcpapplication.utils.IOClipboard;
+import org.txm.utils.logger.Log;
+
+import synopticeditor.SynopticMessages;
+
+public class EditionPanel extends BrowserViewer implements ISelectionProvider {
+
+	public static class RGBA {
+		public int a = 0, r=0, g=0, b=0;
+		public RGBA(int r, int g, int b) {
+			this.r =r;this.g=g; this.b =b;
+		}
+		public RGBA(int r, int g, int b, int a) {
+			this.r =r;this.g=g; this.b =b;this.a =a;
+		}
+
+		public String toString() {return "{"+r+", "+g+","+b+", "+a+"}";}
+	}
+
+	private ProgressListener progresslistener;
+	//	private List<String> wordids;
+	//	private List<String> lineids;
+	/** The edition. */
+	Text currentText;
+	Edition currentEdition;
+	Page currentPage;
+	protected SynopticEditionEditor synopticEditionEditor;
+	private ISelectionProvider selProvider;
+	private MenuManager menuManager;
+
+	private HashSet<int[]> highlightedAreas = null;
+
+	HashMap<String, HashSet<RGBA>> highlightedColorPerWordIDS = new HashMap<String, HashSet<RGBA>>();
+	String focusedWordID = null;
+
+	public static final String highlightscript = "try { var elt = document.getElementById(\"%s\");" + //$NON-NLS-1$ //$NON-NLS-2$
+			"elt.style.backgroundColor=\"rgb(%s,%s,%s)\";" + //$NON-NLS-1$
+			"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
+			"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
+			"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
+			"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
+			"} catch (e) { };"; //$NON-NLS-1$
+	public static final String highlightscriptRuleFast = "sheet.insertRule(\"#%s {background-color:rgb(%s,%s,%s);}\", 0);";
+	public static final String highlightscriptRule = "sheet.insertRule(\"span[id=\\\"%s\\\"] {background-color:rgb(%s,%s,%s); }\", 0);";
+
+	public static final String clearhighlightscript = "try { var elt = document.getElementById(\"%s\");" + //$NON-NLS-1$ //$NON-NLS-2$
+			"elt.style.backgroundColor=\"white\";" + //$NON-NLS-1$
+			"elt.style.paddingLeft=\"\";" + //$NON-NLS-1$
+			"elt.style.paddingRight=\"\";" + //$NON-NLS-1$
+			"elt.style.paddingTop=\"\";" + //$NON-NLS-1$
+			"elt.style.paddingBottom=\"\";" + //$NON-NLS-1$
+			"} catch (e) { };"; //$NON-NLS-1$
+
+	public String functions = 
+			""//"alert(\"loading functions\");"
+					+"\nfunction getNodeText(node) {"
+					+"\n	if (typeof node == 'string') return 'STRING HTML';"
+					+"\n	else if (typeof  node.innerText != 'undefined') return node.innerText;"
+					+"\n	else if (typeof  node.InnerText != 'undefined') return node.InnerText;"
+					+"\n	else if (typeof  node.textContent != 'undefined') return node.textContent;"
+					+"\n	else return null;"
+					+"\n}"
+					+"\nfunction txmGetParent(node) {"
+					+"\n	if (typeof  node.parentNode != 'undefined') return node.parentNode;"
+					+"\n	else return null;"
+					+"\n}"
+					+"\nfunction txmGetChildren(node) {"
+					+"\n	if (typeof node == 'string') return 'STRING HTML';"
+					+"\n	else if (typeof  node.children != 'undefined') return node.children;"
+					+"\n	else if (typeof  node.ChildNodes != 'undefined') return node.ChildNodes;"
+					+"\n	else if (typeof  node.childNodes != 'undefined') return node.childNodes;"
+					+"\n	else return null;"
+					+"\n}"
+					+"\nfunction txmGetSelection() {"
+					+"\n	if (typeof window.getSelection != 'undefined') {return window.getSelection();}"
+					+"\n	else if (typeof document.selection != 'undefined') { return document.selection;}"
+					+"\n	else return 'NO SELECTION';"
+					+"\n}"
+					+"\nfunction txmGetRange(selection, i) {"
+					+"\n	if (typeof selection.getRangeAt != 'undefined') {return selection.getRangeAt(i);}"
+					+"\n	else if (typeof selection.createRange != 'undefined') { return selection.createRange();} // IE5 has no multiple selection"
+					+"\n	else return 'NO RANGE';"
+					+"\n}"
+					+"\nfunction txmGetParentElementRange(range) {"
+					+"\n	if (typeof range.parentElement != 'undefined') {return range.parentElement();}"
+					+"\n	else if (typeof range.startContainer != 'undefined') { return range.startContainer.parentNode;}"
+					+"\n	else return 'NO PARENT';"
+					+"\n}"
+					+"\nfunction txmGetFragment(range) {"
+					+"\n	if (typeof range.cloneContents != 'undefined') { return range.cloneContents();}"
+					+"\n	else if (typeof range.htmlText != 'undefined') {var node = document.createElement('sel'); node.innerHTML = range.htmlText; 		return node;"
+					+"\n	} else return 'NO FRAG';"
+					+"\n}"
+					+"\nfunction txmGetTagName(node) {"
+					+"\n	if (typeof node.tagName != 'undefined') {return node.tagName;}"
+					+"\n	else if (typeof node.nodeName != 'undefined') { return node.nodeName;}"
+					+"\n	else return 'NO TAGNAME';"
+					+"\n}"
+					+"\nfunction findSpans(children, all) {"
+					+"\n    for (var i = 0 ; i < children.length ; i++) {"
+					+"\n    	var node = children.item(i);"
+					+"\n		if (node.nodeType == 1) {"
+					+"\n    	var id = node.getAttribute('id');"
+					+"\n       		if (node.tagName == 'SPAN' && id != null && id.indexOf('w_') == 0 && getNodeText(node).length > 0) {"
+					+"\n            	all.push(id);"
+					+"\n        	} else {"
+					+"\n        		findSpans(txmGetChildren(node), all)"
+					+"\n        	}"
+					+"\n		}"
+					+"\n	}"
+					+"\n}"
+					+"\nfunction get_type(thing){if(thing===null)return \"[object Null]\";  return Object.prototype.toString.call(thing);}\n"
+					+"\nfunction getDetailedObject(inputObject) { var detailedObject = {}; var properties; \n   do {        properties = Object.getOwnPropertyNames( inputObject );        for (var o in properties) {detailedObject[properties[o]] = inputObject[properties[o]];}} while ( inputObject = Object.getPrototypeOf(inputObject) );return detailedObject;}\n"
+					+"\nvar style = document.createElement(\"style\");"
+					+"\nstyle.appendChild(document.createTextNode(\"\"));"//webkit hack
+					+"\ndocument.head.appendChild(style);"
+					+"\nvar sheet = style.sheet;"
+					//+"\nalert(\"create sheet:\"+sheet);"
+					+"\n";
+
+	protected boolean slowWordHighLight = TxmPreferences.getBoolean(EditionPreferencePage.SLOW_HIGHLIGHT, false);
+	
+	protected boolean firstLoad = true;
+	public EditionPanel(SynopticEditionEditor synopticEditionEditor, Composite parent, int style, Edition edition) {
+		super(parent, style);
+		this.synopticEditionEditor = synopticEditionEditor;
+		this.currentEdition = edition;
+		this.currentText = currentEdition.getText();
+
+		progresslistener = new ProgressListener() {
+			
+			@Override
+			public void changed(ProgressEvent event) { }
+
+			@Override
+			public void completed(ProgressEvent event) {
+				if (firstLoad) {
+					//System.out.println(functions);
+					getBrowser().execute(functions); // loads selection Javascript functions
+					firstLoad = false;
+				}
+				
+				//System.out.println("highlight: "+highlightedColorPerWordIDS);
+				StringBuilder buffer = new StringBuilder();
+				//buffer.append("alert(\"\"+sheet);\n");
+				buffer.append("try { while(sheet.cssRules.length > 0) sheet.deleteRule(0); } catch (e) {};\n"); // empty style
+				for (String wordid : highlightedColorPerWordIDS.keySet()) {
+					RGBA composite = new RGBA(0,0,0);
+					int size = highlightedColorPerWordIDS.get(wordid).size();
+					
+					for (RGBA color : highlightedColorPerWordIDS.get(wordid)) {
+						composite.r += color.r;
+						composite.g += color.g;
+						composite.b += color.b;
+					}
+					
+					composite.r /= size;
+					composite.g /= size;
+					composite.b /= size;
+					
+					String s = null;
+					if (slowWordHighLight) {
+						s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b);
+					} else {
+						s = String.format(highlightscriptRuleFast, wordid.replace(" ", "\\ "), composite.r, composite.g, composite.b);
+					}
+					
+					buffer.append(s+"\n");
+				}
+
+				if (focusedWordID != null) {
+					//System.out.println("Focus on: "+focusedWordID);
+					String s = "try { document.getElementById(\"" + focusedWordID + "\").scrollIntoView(true); } catch (e) { };"; //$NON-NLS-1$ //$NON-NLS-2$
+					buffer.append(s+"\n");
+				}
+
+				if (highlightedAreas != null) {
+					for (int[] pos : highlightedAreas ) {
+						if (pos == null || pos.length != 4) continue;
+						String s = "try {v.setFocusOn("+pos[0]+", "+pos[1]+", "+pos[2]+", "+pos[3]+");} catch (e) { };"; //$NON-NLS-1$
+						buffer.append(s+"\n");
+						break;// one word only for now
+					}
+				}
+				
+				//System.out.println(buffer);
+				if (buffer.length() > 0) getBrowser().execute(buffer.toString());
+			}
+		};
+		getBrowser().addProgressListener(progresslistener);
+	}
+
+	/**
+	 * Bypass BrowserViewer restriction on the getBrowser method
+	 */
+	public Browser getBrowser() {
+		return super.getBrowser();
+	}
+
+	public ISelectionProvider getSelectionProvider() {
+		return selProvider;
+	}
+
+	public void setHighlightWordsById(RGBA color, HashSet<String> wordids) {
+		for (String wordid : wordids) {
+			if (this.highlightedColorPerWordIDS.get(wordid) != null) {
+				removeHighlightWordsById(color, wordid);
+			}
+			HashSet<RGBA> hs = new HashSet<RGBA>();
+			this.highlightedColorPerWordIDS.put(wordid, hs);
+			hs.add(color);
+		}
+
+	}
+
+	public void addHighlightWordsById(RGBA color, String wordid) {
+		if (!this.highlightedColorPerWordIDS.containsKey(wordid)) {
+			this.highlightedColorPerWordIDS.put(wordid, new HashSet<RGBA>());
+		}
+		this.highlightedColorPerWordIDS.get(wordid).add(color);
+	}
+
+	/**
+	 * Can be called to refresh the page word styles but only when the page is loaded
+	 */
+	public void updateWordStyles() {
+		progresslistener.completed(null);
+	}
+
+	public void addHighlightWordsById(RGBA color, Collection<String> wordids) {
+		for (String wordid : wordids) {
+			addHighlightWordsById(color, wordid);
+		}
+	}
+
+	public void removeHighlightWordsById(RGBA color, Collection<String> wordids) {
+		//System.out.println("Call removeHighlightWordsById: "+wordids+" color="+color);
+		for (String wordid : wordids) {
+			removeHighlightWordsById(color, wordid);
+		}
+	}
+
+	public void removeHighlightWordsById(RGBA color, String wordid) {
+		if (highlightedColorPerWordIDS.get(wordid) == null) return; // nothing to do
+
+		//System.out.println("remove color="+color+" from id="+wordid);
+		this.highlightedColorPerWordIDS.get(wordid).remove(color);
+
+		if (this.highlightedColorPerWordIDS.get(wordid).size() == 0) {
+			this.highlightedColorPerWordIDS.remove(wordid);
+		}
+	}
+
+	/**
+	 * Open the page containing the word with ID=$line_wordid
+	 * @param line_wordid
+	 * @return true if the page changed
+	 */
+	public boolean backToText(Text text, String line_wordid) {
+
+		String name = currentEdition.getName();
+		Edition edition = text.getEdition(name);
+
+		if (edition == null) {
+			String s = SynopticMessages.EditionPanel_0+text+SynopticMessages.EditionPanel_5+name;
+			System.out.println(s);
+			StatusLine.setMessage(s);
+			Log.severe(s);
+		} else {
+			Page openedPage = edition.getPageForWordId(line_wordid);
+			if (openedPage != null && openedPage != currentPage) {
+				this.showPage(openedPage);
+				return true;
+			}
+		}
+		updateWordStyles(); // update styles if any new one
+		return false;
+	}
+
+	/**
+	 * First page.
+	 */
+	public void firstPage() {
+		// System.out.println(Messages.TxmBrowser_1+currentPage);
+		currentPage = currentEdition.getFirstPage();
+		currentText = currentEdition.getText();
+		if (currentPage == null) {
+			System.out.println(SynopticMessages.EditionPanel_1+currentEdition.getName()+SynopticMessages.EditionPanel_2+currentText.getName());
+		}
+		
+		this.setURL(currentPage.toURL());
+		
+		//page_label.setText(makePageLabel());
+	}
+	
+	public void setURL(String url) {
+		firstLoad = true;
+		super.setURL(url);
+	}
+
+	/**
+	 * Last page.
+	 */
+	public void lastPage() {
+		// System.out.println(Messages.TxmBrowser_2+currentPage);
+
+		if (currentPage != null && currentPage.getFile().equals(currentEdition.getLastPage()))
+			return;
+		currentPage = currentEdition.getLastPage();
+		currentText = currentEdition.getText();
+		this.setURL(currentPage.toURL());
+	}
+
+	/**
+	 * Previous page.
+	 */
+	public void previousPage() {
+		// System.out.println(Messages.TxmBrowser_3+currentPage);
+		if (currentPage != null) {
+			Page previous = currentEdition.getPreviousPage(currentPage);
+
+			if (previous == currentPage) {
+				previousText(true);
+			} else {
+				currentPage = previous;
+				this.setURL(currentPage.toURL());
+			}
+			currentText = currentEdition.getText();
+		} else
+			firstPage();
+		//page_label.setText(makePageLabel());
+	}
+
+
+
+	/**
+	 * Next page.
+	 */
+	public void nextPage() {
+		// System.out.println(Messages.TxmBrowser_4+currentPage);
+		if (currentPage != null) {
+			Page next = currentEdition.getNextPage(currentPage);
+			if (next == currentPage) {
+				nextText();
+			} else {
+				currentPage = next;
+				this.setURL(currentPage.toURL());
+			}
+			currentText = currentEdition.getText();
+		} else
+			firstPage();
+		//page_label.setText(makePageLabel());
+	}
+
+
+	public void firstText() {
+		//Text current = this.currentPage.getEdition().getText();
+		Corpus corpus = currentText.getCorpus();
+		Text firstText = corpus.getFirstText();
+
+		if (firstText != null) {
+			String editionName = currentEdition.getName();
+			Edition tmp = firstText.getEdition(editionName);
+			if (tmp == null) {
+				System.out.println(SynopticMessages.EditionPanel_6+editionName+SynopticMessages.EditionPanel_7+firstText.getName());
+				return;
+			}
+			currentEdition = tmp;
+			currentPage = currentEdition.getFirstPage(); 
+			currentText = firstText;
+			if (currentPage == null) {
+				StatusLine.setMessage("No previous text"); //$NON-NLS-1$
+				return;
+			}
+			this.setURL(currentPage.toURL());
+		}
+	}
+
+	/**
+	 * Next text.
+	 */
+	public void lastText() {
+		//Text current = this.currentPage.getEdition().getText();
+		Corpus b = currentText.getCorpus();
+		Text lastText = b.getLastText();
+
+		if (lastText != null) {
+			String editionName = currentEdition.getName();
+			Edition tmp = lastText.getEdition(editionName);
+			if (tmp == null) {
+				System.out.println(SynopticMessages.EditionPanel_6+editionName+SynopticMessages.EditionPanel_7+lastText.getName());
+				return;
+			}
+
+			currentEdition = tmp;
+			currentPage = currentEdition.getFirstPage(); 
+			currentText = lastText;
+			if (currentPage == null) {
+				StatusLine.setMessage("No text next"); //$NON-NLS-1$
+				return;
+			}
+
+			this.setURL(currentPage.toURL());
+			//page_label.setText(makePageLabel());
+		}
+		// System.out.println("Next texts "+nextText);
+	}
+
+	/**
+	 * Previous text.
+	 * @param fromNextText if true  it means the user was reading the next text and then we show the last page of the previous text
+	 */
+	public void previousText(boolean fromNextText) {
+
+		//Text current = this.currentPage.getEdition().getText();
+		Corpus corpus = currentText.getCorpus();
+		Text previousText = corpus.getPreviousText(currentText);
+
+		if (previousText != null) {
+			String editionName = currentEdition.getName();
+
+			Edition tmp = previousText.getEdition(editionName);
+			if (tmp == null) {
+				System.out.println(SynopticMessages.EditionPanel_6+editionName+SynopticMessages.EditionPanel_7+previousText.getName());
+			}
+			currentEdition = tmp;
+			currentText = previousText;
+			if (fromNextText) {
+				currentPage = currentEdition.getLastPage(); 
+			} else {
+				currentPage = currentEdition.getFirstPage(); 
+			}
+
+			if (currentPage == null) {
+				StatusLine.setMessage("No previous text"); //$NON-NLS-1$
+				return;
+			}
+			this.setURL(currentPage.toURL());
+		}
+		// System.out.println("Previous texts "+previousText);
+	}
+
+	/**
+	 * Next text.
+	 */
+	public void nextText() {
+		//Text current = this.currentPage.getEdition().getText();
+		Corpus b = currentText.getCorpus();
+		Text nextText = b.getNextText(currentText);
+
+		if (nextText != null) {
+			String editionName = currentEdition.getName();
+			Edition tmp = nextText.getEdition(editionName);
+			if (tmp == null) {
+				System.out.println(SynopticMessages.EditionPanel_6+editionName+SynopticMessages.EditionPanel_7+nextText.getName());
+				return;
+			}
+			currentEdition = tmp;
+
+			currentPage = currentEdition.getFirstPage(); 
+			currentText = nextText;
+			if (currentPage == null) {
+				StatusLine.setMessage("No text next"); //$NON-NLS-1$
+				return;
+			}
+
+			this.setURL(currentPage.toURL());
+			//page_label.setText(makePageLabel());
+		}
+		// System.out.println("Next texts "+nextText);
+	}
+
+
+	public void setText(Text text, boolean refresh) {
+		String editionName = currentEdition.getName();
+		Edition tmp = text.getEdition(editionName);
+		if (tmp == null) {
+			System.out.println(SynopticMessages.EditionPanel_6+editionName+SynopticMessages.EditionPanel_7+text.getName());
+			return;
+		}
+
+		currentEdition = tmp;
+		currentPage = currentEdition.getFirstPage(); 
+		currentText = text;
+		if (currentPage == null) {
+			StatusLine.setMessage("No text next"); //$NON-NLS-1$
+			return;
+		}
+
+		if (refresh) this.setURL(currentPage.toURL());
+		//page_label.setText(makePageLabel());
+	}
+
+	/**
+	 * Gets the current page.
+	 *
+	 * @return the current page
+	 */
+	public Page getCurrentPage() {
+		return currentPage;
+	}
+
+	/**
+	 * Gets the current text.
+	 *
+	 * @return the current page
+	 */
+	public Text getCurrentText() {
+		return currentText;
+	}
+
+	/**
+	 * Make page label.
+	 *
+	 * @return the string
+	 */
+	public String makePageLabel() {
+		return currentPage.getName()
+				+ " / " + currentPage.getEdition().getNumPages(); //$NON-NLS-1$
+	}
+
+	/**
+	 * Show page.
+	 *
+	 * @param page the page
+	 */
+	public void showPage(Page page) {
+		//System.out.println("SHOW PAGE "+page);
+		currentEdition = page.getEdition();
+		currentText = currentEdition.getText();
+		currentPage = page;
+		this.setURL(currentPage.toURL());
+	}
+
+	public void reloadPage() {
+		this.setURL(currentPage.toURL());
+	}
+
+	//	/**
+	//	 * Sets the edition.
+	//	 *
+	//	 * @param edition the new edition
+	//	 */
+	//	public void setEdition(Edition edition) {
+	//		this.currentEdition = edition;
+	//	}
+
+	static String SCRIPT01 = "var html = \"\";"+
+			"if (typeof window.getSelection != \"undefined\") {"+ // modern Web browsers
+			"var sel = window.getSelection();"+
+			"if (sel.rangeCount) {"+
+			"var container = document.createElement(\"div\");"+
+			"for (var i = 0, len = sel.rangeCount; i < len; ++i) {"+
+			"container.appendChild(sel.getRangeAt(i).cloneContents());"+
+			"}"+
+			"html = container.innerHTML;"+
+			"}"+
+			"} else if (typeof document.selection != \"undefined\") {"+ // for IE < 11
+			"if (document.selection.type == \"Text\") {"+
+			"html = document.selection.createRange().htmlText;"+
+			"}" +
+			"}" +
+			"return html";
+
+	public String getTextSelectionDOM() {
+		return ((String) getBrowser().evaluate(SCRIPT01));
+	}
+
+	public String[] getWordSelection() {
+		
+		//System.out.println("getWordSelection");
+		String SCRIPT02_getspans = ""//functions
+				+"var all = [];"
+				+"\nvar sel = txmGetSelection();"
+				+"\nif (sel.rangeCount == 0) {return all;}"
+				//+"\nalert('sel='+sel);"
+				+"\nvar range = txmGetRange(sel, 0);"
+				//+"\nalert('range='+range);"
+				+"\nvar frag = txmGetFragment(range);"
+				//+"\nalert('frag='+frag);"
+				+"\nvar children = txmGetChildren(frag);"
+				//+"\nalert('children='+children);"
+				//+"\nalert('children.length='+children.length);"
+				+"\nif ((children.length == 0) || (children.length == 1 && children.item(0).nodeType == 3)) {"
+				+"\n	var parent = txmGetParentElementRange(range);"
+				//+"\n	alert('text selection, parent='+txmGetTagName(parent))"
+				+"\n	var id = parent.getAttribute('id');"
+				+"\n	if (txmGetTagName(parent) == 'SPAN' && id != null && id.indexOf('w_') == 0) {"
+				+"\n		all.push(id);"
+				+"\n	}"
+				+"\n	var parent = txmGetParent(parent);"
+				//+"\n	alert('text selection, parent='+txmGetTagName(parent))"
+				+"\n	var id = parent.getAttribute('id');"
+				+"\n	if (txmGetTagName(parent) == 'SPAN' && id != null && id.indexOf('w_') == 0) {"
+				+"\n		all.push(id);"
+				+"\n	}"
+				+"\n} else {"
+				+"\n	findSpans(children, all);"
+				+"\n}"
+				//+"alert('result='+all)"
+				+"\nreturn all;";
+
+//		System.out.println(functions);
+//		System.out.println(SCRIPT02_getspans);
+		
+		Object ret = getBrowser().evaluate(SCRIPT02_getspans);
+		if (ret instanceof Object[]) {
+			Log.warning("selection word ids="+Arrays.toString((Object[])ret));
+			Object[] array = (Object[])ret;
+			String[] sel = new String[2];
+			if (array.length == 0) {
+				return null;
+			} else if (array.length == 1) {
+				sel[0] = array[0].toString();
+				return sel;
+			} else {
+				sel[0] = array[0].toString();
+				sel[1] = array[array.length-1].toString();
+				return sel;
+			}
+		} else { 
+			System.out.println("SCRIPT RETURNED="+ret);
+			return null;
+		}
+	}
+
+	public String getTextSelection() {
+		//System.out.println("DOM="+getTextSelectionDOM());
+		String rez =  getTextSelectionDOM().replaceAll("<[^>]+>", "");
+		//System.out.println("STR="+rez);
+		return rez;
+	}
+
+	@Override
+	public void addSelectionChangedListener(ISelectionChangedListener listener) {	}
+
+	@Override
+	public ISelection getSelection() {
+		return new SynopticTextSelection(this);
+	}
+
+	@Override
+	public void removeSelectionChangedListener(
+			ISelectionChangedListener listener) {	}
+
+	@Override
+	public void setSelection(ISelection selection) {	}
+
+	static public class SynopticTextSelection implements ISelection  {
+		String str;
+		public SynopticTextSelection(EditionPanel panel) {
+			this.str = panel.getTextSelection();
+		}
+
+		@Override
+		public boolean isEmpty() {
+			return str != null && str.length() > 0;
+		}
+
+		public String getTextSelection() {
+			return str;
+		}
+	}
+
+	public Edition getEdition() {
+		return currentEdition;
+	}
+
+	public MenuManager getMenuManager() {	
+		return menuManager;
+	}
+
+	public void initMenu() {
+		// create a new menu	
+		menuManager = new MenuManager(); //$NON-NLS-1$
+
+		Menu menu = menuManager.createContextMenu(this.getBrowser());
+
+		menu.addMenuListener(new MenuListener() {
+
+			@Override
+			public void menuShown(MenuEvent e) {
+				Menu menu = menuManager.getMenu();
+				if (menu == null) return;
+				new MenuItem(menu, SWT.SEPARATOR);
+
+				MenuItem copyItem = new MenuItem(menu, SWT.NONE);
+				copyItem.setText("Copy text selection");
+				copyItem.addSelectionListener(new SelectionListener() {
+
+					@Override
+					public void widgetSelected(SelectionEvent e) {
+						String text = EditionPanel.this.getTextSelection();
+						if (text != null && text.length() > 0) {
+							IOClipboard.write(text);
+						}
+					}
+
+					@Override
+					public void widgetDefaultSelected(SelectionEvent e) { }
+				});
+				String text = EditionPanel.this.getTextSelection();
+				copyItem.setEnabled(text != null && text.length() > 0);
+				
+				MenuItem reloadItem = new MenuItem(menu, SWT.NONE);
+				reloadItem.setText("Reload");
+				reloadItem.addSelectionListener(new SelectionListener() {
+
+					@Override
+					public void widgetSelected(SelectionEvent e) {
+						EditionPanel.this.getBrowser().refresh();
+					}
+
+					@Override
+					public void widgetDefaultSelected(SelectionEvent e) { }
+				});
+				MenuItem backItem = new MenuItem(menu, SWT.NONE);
+				backItem.setText("Back");
+				backItem.addSelectionListener(new SelectionListener() {
+
+					@Override
+					public void widgetSelected(SelectionEvent e) {
+						EditionPanel.this.getBrowser().back();
+					}
+
+					@Override
+					public void widgetDefaultSelected(SelectionEvent e) { }
+				});
+				MenuItem forwardItem = new MenuItem(menu, SWT.NONE);
+				forwardItem.setText("Forward");
+				forwardItem.addSelectionListener(new SelectionListener() {
+
+					@Override
+					public void widgetSelected(SelectionEvent e) {
+						EditionPanel.this.getBrowser().forward();
+					}
+
+					@Override
+					public void widgetDefaultSelected(SelectionEvent e) { }
+				});
+			}
+
+			@Override
+			public void menuHidden(MenuEvent e) {
+				// TODO Auto-generated method stub
+
+			}
+		});
+		//		// restore old listeners
+		//		Menu origMenu = this.browser.getMenu();
+		//		if (origMenu != null) {
+		//			if (origMenu.getListeners(SWT.Hide) != null)
+		//				for (Listener listener : origMenu.getListeners(SWT.Hide)) menu.addListener(SWT.Hide, listener);
+		//			if (origMenu.getListeners(SWT.Show) != null)
+		//				for (Listener listener : origMenu.getListeners(SWT.Show)) menu.addListener(SWT.Show, listener);
+		//			for (MenuItem origItem : origMenu.getItems()) { // restore old menu items
+		//				MenuItem item = new MenuItem(menu, origItem.getStyle());
+		//				item.setText(origItem.getText());
+		//				item.setImage(origItem.getImage());
+		//				if (origItem.getListeners(SWT.Selection) != null && origItem.getListeners(SWT.Selection).length > 0)
+		//					item.addListener(SWT.Selection, origItem.getListeners(SWT.Selection)[0]);
+		//			}
+		//		}
+		// replace the menu
+		this.getBrowser().setMenu(menu); 
+	}
+
+	public void initSelectionProvider() {
+		selProvider = new ISelectionProvider() {
+			@Override
+			public void setSelection(ISelection selection) { }
+			@Override
+			public void removeSelectionChangedListener(ISelectionChangedListener listener) { }
+			@Override
+			public ISelection getSelection() {
+				ITextSelection sel = new ITextSelection() {
+					@Override
+					public boolean isEmpty() {return EditionPanel.this.getTextSelection().length() == 0;}
+					@Override
+					public String getText() {return EditionPanel.this.getTextSelection();}
+					@Override
+					public int getStartLine() {	return 0;}
+					@Override
+					public int getOffset() {return 0;}
+					@Override
+					public int getLength() {return 0;}
+					@Override
+					public int getEndLine() {return 0;}
+				};
+				return sel;
+			}
+
+			@Override
+			public void addSelectionChangedListener(ISelectionChangedListener listener) { }
+		};
+	}
+
+	public String getWordsUnderCursor() {
+		String SCRIPT02_getspans = ""//functions
+				+"		var sel = txmGetSelection();"
+				//+"alert(\"sel:\"+sel);"
+				+"		if (sel.rangeCount == 0) {return null;}"
+				+"		var range = txmGetRange(sel, 0);"
+				//+"alert(\"range:\"+range);"
+				+"		if (typeof range.startContainer != 'undefined') {"
+				+"			var node = range.startContainer; "
+				+"			if (node != 'undefined' && txmGetTagName(node) == 'SPAN') {"
+				+"		        	var id = node.getAttribute('id');"
+				+"			        if (id != null && id.indexOf('w_') == 0) {"
+				+"	             			return id;"
+				+"			        }"
+				+"			}"
+				+"		}"
+				+"		var parent = txmGetParentElementRange(range);"
+				//+"alert(\"parent:\"+parent);"
+				+"		if (txmGetTagName(parent) == 'SPAN') {"
+				+"			var id = parent.getAttribute('id');"
+				//+"alert(\"parent id:\"+id);"
+				+"	        	if (id != null && id.indexOf('w_') == 0) {"
+				+"					return id;"
+				+"			}"
+				+"		}"
+				+"		parent = txmGetParent(parent);" // 2nd try
+				//+"alert(\"parent2:\"+parent);"
+				+"		if (txmGetTagName(parent) == 'SPAN') {"
+				+"			var id = parent.getAttribute('id');"
+				//+"alert(\"parent2 id:\"+id);"
+				+"	        	if (id != null && id.indexOf('w_') == 0) {"
+				+"					return id;"
+				+"			}"
+				+"		}"
+				+"		return null;"
+				;
+
+		//System.out.println("Eval...\n"+SCRIPT02_getspans);
+		Object ret = getBrowser().evaluate(SCRIPT02_getspans);
+		//System.out.println("word id under cursor="+ret);
+		if (ret instanceof String) {
+			
+			return ret.toString();
+		} else {
+			return null;
+		}
+	}
+
+	public void goToPage(String name) {
+
+		Page next = currentEdition.get(name);
+		// System.out.println(Messages.TxmBrowser_4+currentPage);
+		if (next != null) {
+			currentPage = next;
+			this.setURL(currentPage.toURL());
+		} else {
+			System.out.println("Page not found ("+name+").");
+		}
+	}
+
+	public void setFocusedWordID(String focusid) {
+		this.focusedWordID = focusid;
+	}
+
+	public void setHighlightedArea(HashSet<int[]> positions) {
+		Log.info("Highlight area: not implemented");
+	}
+
+	public void expandSelectionTo(String id) {
+		//		System.out.println("EXPAND SELECTION TO "+id);
+		//		String SCRIPT02_expand = "function get_type(thing){if(thing===null)return \"[object Null]\";  return Object.prototype.toString.call(thing);}\n"
+		//				+ "function getDetailedObject(inputObject) { var detailedObject = {}; var properties; \n   do {        properties = Object.getOwnPropertyNames( inputObject );        for (var o in properties) {detailedObject[properties[o]] = inputObject[properties[o]];}} while ( inputObject = Object.getPrototypeOf( inputObject ) );return detailedObject;}\n"
+		//				+ "function getChildren(node) {\n"
+		//				+ "if (typeof  node.children != \"undefined\") return node.children;\n"
+		//				+ "else if (typeof  node.ChildNodes != \"undefined\") return node.ChildNodes;\n"
+		//				+ "else if (typeof  node.childNodes != \"undefined\") return node.childNodes;\n"
+		//				+ "else return null;\n"
+		//				+ "}\n"
+		//				+ "function txmGetSelection() {\n"
+		//				+ "if (typeof window.getSelection != \"undefined\") {return window.getSelection();}\n"
+		//				+ "else if (typeof document.selection != \"undefined\") { return document.selection;}\n"
+		//				+ "}\n"
+		//				+ "var elt = document.getElementById(\""+id+"\");\n"
+		//				+ "var sel = txmGetSelection();\n"
+		//				+ "alert(\"sel=\"+sel.extentNode);\n"
+		//				+ "alert(\"typeof sel=\"+Object.getOwnPropertyNames(sel));\n"
+		//				+ "alert(\"get_type sel=\"+get_type(sel));\n"
+		//				+ "var range = sel.getRangeAt(0);\n"
+		//				+ "alert(\"range=\"+range);\n"
+		//				+ "alert(\"typeof range=\"+Object.getOwnPropertyNames(range));\n"
+		//				+ "\n"
+		//				+ "return null;"
+		//				;
+		//
+		//		System.out.println("Eval...\n"+SCRIPT02_expand);
+		//		Object ret = getBrowser().evaluate(SCRIPT02_expand);
+		return;
+	}
+}

Property changes on: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/EditionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SynopticEditionEditor.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SynopticEditionEditor.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SynopticEditionEditor.java	(revision 88)
@@ -0,0 +1,867 @@
+// 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.rcp.synoptic.editor;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+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.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.txm.objects.Edition;
+import org.txm.objects.Text;
+import org.txm.rcp.synoptic.editor.EditionPanel.RGBA;
+import org.txm.rcp.synoptic.editor.ext.ToolbarButton;
+import org.txm.rcpapplication.IImageKeys;
+import org.txm.rcpapplication.commands.editor.CustomizableEditor;
+import org.txm.rcpapplication.editors.IEditionEditor;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.utils.logger.Log;
+
+import synopticeditor.SynopticMessages;
+/**
+ * Call the internal browser of RCP a Texte can be set to browse pages and
+ * others texts of the same base 
+ * 
+ * @author mdecorde.
+ * 
+ */
+public class SynopticEditionEditor extends EditorPart implements CustomizableEditor, IEditionEditor {
+
+	/** The Constant ID. */
+	public final static String ID = "org.txm.rcp.synoptic.editor.SynopticEditionEditor"; //$NON-NLS-1$
+	LinkedHashMap<String, EditionPanel> editionPanels = new LinkedHashMap<String, EditionPanel>();
+
+	/** The page_label: show current page name. */
+	org.eclipse.swt.widgets.Text page_text;
+	Label page_label;
+	Composite editionsArea;
+	private String[] editionNames;
+	private Corpus corpus;
+	private Text text;
+	private Button editionsChooser;
+	private Label editionsLabel;
+	private Composite controlsArea;
+	private Composite toolbarsArea;
+	private Composite supplementaryButtonComposite;
+	private HashSet<ToolbarButton> toolbarButtons = new HashSet<ToolbarButton>();
+	private ISelectionProvider selProvider;
+
+	/**
+	 * Instantiates a new txm browser.
+	 */
+	public SynopticEditionEditor() {
+		selProvider = new ISelectionProvider() {
+			@Override
+			public void setSelection(ISelection selection) { }
+			@Override
+			public void removeSelectionChangedListener(ISelectionChangedListener listener) { }
+			@Override
+			public ISelection getSelection() {
+				ITextSelection sel = new ITextSelection() {
+					@Override
+					public boolean isEmpty() {
+						for (EditionPanel panel : editionPanels.values()) {
+							String s = panel.getTextSelection();
+							if (s.length() > 0) return false;
+						}
+						return true;
+					}
+					@Override
+					public String getText() {
+						for (EditionPanel panel : editionPanels.values()) {
+							String s = panel.getTextSelection();
+							if (s.length() > 0) return s;
+						}
+						return "";
+					}
+					@Override
+					public int getStartLine() {	return 0;}
+					@Override
+					public int getOffset() {return 0;}
+					@Override
+					public int getLength() {return 0;}
+					@Override
+					public int getEndLine() {return 0;}
+				};
+				return sel;
+			}
+
+			@Override
+			public void addSelectionChangedListener(ISelectionChangedListener listener) { }
+		};
+	}
+
+	public void setHighlightWordsById(RGBA color, HashSet<String> wordids) {
+		for(EditionPanel panel : editionPanels.values()) {
+			panel.setHighlightWordsById(color, wordids);
+		}
+	}
+
+	public void addHighlightWordsById(RGBA color, String wordid) {
+		for(EditionPanel panel : editionPanels.values()) {
+			panel.addHighlightWordsById(color, wordid);
+		}
+	}
+
+	public void addHighlightWordsById(RGBA color, Collection<String> wordids) {
+		for(EditionPanel panel : editionPanels.values()) {
+			panel.addHighlightWordsById(color, wordids);
+		}
+	}
+
+	public void removeHighlightWordsById(RGBA color, Collection<String> wordids) {
+		for(EditionPanel panel : editionPanels.values()) {
+			panel.removeHighlightWordsById(color, wordids);
+		}
+	}
+
+	public void removeHighlightWordsById(RGBA color, String wordid) {
+		for(EditionPanel panel : editionPanels.values()) {
+			panel.removeHighlightWordsById(color, wordid);
+		}
+	}
+
+	//	/**
+	//	 * 
+	//	 * @param wordids2 all the words to highlight
+	//	 * @param lineids2 the words to highlight better and to scroll to
+	//	 */
+	//	public void highlightWordsById(List<String> wordids, List<String> lineids, int[] pos, String focusid) {
+	//		for(EditionPanel panel : editionPanels.values()) {
+	//			if (panel.getEdition().getName().startsWith("facs")) {
+	//				List<int[]> wordRectangles = new ArrayList<int[]>();
+	//				List<int[]> keywordRectangles = new ArrayList<int[]>();
+	//				if (pos != null) keywordRectangles.add(pos);
+	//				panel.highlightWordsByPositions(wordRectangles, keywordRectangles);
+	//			} else {
+	//				panel.highlightWordsById(wordids, lineids, focusid);
+	//			}
+	//		}
+	//
+	//		updatePageLabel();
+	//		
+	//		
+	//	}
+
+	public void dispose() {
+		if (releaseExtensions()) {
+			super.dispose();
+		}
+	}
+
+	private boolean releaseExtensions() {
+		boolean error = false;
+		for (ToolbarButton tb : toolbarButtons) {
+			try {
+				tb.onClose();
+			} catch(Exception e) {
+				Log.printStackTrace(e);
+				System.out.println("Error while closing editor toolbar button: "+e);
+				error = true;
+			}
+		}
+		return !error;
+	}
+
+	/**
+	 * First page.
+	 */
+	public void firstPage() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.firstPage();
+		updatePageLabel();
+	}
+
+	/**
+	 * Last page.
+	 */
+	public void lastPage() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.lastPage();
+		updatePageLabel();
+	}
+
+	/**
+	 * Previous page.
+	 */
+	public void previousPage() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.previousPage();
+		updatePageLabel();
+	}
+
+	/**
+	 * Next page.
+	 */
+	public void nextPage() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.nextPage();
+		updatePageLabel();
+	}
+
+	/**
+	 * Next page.
+	 */
+	public void goToPage(String name) {
+		for(EditionPanel panel : editionPanels.values())
+			panel.goToPage(name);
+		updatePageLabel();
+	}
+
+	/**
+	 * Previous text.
+	 */
+	public void previousText(boolean fromNextText) {
+		for(EditionPanel panel : editionPanels.values())
+			panel.previousText(fromNextText);
+		updatePageLabel();
+	}
+
+	/**
+	 * Next text.
+	 */
+	public void nextText() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.nextText();
+		updatePageLabel();
+	}
+
+	/**
+	 * Previous text.
+	 */
+	public void firstText() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.firstText();
+		updatePageLabel();
+	}
+
+	/**
+	 * Next text.
+	 */
+	public void lastText() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.lastText();
+		updatePageLabel();
+	}
+
+	public Composite getEditionArea() {
+		return editionsArea;
+	}
+
+	public Composite getUpperToolbarArea() {
+		return toolbarsArea;
+	}
+
+	public Composite getLowerToolbarArea() {
+		return controlsArea;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.internal.browser.WebBrowserEditor#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	public void createPartControl(Composite parent) {
+		FormLayout mainLayout = new FormLayout();
+		parent.setLayout(mainLayout);
+
+		toolbarsArea = new Composite(parent, SWT.NONE);
+		GridLayout toolbarsLayout = new GridLayout(1, true);
+		toolbarsLayout.marginBottom = toolbarsLayout.marginHeight = 0;
+		toolbarsLayout.marginTop = toolbarsLayout.marginWidth = 0;
+		toolbarsLayout.horizontalSpacing = 2;
+		toolbarsArea.setLayout(toolbarsLayout);
+
+		editionsArea = new Composite(parent, SWT.NONE);
+		GridLayout editionLayout = new GridLayout();
+		editionLayout.marginBottom = editionLayout.marginHeight = 0;
+		editionLayout.marginTop = editionLayout.marginWidth = 0;
+		editionLayout.horizontalSpacing = 2;
+		editionsArea.setLayout(editionLayout);
+
+		controlsArea = new Composite(parent, SWT.NONE);
+		GridLayout subLayout = new GridLayout(17, false);
+		subLayout.marginBottom = subLayout.marginHeight = 0;
+		subLayout.marginTop = subLayout.marginWidth = 0;
+		subLayout.horizontalSpacing = 2;
+		controlsArea.setLayout(subLayout);
+
+		//agencing panels : upper toolbar, edition and bottom
+		FormData upperFormData = new FormData();
+		upperFormData.top = new FormAttachment(0);
+		upperFormData.bottom = new FormAttachment(editionsArea);
+		upperFormData.left = new FormAttachment(0);
+		upperFormData.right = new FormAttachment(100);
+		toolbarsArea.setLayoutData(upperFormData);
+		FormData middleFormData = new FormData();
+		middleFormData.top = new FormAttachment(toolbarsArea);
+		middleFormData.bottom = new FormAttachment(controlsArea);
+		middleFormData.left = new FormAttachment(0);
+		middleFormData.right = new FormAttachment(100);
+		editionsArea.setLayoutData(middleFormData);
+		FormData lowerFormData = new FormData();
+		//lowerFormData.top = new FormAttachment(70);
+		lowerFormData.bottom = new FormAttachment(100);
+		lowerFormData.left = new FormAttachment(0);
+		lowerFormData.right = new FormAttachment(100);
+		controlsArea.setLayoutData(lowerFormData);
+
+		//spacer
+		new Label(controlsArea, SWT.NONE).setText("  "); //$NON-NLS-1$
+
+		// Edition names label
+		editionsLabel = new Label(controlsArea, SWT.NONE);
+		editionsLabel.setText(StringUtils.join(editionNames, " | ")); //$NON-NLS-1$
+
+		if (corpus.getEditionNames().size() > 1) {			
+			editionsChooser = new Button(controlsArea, SWT.PUSH);
+			editionsChooser.setText("..."); //$NON-NLS-1$
+			editionsChooser.addSelectionListener(new SelectionListener() {
+				@Override
+				public void widgetSelected(SelectionEvent e) {
+					try {
+						Shell shell = e.display.getActiveShell();
+						EditionSelectorDialog d = new EditionSelectorDialog(shell, corpus, editionNames);
+
+						if (corpus.getEditionNames().size() > 1 && d.open() == Window.OK) {
+							Object[] rez = d.getResult();
+							editionNames = new String[rez.length];
+							for(int i = 0 ; i < rez.length ; i++) editionNames[i] = rez[i].toString();
+							editionsLabel.setText(StringUtils.join(editionNames, " | ")); //$NON-NLS-1$
+							openEditions(corpus, text, editionNames);
+							firstPage();
+						} else if (corpus.getEditionNames().size() == 1) {
+							editionNames = new String[]{corpus.getEditionNames().get(0)};
+							editionsLabel.setText(StringUtils.join(editionNames, " | ")); //$NON-NLS-1$
+							openEditions(corpus, text, editionNames);
+							firstPage();
+						} else {
+							System.out.println(SynopticMessages.SynopticEditionEditor_5);
+						}
+					} catch (Exception e2) {
+						org.txm.rcpapplication.utils.Logger.printStackTrace(e2);
+						System.out.println(SynopticMessages.SynopticEditionEditor_6+e2);
+					}
+				}
+
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) { }
+			});
+		} 
+	
+		supplementaryButtonComposite = new Composite(controlsArea, SWT.NONE);
+		supplementaryButtonComposite.setLayout(new FillLayout(SWT.HORIZONTAL));
+				
+		// Navigation buttons
+		
+		Button first = new Button(controlsArea, SWT.FLAT|SWT.PUSH);
+		Button previous = new Button(controlsArea, SWT.FLAT|SWT.PUSH);
+		page_text = new org.eclipse.swt.widgets.Text(controlsArea, SWT.BORDER);
+		page_label = new Label(controlsArea, SWT.NONE);
+		Button next = new Button(controlsArea, SWT.FLAT|SWT.PUSH);
+		Button last = new Button(controlsArea, SWT.FLAT|SWT.PUSH);
+		
+		
+		Button firstText = new Button(controlsArea, SWT.FLAT);
+		Button previousText = new Button(controlsArea, SWT.FLAT);
+		new Label(controlsArea, SWT.NONE).setText(" ");
+		Button nextText = new Button(controlsArea, SWT.FLAT|SWT.PUSH);
+		Button lastText = new Button(controlsArea, SWT.FLAT|SWT.PUSH);
+		
+		// Layouts data
+		
+		editionsLabel.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false));
+				
+		GridData buttonGridData = new GridData(GridData.FILL,GridData.CENTER, false, false);
+		buttonGridData.widthHint = 30;
+		buttonGridData.heightHint = 30;
+		firstText.setLayoutData(buttonGridData);
+		previousText.setLayoutData(buttonGridData);
+		GridData centerButtonGridData = new GridData(GridData.END,GridData.CENTER, true, true);
+		centerButtonGridData.widthHint = 30;
+		centerButtonGridData.heightHint = 30;
+		first.setLayoutData(centerButtonGridData);
+		previous.setLayoutData(buttonGridData);
+		
+		// set sizes
+		
+		GridData gdata = new GridData(GridData.END,GridData.CENTER, false, false);
+		gdata.minimumWidth = 40;
+		gdata.widthHint = 40;
+		page_text.setLayoutData(gdata);
+		page_label.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false));
+		
+		next.setLayoutData(buttonGridData);
+		centerButtonGridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, true);
+		centerButtonGridData.widthHint = 30;
+		centerButtonGridData.heightHint = 30;
+		last.setLayoutData(centerButtonGridData);
+		nextText.setLayoutData(buttonGridData);
+		lastText.setLayoutData(buttonGridData);
+			
+		GridData supplementaryButtonCompositeLayoutData = new GridData(GridData.BEGINNING, GridData.CENTER, false, true);
+		supplementaryButtonComposite.setLayoutData(supplementaryButtonCompositeLayoutData);
+		
+		if (editionsChooser != null)
+			editionsChooser.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, true));
+		//else spacer.setLayoutData(new GridData(GridData.END,GridData.CENTER, true, true));
+		
+		// set labels
+		page_label.setText(""); //$NON-NLS-1$
+		firstText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWINDSTART));
+		firstText.setToolTipText(SynopticMessages.SynopticEditionEditor_0); 
+		previousText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWIND));
+		previousText.setToolTipText(SynopticMessages.SynopticEditionEditor_1); 
+		first.setImage(IImageKeys.getImage(IImageKeys.CTRLSTART)); 
+		first.setToolTipText(SynopticMessages.SynopticEditionEditor_3); 
+		previous.setImage(IImageKeys.getImage(IImageKeys.CTRLREVERSE));
+		previous.setToolTipText(SynopticMessages.SynopticEditionEditor_4); 
+		next.setImage(IImageKeys.getImage(IImageKeys.CTRLPLAY));
+		next.setToolTipText(SynopticMessages.SynopticEditionEditor_7); 
+		last.setImage(IImageKeys.getImage(IImageKeys.CTRLEND));
+		last.setToolTipText(SynopticMessages.SynopticEditionEditor_8);
+		nextText.setImage(IImageKeys.getImage(IImageKeys.CTRLFASTFORWARD));
+		nextText.setToolTipText(SynopticMessages.SynopticEditionEditor_10); 
+		lastText.setImage(IImageKeys.getImage(IImageKeys.CTRLFASTFORWARDEND));
+		lastText.setToolTipText(SynopticMessages.SynopticEditionEditor_11); 
+		
+		// browse available extension points
+		try {		
+			IConfigurationElement[] config = Platform.getExtensionRegistry()
+					.getConfigurationElementsFor("org.txm.synopticeditor.toolbarbutton");
+			//Log.warning(Messages.ApplicationWorkbenchAdvisor_15+config.length);
+			for (IConfigurationElement e : config) {
+				Object o = e.createExecutableExtension("class"); //$NON-NLS-1$
+				if (o instanceof ToolbarButton) {
+					ToolbarButton tb = ((ToolbarButton) o);
+					Button b = tb.getToolbarButton(supplementaryButtonComposite, this);
+					//b.setLayoutData(buttonGridData);
+					toolbarButtons.add(tb);
+				}
+			}
+		} catch (Exception ex) {
+			System.out.println(ex.getMessage());
+		}
+		
+		page_text.addKeyListener(new KeyListener() {
+
+			@Override
+			public void keyReleased(KeyEvent e) {
+				if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
+					goToPage(page_text.getText());
+				}
+			}
+
+			@Override
+			public void keyPressed(KeyEvent e) {}
+		});
+		// set listeners
+		first.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				firstPage();
+			}
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				firstPage();
+			}
+		});
+		previous.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				previousPage();
+			}
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				previousPage();
+			}
+		});
+		next.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				nextPage();
+			}
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				nextPage();
+			}
+		});
+		last.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				lastPage();
+			}
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				lastPage();
+			}
+		});
+		nextText.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				nextText();
+			}
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				nextText();
+			}
+		});
+		// set listeners
+		previousText.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				previousText(false);
+			}
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				previousText(false);
+			}
+		});
+		lastText.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				lastText();
+			}
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				lastText();
+			}
+		});
+		// set listeners
+		firstText.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				firstText();
+			}
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				firstText();
+			}
+		});
+
+		// set Layouts
+		FormLayout parentLayout = new FormLayout();
+		parent.setLayout(parentLayout);
+
+		parent.pack();
+
+		openEditions(corpus, text, editionNames);
+	}
+
+	/**
+	 * Opens the default corpus edition with the first Text
+	 * 
+	 * @param corpus
+	 */
+	public boolean openEditions(Corpus corpus) {
+		if (corpus == null) return false;
+		return openEditions(corpus, corpus.getFirstText(), corpus.getDefaultEdition());
+	}
+
+	/**
+	 * update editor title using the first panel only 
+	 */
+	private void updatePageLabel() {
+		for (EditionPanel p : editionPanels.values()) {
+			this.setPartName(p.getCurrentPage().getEdition().getText().getName()+ " - "+p.getCurrentPage().getName()); //$NON-NLS-1$
+			page_text.setText(p.getCurrentPage().getName());
+			page_label.setText(" / "+p.getCurrentPage().getEdition().getNumPages()); //$NON-NLS-1$
+			controlsArea.layout();
+			return;
+		}
+	}
+
+	public boolean openEditions(Corpus corpus, String textID, String... editionNames) {
+		Text text = corpus.getText(textID);
+		if (text == null) return false;
+		return openEditions(corpus, text, editionNames);
+	}
+
+	/**
+	 * Opens a list of edition corpus
+	 * @param corpus
+	 * @param editionNames
+	 */
+	public boolean openEditions(Corpus corpus, Text text, String... editionNames) {
+
+		// remove previous EditionPanel
+		for (EditionPanel panel : editionPanels.values()) {
+			panel.dispose();
+		}
+		editionPanels = new LinkedHashMap<String, EditionPanel>();
+
+		editionsArea.setLayout(new GridLayout(editionNames.length, true));
+
+		for (int i = 0 ; i < editionNames.length ;i++) {
+			String editionName = editionNames[i];
+			//System.out.println("EDITION NAME: "+editionName);
+			Composite container = editionsArea;//.getContainer(i);
+			Edition edition = text.getEdition(editionName);
+			if (edition != null) {
+				EditionPanel panel = new EditionPanel(this, container, SWT.BORDER, edition);
+				panel.initSelectionProvider();
+
+				if (i == 0) { // TODO: how to manage multiple menumanager -> the text selection does not work only the first panel selection is used
+					panel.initMenu();
+					getSite().registerContextMenu(panel.getMenuManager(), panel.getSelectionProvider());
+				}
+
+				editionPanels.put(editionName, panel);
+			} else {
+				System.out.println(SynopticMessages.SynopticEditionEditor_9+editionName);
+			}
+		}
+		editionsArea.layout();
+		return true;
+	}
+
+	/**
+	 * 
+	 * //TODO: add getDefaultEditions to Corpus object
+	 * 
+	 * @param corpus
+	 * @return a list of default editions
+	 */
+	public String[] getDefaultEditions(Corpus corpus) {
+		String defaultEdition = corpus.getDefaultEdition();
+		if (defaultEdition.contains(",")) { //$NON-NLS-1$
+			return defaultEdition.split(","); //$NON-NLS-1$
+		} else {
+			return new String[]{defaultEdition};
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.commands.editor.CustomizableEditor#setSource(java.lang.Object)
+	 */
+	@Override
+	public void setSource(Object source) {
+
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.rcpapplication.commands.editor.CustomizableEditor#getSource()
+	 */
+	@Override
+	public Object getSource() {
+		return null;
+	}
+
+	/* (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);
+	}
+
+	@Override
+	public Object toConcordance() { return null;}
+
+	@Override
+	public Object toIndex() { return null;}
+
+	@Override
+	public Object toProgression() { return null;}
+
+	@Override
+	public void doSave(IProgressMonitor monitor) {
+		// TODO Auto-generated method stub
+	}
+
+	@Override
+	public void doSaveAs() {
+
+	}
+
+	@Override
+	public void init(IEditorSite site, IEditorInput input)
+			throws PartInitException {
+		setSite(site);
+		setInput(input);
+
+		corpus = ((SynopticEditorInput) getEditorInput()).getCorpus();
+		corpus = corpus.getMainCorpus();
+		text = ((SynopticEditorInput) getEditorInput()).getText();
+		editionNames = ((SynopticEditorInput) getEditorInput()).getEditions();
+	}
+
+	@Override
+	public boolean isDirty() {
+		return false;
+	}
+
+	public boolean isDisposed() {
+		return editionsArea.isDisposed();
+	}
+
+	@Override
+	public boolean isSaveAsAllowed() {
+		return false;
+	}
+
+	@Override
+	public void setFocus() {
+
+	}
+
+	public void backToText(Text text, String line_wordid) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.backToText(text, line_wordid);
+		}
+		updatePageLabel();
+	}
+
+	public void reloadPage() {
+		for (EditionPanel p : editionPanels.values()) {
+			p.reloadPage();
+		}
+	}
+
+	@Override
+	public String getTextSelection() {
+		String sel = null;
+		for (EditionPanel p : editionPanels.values()) {
+			sel = p.getTextSelection();
+			if (sel != null) return sel;
+		}
+		return "";
+	}
+
+	@Override
+	public Corpus getCorpus() {
+		return corpus;
+	}
+
+	@Override
+	public boolean usingCorpus(Corpus corpus) {
+		return false;
+	}
+
+	@Override
+	public boolean updateCorpus(Corpus corpus) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public EditionPanel getEditionPanel(int i) {
+		int n = 0;
+		for (EditionPanel p : editionPanels.values()) {
+			if (n == i) return p;
+		}
+		return null;
+	}
+
+	/**
+	 * 
+	 * @return the first and last word ID covered by the text selection of the first EditionPanel
+	 */
+	public Object getWordSelection() {
+		for (EditionPanel p : editionPanels.values()) {
+			return p.getWordSelection();
+		}
+		return null;
+	}
+
+	/**
+	 * 
+	 * @param text2 the Text to set
+	 * @param refresh if true set the first Text page
+	 */
+	public void setText(Text text2, boolean refresh) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.setText(text2, refresh);
+		}
+	}
+
+	public void setFocusedWordID(String focusid) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.setFocusedWordID(focusid);
+		}
+	}
+
+	/**
+	 *  NOT DONE
+	 *  
+	 * @param pos
+	 */
+	public void setHighlightedArea(HashSet<int[]> positions) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.setHighlightedArea(positions);
+		}
+	}
+
+	public void updateWordStyles() {
+		for (EditionPanel p : editionPanels.values()) {
+			p.updateWordStyles();
+		}
+	}
+}
\ No newline at end of file

Property changes on: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SynopticEditionEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/EditionSelectorDialog.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/EditionSelectorDialog.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/EditionSelectorDialog.java	(revision 88)
@@ -0,0 +1,53 @@
+package org.txm.rcp.synoptic.editor;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.txm.objects.Corpus;
+
+import synopticeditor.SynopticMessages;
+
+public class EditionSelectorDialog extends ElementListSelectionDialog {
+
+	public EditionSelectorDialog(Shell parent, Corpus corpus, String[] defaultSelection) {
+		super(parent, new ILabelProvider() {
+			@Override
+			public void removeListener(ILabelProviderListener listener) { }
+
+			@Override
+			public boolean isLabelProperty(Object element,
+					String property) {
+				return false;
+			}
+
+			@Override
+			public void dispose() { }
+
+			@Override
+			public void addListener(ILabelProviderListener listener) { }
+
+			@Override
+			public Image getImage(Object element) {
+				return null;
+			}
+
+			@Override
+			public String getText(Object element) {
+				return element.toString();
+			}
+		});
+
+		setTitle(SynopticMessages.EditionSelectorDialog_0);
+		setMessage(SynopticMessages.EditionSelectorDialog_1);
+		setMultipleSelection(true);
+		setElements(corpus.getEditionNames().toArray());
+		setFilter("*"); //$NON-NLS-1$
+		
+		if (defaultSelection == null) {
+			defaultSelection = new String[]{corpus.getDefaultEdition()};
+		}
+		this.setInitialSelections(defaultSelection);
+	}
+}
\ No newline at end of file

Property changes on: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/EditionSelectorDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SashPanel.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SashPanel.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SashPanel.java	(revision 88)
@@ -0,0 +1,90 @@
+package org.txm.rcp.synoptic.editor;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Sash;
+
+public class SashPanel extends Composite {
+
+	//Composite parent;
+	ArrayList<Composite> cells;
+
+	public SashPanel(Composite parent, int style) {
+		super(parent, style);
+		//this.parent = parent;
+		this.setLayout(new FormLayout());
+	}
+
+	public void init(int ncolumns) {
+		if (cells != null) {
+			for(Control c : this.getChildren())
+				c.dispose();
+			cells.clear();
+			cells = new ArrayList<Composite>();
+		}
+
+		cells = new ArrayList<Composite>();
+		Sash sash = null;
+		FormData sashData = null;
+		for (int i = 0 ; i < ncolumns ; i++) {
+			Composite container = new Composite(this, SWT.NONE);
+			container.setLayout(new GridLayout());
+			cells.add(container);
+
+			FormData containerData = new FormData();
+			containerData.width = 100;
+			containerData.top = new FormAttachment(0, 0);
+			containerData.bottom = new FormAttachment(100, 0);
+			container.setLayoutData(containerData);// set new layout data
+
+			if (sash != null) { // attached FormData to previous sash and vice-versa
+				sashData.right = new FormAttachment(container, 0);
+				containerData.left = new FormAttachment(sash, 0);
+			} else if (i == 0) {
+				containerData.left = new FormAttachment(0, 0); // first cell
+			}
+
+			if (i == ncolumns -1 ) {
+				containerData.right = new FormAttachment(100, 0); // last cell
+			} else {
+				sash = new Sash(this, SWT.VERTICAL);
+				containerData.right = new FormAttachment(sash, 0);
+
+				sashData = new FormData();
+				sashData.left = new FormAttachment(container, 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) {
+					SashPanel.this.layout();
+					//								e.getBounds()
+					//								Rectangle sashRect = sash.getBounds();
+					//								Rectangle shellRect = SashPanel.this.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();
+					//								}
+				}
+			});
+		}
+
+	}
+
+	public Composite getContainer(int i) {
+		return cells.get(i);
+	}
+}

Property changes on: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SashPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SynopticEditorInput.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SynopticEditorInput.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SynopticEditorInput.java	(revision 88)
@@ -0,0 +1,109 @@
+package org.txm.rcp.synoptic.editor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.txm.objects.Text;
+import org.txm.rcpapplication.Application;
+import org.txm.rcpapplication.IImageKeys;
+import org.txm.searchengine.cqp.corpus.Corpus;
+
+import cern.colt.Arrays;
+
+public class SynopticEditorInput implements IEditorInput {
+
+	private Corpus corpus;
+	private Text text;
+	private String[] editions;
+
+	/**
+	 * Instantiates a new SynopticEditorInput
+	 *
+	 * @param corpus, the corpus
+	 * @param text, the text to show
+	 * @param editions, the editions to show
+	 */
+	public SynopticEditorInput(Corpus corpus, String text, String[] editions) {
+		this.corpus = corpus;
+		corpus = corpus.getMainCorpus();
+		this.editions = editions;
+		
+		if (text == null) {
+			this.text = corpus.getFirstText();
+		} else {
+			this.text = corpus.getText(text);
+		}
+		
+		if (editions == null) {
+			String[] defaultEditions = {corpus.getDefaultEdition()};
+			this.editions = defaultEditions;
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+	 */
+	@Override
+	public ImageDescriptor getImageDescriptor() {
+		return AbstractUIPlugin.imageDescriptorFromPlugin(
+				Application.PLUGIN_ID, IImageKeys.EDITION);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#getName()
+	 */
+	@Override
+	public String getName() {
+		return corpus.getName()+ " - "+text+ " - "+Arrays.toString(editions);  //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#getPersistable()
+	 */
+	@Override
+	public IPersistableElement getPersistable() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#getToolTipText()
+	 */
+	@Override
+	public String getToolTipText() {
+		return getName();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+	 */
+	@Override
+	public Object getAdapter(Class adapter) {
+		return null;
+	}
+
+	/**
+	 * Gets the corpus.
+	 *
+	 * @return the corpus
+	 */
+	public Corpus getCorpus() {
+		return corpus;
+	}
+
+	public Text getText() {
+		return text;
+	}
+	
+	public String[] getEditions() {
+		return editions;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#exists()
+	 */
+	@Override
+	public boolean exists() {
+		return false;
+	}
+}

Property changes on: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/SynopticEditorInput.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/ext/ToolbarButton.java
===================================================================
--- tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/ext/ToolbarButton.java	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/ext/ToolbarButton.java	(revision 88)
@@ -0,0 +1,32 @@
+package org.txm.rcp.synoptic.editor.ext;
+
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.txm.rcp.synoptic.editor.SynopticEditionEditor;
+
+public class ToolbarButton {
+
+	protected SynopticEditionEditor editor;
+
+	public ToolbarButton() {}
+	
+	/**
+	 * 
+	 * @param parent
+	 * @param editor
+	 * @return the button to dislay in the bottom toolbar
+	 */
+	public Button getToolbarButton(Composite parent, SynopticEditionEditor editor) {
+		this.editor = editor;
+		return null;
+	}
+	
+	/**
+	 * Called when the editor is disposed
+	 * 
+	 * @return true is the editor can be closed
+	 */
+	public boolean onClose() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: tmp/org.txm.synopticeditor.rcp/src/org/txm/rcp/synoptic/editor/ext/ToolbarButton.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/build.properties
===================================================================
--- tmp/org.txm.synopticeditor.rcp/build.properties	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/build.properties	(revision 88)
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               icons/,\
+               OSGI-INF/l10n/bundle.properties

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

Index: tmp/org.txm.synopticeditor.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- tmp/org.txm.synopticeditor.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 88)
@@ -0,0 +1,9 @@
+#Properties file for SynopticEditorRCP
+command.label = �dition
+command.tooltip = Lire l'�dition
+command.tooltip.0 = Lire l'�dition
+command.name = �dition
+command.name.0 = Lire en plein texte
+editor.name = �dition
+Bundle-Name = SynopticEditor
+menu.label.1 = Corpus
\ No newline at end of file

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

Index: tmp/org.txm.synopticeditor.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- tmp/org.txm.synopticeditor.rcp/OSGI-INF/l10n/bundle.properties	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/OSGI-INF/l10n/bundle.properties	(revision 88)
@@ -0,0 +1,9 @@
+#Properties file for SynopticEditorRCP
+command.label = Edition
+command.tooltip = Read corpus texts
+command.tooltip.0 = Read corpus texts
+command.name = Edition
+command.name.0 = Display in full text
+editor.name = Edition
+Bundle-Name = SynopticEditor
+menu.label.1 = Corpus
\ No newline at end of file

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

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

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

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

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

Index: tmp/org.txm.synopticeditor.rcp/plugin.xml
===================================================================
--- tmp/org.txm.synopticeditor.rcp/plugin.xml	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/plugin.xml	(revision 88)
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension-point id="org.txm.synopticeditor.toolbarbutton" name="Synoptic Editor toolbar button" schema="schema/org.txm.synopticeditor.toolbarbutton.exsd"/>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            locationURI="popup:org.txm.rcpapplication.editors.ConcordancesEditor">
+         <command
+               commandId="org.txm.rcp.synoptic.commands.BackToText"
+               icon="icons/objects/edition.png"
+               style="push">
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:menu.help.plugins">
+         <command
+               commandId="org.txm.rcpapplication.commands.OpenBrowser"
+               icon="icons/objects/edition.png"
+               label="%command.label"
+               style="push">
+            <parameter
+                  name="org.txm.rcpapplication.commands.commandParameter2"
+                  value="https://groupes.renater.fr/wiki/txm-users/public/extensions#synoptic_editor">
+            </parameter>
+         </command>
+      </menuContribution>
+      <menuContribution
+            allPopups="true"
+            locationURI="toolbar:org.txm.rcpapplication.toolbarcorpus?before=org.txm.rcpapplication.toolbarcorpus.description">
+         <command
+               commandId="org.txm.rcp.synoptic.commands.OpenEdition"
+               icon="icons/objects/edition.png"
+               style="push"
+               tooltip="%command.tooltip.0">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OneCorpusSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="popup:org.txm.rcpapplication.views.CorporaView?before=corporaview.description">
+         <command
+               commandId="org.txm.rcp.synoptic.commands.OpenEdition"
+               icon="icons/objects/edition.png"
+               style="push"
+               tooltip="%command.tooltip.0">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OneCorpusSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:menu.corpus?before=menu.corpus.description">
+         <command
+               commandId="org.txm.rcp.synoptic.commands.OpenEdition"
+               icon="icons/objects/edition.png"
+               style="push"
+               tooltip="%command.tooltip.0">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OneCorpusSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="popup:org.txm.rcp.synoptic.editor.SynopticEditionEditor">
+         <command
+               commandId="org.txm.rcpapplication.commands.link.TextToConcordance"
+               label="Send to concordances..."
+               style="push">
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="org.txm.rcp.synoptic.commands.OpenEdition"
+            id="org.txm.rcp.synoptic.commands.OpenEdition"
+            name="%command.name">
+      </command>
+      <command
+            defaultHandler="org.txm.rcp.synoptic.commands.BackToText"
+            id="org.txm.rcp.synoptic.commands.BackToText"
+            name="%command.name.0">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.editors">
+      <editor
+            class="org.txm.rcp.synoptic.editor.SynopticEditionEditor"
+            default="false"
+            icon="icons/objects/edition.png"
+            id="org.txm.rcp.synoptic.editor.SynopticEditionEditor"
+            name="%editor.name">
+      </editor>
+   </extension>
+   <extension
+         point="org.eclipse.ui.bindings">
+      <key
+            commandId="org.txm.rcp.synoptic.commands.BackToText"
+            contextId="org.eclipse.ui.contexts.window"
+            schemeId="org.txm.rcp.scheme"
+            sequence="M1+E">
+      </key>
+   </extension>
+   <extension
+         point="org.txm.rcp.extensionpoint.backtotext">
+      <command
+            class="org.txm.rcp.synoptic.commands.BackToText"
+            name="Synoptic">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            category="org.txm.rcpapplication.preferences.UserPreferencePage"
+            class="org.txm.rcp.synoptic.preferences.EditionPreferencePage"
+            id="org.txm.rcp.synoptic.preferences.EditionPreferencePage"
+            name="Edition">
+      </page>
+   </extension>
+
+</plugin>

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

Index: tmp/org.txm.synopticeditor.rcp/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.synopticeditor.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 88)
@@ -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.synopticeditor.rcp/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/.classpath
===================================================================
--- tmp/org.txm.synopticeditor.rcp/.classpath	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/.classpath	(revision 88)
@@ -0,0 +1,11 @@
+<?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">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

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

Index: tmp/org.txm.synopticeditor.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.synopticeditor.rcp/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/META-INF/MANIFEST.MF	(revision 88)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.txm.synopticeditor.rcp;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: synopticeditor.Activator
+Require-Bundle: org.txm.core;bundle-version="0.7.0",
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.txm.rcp;bundle-version="0.7.5",
+ org.eclipse.ui.browser;bundle-version="3.4.100",
+ org.eclipse.jface.databinding;bundle-version="1.6.200",
+ org.eclipse.jface.text;bundle-version="3.9.2"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.txm.rcp.synoptic.commands,
+ org.txm.rcp.synoptic.editor,
+ org.txm.rcp.synoptic.editor.ext,
+ synopticeditor
+Bundle-Vendor: Textometrie.org

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

Index: tmp/org.txm.synopticeditor.rcp/schema/org.txm.synopticeditor.toolbarbutton.exsd
===================================================================
--- tmp/org.txm.synopticeditor.rcp/schema/org.txm.synopticeditor.toolbarbutton.exsd	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/schema/org.txm.synopticeditor.toolbarbutton.exsd	(revision 88)
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="SynopticEditorRCP" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="SynopticEditorRCP" id="org.txm.synopticeditor.bottombutton" name="Synoptic Editor bottom button"/>
+      </appinfo>
+      <documentation>
+         Add a button in the SynapticEditor bottom toolbar
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <choice minOccurs="1" maxOccurs="unbounded">
+            <element ref="Button"/>
+         </choice>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute translatable="true"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="Button">
+      <complexType>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn="org.txm.rcp.synoptic.editor.ext.ToolbarButton:"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         TXM 0.7.8
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         [Enter extension point usage example here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiinfo"/>
+      </appinfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="implementation"/>
+      </appinfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+
+</schema>

Property changes on: tmp/org.txm.synopticeditor.rcp/schema/org.txm.synopticeditor.toolbarbutton.exsd
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.synopticeditor.rcp/.project
===================================================================
--- tmp/org.txm.synopticeditor.rcp/.project	(revision 0)
+++ tmp/org.txm.synopticeditor.rcp/.project	(revision 88)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.synopticeditor.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.synopticeditor.rcp/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.specificities.rcp/.classpath
===================================================================
--- tmp/org.txm.specificities.rcp/.classpath	(revision 0)
+++ tmp/org.txm.specificities.rcp/.classpath	(revision 88)
@@ -0,0 +1,8 @@
+<?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="src" path="OSGI-INF"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

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

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

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

Index: tmp/org.txm.specificities.rcp/.project
===================================================================
--- tmp/org.txm.specificities.rcp/.project	(revision 0)
+++ tmp/org.txm.specificities.rcp/.project	(revision 88)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.specificities.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.specificities.rcp/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/messages/RCPSpecificitiesMessages.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/messages/RCPSpecificitiesMessages.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/messages/RCPSpecificitiesMessages.java	(revision 88)
@@ -0,0 +1,47 @@
+package org.txm.specificities.rcp.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class RCPSpecificitiesMessages extends NLS {
+	
+
+	//private static final String BUNDLE_NAME = "org.txm.rcp.wordcloud.messages.messages"; //$NON-NLS-1$
+	// FIXME: use the same properties file than the bundle	
+	private static final String BUNDLE_NAME = "l10n.bundle"; //$NON-NLS-1$
+	
+	
+	
+	public static String SpecificitiesPreferencePage_0;
+	public static String SpecificitiesPreferencePage_1;
+	public static String SpecificitiesPreferencePage_2;
+	public static String SpecificitiesPreferencePage_3;
+	public static String SpecificitiesPreferencePage_4;
+	public static String SpecificitiesPreferencePage_5;
+	public static String SpecificitiesPreferencePage_6;
+	public static String SpecificitiesPreferencePage_7;
+
+	public static String SpecificitiesPreferencePage_8;
+	public static String SpecificitiesResultEditorInput_0;
+	public static String SpecificitiesResultEditorInput_1;
+	public static String SpecificitiesResultEditorInput_11;
+	public static String SpecificitiesResultEditorInput_2;
+	public static String SpecificitiesResultEditorInput_5;
+	public static String SpecificitiesResultEditorInput_6;
+	public static String SpecificitiesResultEditorInput_7;
+	public static String SpecificitiesTableEditor_0;
+	public static String SpecificitiesTableEditor_1;
+	public static String SpecificitiesTableEditor_11;
+	public static String SpecificitiesTableEditor_16;
+	public static String SpecificitiesTableEditor_17;
+	public static String SpecificitiesTableEditor_5;
+	public static String SpecificitiesTableEditor_8;
+	
+	
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(BUNDLE_NAME, RCPSpecificitiesMessages.class);
+	}
+
+	private RCPSpecificitiesMessages() {
+	}
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesResultEditorInput.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesResultEditorInput.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesResultEditorInput.java	(revision 88)
@@ -0,0 +1,412 @@
+// 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.specificities.rcp.editors;
+
+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.rcpapplication.Application;
+import org.txm.rcpapplication.IImageKeys;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.editors.Tablable;
+import org.txm.rcpapplication.editors.TableEditor;
+import org.txm.rcpapplication.editors.input.AbstractTablable;
+import org.txm.rcpapplication.editors.input.IProvidingMultiPageEditorInput;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.specificities.core.functions.SpecificitesResult;
+import org.txm.specificities.rcp.messages.RCPSpecificitiesMessages;
+import org.txm.stat.StatException;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class SpecificitiesResultEditorInput.
+ * 
+ * TODO : simplif ier toute la partie haut niveau de Specificities :
+ * SpecificitiesResult doit être identique (un vecteur d'indice de spécif icités)
+ * que ce soit des spécif icities de formes ou de parties. SL
+ * 
+ * @author jmague, Sylvain Loiseau
+ */
+public class SpecificitiesResultEditorInput implements IEditorInput, IProvidingMultiPageEditorInput {
+
+	/** The specificities result. */
+	private SpecificitesResult specificitiesResult;
+	
+	/** The editors. */
+	private List<EditorPart> editors;
+	
+	/** The inputs. */
+	private List<IEditorInput> inputs;
+	
+	/** The names. */
+	private List<String> names = Arrays.asList(new String[] {
+			RCPSpecificitiesMessages.SpecificitiesResultEditorInput_0,
+			RCPSpecificitiesMessages.SpecificitiesResultEditorInput_1 });
+	
+	/** The subcorpus. */
+	private Corpus subcorpus;
+	
+	/** The partition. */
+	private Partition partition;
+
+	/**
+	 * The Class SpecificitiesResultLabelProvider.
+	 */
+	private class SpecificitiesResultLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+		/* (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) {
+			return ((List<Object>) element).get(columnIndex).toString();
+		}
+	}
+
+	/**
+	 * The Class SpecificitiesContentProvider.
+	 */
+	private class SpecificitiesContentProvider implements IStructuredContentProvider {
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+		 */
+		@Override
+		public Object[] getElements(Object inputElement) {
+			SpecificitesResult res = (SpecificitesResult) inputElement;
+			int[][] freq = null;
+			double[][] specificitiesIndex = null;
+			String[] names = null;
+			try {
+				freq = res.getFrequency();
+				specificitiesIndex = res.getSpecificitesIndex();
+				names = res.getTypeNames();
+			} catch (StatException e) {
+				org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+			}
+
+			List<List<Object>> specif = new ArrayList<List<Object>>();
+
+			if (freq.length > 1) {
+				int[] formFreq = null;
+				try {
+					formFreq = res.getFormFrequencies();
+				} catch (StatException e) {
+					org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+				}
+				if (freq[0].length > 1)
+					throw new IllegalStateException(RCPSpecificitiesMessages.SpecificitiesResultEditorInput_2);
+				for (int i = 0; i < freq.length; i++) {
+					List<Object> node = new ArrayList<Object>();
+					node.add(names[i]);
+					node.add(formFreq[i]);
+					node.add(freq[i][0]);
+					node.add(specificitiesIndex[i][0]);
+					specif.add(node);
+				}
+			} else {
+				int[] partSize = null;
+				try {
+					partSize = res.getPartSize();
+				} catch (StatException e) {
+					org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+				}
+				if (freq.length != 1)
+					throw new IllegalStateException(
+							RCPSpecificitiesMessages.SpecificitiesResultEditorInput_2);
+				for (int i = 0; i < freq[0].length; i++) {
+					List<Object> node = new ArrayList<Object>();
+					node.add(names[i]);
+					node.add(partSize[i]);
+					node.add(freq[0][i]);
+					node.add(specificitiesIndex[0][i]);
+					specif.add(node);
+				}
+				// throw new
+				// UnsupportedOperationException("Not implemented yet.");
+			}
+			return specif.toArray();
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+		 */
+		@Override
+		public void dispose() {
+			// TODO Auto-generated method stub
+
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+		 */
+		@Override
+		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			// TODO Auto-generated method stub
+
+		}
+
+	};
+
+	/**
+	 * Instantiates a new specificities result editor input.
+	 *
+	 * @param specificitiesResult the specificities result
+	 * @param subcorpus the subcorpus
+	 */
+	public SpecificitiesResultEditorInput(final SpecificitesResult specificitiesResult, Corpus subcorpus) {
+		this.specificitiesResult = specificitiesResult;
+		this.subcorpus = subcorpus;
+		init();
+	}
+
+	/**
+	 * Instantiates a new specificities result editor input.
+	 *
+	 * @param specificitiesResult the specificities result
+	 * @param partition the partition
+	 */
+	public SpecificitiesResultEditorInput(final SpecificitesResult specificitiesResult, Partition partition) {
+		this.specificitiesResult = specificitiesResult;
+		this.partition = partition;
+		specificitiesResult.getLexicalTable().getPartition();
+		specificitiesResult.getLexicalTable().getProperty();
+		specificitiesResult.getTypeFocus();
+		specificitiesResult.getPartFocus();
+		init();
+	}
+
+	/**
+	 * Gets the specificites result.
+	 *
+	 * @return the specificites result
+	 */
+	public SpecificitesResult getSpecificitesResult() {
+		return specificitiesResult;
+	}
+
+	/**
+	 * Inits the.
+	 */
+	private void init() {
+		editors = new ArrayList<EditorPart>();
+		editors.add(new TableEditor());
+
+		inputs = new ArrayList<IEditorInput>();
+
+		Tablable asTable = new AbstractTablable() {
+
+			@Override
+			public String[] getColumnTitles() {
+				return new String[] {
+						Messages.FrequencyListEditorInput_3,
+						RCPSpecificitiesMessages.SpecificitiesResultEditorInput_5,
+						RCPSpecificitiesMessages.SpecificitiesResultEditorInput_6,
+						RCPSpecificitiesMessages.SpecificitiesResultEditorInput_7 };
+			}
+
+			@Override
+			public String[] getColumnTypes() {
+				return new String[] {
+						Messages.FrequencyListEditorInput_5,
+						Messages.FrequencyListEditorInput_6,
+						Messages.FrequencyListEditorInput_6,
+						RCPSpecificitiesMessages.SpecificitiesResultEditorInput_11 };
+			}
+
+			@Override
+			public IStructuredContentProvider getContentProvider() {
+				return new SpecificitiesContentProvider();
+			}
+
+			@Override
+			public Object getInput() {
+				return specificitiesResult;
+			}
+
+			@Override
+			public LabelProvider getLabelProvider() {
+				return new SpecificitiesResultLabelProvider();
+			}
+
+		};
+		inputs.add(asTable);
+
+	}
+
+	/**
+	 * 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_SPECIFICITIES);
+	}
+
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 * @see org.eclipse.ui.IEditorInput#getName()
+	 */
+	@Override
+	public String getName() {
+		return ""; //$NON-NLS-1$
+	}
+
+	/**
+	 * 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
+	public Object getAdapter(Class arg0) {
+		return null;
+	}
+
+	/**
+	 * Gets the specificities result.
+	 *
+	 * @return the specificitiesResult
+	 */
+	public SpecificitesResult getSpecificitiesResult() {
+		return specificitiesResult;
+	}
+
+	/* (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() {
+		// TODO Auto-generated method stub
+		return names;
+	}
+	
+	/**
+	 * Gets the partition.
+	 *
+	 * @return the partition
+	 */
+	public Partition getPartition() {
+		return partition;
+	}
+
+	/**
+	 * Gets the subcorpus.
+	 *
+	 * @return the subcorpus
+	 */
+	public Corpus getSubcorpus() {
+		return subcorpus;
+	}
+	
+	/**
+	 * Sets the subcorpus.
+	 *
+	 * @param subcorpus the new subcorpus
+	 */
+	public void setSubcorpus(Corpus subcorpus) {
+		this.subcorpus = subcorpus;
+	}
+
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecifForm.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecifForm.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecifForm.java	(revision 88)
@@ -0,0 +1,86 @@
+package org.txm.specificities.rcp.editors;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.txm.rcpapplication.Messages;
+
+
+public class SpecifForm extends Composite {
+	SashForm sashForm;
+	private Table table;
+	Combo propCombo;
+	Button okButton;
+	
+	/**
+	 * Create the composite.
+	 * @param parent
+	 * @param style
+	 */
+	public SpecifForm(Composite parent, int style) {
+		super(parent, style);
+		setLayout(new GridLayout(1, true));
+		
+		sashForm = new SashForm(this, SWT.VERTICAL);
+		sashForm.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+		
+		ScrolledComposite scrolledComposite_1 = new ScrolledComposite(sashForm, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+		scrolledComposite_1.setExpandHorizontal(true);
+		scrolledComposite_1.setExpandVertical(true);
+		
+		Composite composite = new Composite(scrolledComposite_1, SWT.NONE);
+		composite.setLayout(new GridLayout(3, false));
+		
+		Label lblProprit = new Label(composite, SWT.NONE);
+		lblProprit.setText(Messages.ProgressionForm_7);
+		
+		propCombo = new Combo(composite, SWT.NONE);
+		
+		okButton = new Button(composite, SWT.NONE);
+		okButton.setText(Messages.InternalViewEditor_11);
+		scrolledComposite_1.setContent(composite);
+		scrolledComposite_1.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+		
+//		table = new Table(sashForm, SWT.BORDER | SWT.FULL_SELECTION);
+//		table.setHeaderVisible(true);
+//		table.setLinesVisible(true);
+//		sashForm.setWeights(new int[] {47, 545});
+	}
+	
+	public void setTable(Table table) {
+		//table = new Table(sashForm, SWT.BORDER | SWT.FULL_SELECTION);
+		table.setHeaderVisible(true);
+		table.setLinesVisible(true);
+		sashForm.setWeights(new int[] {215, 334});
+	}
+	
+	@Override
+	protected void checkSubclass() {
+		// Disable the check that prevents subclassing of SWT components
+	}
+
+	public SashForm getSash() {
+		return sashForm;
+	}
+	
+	/**
+	 * @return the table
+	 */
+	public Table getTable() {
+		return table;
+	}
+	
+	public Button getOkButton() {
+		return okButton;
+	}
+	
+	public Combo getPropCombo() {
+		return propCombo;
+	}
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/package.html
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/package.html	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/package.html	(revision 88)
@@ -0,0 +1,5 @@
+<html>
+<body>
+	<p>specificites editor</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableEditor.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableEditor.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableEditor.java	(revision 88)
@@ -0,0 +1,598 @@
+// 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.specificities.rcp.editors;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.Collator;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Locale;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.EditorPart;
+import org.txm.objects.TxmObject;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.rcpapplication.commands.editor.CustomizableEditor;
+import org.txm.rcpapplication.editors.TableKeyListener;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.specificities.core.functions.SpecificitesResult;
+import org.txm.specificities.rcp.messages.RCPSpecificitiesMessages;
+import org.txm.stat.StatException;
+// TODO: Auto-generated Javadoc
+/**
+ * Display a table editor with specificites index.
+ * 
+ * @author sloiseau
+ * 
+ */
+public class SpecificitiesTableEditor extends EditorPart implements CustomizableEditor{
+
+	public static String ID = "org.txm.specificities.editors.SpecificitiesTableEditor";
+	
+	
+
+	/** The specificities table. */
+	private Table specificitesTable;
+	private TableViewer viewer;
+	
+	/** Column for table typeNameTable. */
+	private TableColumn typeNameColumn;
+
+	/** Column for table typeFrequencyColumn. */
+	private TableColumn typeFrequencyColumn;
+
+	/** The current comparator: updated when user click on a column header */
+	protected Comparator currentComparator;
+
+	/** All columns for the table specificitesTable. */
+	private List<TableColumn> specificitesTableColumn = new ArrayList<TableColumn>();
+
+	/** The result of specificites*/
+	private SpecificitesResult specificitiesResult;
+
+	/** The table lines : table input */
+	private SpecificitiesTableLines tableLines;
+
+	/** The source. */
+	private Object source;
+
+	/* (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);
+
+		SpecificitiesResultEditorInput spinput = (SpecificitiesResultEditorInput) getEditorInput();
+		this.specificitiesResult = ((SpecificitiesResultEditorInput) getEditorInput()).getSpecificitesResult();
+		if (this.specificitiesResult.getLexicalTable()!= null && this.specificitiesResult.getLexicalTable().getPartition() != null)	{
+			setPartName(this.specificitiesResult.getLexicalTable().getPartition().getName()+": "+specificitiesResult.getName()); //$NON-NLS-1$
+		} else if (spinput.getSubcorpus() != null) {
+			setPartName(spinput.getSubcorpus().getName()+": "+specificitiesResult.getName()); //$NON-NLS-1$
+		} else {
+			setPartName(specificitiesResult.getName());
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	public void createPartControl(Composite parent) {
+		Composite displayArea = new Composite(parent, SWT.BORDER);
+		displayArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+		try {
+			composeDisplayArea(displayArea);
+		} catch (StatException e) {
+			System.err.println(NLS.bind(RCPSpecificitiesMessages.SpecificitiesTableEditor_0, e.getMessage()));
+		}
+	}
+
+	/** Sort. */
+	protected void sort() {
+		if (currentComparator != null) {
+			try {
+				PlatformUI.getWorkbench().getProgressService().busyCursorWhile(
+						new IRunnableWithProgress() {
+							@Override
+							public void run(IProgressMonitor monitor)
+							throws InvocationTargetException,
+							InterruptedException {
+								tableLines.sort(currentComparator);
+							}
+						});
+				StatusLine.setMessage(Messages.IndexEditor_37);
+				fillDisplay();
+			} catch (Exception e) {
+				System.err.println(NLS.bind(RCPSpecificitiesMessages.SpecificitiesTableEditor_1, e)); 
+			}
+		}
+	}
+
+	/**
+	 * Compose display area.
+	 *
+	 * @param parent the parent
+	 * @throws StatException the stat exception
+	 */
+	private void composeDisplayArea(final Composite parent) throws StatException {
+
+		GridLayout layout = new GridLayout(2, false);
+		layout.marginWidth = layout.marginHeight = layout.horizontalSpacing = 0;
+		parent.setLayout(layout);
+
+		final SpecificitesResult specificitiesResult = this.specificitiesResult;
+		// units
+		final String[] typeNames = specificitiesResult.getTypeNames();
+		// units' total freq
+		final int[] typeFreq = specificitiesResult.getFormFrequencies();
+		// units' index fr each part
+		final double[][] specIndex = specificitiesResult.getSpecificitesIndex();
+		final int[][] specFreqs = specificitiesResult.getFrequency();
+		// units' total in parts
+		//final int[] sortedPartIndexes = specificitesResult.getSortedPartIndexes();
+
+		// Create an array of lines to fill the tables
+//		System.out.println("len types: "+typeNames.length);
+//		System.out.println("len freq: "+typeFreq.length);
+//		System.out.println("len spec: "+specFreqs.length);
+//		System.out.println("len specidx: "+specIndex.length);
+		Object[] lines = new Object[typeNames.length];
+		for (int j = 0; j < lines.length; j++)
+			lines[j] = new Object[] { typeNames[j], new Integer(typeFreq[j]), specFreqs[j], specIndex[j] };
+
+		// final SpecificitesTableLines
+		tableLines = new SpecificitiesTableLines(lines);
+
+		// create table viewer
+		viewer = new TableViewer(parent, SWT.VIRTUAL | SWT.MULTI | SWT.FULL_SELECTION);
+		viewer.getTable().addKeyListener(new TableKeyListener(viewer));
+		viewer.getTable().setLinesVisible(true);
+		viewer.getTable().setHeaderVisible(true);
+		viewer.setLabelProvider(new SpecificitiesTableLabelProvider());
+		viewer.setContentProvider(new IStructuredContentProvider() {
+			@Override
+			public Object[] getElements(Object inputElement) {
+				return ((SpecificitiesTableLines) inputElement).getLines();
+			}
+
+			@Override
+			public void dispose() { }
+
+			@Override
+			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			}
+		});
+
+		specificitesTable = viewer.getTable();
+		GridData table2Data = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2);
+		specificitesTable.setLayoutData(table2Data);
+
+		// create 1st column
+		typeNameColumn = new TableColumn(specificitesTable,
+				SWT.NONE);
+		typeNameColumn.setText(Messages.ReferencerEditor_9);
+		typeNameColumn.setToolTipText(Messages.ReferencerEditor_9);
+		typeNameColumn.setAlignment(SWT.RIGHT);
+		typeNameColumn.pack();
+		typeNameColumn.setWidth((int) (typeNameColumn.getWidth()*1.5));
+
+		Object oparent = specificitiesResult.getParent();
+		Locale locale = Locale.getDefault();
+		if (oparent instanceof TxmObject) {
+			String lang = (String) ((TxmObject) oparent).getAttribute("lang"); //$NON-NLS-1$
+			if (lang != null)
+				locale = new Locale(lang);
+		}
+		final Collator collator = Collator.getInstance(locale);
+		collator.setStrength(Collator.TERTIARY);
+		typeNameColumn.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				StatusLine.setMessage(Messages.IndexEditor_36);
+				Comparator column_comparator = new Comparator() {
+					@Override
+					public int compare(Object o1, Object o2) {
+						Object[] line1 = (Object[]) o1;
+						Object[] line2 = (Object[]) o2;
+						return collator.compare(line1[0], line2[0]);
+					}
+				};
+				if (specificitesTable.getSortColumn() != typeNameColumn) {
+					specificitesTable.setSortColumn(
+							typeNameColumn);
+					specificitesTable.setSortDirection(SWT.UP);
+				} else if (specificitesTable
+						.getSortDirection() == SWT.UP) {
+					specificitesTable.setSortDirection(
+							SWT.DOWN);
+					column_comparator = new ReverseComparator(column_comparator);
+				} else {
+					specificitesTable.setSortDirection(SWT.UP);
+				}
+				currentComparator = column_comparator;
+				sort();
+				StatusLine.setMessage(""); //$NON-NLS-1$
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+			}
+		});
+
+		// create 2nd column
+		typeFrequencyColumn = new TableColumn(viewer
+				.getTable(), SWT.NONE);
+		typeFrequencyColumn.setText(Messages.FrequencyListEditorInput_4
+				+ " "+RCPSpecificitiesMessages.SpecificitiesTableEditor_11+" "
+				+ specificitiesResult.getCorpusSize()); 
+		typeFrequencyColumn.setToolTipText(Messages.FrequencyListEditorInput_4
+				+ RCPSpecificitiesMessages.SpecificitiesTableEditor_11
+				+ specificitiesResult.getCorpusSize()); 
+		typeFrequencyColumn.setAlignment(SWT.RIGHT);
+		typeFrequencyColumn.pack();
+		typeFrequencyColumn.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				StatusLine.setMessage(Messages.IndexEditor_36);
+				Comparator<Object[]> column_comparator = new Comparator<Object[]>() {
+					@Override
+					public int compare(Object[] line1, Object[] line2) { // Compare two
+						return ((Integer) line1[1]).compareTo(((Integer) line2[1]));
+					}
+				};
+				if (specificitesTable.getSortColumn() != typeFrequencyColumn) {
+					specificitesTable.setSortColumn(
+							typeFrequencyColumn);
+					specificitesTable.setSortDirection(SWT.UP);
+				} else if (specificitesTable
+						.getSortDirection() == SWT.UP) {
+					specificitesTable.setSortDirection(
+							SWT.DOWN);
+					column_comparator = new ReverseComparator(column_comparator);
+				} else {
+					specificitesTable.setSortDirection(SWT.UP);
+				}
+				currentComparator = column_comparator;
+				sort();
+				StatusLine.setMessage(""); //$NON-NLS-1$
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+			}
+		});
+
+		// add a separator column
+		TableColumn separatorColumn = new TableColumn(specificitesTable, SWT.NONE);
+		separatorColumn.setResizable(false);
+		specificitesTableColumn.add(separatorColumn);
+
+		String[] partNames = null;
+		int[] partSize = null;
+		try {
+			partNames = specificitiesResult.getPartShortNames();
+			partSize = specificitiesResult.getPartSize();
+		} catch (StatException e) {
+			System.err.println(NLS.bind(RCPSpecificitiesMessages.SpecificitiesTableEditor_5, e));
+			return;
+		}
+		// System.out.println("partnames: "+Arrays.toString(partNames));
+		// for (int i = 0; i <
+		// specificitesResult.getSpecificitesIndex()[0].length; i++)
+		for (int i = 0; i < partNames.length ; i++) { // for each part
+			final int columnIndex = i;
+
+			//FREQ COLUMN
+			final TableColumn freqpartTableColumn = new TableColumn(
+					specificitesTable, SWT.NONE);
+			freqpartTableColumn.setText(partNames[i] + " t=" + partSize[i]); //$NON-NLS-1$ 
+			freqpartTableColumn.setToolTipText(partNames[i] + " t=" + partSize[i]); //$NON-NLS-1$ 
+			// System.out.println("create column "+partNames[i]);
+			freqpartTableColumn.setAlignment(SWT.RIGHT);
+			freqpartTableColumn.pack();
+			freqpartTableColumn.addSelectionListener(new SelectionListener() {
+				@Override
+				public void widgetSelected(SelectionEvent e) {
+					StatusLine.setMessage(Messages.IndexEditor_36);
+					Comparator<Object> column_comparator = new Comparator<Object>() {
+						@Override
+						public int compare(Object o1, Object o2) { // Compare
+							// two Integer
+							Object[] line1 = (Object[]) o1;
+							Object[] line2 = (Object[]) o2;
+							return new Integer(
+									((int[]) line1[2])[columnIndex])
+							.compareTo(new Integer(
+									((int[]) line2[2])[columnIndex]));
+						}
+					};
+					
+					if (specificitesTable.getSortColumn() != freqpartTableColumn) {
+						specificitesTable.setSortColumn(freqpartTableColumn);
+						specificitesTable.setSortDirection(SWT.DOWN);
+						column_comparator = new ReverseComparator(column_comparator);
+					} else if (specificitesTable.getSortDirection() == SWT.UP) {
+						specificitesTable.setSortDirection(SWT.DOWN);
+						column_comparator = new ReverseComparator(column_comparator);
+					} else {
+						specificitesTable.setSortDirection(SWT.UP);
+					}
+					currentComparator = column_comparator;
+					sort();
+					StatusLine.setMessage(""); //$NON-NLS-1$
+				}
+
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+			});
+			specificitesTableColumn.add(freqpartTableColumn);
+
+			//SCORE COLUMN
+			final TableColumn partTableColumn = new TableColumn(
+					specificitesTable, SWT.NONE);
+			partTableColumn.setText("score");//partNames[i] + " t=" + partSize[i]); //$NON-NLS-1$ 
+			partTableColumn.setToolTipText(partNames[i] + " t=" + partSize[i]); //$NON-NLS-1$ 
+			// System.out.println("create column "+partNames[i]);
+			partTableColumn.setAlignment(SWT.RIGHT);
+			partTableColumn.pack();
+			partTableColumn.addSelectionListener(new SelectionListener() {
+				@Override
+				public void widgetSelected(SelectionEvent e) {
+					StatusLine.setMessage(Messages.IndexEditor_36);
+					Comparator<Object> column_comparator = new Comparator<Object>() {
+						@Override
+						public int compare(Object o1, Object o2) { // Compare
+							Object[] line1 = (Object[]) o1;
+							Object[] line2 = (Object[]) o2;
+							return new Double(
+									((double[]) line1[3])[columnIndex])
+							.compareTo(new Double(
+									((double[]) line2[3])[columnIndex]));
+						}
+					};
+					if (specificitesTable.getSortColumn() != partTableColumn) {
+						specificitesTable.setSortColumn(partTableColumn);
+						specificitesTable.setSortDirection(SWT.DOWN);
+						column_comparator = new ReverseComparator(column_comparator);
+					} else if (specificitesTable.getSortDirection() == SWT.UP) {
+						specificitesTable.setSortDirection(SWT.DOWN);
+						column_comparator = new ReverseComparator(column_comparator);
+					} else {
+						specificitesTable.setSortDirection(
+								SWT.UP);
+					}
+					currentComparator = column_comparator;
+					sort();
+					StatusLine.setMessage(""); //$NON-NLS-1$
+				}
+
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+			});
+
+			specificitesTableColumn.add(partTableColumn);
+		}
+
+		specificitesTable.setHeaderVisible(true);
+
+		// Horizontal bar on second table takes up a little extra space.
+		// To keep vertical scroll bars in sink, force table1 to end above
+		// horizontal scrollbar
+		ScrollBar hBarRight = specificitesTable.getHorizontalBar();
+		Label spacer = new Label(parent, SWT.NONE);
+		GridData spacerData = new GridData();
+		spacerData.heightHint = hBarRight.getSize().y;
+		spacer.setLayoutData(spacerData);
+		spacer.setVisible(false);
+
+		// --------------------------------------
+		// make the contextual menu for displaying graphics.
+		// --------------------------------------
+
+		// Menu menu = new Menu(specificitesTable); // old ways
+		MenuManager menuManager = new MenuManager();
+		Menu menu = menuManager.createContextMenu(specificitesTable);
+		specificitesTable.setMenu(menu);
+		getSite().setSelectionProvider(viewer);
+		getSite().registerContextMenu(menuManager, viewer);
+		
+		// Draw lines
+		fillDisplay();
+
+		// and first sort
+		specificitesTable.setSortColumn(typeNameColumn);
+		specificitesTable.setSortDirection(SWT.UP);
+		currentComparator = new Comparator() {
+			@Override
+			public int compare(Object o1, Object o2) {
+				Object[] line1 = (Object[]) o1;
+				Object[] line2 = (Object[]) o2;
+				return collator.compare(line1[0], line2[0]);
+			}
+		};
+		
+		sort();
+		
+		specificitesTable.setFocus();
+	}
+	
+	public Table getSpecificitesTable() {
+		return specificitesTable;
+	}
+
+	/**
+	 * Fills display.
+	 */
+	private void fillDisplay() {
+		
+		viewer.setInput(tableLines);
+
+		// Pack the columns so the label of the sort column is not truncated due of the sorting order arrow display
+		for (TableColumn col : specificitesTable.getColumns())	{
+			col.pack();
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+	 */
+	@Override
+	public void setFocus() {
+		StatusLine.setMessage(RCPSpecificitiesMessages.SpecificitiesTableEditor_17);
+		specificitesTable.setFocus();
+	}
+
+	/**
+	 * Instantiates a new specificities table editor.
+	 */
+	public SpecificitiesTableEditor() {
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	@Override
+	public void doSave(IProgressMonitor monitor) {
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+	 */
+	@Override
+	public void doSaveAs() {
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#isDirty()
+	 */
+	@Override
+	public boolean isDirty() {
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+	 */
+	@Override
+	public boolean isSaveAsAllowed() {
+		return false;
+	}
+
+	/**
+	 * Gets the specificities result.
+	 *
+	 * @return the specificities result
+	 */
+	public SpecificitesResult getSpecificitiesResult() {
+		return this.specificitiesResult;
+	}
+	
+	public SpecificitiesTableLines getTableLines() {
+		return tableLines;
+	}
+
+	/* (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 specificitiesResult;
+	}
+	
+	@Override
+	public Object toConcordance() { return null;}
+	@Override
+	public Object toIndex() { return null;}
+	@Override
+	public Object toProgression() { return null;}
+	
+	@Override
+	public boolean usingCorpus(Corpus corpus) {
+		if (this.specificitiesResult == null) return false;
+		if (this.specificitiesResult.getCorpus() == null) return false;
+		return this.specificitiesResult.getCorpus().getName().equals(corpus.getName());
+	}
+
+	@Override
+	public boolean updateCorpus(Corpus corpus) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/ReverseComparator.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/ReverseComparator.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/ReverseComparator.java	(revision 88)
@@ -0,0 +1,58 @@
+// 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.specificities.rcp.editors;
+
+import java.util.Comparator;
+
+// TODO: Auto-generated Javadoc
+/**
+ * reverse a comparator results @ author mdecorde.
+ */
+public class ReverseComparator implements Comparator {
+
+	/** The inverse comparator. */
+	private Comparator inverseComparator;
+
+	/**
+	 * Instantiates a new reverse comparator.
+	 *
+	 * @param comparator the comparator
+	 */
+	public ReverseComparator(Comparator comparator) {
+		inverseComparator = comparator;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+	 */
+	@Override
+	public int compare(Object o1, Object o2) {
+		return -1 * inverseComparator.compare(o1, o2);
+	}
+
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLabelProvider.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLabelProvider.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLabelProvider.java	(revision 88)
@@ -0,0 +1,141 @@
+// 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.specificities.rcp.editors;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.specificities.core.preferences.SpecificitiesPreferences;
+
+// TODO: Auto-generated Javadoc
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// create the specificites table (as many columns as parts)
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+/**
+ * The Class SpecificitesTableLabelProvider.
+ */
+class SpecificitiesTableLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+	/** The partindexes. */
+	//int[] partindexes;
+
+	private boolean showPValues;
+	private String format;
+
+	/**
+	 * Instantiates a new specificites table label provider.
+	 *
+	 * @param partindexes the partindexes
+	 */
+	public SpecificitiesTableLabelProvider() {
+		//this.partindexes = partindexes;
+		//showPValues = "true".equals(Toolbox.getParam(SpecificitiesPreferencePage.SPECIF_PVALUES)); //$NON-NLS-1$
+		this.format = TXMPreferences.getString(SpecificitiesPreferences.PREFERENCES_NODE, SpecificitiesPreferences.FORMAT);
+		if (format == null || format.trim().length() == 0) format = "%,.1f"; //$NON-NLS-1$
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+	 */
+	@Override
+	public Image getColumnImage(Object element, int columnIndex) {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+	 */
+	@Override
+	public String getColumnText(Object element, int columnIndex) {
+
+		Object[] line = (Object[]) element;
+		//line content : {unit, freq, freqs[], scores[]}
+
+		if (columnIndex < 2) {
+			Object cell = line[columnIndex];
+			return cell.toString();
+		} else if (columnIndex == 2) { // separator column
+			return ""; //$NON-NLS-1$
+		} else {
+			columnIndex = columnIndex - 3 ;//this.partindexes[columnIndex - 3];
+			if (columnIndex%2 == 0) { // FREQ COLUMN
+				columnIndex = columnIndex/2; // because there is 2 col per part
+				int[] freqs = (int[])line[2];// get the freqs
+				return String.valueOf(freqs[columnIndex]);
+			} else { // SCORE COLUMN
+				columnIndex = columnIndex/2; // because there is 2 cols per part
+				Object specif = line[3]; // get the scores
+				double[] specifs = (double[]) specif ;
+
+				double s = specifs[columnIndex];
+				//if (-2 < s && s < 2) return "";
+				return String.format(format, s);
+//				if (showPValues) {
+//					return String.valueOf();
+//				} else {
+//					return String.valueOf((int) specifs[columnIndex]);
+//				}
+			}
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.BaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+	 */
+	@Override
+	public void addListener(ILabelProviderListener listener) {
+
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.BaseLabelProvider#dispose()
+	 */
+	@Override
+	public void dispose() {
+
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.BaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
+	 */
+	@Override
+	public boolean isLabelProperty(Object element, String property) {
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.BaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+	 */
+	@Override
+	public void removeListener(ILabelProviderListener listener) {
+
+	}
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLines.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLines.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLines.java	(revision 88)
@@ -0,0 +1,85 @@
+// 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.specificities.rcp.editors;
+
+import java.util.Arrays;
+import java.util.Comparator;
+
+/**
+ * The Class SpecificitesTableLines : input object of the TableViewer of the SpecificitiesTableEditor
+ */
+public class SpecificitiesTableLines {
+
+	/** The lines. */
+	private Object[] lines;
+
+	/**
+	 * Instantiates a new specificites table lines.
+	 *
+	 * @param lines the lines
+	 */
+	public SpecificitiesTableLines(Object[] lines) {
+		this.lines = lines;
+	}
+
+	/**
+	 * Gets the lines.
+	 *
+	 * @return the lines
+	 */
+	public Object[] getLines() {
+		return lines;
+	}
+
+	/**
+	 * Gets the lines.
+	 *
+	 * @param start the start
+	 * @param end the end
+	 * @return the lines
+	 */
+	public Object[] getLines(int start, int end) {
+		Object[] ret = new Object[end - start];
+		int c = 0;
+		for (int i = start; i < end; i++) {
+			ret[c] = lines[i];
+			c++;
+		}
+		return ret;
+	}
+
+	/**
+	 * Sort.
+	 *
+	 * @param comparator the comparator
+	 */
+	public void sort(Comparator comparator) {
+		Arrays.sort(lines, comparator);
+	}
+
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/handlers/ComputeSpecifictiesBarChart.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/handlers/ComputeSpecifictiesBarChart.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/handlers/ComputeSpecifictiesBarChart.java	(revision 88)
@@ -0,0 +1,91 @@
+package org.txm.specificities.rcp.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.chartsengine.rcp.editors.ChartEditorPart;
+import org.txm.specificities.core.functions.SpecificitesResult;
+import org.txm.specificities.core.preferences.SpecificitiesPreferences;
+import org.txm.specificities.rcp.editors.SpecificitiesTableEditor;
+import org.txm.specificities.rcp.editors.SpecificitiesTableLines;
+
+public class ComputeSpecifictiesBarChart extends AbstractHandler {
+
+
+	/**
+	 * Get the active editor and show a bar chart if the editor is a SpecificitiesTableEditor
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		try {
+			IWorkbenchWindow iww = HandlerUtil.getActiveWorkbenchWindow(event);
+			IWorkbenchPage iwp = iww.getActivePage();
+			IEditorPart ieditor = iwp.getActiveEditor();
+			if (!(ieditor instanceof SpecificitiesTableEditor)) {
+				System.out.println("Editor is not SpecificitiesTableEditor: " + ieditor.getClass());
+				return null;
+			}
+
+			SpecificitiesTableEditor editor = (SpecificitiesTableEditor)ieditor;
+			SpecificitesResult specificitiesResult = editor.getSpecificitiesResult();
+			Table specificitesTable = editor.getSpecificitesTable();
+			SpecificitiesTableLines tableLines = editor.getTableLines();
+			double[][] specIndex = specificitiesResult.getSpecificitesIndex();
+
+			int[] indices = specificitesTable.getSelectionIndices();
+			if (indices.length == 0) return null; // no line selected
+
+			final String[] selectedTypeNames = new String[indices.length];
+			for (int i = 0; i < selectedTypeNames.length; i++) {
+				selectedTypeNames[i] = (String) ((Object[]) tableLines.getLines()[indices[i]])[0];
+			}
+
+			int nbrPart = specIndex[0].length;
+			final double[][] selectedSpecificteIndices = new double[indices.length][nbrPart];
+			for (int i = 0; i < selectedSpecificteIndices.length; i++) {
+				selectedSpecificteIndices[i] = (double[]) ((Object[]) tableLines.getLines()[indices[i]])[3];
+			}
+
+			String[] partNames = specificitiesResult.getPartShortNames();
+
+			show(specificitiesResult, partNames, selectedTypeNames, selectedSpecificteIndices);
+		} catch (Exception e) {
+			System.out.println("Error while computing specificities bar chart: "+e.getLocalizedMessage());
+			org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+		}
+		return null;
+	}
+
+	/**
+	 * Opens the bar chart of the selected partNames, typeNames and specif indexes 
+	 * 
+	 * @param specificitiesResult
+	 * @param partNames
+	 * @param typeNames
+	 * @param specificteIndices
+	 */
+	public void show(SpecificitesResult specificitiesResult, String[] partNames, String[] typeNames, double[][] specificteIndices) {
+		try {
+
+			// Set the data to focus on
+			specificitiesResult.setSelectedPartNames(partNames);
+			specificitiesResult.setSelectedTypeNames(typeNames);
+			specificitiesResult.setSelectedSpecificitiesIndex(specificteIndices);
+
+			// Create and open the chart editor
+			ChartEditorPart editor = SWTChartsComponentsProvider.getCurrent().openEditor(specificitiesResult.getName(), specificitiesResult, SpecificitiesPreferences.PREFERENCES_NODE);
+
+		}
+		catch (Exception e) {
+			System.out.println("Error while computing specificities bar chart: "+e.getLocalizedMessage());
+			org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+		}
+	}
+
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/handlers/ComputeSpecifities.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/handlers/ComputeSpecifities.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/handlers/ComputeSpecifities.java	(revision 88)
@@ -0,0 +1,386 @@
+// 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.specificities.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.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.Toolbox;
+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.TxmPreferences;
+import org.txm.rcpapplication.preferences.LexicalTablePreferencePage;
+import org.txm.rcpapplication.utils.JobHandler;
+import org.txm.rcpapplication.views.CorporaView;
+import org.txm.rcpapplication.views.QueriesView;
+import org.txm.rcpapplication.views.RVariablesView;
+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.searchengine.cqp.corpus.Subcorpus;
+import org.txm.specificities.core.functions.Specificites;
+import org.txm.specificities.core.functions.SpecificitesResult;
+import org.txm.specificities.core.preferences.SpecificitiesPreferences;
+import org.txm.specificities.rcp.dialogs.ComputeSpecificitiesDialog;
+import org.txm.specificities.rcp.dialogs.ComputeSpecificitiesForSubcorpusDialog;
+import org.txm.specificities.rcp.editors.SpecificitiesResultEditorInput;
+import org.txm.specificities.rcp.editors.SpecificitiesTableEditor;
+import org.txm.stat.StatException;
+import org.txm.stat.data.LexicalTable;
+import org.txm.utils.logger.Log;
+
+// TODO: Auto-generated Javadoc
+/**
+ * if the selection is a Partition : open the dialog for partition if the
+ * selection is a sub-corpus : open the diaog for sub-corpus then open the
+ * result in the Specificities Editor
+ * 
+ * @author mdecorde
+ */
+public class ComputeSpecifities extends AbstractHandler {
+	
+	
+	// FIXME: should be put in an Activator? or better in an extension point loaded by the corpora view?
+	// adds a double click listener to the Corpus View
+	static	{
+		CorporaView.addDoubleClickListener(SpecificitesResult.class, "ComputeSpecifities"); //$NON-NLS-1$
+	}
+	
+	
+	
+
+	/** The window. */
+	private IWorkbenchWindow window;
+
+	/** The selection. */
+	private IStructuredSelection selection;
+
+	/** The specificities result. */
+	private SpecificitesResult specificitiesResult;
+
+	/*
+	 * (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(Messages.ComputeSpecifities_0);
+			return null;
+		}
+
+		window = HandlerUtil.getActiveWorkbenchWindow(event);
+		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		if(selection == null) {
+			Log.info(Messages.ComputeSpecifities_1);
+			return null;
+		}
+		Object s = selection.getFirstElement();
+		final int maxScore = TXMPreferences.getInt(SpecificitiesPreferences.PREFERENCES_NODE, SpecificitiesPreferences.MAX_SCORE);
+		if(s instanceof Partition) {
+			final Partition partition = (Partition) selection.getFirstElement();
+			final int Fmin = TxmPreferences.getInt(LexicalTablePreferencePage.FMIN, 1);
+
+			final ComputeSpecificitiesDialog d = new ComputeSpecificitiesDialog(window.getShell(), partition, false);
+			int code = d.open();
+			if(code == Window.OK) {
+				final Property property = d.getAnalysisProperty();
+
+				// final CorporaView corporaView = (CorporaView)
+				// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(CorporaView.ID);
+				JobHandler jobhandler = new JobHandler(Messages.ComputeSpecificities_0) {
+					@Override
+					protected IStatus run(IProgressMonitor monitor) {
+						this.runInit(monitor);
+						try {
+							JobsTimer.start();
+							String str = NLS.bind(Messages.ComputeSpecificities_2, new Object[] { partition.getName(), property });
+							monitor.beginTask(str, 100);
+							try {
+								System.out.println(str);
+								this.acquireSemaphore();
+								specificitiesResult = Specificites.specificites(partition, property, d.getPartFocus(), Fmin, maxScore);
+								this.releaseSemaphore();
+
+								System.out.println(NLS.bind(Messages.DONE, specificitiesResult.getName()));
+							}
+							catch(StatException e) {
+								System.out.println(Messages.ComputeSpecifities_4 + e);
+								org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+								return Status.CANCEL_STATUS;
+							}
+							monitor.worked(45);
+
+							specificitiesResult.getLexicalTable().storeResult(specificitiesResult);
+							// partition.storeResult(specificitiesResult);
+							monitor.worked(5);
+
+							monitor.subTask(Messages.ComputeSpecifities_10);
+							syncExec(new Runnable() {
+								@Override
+								public void run() {
+									IWorkbenchPage page = window.getActivePage();
+									SpecificitiesResultEditorInput editorInput = new SpecificitiesResultEditorInput(specificitiesResult, partition);
+									try {
+										StatusLine.setMessage(Messages.ComputeSpecifities_10);
+										page.openEditor(editorInput, SpecificitiesTableEditor.ID); //$NON-NLS-1$
+									}
+									catch(PartInitException e) {
+										System.err.println(NLS.bind(Messages.Error_computing_specificities, e));
+										org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+									}
+								}
+							});
+
+							monitor.worked(50);
+							if(monitor.isCanceled())
+								return Status.CANCEL_STATUS;
+
+							monitor.subTask(Messages.ComputeSpecifities_2);
+							syncExec(new Runnable() {
+								@Override
+								public void run() {
+									CorporaView.refresh();
+									CorporaView.expand(specificitiesResult.getParent());
+									QueriesView.refresh();
+									RVariablesView.refresh();
+								}
+							});
+
+							monitor.worked(100);
+						}
+						catch(ThreadDeath td) {
+							return Status.CANCEL_STATUS;
+						}
+						catch(CqiClientException e) {
+							org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+						}
+						finally {
+							monitor.done();
+							JobsTimer.stopAndPrint();
+						}
+						return Status.OK_STATUS;
+					}
+				};
+				jobhandler.startJob();
+			}
+		}
+		else if(s instanceof Subcorpus) {
+			final Subcorpus subcorpus = (Subcorpus) s;
+			ComputeSpecificitiesForSubcorpusDialog d = new ComputeSpecificitiesForSubcorpusDialog(window.getShell(), subcorpus);
+			int code = d.open();
+			if(code == Window.OK) {
+				final Property property = d.getProperty();
+				try {
+					JobHandler jobhandler = new JobHandler(Messages.ComputeSpecificities_0) {
+						@Override
+						protected IStatus run(IProgressMonitor monitor) {
+							this.runInit(monitor);
+
+							try {
+								Corpus parentCorpus = subcorpus.getMotherSubcorpus();
+								if(parentCorpus == null)
+									parentCorpus = subcorpus.getMainCorpus();
+
+								System.out.println(NLS.bind(Messages.ComputeSpecifities_3, new Object[] { subcorpus.getName(), parentCorpus.getName(), property }));
+								specificitiesResult = Specificites.specificites(parentCorpus, subcorpus, property, maxScore);
+								System.out.println(NLS.bind(Messages.DONE, specificitiesResult.getName()));
+								subcorpus.storeResult(specificitiesResult);
+							}
+							catch(Exception e) {
+								System.err.println(NLS.bind(Messages.Error_computing_specificities, e));
+								System.err.println(e);
+								org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+							}
+
+							monitor.subTask(Messages.ComputeSpecifities_2);
+							syncExec(new Runnable() {
+								@Override
+								public void run() {
+									IWorkbenchPage page = window.getActivePage();
+									SpecificitiesResultEditorInput editorInput = new SpecificitiesResultEditorInput(specificitiesResult, subcorpus);
+
+									try {
+										page.openEditor(editorInput, SpecificitiesTableEditor.ID);
+									}
+									catch(PartInitException e) {
+										e.printStackTrace();
+									}
+
+									CorporaView.refresh();
+									CorporaView.expand(specificitiesResult.getParent());
+									QueriesView.refresh();
+									RVariablesView.refresh();
+								}
+							});
+
+							return Status.OK_STATUS;
+						}
+					};
+					jobhandler.startJob();
+				}
+				catch(Exception e) {
+					System.err.println(NLS.bind(Messages.Error_computing_specificities, e));
+				}
+			}
+		}
+		else if(s instanceof LexicalTable) {
+			final LexicalTable table = (LexicalTable) s;
+			JobHandler jobhandler = new JobHandler(Messages.ComputeSpecificities_0) {
+				@Override
+				protected IStatus run(IProgressMonitor monitor) {
+					this.runInit(monitor);
+					try {
+						JobsTimer.start();
+						monitor.beginTask(NLS.bind(Messages.ComputeSpecifities_11, table.getPartition().getName()), 100);
+						try {
+							System.out.println(Messages.ComputeSpecificities_0 + ": " + table.getPartition().getName()); //$NON-NLS-1$
+							this.acquireSemaphore();
+							specificitiesResult = Specificites.specificites(table, maxScore);
+							this.releaseSemaphore();
+							System.out.println(NLS.bind(Messages.DONE, specificitiesResult.getName()));
+						}
+						catch(StatException e) {
+							System.err.println(NLS.bind(Messages.Error_computing_specificities, e));
+							org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+							return Status.CANCEL_STATUS;
+						}
+						monitor.worked(45);
+						if(monitor.isCanceled())
+							return Status.CANCEL_STATUS;
+
+						this.acquireSemaphore();
+						table.storeResult(specificitiesResult);
+						this.releaseSemaphore();
+						monitor.worked(5);
+
+						monitor.subTask(Messages.ComputeSpecifities_10);
+						syncExec(new Runnable() {
+							@Override
+							public void run() {
+								IWorkbenchPage page = window.getActivePage();
+								SpecificitiesResultEditorInput editorInput = null;
+								if(table.getPartition() == null) {
+									editorInput = new SpecificitiesResultEditorInput(specificitiesResult, table.getCorpus());
+								}
+								else {
+									editorInput = new SpecificitiesResultEditorInput(specificitiesResult, table.getPartition());
+								}
+								try {
+									StatusLine.setMessage(Messages.ComputeSpecifities_10);
+									page.openEditor(editorInput, SpecificitiesTableEditor.ID); //$NON-NLS-1$
+
+								}
+								catch(PartInitException e) {
+									org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+								}
+							}
+						});
+
+						monitor.worked(50);
+						if(monitor.isCanceled()) {
+							return Status.CANCEL_STATUS;
+						}
+
+						monitor.subTask(Messages.ComputeSpecifities_2);
+						syncExec(new Runnable() {
+							@Override
+							public void run() {
+								CorporaView.refresh();
+								CorporaView.expand(specificitiesResult.getParent());
+								QueriesView.refresh();
+								RVariablesView.refresh();
+							}
+						});
+
+						monitor.worked(100);
+					}
+					catch(ThreadDeath td) {
+						return Status.CANCEL_STATUS;
+					}
+					catch(CqiClientException e) {
+						org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+					}
+					finally {
+						monitor.done();
+						JobsTimer.stopAndPrint();
+					}
+					return Status.OK_STATUS;
+				}
+			};
+			jobhandler.startJob();
+		}
+		// reopens an existing result
+		else if(s instanceof SpecificitesResult) {
+			SpecificitesResult specifRes = (SpecificitesResult) s;
+			Partition partition = null;
+			IEditorInput editorInput = null;
+
+			if(specifRes.getLexicalTable() != null) {
+				if(specifRes.getLexicalTable().getPartition() != null) {
+					partition = specifRes.getLexicalTable().getPartition();
+					editorInput = new SpecificitiesResultEditorInput(specifRes, partition);
+				}
+				else {
+					editorInput = new SpecificitiesResultEditorInput(specifRes, specifRes.getLexicalTable().getCorpus());
+				}
+			}
+			else {
+				editorInput = new SpecificitiesResultEditorInput(specifRes, specifRes.getCorpus());
+			}
+
+			IWorkbenchPage page = window.getActivePage();
+			try {
+				page.openEditor(editorInput, SpecificitiesTableEditor.ID); //$NON-NLS-1$
+			}
+			catch(PartInitException e) {
+				System.err.println(Messages.CorporaView_5 + e);
+			}
+		}
+
+		return null;
+	}
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/preferences/SpecificitiesPreferencePage.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/preferences/SpecificitiesPreferencePage.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/preferences/SpecificitiesPreferencePage.java	(revision 88)
@@ -0,0 +1,112 @@
+// 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.specificities.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.ui.IWorkbench;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.rcp.preferences.TXMPreferencePage;
+import org.txm.rcp.preferences.TXMPreferenceStore;
+import org.txm.rcpapplication.jface.DoubleFieldEditor;
+import org.txm.specificities.core.preferences.SpecificitiesPreferences;
+import org.txm.specificities.rcp.adapters.SpecificitiesAdapterFactory;
+import org.txm.specificities.rcp.messages.RCPSpecificitiesMessages;
+/**
+ * Specificities preferences page.
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class SpecificitiesPreferencePage extends TXMPreferencePage	{
+	
+	
+	
+
+	/**
+	 * Instantiates a new specificities preference page.
+	 */
+	public SpecificitiesPreferencePage() {
+		super();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+	 */
+	@Override
+	protected void createFieldEditors() {
+				
+		
+		this.addField(new StringFieldEditor(SpecificitiesPreferences.FORMAT, RCPSpecificitiesMessages.SpecificitiesPreferencePage_3, this.getFieldEditorParent()));
+
+		
+		IntegerFieldEditor maxScoreField = new IntegerFieldEditor(SpecificitiesPreferences.MAX_SCORE, RCPSpecificitiesMessages.SpecificitiesPreferencePage_8, this.getFieldEditorParent()); 
+		maxScoreField.setTextLimit(4);
+		maxScoreField.setValidRange(10, 1000);
+		this.addField(maxScoreField);
+		
+		
+		// Charts rendering
+		Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent());
+		
+		this.addField(new DoubleFieldEditor(SpecificitiesPreferences.CHART_BANALITY, RCPSpecificitiesMessages.SpecificitiesPreferencePage_7, chartsTab));
+		
+		// Create a group for columns management of mixed boolean fields and field/text input fields
+		Composite booleansGroup = new Composite(chartsTab, SWT.NONE);
+		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
+		gridData.horizontalSpan = 2;
+		booleansGroup.setLayoutData(gridData);
+		
+		this.addField(new BooleanFieldEditor(SpecificitiesPreferences.CHART_TRANSPOSE, RCPSpecificitiesMessages.SpecificitiesPreferencePage_4, booleansGroup));
+		this.addField(new BooleanFieldEditor(SpecificitiesPreferences.CHART_DRAW_LINES, RCPSpecificitiesMessages.SpecificitiesPreferencePage_5, booleansGroup));
+		this.addField(new BooleanFieldEditor(SpecificitiesPreferences.CHART_DRAW_BARS, RCPSpecificitiesMessages.SpecificitiesPreferencePage_6, booleansGroup));
+		
+		// other shared preferences
+		SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab);
+		
+	}
+
+	
+	public static TXMPreferenceStore getNewPreferenceStore()	{
+		return new TXMPreferenceStore(SpecificitiesPreferences.PREFERENCES_NODE);
+	}
+	
+	@Override
+	public void init(IWorkbench workbench) {
+		this.setPreferenceStore(getNewPreferenceStore());
+		this.setTitle(RCPSpecificitiesMessages.SpecificitiesPreferencePage_2);
+		this.setImageDescriptor(SpecificitiesAdapterFactory.ICON);
+	}
+
+
+
+}

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

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/dialogs/ComputeSpecificitiesForSubcorpusDialog.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/dialogs/ComputeSpecificitiesForSubcorpusDialog.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/dialogs/ComputeSpecificitiesForSubcorpusDialog.java	(revision 88)
@@ -0,0 +1,148 @@
+// 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.specificities.rcp.dialogs;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.txm.rcpapplication.Messages;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.Subcorpus;
+// TODO: Auto-generated Javadoc
+/**
+ * 
+ * TODO : this dialog box should be factorized between function (getProperty,
+ * getPropertyWithModality, etc.)
+ * 
+ * @author sloiseau
+ * 
+ */
+public class ComputeSpecificitiesForSubcorpusDialog extends Dialog {
+
+	/** The property. */
+	private Property property;
+	
+	/** The properties. */
+	private List<Property> properties;
+	
+	/** The ana prop combo. */
+	private Combo anaPropCombo;
+
+	/**
+	 * Instantiates a new compute specificities for subcorpus dialog.
+	 *
+	 * @param parentShell the parent shell
+	 * @param subcorpus the subcorpus
+	 */
+	public ComputeSpecificitiesForSubcorpusDialog(Shell parentShell,
+			Subcorpus subcorpus) {
+		super(parentShell);
+		try {
+			this.properties = new ArrayList<Property>(subcorpus.getOrderedProperties());
+		} catch (CqiClientException e) {
+			// TODO Auto-generated catch block
+			org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+	 */
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText(Messages.Compute_Specificities);
+	}
+
+	/**
+	 * Gets the property.
+	 *
+	 * @return the property
+	 */
+	public Property getProperty() {
+		return property;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		Composite composite = new Composite(parent, SWT.NONE);
+		GridLayout layout = new GridLayout(2, false);
+		composite.setLayout(layout);
+
+		Label anaPropLabel = new Label(composite, SWT.NONE);
+		anaPropLabel.setText(Messages.CreatePartitionDialog_4);
+		anaPropLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER,
+				false, false));
+
+		anaPropCombo = new Combo(composite, SWT.READ_ONLY);
+		anaPropCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
+				true, false));
+		int iword= 0;
+		int i = 0;
+		for (Property p : properties) {
+			anaPropCombo.add(p.getName());
+			if (p.getName().equals("word")) //$NON-NLS-1$
+				iword=i;
+			i++;
+		}
+		anaPropCombo.select(iword);
+		return composite;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+	 */
+	@Override
+	protected void okPressed() {
+		int propIndex = anaPropCombo.getSelectionIndex();
+		if (propIndex == -1) {
+			MessageDialog.openError(getShell(),
+					Messages.Invalid_analysis_property,
+					Messages.Structure_field_not_empty);
+			return;
+		}
+
+		property = properties.get(propIndex);
+		super.okPressed();
+	}
+
+}

Property changes on: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/dialogs/ComputeSpecificitiesForSubcorpusDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/dialogs/ComputeSpecificitiesDialog.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/dialogs/ComputeSpecificitiesDialog.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/dialogs/ComputeSpecificitiesDialog.java	(revision 88)
@@ -0,0 +1,380 @@
+// 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.specificities.rcp.dialogs;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Part;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.searchengine.cqp.corpus.Property;
+// TODO: Auto-generated Javadoc
+/**
+ * User can choose a lexical property the values to keep and the parts to keep.
+ *
+ * @author jpmague, Sylvain Loiseau
+ */
+public class ComputeSpecificitiesDialog extends Dialog {
+
+	/** The properties. */
+	private List<Property> properties;
+	
+	/** The ana prop combo. */
+	private Combo anaPropCombo;
+	
+	/** The property. */
+	private Property property;
+
+	/** The type focus. */
+	private List<Text> typeFocus = new ArrayList<Text>();
+	
+	/** The part focus. */
+	private List<Combo> partFocus = new ArrayList<Combo>();
+	
+	/** The type focus string. */
+	private List<String> typeFocusString;
+	
+	/** The part focus string. */
+	private ArrayList<Part> partFocusString;
+
+	/** The partition. */
+	private Partition partition;
+
+	/** The show part focus selection. */
+	boolean showPartFocusSelection = false;
+
+	/**
+	 * Instantiates a new compute specificities dialog.
+	 *
+	 * @param parentShell the parent shell
+	 * @param partition the partition
+	 * @param showPartFocusSelection the show part focus selection
+	 */
+	public ComputeSpecificitiesDialog(Shell parentShell, Partition partition,
+			boolean showPartFocusSelection) {
+		super(parentShell);
+		this.partition = partition;
+		this.showPartFocusSelection = showPartFocusSelection;
+		try {
+			this.properties = new ArrayList<Property>(partition
+					.getCorpus().getOrderedProperties());
+		} catch (CqiClientException e) {
+			System.err.println(NLS.bind(
+					Messages.ComputeSpecificitiesDialog_0, e));
+		}
+		this.setShellStyle(this.getShellStyle() | SWT.RESIZE);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+	 */
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText(Messages.Compute_Specificities);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		Composite composite = new Composite(parent, SWT.NONE);
+		// TODO : we just put a composite into another composite. Everything
+		// should be directly put into parent
+		GridLayout layout = new GridLayout(2, false);
+		composite.setLayout(layout);
+
+		Label anaPropLabel = new Label(composite, SWT.NONE);
+		anaPropLabel.setText(Messages.CreatePartitionDialog_4);
+		anaPropLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER,
+				false, false));
+
+		anaPropCombo = new Combo(composite, SWT.READ_ONLY);
+		anaPropCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
+				true, false));
+		int iword= 0;
+		int i = 0;
+		for (Property p : properties) {
+			anaPropCombo.add(p.getName());
+			if (p.getName().equals("word")) //$NON-NLS-1$
+				iword=i;
+			i++;
+		}
+		anaPropCombo.select(iword);
+
+		// set the focus
+//		Label advancedFocusLabel = new Label(composite, SWT.NONE);
+//		advancedFocusLabel.setText(Messages.ComputeSpecificitiesDialog_3);
+//		advancedFocusLabel.setLayoutData(new GridData(GridData.END,
+//				GridData.CENTER, false, false));
+//
+//		Composite focusComposite = new Composite(composite, SWT.NONE);
+//		// TODO : we just put a composite into another composite. Everything
+//		// should be directly put into parent
+//		focusComposite.setLayout(new GridLayout(1, false));
+//
+//		createTypeFocusField(focusComposite);
+
+		// Set the part focus
+		if (showPartFocusSelection) {
+
+			Label advancedPartLabel = new Label(composite, SWT.NONE);
+			advancedPartLabel.setText(Messages.ComputeSpecificitiesDialog_4);
+			advancedPartLabel.setLayoutData(new GridData(GridData.END,
+					GridData.CENTER, false, false));
+
+			Composite partFocusComposite = new Composite(composite, SWT.NONE);
+			// TODO : we just put a composite into another composite. Everything
+			// should be directly put into parent
+			partFocusComposite.setLayout(new GridLayout(1, false));
+
+			createPartFocusField(partFocusComposite);
+		}
+
+		return composite;
+	}
+
+	/**
+	 * Creates the type focus field.
+	 *
+	 * @param composite the composite
+	 */
+	private void createTypeFocusField(final Composite composite) {
+		Text focusTextBox = new Text(composite, SWT.BORDER);
+		focusTextBox.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
+				true, false));
+		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true,
+				false);
+		gridData.widthHint = convertHeightInCharsToPixels(20);
+		focusTextBox.setLayoutData(gridData);
+
+		final Button plusButton = new Button(composite, SWT.NONE);
+		plusButton.setText("+"); //$NON-NLS-1$
+		plusButton.addListener(SWT.Selection, new Listener() {
+			@Override
+			public void handleEvent(Event event) {
+				createTypeFocusField(composite);
+				getShell().pack();
+			}
+		});
+
+		// final Button minusButton = new Button(composite, SWT.NONE);
+		// minusButton.setText("-");
+		// minusButton.addListener(SWT.Selection, new Listener() {
+		// public void handleEvent(Event event) {
+		// }
+		// });
+
+		// queryText.addKeyListener(new KeyListener() {
+		// public void keyPressed(KeyEvent e) {
+		// // If there is no query in any text field, disabled the "Ok" button.
+		// if (noquery()) {
+		// CreatePartitionDialog.this.getButton(IDialogConstants.OK_ID).setEnabled(false);
+		// } else {
+		// CreatePartitionDialog.this.getButton(IDialogConstants.OK_ID).setEnabled(true);
+		// }
+		//
+		// // // If there is no text in this particular text field, disabled the
+		// "+" button.
+		// // if (queryText.getText().length() == 0) {
+		// // plusButton.setEnabled(false);
+		// // } else {
+		// // plusButton.setEnabled(true);
+		// // }
+		// }
+		//
+		// public void keyReleased(KeyEvent e) {
+		// }
+		// }
+		// );
+
+		typeFocus.add(focusTextBox);
+	}
+
+	/**
+	 * Creates the part focus field.
+	 *
+	 * @param composite the composite
+	 */
+	private void createPartFocusField(final Composite composite) {
+
+		final Combo partFocusBox;
+		partFocusBox = new Combo(composite, SWT.BORDER);
+		partFocusBox.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
+				true, false));
+		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true,
+				false);
+		gridData.widthHint = convertHeightInCharsToPixels(20);
+		partFocusBox.setLayoutData(gridData);
+		for (String name : partition.getPartShortNames()) {
+			partFocusBox.add(name);
+		}
+
+		final Button plusButton = new Button(composite, SWT.NONE);
+		plusButton.setText("+"); //$NON-NLS-1$
+		plusButton.addListener(SWT.Selection, new Listener() {
+			@Override
+			public void handleEvent(Event event) {
+				createPartFocusField(composite);
+				getShell().pack();
+			}
+		});
+
+		// final Button minusButton = new Button(composite, SWT.NONE);
+		// minusButton.setText("-");
+		// minusButton.addListener(SWT.Selection, new Listener() {
+		// public void handleEvent(Event event) {
+		// }
+		// });
+
+		// queryText.addKeyListener(new KeyListener() {
+		// public void keyPressed(KeyEvent e) {
+		// // If there is no query in any text field, disabled the "Ok" button.
+		// if (noquery()) {
+		// CreatePartitionDialog.this.getButton(IDialogConstants.OK_ID).setEnabled(false);
+		// } else {
+		// CreatePartitionDialog.this.getButton(IDialogConstants.OK_ID).setEnabled(true);
+		// }
+		//
+		// // // If there is no text in this particular text field, disabled the
+		// "+" button.
+		// // if (queryText.getText().length() == 0) {
+		// // plusButton.setEnabled(false);
+		// // } else {
+		// // plusButton.setEnabled(true);
+		// // }
+		// }
+		//
+		// public void keyReleased(KeyEvent e) {
+		// }
+		// }
+		// );
+
+		partFocus.add(partFocusBox);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+	 */
+	@Override
+	protected void okPressed() {
+		int propIndex = anaPropCombo.getSelectionIndex();
+		if (propIndex == -1) {
+			MessageDialog.openError(getShell(),
+					Messages.Invalid_analysis_property,
+					Messages.Structure_field_not_empty);
+			return;
+		}
+		property = properties.get(propIndex);
+
+		typeFocusString = new ArrayList<String>();
+		if (typeFocus != null)
+		for (Text foc : typeFocus) {
+			String regex = foc.getText().trim();
+			if (regex.length() != 0) {
+				try
+				{
+					Pattern p = Pattern.compile(regex);
+					if (p != null)
+						typeFocusString.add(regex);
+				}
+				catch(PatternSyntaxException e)
+				{
+					String str = NLS.bind(Messages.ComputeSpecificitiesDialog_1, e.getMessage());
+					System.out.println(str);
+					StatusLine.error(str);
+					return;
+				}
+			}
+		}
+
+		partFocusString = new ArrayList<Part>();
+		if (partFocus != null)
+		for (Combo com : partFocus) {
+			if (com.getText().length() != 0) {
+				partFocusString.add(partition.getParts().get(
+						com.getSelectionIndex()));
+			}
+		}
+
+		super.okPressed();
+	}
+
+	/**
+	 * Gets the analysis property.
+	 *
+	 * @return the analysis property
+	 */
+	public Property getAnalysisProperty() {
+		return property;
+	}
+
+	/**
+	 * Gets the type focus.
+	 *
+	 * @return the type focus
+	 */
+	public List<String> getTypeFocus() {
+		return typeFocusString;
+	}
+
+	/**
+	 * Gets the part focus.
+	 *
+	 * @return the part focus
+	 */
+	public List<Part> getPartFocus() {
+		if (!showPartFocusSelection) {
+			//throw new IllegalStateException(Messages.ComputeSpecificitiesDialog_9);
+		}
+		// System.out.println("get partfocus (string ,normalement) "+partFocusString);
+		return partFocusString;
+	}
+
+}

Property changes on: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/dialogs/ComputeSpecificitiesDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/adapters/SpecificitiesAdapterFactory.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/adapters/SpecificitiesAdapterFactory.java	(revision 0)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/adapters/SpecificitiesAdapterFactory.java	(revision 88)
@@ -0,0 +1,65 @@
+// Copyright © 2010-2013 ENS de Lyon.
+package org.txm.specificities.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.rcp.adapters.BaseAdapterFactory;
+import org.txm.specificities.core.functions.SpecificitesResult;
+
+
+/**
+ * A factory for creating Adapter objects.
+ *  
+ * @author mdecorde
+ * @author sjacquot
+ */
+public class SpecificitiesAdapterFactory extends BaseAdapterFactory {
+
+	
+	public static final ImageDescriptor ICON =
+			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(SpecificitiesAdapterFactory.class).getSymbolicName(),
+					"platform:/plugin/"+ FrameworkUtil.getBundle(SpecificitiesAdapterFactory.class).getSymbolicName() + "/icons/functions/specificities.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 SpecificitesResult)	{
+				return new IWorkbenchAdapter() {
+					@Override
+					public Object[] getChildren(Object o) {
+						return new Object[0];
+					}
+
+					@Override
+					public ImageDescriptor getImageDescriptor(Object object) {
+						return ICON;
+					}
+
+					@Override
+					public String getLabel(Object o) {
+						return ((SpecificitesResult) o).getName();
+					}
+
+					@Override
+					public Object getParent(Object o) {
+						return ((SpecificitesResult) o).getParent();
+					}
+				};
+			}
+		}
+		return null;
+	}
+
+
+}

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

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

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

Index: tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties
===================================================================
--- tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties	(revision 0)
+++ tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties	(revision 88)
@@ -0,0 +1,27 @@
+command.name=Специфичность
+editor.name=Специфичность
+page.name=Специфичность
+command.label=Специфичность
+command.tooltip=Вычислить специфичные для каждой части слова
+SpecificitiesPreferencePage_0=N/A_Show p-values
+SpecificitiesPreferencePage_1=Ч/Б график
+SpecificitiesPreferencePage_2=Специфичность
+SpecificitiesPreferencePage_3=N/A_Scores format (default%,.1f)
+SpecificitiesPreferencePage_4=Сгруппировать столбики по строкам таблицы
+SpecificitiesPreferencePage_5=График: показать кривые
+SpecificitiesPreferencePage_6=График: показать столбики
+SpecificitiesPreferencePage_7=N/A_Banalit�
+SpecificitiesResultEditorInput_0=Значения
+SpecificitiesResultEditorInput_1=График
+SpecificitiesResultEditorInput_11=Плавающий
+SpecificitiesResultEditorInput_2=Невозможно рассчитать одновременно специфичность части и форм
+SpecificitiesResultEditorInput_5=Общая частотность
+SpecificitiesResultEditorInput_6=Подчастотность
+SpecificitiesResultEditorInput_7=Индекс специфичности
+SpecificitiesTableEditor_0=Не удалось подсчитать специфичность
+SpecificitiesTableEditor_1=** Ошибка при сортировке специфичности
+SpecificitiesTableEditor_11= T
+SpecificitiesTableEditor_16=График: 
+SpecificitiesTableEditor_17=Загрузка таблицы специфичности
+SpecificitiesTableEditor_5=Неожиданная ошибка в статистической машине R
+SpecificitiesTableEditor_8=Построить гистограмму выделенных строк

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

Index: tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle.properties	(revision 0)
+++ tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle.properties	(revision 88)
@@ -0,0 +1,29 @@
+command.name.0 = Compute the histogram of the selected lines
+command.name=Compute Specificities
+editor.name=Specificities
+page.name=Specificities
+command.label=Specificities
+command.tooltip=Compute the specific words of each part of the selected item
+SpecificitiesPreferencePage_0=Show p-values
+SpecificitiesPreferencePage_1=Monochrome graph
+SpecificitiesPreferencePage_2=Specificities
+SpecificitiesPreferencePage_3=Scores format (default is %,.1f)
+SpecificitiesPreferencePage_4=Group bars by lines
+SpecificitiesPreferencePage_5=Draw lines
+SpecificitiesPreferencePage_6=Draw bars
+SpecificitiesPreferencePage_7=Banality
+SpecificitiesPreferencePage_8=Maximum score
+SpecificitiesResultEditorInput_0=Values
+SpecificitiesResultEditorInput_1=Graphic
+SpecificitiesResultEditorInput_11=Double
+SpecificitiesResultEditorInput_2=Cannot compute simultaneously part and form specificities
+SpecificitiesResultEditorInput_5=Total frequency
+SpecificitiesResultEditorInput_6=Sub frequency
+SpecificitiesResultEditorInput_7=Specificities index
+SpecificitiesTableEditor_0=Unable to compute the specificities
+SpecificitiesTableEditor_1=Error while sorting specificities\: {0}
+SpecificitiesTableEditor_11=\ T
+SpecificitiesTableEditor_16=Graph\:
+SpecificitiesTableEditor_17=Opening the specificities table
+SpecificitiesTableEditor_5=Unexpected error in the statistical engine R {0}
+SpecificitiesTableEditor_8=Compute the histogram of the lines selected

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

Index: tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_ru.properties
===================================================================
--- tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 0)
+++ tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 88)
@@ -0,0 +1,27 @@
+command.name=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
+editor.name=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
+page.name=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
+command.label=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
+command.tooltip=\u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u043b\u043e\u0432\u0430
+SpecificitiesPreferencePage_0=N/A_Show p-values
+SpecificitiesPreferencePage_1=\u0427/\u0411 \u0433\u0440\u0430\u0444\u0438\u043a
+SpecificitiesPreferencePage_2=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
+SpecificitiesPreferencePage_3=N/A_Scores format (default%,.1f)
+SpecificitiesPreferencePage_4=\u0421\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0438\u043a\u0438 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b
+SpecificitiesPreferencePage_5=\u0413\u0440\u0430\u0444\u0438\u043a: \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0440\u0438\u0432\u044b\u0435
+SpecificitiesPreferencePage_6=\u0413\u0440\u0430\u0444\u0438\u043a: \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0438\u043a\u0438
+SpecificitiesPreferencePage_7=N/A_Banalit�
+SpecificitiesResultEditorInput_0=\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f
+SpecificitiesResultEditorInput_1=\u0413\u0440\u0430\u0444\u0438\u043a
+SpecificitiesResultEditorInput_11=\u041f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0439
+SpecificitiesResultEditorInput_2=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0447\u0430\u0441\u0442\u0438 \u0438 \u0444\u043e\u0440\u043c
+SpecificitiesResultEditorInput_5=\u041e\u0431\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0441\u0442\u044c
+SpecificitiesResultEditorInput_6=\u041f\u043e\u0434\u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0441\u0442\u044c
+SpecificitiesResultEditorInput_7=\u0418\u043d\u0434\u0435\u043a\u0441 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u0438
+SpecificitiesTableEditor_0=\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c
+SpecificitiesTableEditor_1=** \u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u0438
+SpecificitiesTableEditor_11= T
+SpecificitiesTableEditor_16=\u0413\u0440\u0430\u0444\u0438\u043a: 
+SpecificitiesTableEditor_17=\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u0438
+SpecificitiesTableEditor_5=\u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 R
+SpecificitiesTableEditor_8=\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a

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

Index: tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 0)
+++ tmp/org.txm.specificities.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 88)
@@ -0,0 +1,29 @@
+command.name.0=Calculer le diagramme en b\u00E2tons des lignes s�lectionn�es
+command.name=Sp�cificit�s
+editor.name=Sp�cificit�s
+page.name=Sp�cificit�s
+command.label=Sp�cificiti�s
+command.tooltip=Calculer les mots sp�cifiques de chaque partie
+SpecificitiesPreferencePage_0=Montrer les p-values
+SpecificitiesPreferencePage_1=Graphique N/B
+SpecificitiesPreferencePage_2=Sp�cificit�s
+SpecificitiesPreferencePage_3=Format des indices (par d�faut \: %,.1f)
+SpecificitiesPreferencePage_4=Regrouper les barres par les lignes de la table
+SpecificitiesPreferencePage_5=Afficher les lignes
+SpecificitiesPreferencePage_6=Afficher les barres
+SpecificitiesPreferencePage_7=Banalit�
+SpecificitiesPreferencePage_8=Indice maximum
+SpecificitiesResultEditorInput_0=Valeurs
+SpecificitiesResultEditorInput_1=Graphique
+SpecificitiesResultEditorInput_11=Flottant
+SpecificitiesResultEditorInput_2=On ne peut pas calculer � la fois les sp�cificit�s d'une partie et des formes
+SpecificitiesResultEditorInput_5=Fr�quence totale
+SpecificitiesResultEditorInput_6=Sous-fr�quence
+SpecificitiesResultEditorInput_7=Index des sp�cificit�s
+SpecificitiesTableEditor_0=Le calcul des sp�cificit�s a �chou�
+SpecificitiesTableEditor_1=** Erreur lors du tri des sp�cificit�s
+SpecificitiesTableEditor_11=T
+SpecificitiesTableEditor_16=Graphique \: 
+SpecificitiesTableEditor_17=Chargement de la table des sp�cificit�s
+SpecificitiesTableEditor_5=Erreur inattendue dans le moteur statistique R
+SpecificitiesTableEditor_8=Calculer le diagramme en b\u00E2tons des lignes s�lectionn�es

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

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

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

Index: tmp/org.txm.specificities.rcp/plugin.xml
===================================================================
--- tmp/org.txm.specificities.rcp/plugin.xml	(revision 0)
+++ tmp/org.txm.specificities.rcp/plugin.xml	(revision 88)
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.editors">
+      <editor
+            class="org.txm.chartsengine.rcp.editors.ChartEditorPart"
+            default="false"
+            icon="icons/functions/specificities.png"
+            id="org.txm.specificities.core.functions.SpecificitesResult"
+            name="Specificities Chart">
+      </editor>
+      <editor
+            class="org.txm.specificities.rcp.editors.SpecificitiesTableEditor"
+            default="false"
+            icon="icons/functions/specificities.png"
+            id="org.txm.specificities.editors.SpecificitiesTableEditor"
+            name="%editor.name">
+      </editor>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            categoryId="org.txm.rcpapplication.category.txm"
+            defaultHandler="org.txm.specificities.rcp.handlers.ComputeSpecifities"
+            id="ComputeSpecifities"
+            name="%command.name">
+      </command>
+      <command
+            defaultHandler="org.txm.specificities.rcp.handlers.ComputeSpecifictiesBarChart"
+            id="ComputeSpecifictiesBarChart"
+            name="%command.name.0">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="OneSpecificitiesResultSelected">
+         <with
+               variable="selection">
+            <iterate
+                  ifEmpty="false"
+                  operator="and">
+               <instanceof
+                     value="org.txm.functions.specificities.SpecificitesResult">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            locationURI="popup:org.txm.specificities.editors.SpecificitiesTableEditor">
+         <command
+               commandId="ComputeSpecifictiesBarChart"
+               icon="icons/functions/specificities.png"
+               style="push">
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
+         <command
+               commandId="ComputeSpecifities"
+               icon="icons/functions/specificities.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneSubCorpusSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneLexicalTableSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:menu.tools">
+         <command
+               commandId="ComputeSpecifities"
+               icon="icons/functions/specificities.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneSubCorpusSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneLexicalTableSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="toolbar:org.txm.rcpapplication.toolbartools">
+         <command
+               commandId="ComputeSpecifities"
+               icon="icons/functions/specificities.png"
+               style="push"
+               tooltip="%command.tooltip">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneSubCorpusSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneLexicalTableSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.adapters">
+      <factory
+            adaptableType="org.txm.specificities.core.functions.SpecificitesResult"
+            class="org.txm.specificities.rcp.adapters.SpecificitiesAdapterFactory">
+         <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.specificities.rcp.preferences.SpecificitiesPreferencePage"
+            id="org.txm.specificities.rcp.preferences.SpecificitiesPreferencePage"
+            name="%page.name">
+      </page>
+   </extension>
+
+</plugin>

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

Index: tmp/org.txm.specificities.rcp/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.specificities.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.specificities.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 88)
@@ -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.specificities.rcp/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.specificities.rcp/.settings/org.eclipse.core.resources.prefs
===================================================================
--- tmp/org.txm.specificities.rcp/.settings/org.eclipse.core.resources.prefs	(revision 0)
+++ tmp/org.txm.specificities.rcp/.settings/org.eclipse.core.resources.prefs	(revision 88)
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//OSGI-INF/l10n/bundle_ru_utf-8.properties=UTF-8

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

Index: tmp/org.txm.textsbalance.feature/.project
===================================================================
--- tmp/org.txm.textsbalance.feature/.project	(revision 0)
+++ tmp/org.txm.textsbalance.feature/.project	(revision 88)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.textsbalance.feature</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.FeatureBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.FeatureNature</nature>
+	</natures>
+</projectDescription>

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

Index: tmp/org.txm.textsbalance.feature/build.properties
===================================================================
--- tmp/org.txm.textsbalance.feature/build.properties	(revision 0)
+++ tmp/org.txm.textsbalance.feature/build.properties	(revision 88)
@@ -0,0 +1 @@
+bin.includes = feature.xml

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

Index: tmp/org.txm.textsbalance.feature/feature.xml
===================================================================
--- tmp/org.txm.textsbalance.feature/feature.xml	(revision 0)
+++ tmp/org.txm.textsbalance.feature/feature.xml	(revision 88)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="TextBalanceFeature"
+      label="Texts Balance"
+      version="1.0.0.qualifier"
+      provider-name="TXM">
+
+   <description url="http://www.example.com/description">
+      Additional TextBalance command to build a radar representation of text metadata values.
+   </description>
+
+   <copyright url="http://www.example.com/copyright">
+      Copyright © 2010-2015 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
+   </copyright>
+
+   <license url="">
+      &lt;TXM Software User Agreement&gt;
+
+TXM 0.7.8 Copyright © 2010-2016 ENS de Lyon, University of Franche-Comté, CNRS
+
+&lt;English version below&gt;
+
+EN ACCEPTANT CETTE MISE À JOUR ET EN UTILISANT TXM, VOUS VOUS ENGAGEZ À CITER L&apos;ARTICLE DE RÉFÉRENCE DE LA PLATEFORME* DANS VOS PUBLICATIONS DE RÉSULTATS OBTENUS À PARTIR D&apos;ELLE. CELA EST ESSENTIEL POUR NOUS PERMETTRE DE JUSTIFIER LE BESOIN DE PÉRENNISATION DE CET INSTRUMENT DE TRAVAIL POUR LA COMMUNAUTÉ SCIENTIFIQUE.
+
+Le logiciel TXM est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier suivant les termes de la Licence publique générale GNU telle que publiée par la Free Software Foundation, soit la version 2 de cette License, soit une version ultérieure.
+
+Le logiciel TXM est distribué dans l&apos;espoir qu&apos;il sera utile, mais sans aucune garantie, y compris mais non de façon limitative les garanties implicites de qualité marchande et de convenance à un usage particulier. Consultez la version 2 et la version 3 de la Licence publique générale GNU pour plus de détails.
+
+Vous devriez avoir reçu une copie de la Licence publique générale GNU en accompagnement du logiciel TXM ; si ce n&apos;est pas le cas, veuillez consulter la page http://www.gnu.org/licenses/gpl-2.0.html.
+_______________
+* Serge Heiden, Jean-Philippe Magué, Bénédicte Pincemin.
+TXM : Une plateforme logicielle open-source pour la textométrie - conception et développement. Sergio Bolasco, Isabella Chiari, Luca Giuliano. 10th International Conference on the Statistical Analysis of Textual Data - JADT 2010, Jun 2010, Rome, Italie.
+Edizioni Universitarie di Lettere Economia Diritto, 2 (3), pp.1021-1032, 2010. &lt;halshs-00549779&gt;
+
+
+ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH
+
+
+By accepting this update and by using TXM, you agree to cite the TXM platform reference article** in your publications of results obtained from it. That is essential for us to justify the need for sustainability of this instrument for the scientific community.
+
+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/gpl-2.0.html.
+_______________
+** Serge Heiden. The TXM Platform: Building Open-Source Textual
+Analysis Software Compatible with the TEI Encoding Scheme. Ryo Otoguro, Kiyoshi Ishikawa, Hiroshi Umemoto, Kei Yoshimoto and Yasunari Harada. 24th Pacific Asia Conference on Language, Information and Computation, Nov 2010, Sendai, Japan. Institute for Digital Enhancement of Cognitive Development, Waseda University, pp.389-398, 2010. &lt;halshs-00549764&gt;
+   </license>
+
+   <requires>
+      <import plugin="org.txm.rcp" version="0.7.7" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.jface.text"/>
+      <import plugin="org.eclipse.ui.editors"/>
+      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
+      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.chartsengine.r.core"/>
+      <import plugin="org.txm.textsbalance.core" version="1.0.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.chartsengine.jfreechart.core" version="1.0.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.chartsengine.rcp" version="1.0.0" match="greaterOrEqual"/>
+   </requires>
+
+   <plugin
+         id="org.txm.textsbalance.rcp"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.txm.textsbalance.tbx"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+</feature>

Property changes on: tmp/org.txm.textsbalance.feature/feature.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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

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

Index: tmp/org.txm.specificities.core/plugin.xml
===================================================================
--- tmp/org.txm.specificities.core/plugin.xml	(revision 0)
+++ tmp/org.txm.specificities.core/plugin.xml	(revision 88)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.txm.chartsengine.chartcreator">
+      <ChartCreator
+            chartsEngineName="jfreechart_charts_engine"
+            class="org.txm.specificities.core.chartsengine.jfreechart.JFCSpecificitiesBarChartCreator"
+            fileNamePrefix="specificities">
+      </ChartCreator>
+      <ChartCreator
+            chartsEngineName="r_charts_engine"
+            class="org.txm.specificities.core.chartsengine.r.RSpecificitiesBarChartCreator"
+            fileNamePrefix="specificities">
+      </ChartCreator>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.txm.specificities.core.preferences.SpecificitiesPreferences">
+      </initializer>
+   </extension>
+
+</plugin>

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

Index: tmp/org.txm.specificities.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.specificities.core/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.specificities.core/.settings/org.eclipse.jdt.core.prefs	(revision 88)
@@ -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.specificities.core/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.specificities.core/.classpath
===================================================================
--- tmp/org.txm.specificities.core/.classpath	(revision 0)
+++ tmp/org.txm.specificities.core/.classpath	(revision 88)
@@ -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.specificities.core/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.specificities.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.specificities.core/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.specificities.core/META-INF/MANIFEST.MF	(revision 88)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Specificities Core
+Bundle-SymbolicName: org.txm.specificities.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,
+ org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0",
+ org.txm.chartsengine.r.core;bundle-version="1.0.0",
+ org.eclipse.core.runtime;bundle-version="3.10.0"
+Export-Package: org.txm.specificities.core.chartsengine.jfreechart,
+ org.txm.specificities.core.chartsengine.r,
+ org.txm.specificities.core.functions,
+ org.txm.specificities.core.messages,
+ org.txm.specificities.core.preferences

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

Index: tmp/org.txm.specificities.core/.project
===================================================================
--- tmp/org.txm.specificities.core/.project	(revision 0)
+++ tmp/org.txm.specificities.core/.project	(revision 88)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.specificities.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.specificities.core/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/messages/messages.properties
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/messages/messages.properties	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/messages/messages.properties	(revision 88)
@@ -0,0 +1,3 @@
+ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL=Banality: {0}
+ChartsEngine_SPECIFICITIES_X_AXIS_LABEL=Part
+ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL=Score

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/messages/TBXSpecificitiesMessages.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/messages/TBXSpecificitiesMessages.java	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/messages/TBXSpecificitiesMessages.java	(revision 88)
@@ -0,0 +1,21 @@
+package org.txm.specificities.core.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+
+
+public class TBXSpecificitiesMessages extends NLS {
+
+	private static final String BUNDLE_NAME = "org.txm.specificities.core.messages.messages"; //$NON-NLS-1$
+
+	public static String ChartsEngine_SPECIFICITIES_X_AXIS_LABEL;
+	public static String ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL;
+	public static String ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL;
+
+
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(BUNDLE_NAME, TBXSpecificitiesMessages.class);
+	}
+
+}

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/messages/messages_fr.properties	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/messages/messages_fr.properties	(revision 88)
@@ -0,0 +1,3 @@
+ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL=Banalit� : {0}
+ChartsEngine_SPECIFICITIES_X_AXIS_LABEL=Partie
+ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL=Score
\ No newline at end of file

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/package.html
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/package.html	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/package.html	(revision 88)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Computing indicator of association between part and forms in a corpus following the "specificites" method.</p>
+</body>
+</html>
\ No newline at end of file

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Chi2.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Chi2.java	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Chi2.java	(revision 88)
@@ -0,0 +1,50 @@
+package org.txm.specificities.core.functions;
+
+import org.txm.functions.contrasts.Contrast;
+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.searchengine.cqp.corpus.Subcorpus;
+import org.txm.stat.StatException;
+import org.txm.stat.data.LexicalTable;
+import org.txm.stat.engine.r.RWorkspace;
+
+public class Chi2 extends Contrast {
+	public Chi2(Corpus corpus, Subcorpus subcorpus, Property property)
+			throws StatException, CqiClientException {
+		super(corpus, subcorpus, property);
+		// TODO Auto-generated constructor stub
+	}
+
+	public Chi2(Partition partition, Property property, int Fmin)
+			throws StatException, CqiClientException {
+		super(partition, property, Fmin);
+		// TODO Auto-generated constructor stub
+	}
+
+
+	public Chi2(LexicalTable table) {
+		super(table);
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public boolean compute() throws StatException {
+		colNames = table.getColNames().asStringsArray();
+		rowNames = table.getRowNames().asStringsArray();
+		frequencies = RWorkspace.getRWorkspaceInstance().evalToInt2D(table.getSymbol());
+		
+		// compute
+		String cmd = "mat <- "+table.getSymbol()+"\n"+ //$NON-NLS-1$ //$NON-NLS-2$
+					" mat2 <- rowSums(mat) %o% colSums(mat) / sum(mat)"+"\n"+ //$NON-NLS-1$ //$NON-NLS-2$
+					symbol +" <- (mat - mat2) ^ 2 / mat2"; //$NON-NLS-1$
+		indices = RWorkspace.getRWorkspaceInstance().evalToDouble2D(cmd);
+		return true;
+	}
+
+	@Override
+	public String getName() {
+		return "Chi2"; //$NON-NLS-1$
+	}
+}

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitesException.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitesException.java	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitesException.java	(revision 88)
@@ -0,0 +1,79 @@
+// 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: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.specificities.core.functions;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class SpecificitesException.
+ *
+ * @author sloiseau
+ */
+public class SpecificitesException extends Exception {
+
+	/** The Constant serialVersionUID. */
+	private static final long serialVersionUID = 4206288552541531386L;
+
+	/**
+	 * Instantiates a new specificites exception.
+	 */
+	public SpecificitesException() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * Instantiates a new specificites exception.
+	 *
+	 * @param arg0 the arg0
+	 * @param arg1 the arg1
+	 */
+	public SpecificitesException(String arg0, Throwable arg1) {
+		super(arg0, arg1);
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * Instantiates a new specificites exception.
+	 *
+	 * @param arg0 the arg0
+	 */
+	public SpecificitesException(String arg0) {
+		super(arg0);
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * Instantiates a new specificites exception.
+	 *
+	 * @param arg0 the arg0
+	 */
+	public SpecificitesException(Throwable arg0) {
+		super(arg0);
+		// TODO Auto-generated constructor stub
+	}
+}

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitesResult.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitesResult.java	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitesResult.java	(revision 88)
@@ -0,0 +1,840 @@
+// 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: 2017-01-24 18:11:42 +0100 (Tue, 24 Jan 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.specificities.core.functions;
+
+import java.io.BufferedWriter;
+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.util.ArrayList;
+import java.util.List;
+
+import org.rosuda.REngine.REXPMismatchException;
+import org.txm.core.chartsengine.r.__RDevice;
+import org.txm.functions.Function;
+import org.txm.functions.TXMResult;
+import org.txm.functions.progression.Progression;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Lexicon;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.searchengine.cqp.corpus.Subcorpus;
+import org.txm.stat.StatException;
+import org.txm.stat.data.LexicalTable;
+import org.txm.stat.data.Matrix;
+import org.txm.stat.data.Vector;
+import org.txm.stat.engine.r.RWorkspace;
+import org.txm.stat.engine.r.data.DoubleMatrix;
+import org.txm.stat.engine.r.data.VectorImpl;
+import org.txm.stat.utils.ArrayIndex;
+import org.txm.stat.utils.CheckArray;
+import org.txm.stat.utils.VectorizeArray;
+import org.txm.HasResults;
+import org.txm.Messages;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Hold specificites computation result.
+ * 
+ * @author sloiseau
+ * 
+ */
+public class SpecificitesResult extends Function implements TXMResult  {
+
+	public static int MAXSPECIF = 1000;
+
+	/** The indices. */
+	private final double[][] indices;
+
+	/** The table. */
+	private final LexicalTable table;
+
+	/** The rowindex. */
+	private int[] rowindex = null;
+
+	/** The colindex. */
+	private int[] colindex = null;
+
+	/** The frequencies. */
+	private int[][] frequencies = null;
+
+	/** The lexicon. */
+	private Lexicon lexicon;
+
+	/** The sub lexicon. */
+	private Lexicon subLexicon;
+
+	/** The colnames. */
+	private List<String> colnames = null;
+
+	/** The rownames. */
+	private List<String> rownames = null;
+
+	/** The corpus. */
+	private Corpus corpus = null;
+
+	/** The sub corpus. */
+	private Corpus subCorpus = null;
+
+	/** The partition. */
+	private Partition partition;
+
+	/** The name. */
+	private String name;
+
+	/** The symbol. */
+	private String symbol;
+
+	/** The subcorpus. */
+	private Corpus subcorpus;
+
+	/** The writer. */
+	private BufferedWriter writer;
+	
+	/**
+	 * The selected type names to focus on.
+	 */
+	protected String[] selectedTypeNames;
+
+	/**
+	 * The selected part names to focus on.
+	 */
+	protected String[] selectedPartNames;
+
+	/**
+	 * The selected specificities indices to focus on.
+	 */
+	protected double[][] selectedSpecificitiesIndex;
+	
+
+	/**
+	 * Instantiates a new specificites result : for subcorpus specif ities.
+	 *
+	 * @param symbol the symbol
+	 * @param specIndex the spec index
+	 * @param lexicon the lexicon
+	 * @param subLexicon the sub lexicon
+	 * @param name the name
+	 */
+	protected SpecificitesResult(String symbol, double[][] specIndex, Lexicon lexicon,
+			Lexicon subLexicon, String name, int maxScore) {
+		this.symbol = symbol;
+		this.indices = specIndex;
+
+		this.lexicon = lexicon;
+		this.subLexicon = subLexicon;
+		this.corpus = lexicon.getCorpus();
+		this.subCorpus = subLexicon.getCorpus();
+		this.name = name;
+
+		int MAX = MAXSPECIF;
+		int MIN = -MAXSPECIF;
+
+		if (maxScore > 0) {
+			MAX = maxScore;
+			MIN = -maxScore;
+		}
+		for (int i = 0 ; i < indices.length ; i++) {
+			for (int j = 0 ; j < indices[i].length ; j++) {
+				if (indices[i][j] > MAX) {
+					indices[i][j] = MAX;
+				} else if (indices[i][j] < MIN) {
+					indices[i][j] = MIN;
+				}
+			}
+		}
+
+		this.table = null;
+	}
+
+	/**
+	 * Instantiates a new specificites result.
+	 *
+	 * @param symbol the symbol
+	 * @param specIndex the spec index (as double[row][column])
+	 * @param table the table
+	 * @param typeFocus names of the rows of the lexical table with corresponding rows
+	 * in the specIndex array; <code>null</code> if all the rows are
+	 * represented in specIndex.
+	 * @param partFocus names of the cols of the lexical table with corresponding cols
+	 * in the specIndex array; <code>null</code> if all the cols are
+	 * represented in specIndex.
+	 * @param name the name
+	 * @param maxScore if abs(score) > maxScore -> score = +/- maxScore
+	 * @throws StatException the stat exception
+	 */
+	protected SpecificitesResult(String symbol, double[][] specIndex, LexicalTable table,
+			List<String> typeFocus, List<String> partFocus, String name, int maxScore)
+					throws StatException {
+		this.symbol = symbol;
+
+		if (table == null) {
+			throw new IllegalArgumentException(Messages.SpecificitesResult_2);
+		}
+		this.partition = table.getPartition();
+		this.name = name;
+
+		if (specIndex == null || specIndex.length == 0) {
+			throw new IllegalArgumentException(Messages.SpecificitesResult_0);
+		}
+		boolean ok = CheckArray.checkMatrixRepresentation(specIndex);
+		if (!ok) {
+			throw new IllegalArgumentException(Messages.SpecificitesResult_1);
+		}
+
+		this.indices = specIndex;
+		this.table = table;
+		this.colnames = partFocus;
+		this.rownames = typeFocus;
+
+		// filter by max&min
+		int MAX = MAXSPECIF;
+		int MIN = -MAXSPECIF;
+
+		if (maxScore > 0) {
+			MAX = maxScore;
+			MIN = -maxScore;
+		}
+
+		for (int i = 0 ; i < indices.length ; i++) {
+			for (int j = 0 ; j < indices[i].length ; j++) {
+				if (indices[i][j] > MAX) {
+					indices[i][j] = MAX;
+				} else if (indices[i][j] < MIN) {
+					indices[i][j] = MIN;
+				}
+			}
+		}
+
+		if (typeFocus != null && typeFocus.size() != 0) {
+			if (typeFocus.size() != specIndex.length) {
+				throw new IllegalArgumentException(
+						Messages.SpecificitesResult_3 + typeFocus.size()
+						+ Messages.SpecificitesResult_4
+						+ specIndex.length
+						+ Messages.SpecificitesResult_5);
+			}
+
+			rowindex = ArrayIndex.getIndex(
+					table.getRowNames().asStringsArray(), typeFocus
+					.toArray(new String[] {}));
+			for (int i : rowindex) {
+				if (i == -1) {
+					throw new IllegalArgumentException(
+							Messages.SpecificitesResult_6);
+				}
+			}
+		}
+		if (partFocus != null && partFocus.size() != 0) {
+			if (partFocus.size() != specIndex[0].length) {
+				throw new IllegalArgumentException(
+						Messages.SpecificitesResult_7 + partFocus.size()
+						+ ", " + specIndex[0].length + ")."); //$NON-NLS-1$//$NON-NLS-2$ 
+			}
+			colindex = ArrayIndex.getIndex(
+					table.getColNames().asStringsArray(), partFocus
+					.toArray(new String[] {}));
+			for (int i : colindex) {
+				if (i == -1) {
+					throw new IllegalArgumentException(
+							Messages.SpecificitesResult_10);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Gets the type focus.
+	 *
+	 * @return the type focus
+	 */
+	public List<String> getTypeFocus() {
+		return rownames;
+	}
+
+	/**
+	 * Gets the part focus.
+	 *
+	 * @return the part focus
+	 */
+	public List<String> getPartFocus() {
+		return colnames;
+	}
+
+	/**
+	 * Gets the nbr part.
+	 *
+	 * @return the nbr part
+	 * @throws StatException the stat exception
+	 */
+	public int getNbrPart() throws StatException {
+		if (table != null)
+			return table.getNColumns();
+		else
+			return getPartShortNames().length;
+	}
+
+	/**
+	 * Gets the corpus size.
+	 *
+	 * @return the corpus size
+	 * @throws StatException the stat exception
+	 */
+	public int getCorpusSize() throws StatException {
+		return table != null ? table.getTotal() : lexicon.nbrOfToken();
+	}
+
+	/**
+	 * Gets the specificites index.
+	 * 
+	 * @return the specificites index
+	 */
+	public double[][] getSpecificitesIndex() {
+		return indices;
+	}
+
+	/**
+	 * Name of the type for which specificite are computed.
+	 *
+	 * @return the type names
+	 * @throws StatException the stat exception
+	 */
+	public String[] getTypeNames() throws StatException {
+		if (table != null) {
+			return (rownames != null && rownames.size() != 0) ? rownames
+					.toArray(new String[] {}) : table.getRowNames()
+					.asStringsArray();
+		} else {
+			return lexicon.getForms();
+		}
+	}
+
+	/**
+	 * Name of the part for which specif icite are computed.
+	 *
+	 * @return the part short names
+	 * @throws StatException the stat exception
+	 */
+	public String[] getPartShortNames() throws StatException {
+		//		System.out.println("get col names: "+table);
+		//		System.out.println("colnames: "+colnames);
+		if (colnames != null && colnames.size() > 0)
+			return colnames.toArray(new String[]{});
+		else if (table != null) {
+			// return (colnames != null && colnames.size() != 0) ?
+			// colnames.toArray(new String[]{}) :
+			// table.getColNames().asStringsArray();
+			/*
+			 * List<Part> parts = table.getPartition().getOrderedParts(); String[]
+			 * partShortNames = new String[parts.size()]; for (int i = 0; i <
+			 * partShortNames.length; i++) { partShortNames[i] =
+			 * parts.get(i).getShortName(); }
+			 */
+			return table.getColNames().asStringsArray();
+
+		} else {
+			if(this.subCorpus != null)
+				return new String[] { this.subCorpus.getName(),
+					this.corpus.getName() + " \\ " + this.subCorpus.getName() }; //$NON-NLS-1$
+		}
+		return new String[0];
+	}
+
+	/**
+	 * Gets the frequency.
+	 *
+	 * @return the frequency
+	 * @throws StatException the stat exception
+	 */
+	public int[][] getFrequency() throws StatException {
+		//System.out.println("GET FREQUENCIES");
+		if (frequencies == null) {
+			//System.out.println("no frequencies");
+			if (table != null) {
+				//System.out.println("FROM TABLE");
+				frequencies = RWorkspace.getRWorkspaceInstance().evalToInt2D(table.getSymbol());
+				
+			} else {// if table == null : subcorpus specif 
+				//System.out.println("FROM LEXICON");
+				frequencies = new int[lexicon.getFreq().length][2]; // build a frenquency table from lexicons
+				String[] corpusforms = lexicon.getForms(); // all the forms
+				String[] subcorpusforms = subLexicon.getForms(); // all the forms
+				int[] corpusfreq = lexicon.getFreq(); // all the freqs
+				int[] subcorpusfreq = subLexicon.getFreq(); // all the freqs in the subcorpus
+
+				//				System.out.println("len subforms: "+subcorpusforms.length);
+				//				System.out.println("len subfreqs: "+subcorpusfreq.length);
+				for (int i = 0 ; i < corpusforms.length ; i++) //get all forms
+				{
+					int j = 0; // find the index of the form in the subcorpus arrays
+					for (j = 0; j < subcorpusforms.length; j++) {
+						if (subcorpusforms[j].equals(corpusforms[i]))
+							break;// found the good form
+					}
+					if(j < subcorpusforms.length)
+						frequencies[i][0] = subcorpusfreq[j];
+					frequencies[i][1] = corpusfreq[i] - frequencies[i][0];
+				}
+			}
+		}
+		return frequencies;
+	}
+
+	/**
+	 * Gets the lexical table.
+	 *
+	 * @return the lexical table
+	 */
+	public LexicalTable getLexicalTable() {
+		return table;
+	}
+
+	/**
+	 * Gets the lexicon.
+	 *
+	 * @return the lexicon
+	 */
+	public Lexicon getLexicon() {
+		return lexicon;
+	}
+
+	/**
+	 * Gets the part size.
+	 *
+	 * @return the part size
+	 * @throws StatException the stat exception
+	 */
+	public int[] getPartSize() throws StatException {
+		if (table != null) {
+			Vector partsize = table.getColMarginsVector();
+			if (colindex != null) {
+				partsize = partsize.get(colindex);
+			}
+			return partsize.asIntArray();
+		} else {
+			return new int[] { subLexicon.nbrOfToken(),
+					lexicon.nbrOfToken() - subLexicon.nbrOfToken() };
+		}
+	}
+
+	/**
+	 * The frequency in the whole corpus.
+	 *
+	 * @return the form frequencies
+	 * @throws StatException the stat exception
+	 */
+	public int[] getFormFrequencies() throws StatException {
+		if (table != null) {
+			//System.out.println("get freq by table");
+			Vector formFrequencies = table.getRowMarginsVector();
+			if (rowindex != null) {
+				formFrequencies = formFrequencies.get(rowindex);
+			}
+			return formFrequencies.asIntArray();
+		} else {
+			//System.out.println("freqs by lexicon of "+lexicon.getCorpus());
+			return lexicon.getFreq();
+		}
+	}
+
+	/**
+	 * To txt.
+	 *
+	 * @param outfile the outfile
+	 * @param encoding the encoding
+	 * @param colseparator the colseparator
+	 * @param txtseparator the txtseparator
+	 * @return true, if successful
+	 * @throws StatException the stat exception
+	 */
+	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws StatException {
+
+		// NK: Declared as class attribute to perform a clean if the operation is interrupted
+		//OutputStreamWriter writer;
+		try {
+			this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile),	encoding)); 
+		} catch (UnsupportedEncodingException e1) {
+			org.txm.utils.logger.Log.printStackTrace(e1);
+			return false;
+		} catch (FileNotFoundException e1) {
+			org.txm.utils.logger.Log.printStackTrace(e1);
+			return false;
+		}
+
+		//int[] T = getPartSize();
+		acquireSemaphore();
+		try {
+			getFrequency();
+			getFormFrequencies();
+			getLexicon();
+			String[] names = getPartShortNames();
+			// if ("UTF-8".equals(encoding)) writer.write('\ufeff'); // UTF-8 BOM
+			//write column header
+			String txt = Messages.SpecificitesResult_8+colseparator+"F"; //$NON-NLS-1$
+			for(String colname : names) {
+				txt += colseparator+ "f_"+colname + colseparator + "Score"; //$NON-NLS-1$ //$NON-NLS-2$
+			}
+			writer.write(txt +"\n"); //$NON-NLS-1$
+
+			//write data
+			for (int ii = 0; ii < frequencies.length; ii++) {
+				txt = txtseparator + getTypeNames()[ii].replace(txtseparator, txtseparator+txtseparator)+txtseparator; 
+				int somme = 0;
+				String txtcols = ""; //$NON-NLS-1$
+				for (int j = 0; j < frequencies[ii].length; j++) {
+					somme += frequencies[ii][j];
+					txtcols += (colseparator + frequencies[ii][j]); 
+					txtcols += (colseparator + indices[ii][j]); 
+				}
+				writer.write(txt + colseparator + somme+ txtcols+ "\n"); //$NON-NLS-1$
+				writer.flush();
+			}
+			writer.close();
+		} catch (IOException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		} finally {
+			releaseSemaphore();
+		}
+
+		return true;
+	}
+
+	/**
+	 * To svg.
+	 *
+	 * @param file the file
+	 * @param typeNames the type names
+	 * @param partNames the part names
+	 * @param specIndex the spec index
+	 * @param transpose the transpose
+	 * @param drawBarPlot the draw bar plot
+	 * @param drawLines the draw lines
+	 * @param device the device
+	 * @throws StatException the stat exception
+	 */
+	@Deprecated
+	// FIXME : to remove when charts engine will be validated
+	public final void toSVG(File file, String[] typeNames,
+			String[] partNames, double[][] specIndex, boolean transpose, boolean drawBarPlot, boolean drawLines, __RDevice device, float BANALITE, boolean monochrome) throws StatException {
+
+		// TODO: should filter max and min here
+		// specIndex
+
+		Matrix spec = new DoubleMatrix(specIndex);
+		Vector types = new VectorImpl(typeNames);
+		Vector parts = new VectorImpl(partNames);
+
+		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+		rw.eval("rownames(" + spec.getSymbol() + ") <- " + types.getSymbol() + ";"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		rw.eval("colnames(" + spec.getSymbol() + ") <- " + parts.getSymbol() + ";"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		try {
+			//System.out.println(""+"barplot(" + spec.getSymbol() + ", beside=T, legend.text=rownames(" + spec.getSymbol() + "));"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+			String matrix = spec.getSymbol();
+			if (transpose)
+				matrix = "t("+matrix+")"; //$NON-NLS-1$ //$NON-NLS-2$
+
+
+			String names = parts.getSymbol();
+			if (transpose)
+				names = types.getSymbol();
+
+			String legend = types.getSymbol();
+			if (transpose)
+				legend = parts.getSymbol();
+
+			String title = this.getName();
+
+			String cmd = ""; //$NON-NLS-1$
+
+			String[] colors;
+			String[] allcolors = Progression.colors;
+			if (transpose) { // one color per part
+				colors = new String[partNames.length];
+				for (int j = 0 ; j < partNames.length ; j++) {
+					colors[j] = allcolors[j%allcolors.length];
+				}
+			} else { // one color per word
+				colors = new String[typeNames.length];
+				for (int j = 0 ; j < typeNames.length ; j++)
+					colors[j] = allcolors[j%allcolors.length];
+			}
+
+			RWorkspace.getRWorkspaceInstance().eval("rm(colors)"); //$NON-NLS-1$
+			RWorkspace.getRWorkspaceInstance().addVectorToWorkspace("colors", colors); //$NON-NLS-1$
+			//System.out.println("colors: "+Arrays.toString(colors));
+
+			String colorString;
+
+			if (monochrome)
+				colorString = ""; //$NON-NLS-1$
+			else
+				colorString = ", col=colors"; //$NON-NLS-1$
+
+			cmd += "op <- par(mar=c(5,5,5,10), xpd=TRUE);\n"; //$NON-NLS-1$
+
+			if (drawBarPlot) {
+				cmd += 	"mat <- "+matrix+";\n" + //$NON-NLS-1$ //$NON-NLS-2$
+						"draw <- barplot(mat, space=c(1,3)"+colorString+ //$NON-NLS-1$
+						", horiz=F, las=2, names.arg="+names+", main=\""+title+ //$NON-NLS-1$ //$NON-NLS-2$
+						"\", beside=T, xpd=TRUE);\n" +  //$NON-NLS-1$ //$NON-NLS-2$
+						// removed : legend.text="+legend + "
+						//"rm(op);" + //$NON-NLS-1$
+						"W2 <- 100000;\n"+//$NON-NLS-1$
+						"lines(c(0,W2), c(-"+BANALITE+", -"+BANALITE+"), lty=2);\n" + // seuil banalité inférieur //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						"lines(c(0,W2), c("+BANALITE+", "+BANALITE+"), lty=2);\n" + // seuil banalité supérieur //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						"lines(c(0,W2), c(0,0), lty=1);\n"+ //$NON-NLS-1$
+						"\n"; //$NON-NLS-1$ 
+			} else {
+				//compute the hist but dont show the bar
+				cmd += 	"mat <- "+matrix+";\n" + //$NON-NLS-1$ //$NON-NLS-2$
+						"draw <- barplot(mat, space=c(1,3), col=\"white\", border=NA, horiz=F, las=2, names.arg="+names+", main=\""+title+"\", beside=T);\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+				//"rm(op);\n"; //$NON-NLS-1$ 
+			}
+
+			if (drawLines) {
+				if (transpose) {
+					cmd +=	"for(i in 1:length(draw[1,])){\n" + //$NON-NLS-1$
+							"lines(draw[,i], mat[,i], col=colors[[i]]);\n" + //$NON-NLS-1$
+							"}\n"; //$NON-NLS-1$
+				} else {
+					cmd +=	"for(i in 1:length(draw[,1])){\n" + //$NON-NLS-1$
+							"lines(draw[i,], mat[i,], col=colors[[i]]);\n" + //$NON-NLS-1$
+							"}\n"; //$NON-NLS-1$
+				}
+				if (!drawBarPlot) {
+					if (transpose) {
+						cmd +=	"for(i in 1:length(draw[1,])){\n" + //$NON-NLS-1$
+								"text(draw[,i], 0, label="+legend+", offset=0, srt=90);\n" + //$NON-NLS-1$ //$NON-NLS-2$
+								"lines(c(draw[[1,i]],draw[[length(draw[,i]),i]]), c(0,0))" + //$NON-NLS-1$
+								"}\n"; //$NON-NLS-1$
+					} else {
+						cmd += "lines( c(0,99999), c(0,0))\n"; //$NON-NLS-1$
+					}
+				}
+			}
+
+			//			if (transpose)
+			//				cmd += "legend(\"topright\", "+names+", inset = c(-0.2, 0), col = colors, lty = 1, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
+			//			else
+			if (drawBarPlot)
+				cmd += "legend(\"topright\", "+legend+", inset = c(-0.2,0), col = colors, pch = 0, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
+			else
+				cmd += "legend(\"topright\", "+legend+", inset = c(-0.2,0), col = colors, lty = 1, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
+
+			rw.plot(file, cmd, device);
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			throw new StatException(e);
+		}
+	}
+
+	/**
+	 * SL
+	 * 
+	 * TODO should be a generic function for drawing barplot with vector.
+	 *
+	 * @param file the file
+	 * @throws StatException the stat exception
+	 */
+	@Deprecated
+	// FIXME : to remove when charts engine will be validated
+	public void toSVG(File file) throws StatException {
+		toSVG(file, __RDevice.SVG);
+	}
+
+
+	/**
+	 * To svg.
+	 *
+	 * @param file the file
+	 * @param device the device
+	 * @throws StatException the stat exception
+	 */
+	@Deprecated
+	// FIXME : to remove when charts engine will be validated
+	public void toSVG(File file, __RDevice device) throws StatException {
+		// TODO Auto-generated method stub
+		double[][] specindex = getSpecificitesIndex();
+		try {
+			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+			double[] i = VectorizeArray.vectorizeByInner(specindex);
+			VectorImpl v = new VectorImpl(i);
+			//System.out.println("R : "+v.getSymbol()); //$NON-NLS-1$
+			rw.plot(file, "barplot(" + v.getSymbol() + ")", device); //$NON-NLS-1$ //$NON-NLS-2$
+		} catch (REXPMismatchException e) {
+			throw new StatException(e);
+		}
+	}
+
+	/**
+	 * Gets the parent, i.e. the subcorpus if the specif ities were computed on a
+	 * subcorpus, and the partition if teh specificities were computed on a
+	 * partition
+	 * 
+	 * @return the parent
+	 */
+	public HasResults getParent() {
+		if (partition != null) return table;
+		if (subcorpus != null) return subcorpus;
+		return corpus; // computed on subcorpus
+	}
+
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Gets the symbol.
+	 *
+	 * @return the symbol
+	 */
+	public String getSymbol() {
+		return symbol;
+	}
+
+	/**
+	 * Gets the sorted part indexes.
+	 *
+	 * @return the sorted part indexes
+	 */
+	public int[] getSortedPartIndexes() {
+
+		try {
+			int[] indexes = new int[this.getNbrPart()];
+			String[] partsname = this.getPartShortNames().clone();
+			for (int i = 0; i < this.getNbrPart(); i++) {
+				indexes[i] = i;
+			}
+
+			for (int i = 0; i < this.getNbrPart(); i++) {
+				int imin = i;
+				for (int j = i; j < this.getNbrPart(); j++) {
+					if (partsname[imin].compareTo(partsname[j]) > 0) {
+						imin = j;
+					}
+				}
+				String tmp = partsname[i];
+				partsname[i] = partsname[imin];
+				partsname[imin] = tmp;
+
+				int tmp2 = indexes[i];
+				indexes[i] = indexes[imin];
+				indexes[imin] = tmp2;
+			}
+			return indexes;
+		} catch (StatException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+		return new int[0];
+	}
+
+	/**
+	 * Sets the corpus.
+	 *
+	 * @param subcorpus2 the new corpus
+	 */
+	public void setCorpus(Subcorpus subcorpus2) {
+		this.subcorpus = subcorpus2;
+	}
+
+	/**
+	 * Gets the corpus.
+	 *
+	 * @return the corpus
+	 */
+	public Corpus getCorpus() {
+		return subcorpus;
+	}
+
+	@Override
+	public void clean() {
+		try {
+			this.writer.flush();
+			this.writer.close();	
+		} catch (IOException e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+	}
+
+	/**
+	 * @return the selectedTypeNames
+	 */
+	public String[] getSelectedTypeNames() {
+		return selectedTypeNames;
+	}
+
+	/**
+	 * @param selectedTypeNames the selectedTypeNames to set
+	 */
+	public void setSelectedTypeNames(String[] selectedTypeNames) {
+		this.selectedTypeNames = selectedTypeNames;
+	}
+
+	/**
+	 * @return the selectedPartNames
+	 */
+	public String[] getSelectedPartNames() {
+		return selectedPartNames;
+	}
+
+	/**
+	 * @param selectedPartNames the selectedPartNames to set
+	 */
+	public void setSelectedPartNames(String[] selectedPartNames) {
+		this.selectedPartNames = selectedPartNames;
+	}
+
+	/**
+	 * @return the selectedSpecificitiesIndex
+	 */
+	public double[][] getSelectedSpecificitiesIndex() {
+		return selectedSpecificitiesIndex;
+	}
+
+	/**
+	 * @param selectedSpecificitiesIndex the selectedSpecificitiesIndex to set
+	 */
+	public void setSelectedSpecificitiesIndex(double[][] selectedSpecificitiesIndex) {
+		this.selectedSpecificitiesIndex = selectedSpecificitiesIndex;
+	}
+
+	@Override
+	public boolean delete() {
+		if (partition != null) return partition.removeResult(this);
+		return corpus.removeResult(this);
+	}
+}

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificites.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificites.java	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificites.java	(revision 88)
@@ -0,0 +1,217 @@
+// 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-11-29 16:47:07 +0100 (Tue, 29 Nov 2016) $
+// $LastChangedRevision: 3349 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.specificities.core.functions;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Lexicon;
+import org.txm.searchengine.cqp.corpus.Part;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.Subcorpus;
+import org.txm.searchengine.cqp.corpus.query.Focus;
+import org.txm.stat.StatException;
+import org.txm.stat.data.LexicalTable;
+import org.txm.stat.data.Vector;
+import org.txm.stat.engine.r.RWorkspaceException;
+import org.txm.Messages;
+
+// TODO: Auto-generated Javadoc
+/**
+ * High level access to the Specificities.
+ * 
+ * The methods in this class access the Specificities function through
+ * high-level objects (representation of CQP corpus ({@link Corpus},
+ * {@link Subcorpus}, {@link Partition}), representation of queries (
+ * {@link Focus}, {@link Property}), and lexicon {@link Lexicon})).
+ * 
+ * @author sloiseau
+ * 
+ */
+public class Specificites {
+
+	/** The specif_counter. */
+	private static int specif_counter = 1;
+	private static ArrayList<Integer> selectedColIdx;
+
+	/**
+	 * Compute the specificity index for all the cells of a complete lexical
+	 * table, as defined by a {@link Partition} and a {@link Property}.
+	 * 
+	 * This may be used for extracting, for all part, the forms the most or the
+	 * less specif ic.
+	 *
+	 * @param partition the partition
+	 * @param analysisProperty the analysis property
+	 * @param formFocus the form focus
+	 * @param partsFocus the parts focus
+	 * @param Fmin the fmin
+	 * @return the specificites result
+	 * @throws CqiClientException the cqi client exception
+	 * @throws StatException the stat exception
+	 */
+	public static SpecificitesResult specificites(Partition partition, Property analysisProperty,
+			List<Part> partsFocus, int Fmin, int maxScore) throws CqiClientException, StatException {
+		if (partition.getParts().size() < 2) {
+			throw new IllegalArgumentException(Messages.Specificites_0);
+		}
+		// complication due to Jean-Philippe special interest in usage of Part.
+		List<String> partNamesFocus = new ArrayList<String>();
+		
+		if (partsFocus != null) {
+			partNamesFocus = new ArrayList<String>();
+			for (Part p : partsFocus) {
+				partNamesFocus.add(p.getShortName());
+			}
+		}
+		// System.out.println("get/create lexical table");
+		LexicalTable table = partition.getLexicalTable(analysisProperty, Fmin);
+		partition.storeResult(table);
+
+		// Create a set of the existing types
+		String[] rownames = table.getRowNames().asStringsArray();
+		ArrayList<String> found = new ArrayList<String>(Arrays.asList(rownames));
+
+		String symbol = org.txm.stat.engine.r.function.Specificites.prefixR+(specif_counter++);
+		
+		//System.out.println("Av specif ");
+		double[][] specIndex = org.txm.stat.engine.r.function.Specificites
+		.specificites(symbol, table, found.toArray(new String[] {}), partNamesFocus.toArray(new String[] {}));
+		//System.out.println("Ap specif ");
+		
+		return new SpecificitesResult(
+				symbol,
+				specIndex,
+				table,
+				found,
+				partNamesFocus,
+				analysisProperty.getName(),
+				maxScore);
+	}
+
+	/**
+	 * Specificites.
+	 *
+	 * @param table the table
+	 * @return the specificites result
+	 * @throws CqiClientException the cqi client exception
+	 * @throws StatException the stat exception
+	 */
+	public static SpecificitesResult specificites(LexicalTable table, int maxScore)
+	throws CqiClientException, StatException {
+		if (table.getNColumns() < 2) {
+			throw new IllegalArgumentException(Messages.Specificites_0);
+		}
+
+		String[] rownames = table.getRowNames().asStringsArray();
+		String[] colnames = table.getColNames().asStringsArray();
+		String symbol = org.txm.stat.engine.r.function.Specificites.prefixR+(specif_counter++);
+
+		double[][] specIndex = org.txm.stat.engine.r.function.Specificites.specificites(symbol, table, rownames, colnames);
+
+		if (table.getPartition() != null) {
+			return new SpecificitesResult(symbol, specIndex, table, Arrays
+					.asList(rownames), Arrays.asList(colnames), table.getProperty().getName(), maxScore); 
+		} else {
+			return new SpecificitesResult(symbol, specIndex, table, Arrays
+					.asList(rownames), Arrays.asList(colnames),
+					"TLNONAME: " + table.getProperty().getName(), maxScore); //$NON-NLS-1$
+		}
+	}
+
+	/**
+	 * Specificites.
+	 *
+	 * @param corpus the corpus
+	 * @param subcorpus the subcorpus
+	 * @param property the property
+	 * @return the specificites result
+	 * @throws CqiClientException the cqi client exception
+	 * @throws StatException the stat exception
+	 */
+	public static SpecificitesResult specificites(Corpus corpus,
+			Subcorpus subcorpus, Property property, int maxScore) throws CqiClientException,
+			StatException {
+
+		Lexicon totalFrequencies = corpus.getLexicon(property);
+		Lexicon subFrequencies = subcorpus.getLexicon(property);
+
+		//System.out.println("Send corpus vector");
+		Vector totalFSymbol;
+		Vector subFSymbol;
+		try {
+			totalFSymbol = totalFrequencies.asVector();
+			subFSymbol = subFrequencies.asVector();
+		} catch (StatException e) {
+			throw new RWorkspaceException(e);
+		}
+
+		//System.out.println("compute specifs");
+		String symbol = org.txm.stat.engine.r.function.Specificites.prefixR+(specif_counter++);
+		double[][] specIndex = org.txm.stat.engine.r.function.Specificites.specificites(symbol, totalFSymbol, subFSymbol);
+
+		//System.out.println("build SpecificitesResult");
+		SpecificitesResult specif =  new SpecificitesResult(symbol, specIndex, totalFrequencies,
+				subFrequencies, property.getName(), maxScore); 
+
+		specif.setCorpus(subcorpus);
+		return specif ;
+	}
+
+	/**
+	 * TODO to be replaced by
+	 * "org.apache.commons.collections.CollectionUtils.subtract" when someone
+	 * figure out where is the eclipse plugin for apache commons collections. SL
+	 *
+	 * @param leftoperande the leftoperande
+	 * @param rightoperande the rightoperande
+	 * @return an array of two sets: the first one contains the element of
+	 * leftoperande not in rightoperande, the second the element of
+	 * leftoperande present in rightoperande.
+	 */
+	private static final Set<String>[] subtract(Set<String> leftoperande,
+			Set<String> rightoperande) {
+		Set<String>[] returned = new HashSet[] { new HashSet<String>(),
+				new HashSet<String>() };
+		for (String s : leftoperande) {
+			if (!rightoperande.contains(s)) {
+				returned[0].add(s);
+			} else {
+				returned[1].add(s);
+			}
+		}
+		return returned;
+	}
+}

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificites2.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificites2.java	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificites2.java	(revision 88)
@@ -0,0 +1,50 @@
+package org.txm.specificities.core.functions;
+
+import org.txm.functions.contrasts.Contrast;
+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.searchengine.cqp.corpus.Subcorpus;
+import org.txm.stat.StatException;
+import org.txm.stat.data.LexicalTable;
+import org.txm.stat.engine.r.RWorkspace;
+
+public class Specificites2 extends Contrast {
+	
+	public Specificites2(Corpus corpus, Subcorpus subcorpus, Property property)
+			throws StatException, CqiClientException {
+		super(corpus, subcorpus, property);
+		// TODO Auto-generated constructor stub
+	}
+
+	public Specificites2(Partition partition, Property property, int Fmin)
+			throws StatException, CqiClientException {
+		super(partition, property, Fmin);
+		// TODO Auto-generated constructor stub
+	}
+
+
+	public Specificites2(LexicalTable table) {
+		super(table);
+		// TODO Auto-generated constructor stub
+	}
+
+	public boolean compute() throws StatException {
+	
+	colNames = table.getColNames().asStringsArray();
+	rowNames = table.getRowNames().asStringsArray();
+	frequencies = RWorkspace.getRWorkspaceInstance().evalToInt2D(table.getSymbol());
+	
+	// compute
+	indices = org.txm.stat.engine.r.function.Specificites.specificites("SYMBOL", table, null, null); //$NON-NLS-1$
+	
+	return true;
+}
+
+	@Override
+	public String getName() {
+		// TODO Auto-generated method stub
+		return "Specif2"; //$NON-NLS-1$
+	}
+}

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/jfreechart/JFCSpecificitiesBarChartCreator.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/jfreechart/JFCSpecificitiesBarChartCreator.java	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/jfreechart/JFCSpecificitiesBarChartCreator.java	(revision 88)
@@ -0,0 +1,227 @@
+package org.txm.specificities.core.chartsengine.jfreechart;
+
+import java.awt.Color;
+
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.plot.Marker;
+import org.jfree.chart.plot.ValueMarker;
+import org.jfree.data.general.DatasetUtilities;
+import org.jfree.data.xy.XYSeries;
+import org.jfree.data.xy.XYSeriesCollection;
+import org.jfree.ui.RectangleAnchor;
+import org.jfree.ui.TextAnchor;
+import org.txm.chartsengine.core.ChartsEngine;
+import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
+import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IItemSelectionRenderer;
+import org.txm.chartsengine.jfreechart.core.themes.base.ExtendedNumberAxis;
+import org.txm.core.chartsengine.base.messages.ChartsEngineMessages;
+import org.txm.core.chartsengine.jfreechart.messages.JFreeChartsEngineMessages;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.specificities.core.functions.SpecificitesResult;
+import org.txm.specificities.core.preferences.SpecificitiesPreferences;
+
+/**
+ * Creates a specificities chart from the specified <code>SpecificitesResult</code> result.
+ * @author sjacquot
+ *
+ */
+public class JFCSpecificitiesBarChartCreator extends JFCChartCreator {
+
+	public JFCSpecificitiesBarChartCreator() {
+	}
+
+	@Override
+	public JFreeChart createChart(Object resultData, String preferencesNode) {
+
+		SpecificitesResult specificitiesResult = (SpecificitesResult) resultData;
+
+		// parameters
+		boolean transpose = TXMPreferences.getBoolean(preferencesNode, resultData, SpecificitiesPreferences.CHART_TRANSPOSE);
+		boolean drawBars = TXMPreferences.getBoolean(preferencesNode, resultData, SpecificitiesPreferences.CHART_DRAW_BARS);
+		boolean drawLines = TXMPreferences.getBoolean(preferencesNode, resultData, SpecificitiesPreferences.CHART_DRAW_LINES);
+		float banality = TXMPreferences.getFloat(preferencesNode, resultData, SpecificitiesPreferences.CHART_BANALITY);
+		
+		JFreeChart chart = null;
+
+
+		// FIXME: XY bar chart version
+		// Create the data set
+		final XYSeriesCollection dataset = new XYSeriesCollection();
+
+
+		String[] xAxisSymbols;
+
+		// Transpose the data set
+		if(transpose)	{
+	        xAxisSymbols = new String[specificitiesResult.getSelectedTypeNames().length];
+
+			for(int i = 0; i < specificitiesResult.getSelectedPartNames().length; i++) {
+				XYSeries series = new XYSeries(specificitiesResult.getSelectedPartNames()[i]);
+				dataset.addSeries(series);
+
+
+				for(int j = 0; j < specificitiesResult.getSelectedTypeNames().length; j++) {
+					series.add(j, specificitiesResult.getSelectedSpecificitiesIndex()[j][i]);
+					// Add X axis symbol
+					xAxisSymbols[j] = specificitiesResult.getSelectedTypeNames()[j];
+				}
+			}
+
+		}
+		else {
+	        xAxisSymbols = new String[specificitiesResult.getSelectedPartNames().length];
+
+			for(int i = 0; i < specificitiesResult.getSelectedTypeNames().length; i++) {
+
+				XYSeries series = new XYSeries(specificitiesResult.getSelectedTypeNames()[i]);
+				dataset.addSeries(series);
+
+				for(int j = 0; j < specificitiesResult.getSelectedPartNames().length; j++) {
+					series.add(j, specificitiesResult.getSelectedSpecificitiesIndex()[i][j]);
+					// Add X axis symbol
+					xAxisSymbols[j] = specificitiesResult.getSelectedPartNames()[j];
+				}
+			}
+		}
+
+        if(drawBars)	{
+			// Create the bar chart
+	        chart = this.getChartsEngine().createXYBarChart(dataset, specificitiesResult.getName(), ChartsEngineMessages.ChartsEngine_SPECIFICITIES_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL, true, false, false, xAxisSymbols);
+        }
+        else	{
+			// Create the line chart
+	        chart = this.getChartsEngine().createXYLineChart(dataset, specificitiesResult.getName(), ChartsEngineMessages.ChartsEngine_SPECIFICITIES_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL,
+	        		true, false, true, true, true, false, false, xAxisSymbols);
+        }
+
+        ((IItemSelectionRenderer) chart.getXYPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_SPECIFICITIES);
+
+
+        // Custom range axis for ticks drawing options
+        double minimumValue = DatasetUtilities.findMinimumRangeValue(chart.getXYPlot().getDataset()).doubleValue();
+        double maximumValue = DatasetUtilities.findMaximumRangeValue(chart.getXYPlot().getDataset()).doubleValue();
+        // Adjust ticks values according to data set contains only positives values or only negatives values
+        if(minimumValue > 0)	{
+        	minimumValue = 0;
+        }
+        if(maximumValue < 0)	{
+        	maximumValue = banality;
+        }
+
+        // Custom range axis to cut the values to minimum and maximum values
+        chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), true, true, minimumValue, maximumValue));
+
+
+        // Add positive banality marker
+        Marker marker = new ValueMarker(banality);
+        marker.setPaint(Color.red);
+        marker.setLabel(JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL, banality));
+        marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
+        marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
+        chart.getXYPlot().addRangeMarker(marker);
+
+
+        // Add negative banality marker
+        marker = new ValueMarker(-banality);
+        marker.setPaint(Color.red);
+        marker.setLabel(JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL, -banality));
+        marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
+        marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
+        chart.getXYPlot().addRangeMarker(marker);
+
+
+
+		// FIXME: Category bar chart version
+//		// Create the data set
+//		final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
+//
+//		// Transpose the data set
+//		if(transpose)	{
+//			for(int i = 0; i < specificitiesResult.getSelectedTypeNames().length; i++) {
+//				for(int j = 0; j < specificitiesResult.getSelectedPartNames().length; j++) {
+//					dataset.addValue(specificitiesResult.getSelectedSpecificitiesIndex()[i][j],
+//							specificitiesResult.getSelectedPartNames()[j],
+//							specificitiesResult.getSelectedTypeNames()[i]);
+//				}
+//			}
+//		}
+//		else {
+//			for(int i = 0; i < specificitiesResult.getSelectedPartNames().length; i++) {
+//				for(int j = 0; j < specificitiesResult.getSelectedTypeNames().length; j++) {
+//					dataset.addValue(specificitiesResult.getSelectedSpecificitiesIndex()[j][i],
+//							specificitiesResult.getSelectedTypeNames()[j],
+//							specificitiesResult.getSelectedPartNames()[i]);
+//				}
+//			}
+//		}
+//
+//        if(drawBars)	{
+//			// Create the bar chart
+//	        chart = this.createCategoryBarChart(dataset, specificitiesResult.getName(), ChartsEngineMessages.ChartsEngine_SPECIFICITIES_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL, true, false);
+//        }
+//        else	{
+//			// Create the line chart
+//	        chart = this.createCategoryLineChart(dataset, specificitiesResult.getName(), ChartsEngineMessages.ChartsEngine_SPECIFICITIES_X_AXIS_LABEL, ChartsEngineMessages.ChartsEngine_SPECIFICITIES_Y_AXIS_LABEL, true, false);
+//        }
+//        ((IItemSelectionRenderer) chart.getCategoryPlot().getRenderer()).setChartType(ChartsEngine.CHART_TYPE_SPECIFICITIES);
+//
+//
+//        // Custom range axis for ticks drawing options
+//        double minimumValue = DatasetUtilities.findMinimumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue();
+//        double maximumValue = DatasetUtilities.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue();
+//        // Adjust ticks values according to data set contains only positives values or only negatives values
+//        if(minimumValue > 0)	{
+//        	minimumValue = 0;
+//        }
+//        if(maximumValue < 0)	{
+//        	maximumValue = banality;
+//        }
+//
+//        // Custom range axis to cut the values to minimum and maximum values
+//        chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), true, true, minimumValue, maximumValue));
+//
+//
+//        // Add positive banality marker
+//        Marker marker = new ValueMarker(banality);
+//        marker.setPaint(Color.red);
+//        marker.setLabel(JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL, banality));
+//        marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
+//        marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
+//        chart.getCategoryPlot().addRangeMarker(marker);
+//
+//
+//        // Add negative banality marker
+//        marker = new ValueMarker(-banality);
+//        marker.setPaint(Color.red);
+//        marker.setLabel(JFreeChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_SPECIFICITIES_BANALITY_MARKER_LABEL, -banality));
+//        marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
+//        marker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
+//        chart.getCategoryPlot().addRangeMarker(marker);
+
+
+//        int itemsColorsRenderingMode = Theme.ITEMS_RENDERING_COLORS_MODE;
+//		// Grayscale
+//        if(grayscale)	{
+//        	itemsColorsRenderingMode = Theme.ITEMS_RENDERING_GRAYSCALE_MODE;
+//        }
+//
+//        // Re-apply theme to the chart to match the colors rendering mode
+//        // FIXME : the rendering mode should be pass to all methods, even base methods as createXYLineChart(), createBarChart(), etc.
+//		this.theme.applyThemeToChart(chart, itemsColorsRenderingMode);
+
+		return chart;
+		
+	}
+
+
+	@Override
+	public Class getResultDataClass() {
+		return SpecificitesResult.class;
+	}
+	
+
+	
+	
+
+}

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/r/RSpecificitiesBarChartCreator.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/r/RSpecificitiesBarChartCreator.java	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/r/RSpecificitiesBarChartCreator.java	(revision 88)
@@ -0,0 +1,177 @@
+package org.txm.specificities.core.chartsengine.r;
+
+import java.io.File;
+
+import org.txm.chartsengine.core.ChartsEngine;
+import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
+import org.txm.chartsengine.r.core.RChartCreator;
+import org.txm.core.chartsengine.base.messages.ChartsEngineMessages;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.functions.progression.Progression;
+import org.txm.specificities.core.functions.SpecificitesResult;
+import org.txm.specificities.core.preferences.SpecificitiesPreferences;
+import org.txm.stat.data.Matrix;
+import org.txm.stat.data.Vector;
+import org.txm.stat.engine.r.RWorkspace;
+import org.txm.stat.engine.r.data.DoubleMatrix;
+import org.txm.stat.engine.r.data.VectorImpl;
+import org.txm.utils.logger.Log;
+
+/**
+ * Creates a partition dimensions bar chart from the specified <code>Partition</code> result.
+ * @author sjacquot
+ *
+ */
+public class RSpecificitiesBarChartCreator extends RChartCreator {
+
+	public RSpecificitiesBarChartCreator() {
+	}
+
+	@Override
+	public Object createChart(Object resultData, String preferencesNode) {
+		return null;
+	}
+
+	
+	@Override
+	public File createChartFile(Object resultData, File file, String preferencesNode) {
+
+		try {
+			
+			SpecificitesResult specificitiesResult = (SpecificitesResult) resultData;
+
+			// parameters
+			boolean transpose = TXMPreferences.getBoolean(preferencesNode, resultData, SpecificitiesPreferences.CHART_TRANSPOSE);
+			boolean drawBars = TXMPreferences.getBoolean(preferencesNode, resultData, SpecificitiesPreferences.CHART_DRAW_BARS);
+			boolean drawLines = TXMPreferences.getBoolean(preferencesNode, resultData, SpecificitiesPreferences.CHART_DRAW_LINES);
+			float banality = TXMPreferences.getFloat(preferencesNode, resultData, SpecificitiesPreferences.CHART_BANALITY);
+			boolean grayscale = (TXMPreferences.getInt(preferencesNode, resultData, ChartsEnginePreferences.RENDERING_COLORS_MODE) == ChartsEngine.RENDERING_GRAYSCALE_MODE);
+			
+	
+
+			// TODO: should filter max and min here
+			// specIndex
+
+			Matrix spec = new DoubleMatrix(specificitiesResult.getSelectedSpecificitiesIndex());
+			Vector types = new VectorImpl(specificitiesResult.getSelectedTypeNames());
+			Vector parts = new VectorImpl(specificitiesResult.getSelectedPartNames());
+
+			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+			rw.eval("rownames(" + spec.getSymbol() + ") <- " + types.getSymbol() + ";"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			rw.eval("colnames(" + spec.getSymbol() + ") <- " + parts.getSymbol() + ";"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+			//System.out.println(""+"barplot(" + spec.getSymbol() + ", beside=T, legend.text=rownames(" + spec.getSymbol() + "));"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+			String matrix = spec.getSymbol();
+			if (transpose)
+				matrix = "t("+matrix+")"; //$NON-NLS-1$ //$NON-NLS-2$
+
+
+			String names = parts.getSymbol();
+			if (transpose)
+				names = types.getSymbol();
+
+			String legend = types.getSymbol();
+			if (transpose)
+				legend = parts.getSymbol();
+
+			String title = specificitiesResult.getName();
+
+			String cmd = ""; //$NON-NLS-1$
+
+			String[] colors;
+			String[] allcolors = Progression.colors;
+			if (transpose) { // one color per part
+				colors = new String[specificitiesResult.getSelectedPartNames().length];
+				for (int j = 0 ; j < specificitiesResult.getSelectedPartNames().length ; j++) {
+					colors[j] = allcolors[j%allcolors.length];
+				}
+			} else { // one color per word
+				colors = new String[specificitiesResult.getSelectedTypeNames().length];
+				for (int j = 0 ; j < specificitiesResult.getSelectedTypeNames().length ; j++)
+					colors[j] = allcolors[j%allcolors.length];
+			}
+
+			RWorkspace.getRWorkspaceInstance().eval("rm(colors)"); //$NON-NLS-1$
+			RWorkspace.getRWorkspaceInstance().addVectorToWorkspace("colors", colors); //$NON-NLS-1$
+			//System.out.println("colors: "+Arrays.toString(colors));
+
+			String colorString;
+
+			if (grayscale)
+				colorString = ""; //$NON-NLS-1$
+			else
+				colorString = ", col=colors"; //$NON-NLS-1$
+
+			cmd += "op <- par(mar=c(5,5,5,10), xpd=TRUE);\n"; //$NON-NLS-1$
+
+			if (drawBars) {
+				cmd += 	"mat <- "+matrix+";\n" + //$NON-NLS-1$ //$NON-NLS-2$
+						"draw <- barplot(mat, space=c(1,3)"+colorString+ //$NON-NLS-1$
+						", horiz=F, las=2, names.arg="+names+", main=\""+title+ //$NON-NLS-1$ //$NON-NLS-2$
+						"\", beside=T, xpd=TRUE);\n" +  //$NON-NLS-1$ //$NON-NLS-2$
+						// removed : legend.text="+legend + "
+						//"rm(op);" + //$NON-NLS-1$
+						"W2 <- 100000;\n"+//$NON-NLS-1$
+						"lines(c(0,W2), c(-"+banality+", -"+banality+"), lty=2);\n" + // seuil banalité inférieur //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						"lines(c(0,W2), c("+banality+", "+banality+"), lty=2);\n" + // seuil banalité supérieur //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						"lines(c(0,W2), c(0,0), lty=1);\n"+ //$NON-NLS-1$
+						"\n"; //$NON-NLS-1$
+			} else {
+				//compute the hist but dont show the bar
+				cmd += 	"mat <- "+matrix+";\n" + //$NON-NLS-1$ //$NON-NLS-2$
+						"draw <- barplot(mat, space=c(1,3), col=\"white\", border=NA, horiz=F, las=2, names.arg="+names+", main=\""+title+"\", beside=T);\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						//"rm(op);\n"; //$NON-NLS-1$
+			}
+
+			if (drawLines) {
+				if (transpose) {
+					cmd +=	"for(i in 1:length(draw[1,])){\n" + //$NON-NLS-1$
+							"lines(draw[,i], mat[,i], col=colors[[i]]);\n" + //$NON-NLS-1$
+							"}\n"; //$NON-NLS-1$
+				} else {
+					cmd +=	"for(i in 1:length(draw[,1])){\n" + //$NON-NLS-1$
+							"lines(draw[i,], mat[i,], col=colors[[i]]);\n" + //$NON-NLS-1$
+							"}\n"; //$NON-NLS-1$
+				}
+				if (!drawBars) {
+					if (transpose) {
+						cmd +=	"for(i in 1:length(draw[1,])){\n" + //$NON-NLS-1$
+								"text(draw[,i], 0, label="+legend+", offset=0, srt=90);\n" + //$NON-NLS-1$ //$NON-NLS-2$
+								"lines(c(draw[[1,i]],draw[[length(draw[,i]),i]]), c(0,0))" + //$NON-NLS-1$
+								"}\n"; //$NON-NLS-1$
+					} else {
+						cmd += "lines( c(0,99999), c(0,0))\n"; //$NON-NLS-1$
+					}
+				}
+			}
+
+//				if (transpose)
+//					cmd += "legend(\"topright\", "+names+", inset = c(-0.2, 0), col = colors, lty = 1, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
+//				else
+			if (drawBars)
+				cmd += "legend(\"topright\", "+legend+", inset = c(-0.2,0), col = colors, pch = 0, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
+			else
+				cmd += "legend(\"topright\", "+legend+", inset = c(-0.2,0), col = colors, lty = 1, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
+
+			
+			this.getChartsEngine().plot(file, cmd);
+
+
+		}
+		catch (Exception e) {
+			Log.severe(ChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_CANT_CREATE_SPECIFICITIES_FILE_CHART, this.getChartsEngine().getName()) + e);
+		}
+
+		return file;
+	}
+
+	
+
+
+	@Override
+	public Class getResultDataClass() {
+		return SpecificitesResult.class;
+	}
+
+}

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

Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/preferences/SpecificitiesPreferences.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/preferences/SpecificitiesPreferences.java	(revision 0)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/preferences/SpecificitiesPreferences.java	(revision 88)
@@ -0,0 +1,53 @@
+package org.txm.specificities.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 sjacquot
+ *
+ */
+public class SpecificitiesPreferences extends TXMPreferences {
+
+
+	// auto populate the preference node qualifier from the current bundle id
+	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(SpecificitiesPreferences.class).getSymbolicName();
+	
+	public static final String PREFERENCES_PREFIX = "specificities_"; //$NON-NLS-1$
+	
+	
+	public static final String MAX_SCORE = PREFERENCES_PREFIX + "maxscore"; //$NON-NLS-1$
+	public static final String FORMAT = PREFERENCES_PREFIX + "format"; //$NON-NLS-1$
+	
+	// charts
+	public static final String CHART_TRANSPOSE = PREFERENCES_PREFIX + "chart_transpose"; //$NON-NLS-1$
+	public static final String CHART_DRAW_BARS = PREFERENCES_PREFIX + "chart_draw_bars"; //$NON-NLS-1$
+	public static final String CHART_DRAW_LINES = PREFERENCES_PREFIX + "chart_draw_lines"; //$NON-NLS-1$
+	public static final String CHART_BANALITY = PREFERENCES_PREFIX + "chart_banality"; //$NON-NLS-1$
+
+	public SpecificitiesPreferences() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public void initializeDefaultPreferences() {
+		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
+		
+		preferences.put(FORMAT, "%,.1f");
+		preferences.putInt(MAX_SCORE, 1);
+		
+		preferences.putBoolean(CHART_TRANSPOSE, false);
+		preferences.putBoolean(CHART_DRAW_BARS, true);
+		preferences.putBoolean(CHART_DRAW_LINES, false);
+		preferences.putFloat(CHART_BANALITY, 2);
+		
+		
+		// shared charts rendering preferences
+		super.initializeChartsEngineSharedPreferences(preferences);
+	}
+	
+}

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

Index: tmp/org.txm.wordcloud.rcp/.project
===================================================================
--- tmp/org.txm.wordcloud.rcp/.project	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/.project	(revision 88)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.wordcloud.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.wordcloud.rcp/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationActionBarAdvisor.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationActionBarAdvisor.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationActionBarAdvisor.java	(revision 88)
@@ -0,0 +1,20 @@
+package ___wordcloudrcp;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+
+public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
+
+    public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
+        super(configurer);
+    }
+
+    protected void makeActions(IWorkbenchWindow window) {
+    }
+
+    protected void fillMenuBar(IMenuManager menuBar) {
+    }
+    
+}

Property changes on: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationActionBarAdvisor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchAdvisor.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchAdvisor.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchAdvisor.java	(revision 88)
@@ -0,0 +1,18 @@
+package ___wordcloudrcp;
+
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
+
+	private static final String PERSPECTIVE_ID = "WordCloudRCP.perspective"; //$NON-NLS-1$
+
+    public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+        return new ApplicationWorkbenchWindowAdvisor(configurer);
+    }
+
+	public String getInitialWindowPerspectiveId() {
+		return PERSPECTIVE_ID;
+	}
+}

Property changes on: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchAdvisor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/messages.properties
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/messages.properties	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/messages.properties	(revision 88)
@@ -0,0 +1,25 @@
+WordCloudTitle=WordCloud
+ComputeVocabulary_0=Opening WordCloud results
+ComputeWordCloud_0=StatEngine is not ready. Canceling command.
+ComputeWordCloud_11=The necessary R packages have not been installed properly, it is not possible to complete the installation of the WordCloud command.\nSee instructions at https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud 
+ComputeWordCloud_12=Aborting WordCloud.
+ComputeWordCloud_2=R packages loaded. Now running WordCloud
+ComputeWordCloud_3=The {0} R package was not installed. Reason: {1}
+ComputeWordCloud_4=Installing {0} R package...
+ComputeWordCloud_5=Loading package: 
+ComputeWordCloud_6=Could not install the {0} package
+ComputeWordCloud_7=Operation canceled by user
+WordCloudEditor_0=Vmax: 
+WordCloudEditor_1=Fmin: 
+WordCloudEditor_2=% of rotated labels: 
+WordCloudEditor_3=Randomize positions
+WordCloudEditor_4=Draw
+WordCloudEditor_5=Wrong WordCloud input object
+WordCloudEditor_6=WordCloud ready: 
+WordCloudEditor_7=WordClouding...
+WordCloudEditor_8=Drawing in {0}
+WordCloudEditor_9=WordCloud refreshed
+WordCloudPreferencePage_0=Number of used words
+WordCloudPreferencePage_1=Minimal frequency for used words
+WordCloudPreferencePage_2=Percent of rotated words
+WordCloudPreferencePage_3=Random word positions
\ No newline at end of file

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

Index: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Application.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Application.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Application.java	(revision 88)
@@ -0,0 +1,47 @@
+package ___wordcloudrcp;
+
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This class controls all aspects of the application's execution
+ */
+public class Application implements IApplication {
+	
+	public static String PLUGIN_ID = "WordCloudRCP"; //$NON-NLS-1$
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
+	 */
+	public Object start(IApplicationContext context) throws Exception {
+		Display display = PlatformUI.createDisplay();
+		try {
+			int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
+			if (returnCode == PlatformUI.RETURN_RESTART)
+				return IApplication.EXIT_RESTART;
+			else
+				return IApplication.EXIT_OK;
+		} finally {
+			display.dispose();
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.equinox.app.IApplication#stop()
+	 */
+	public void stop() {
+		if (!PlatformUI.isWorkbenchRunning())
+			return;
+		final IWorkbench workbench = PlatformUI.getWorkbench();
+		final Display display = workbench.getDisplay();
+		display.syncExec(new Runnable() {
+			public void run() {
+				if (!display.isDisposed())
+					workbench.close();
+			}
+		});
+	}
+}

Property changes on: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Application.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/___Messages.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/___Messages.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/___Messages.java	(revision 88)
@@ -0,0 +1,39 @@
+package ___wordcloudrcp;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ___Messages extends NLS {
+	private static final String BUNDLE_NAME = "wordcloudrcp.messages"; //$NON-NLS-1$
+	public static String WordCloudTitle;
+	public static String ComputeIndex_0;
+	public static String ComputeWordCloud_0;
+	public static String ComputeWordCloud_11;
+	public static String ComputeWordCloud_12;
+	public static String ComputeWordCloud_2;
+	public static String ComputeWordCloud_3;
+	public static String ComputeWordCloud_4;
+	public static String ComputeWordCloud_5;
+	public static String ComputeWordCloud_6;
+	public static String ComputeWordCloud_7;
+	public static String WordCloudEditor_0;
+	public static String WordCloudEditor_1;
+	public static String WordCloudEditor_2;
+	public static String WordCloudEditor_3;
+	public static String WordCloudEditor_4;
+	public static String WordCloudEditor_5;
+	public static String WordCloudEditor_6;
+	public static String WordCloudEditor_7;
+	public static String WordCloudEditor_8;
+	public static String WordCloudEditor_9;
+	public static String WordCloudPreferencePage_0;
+	public static String WordCloudPreferencePage_1;
+	public static String WordCloudPreferencePage_2;
+	public static String WordCloudPreferencePage_3;
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(BUNDLE_NAME, ___Messages.class);
+	}
+
+	private ___Messages() {
+	}
+}

Property changes on: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/___Messages.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchWindowAdvisor.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchWindowAdvisor.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchWindowAdvisor.java	(revision 88)
@@ -0,0 +1,26 @@
+package ___wordcloudrcp;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
+
+    public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+        super(configurer);
+    }
+
+    public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
+        return new ApplicationActionBarAdvisor(configurer);
+    }
+    
+    public void preWindowOpen() {
+        IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
+        configurer.setInitialSize(new Point(400, 300));
+        configurer.setShowCoolBar(false);
+        configurer.setShowStatusLine(false);
+        configurer.setTitle("Hello RCP"); //$NON-NLS-1$
+    }
+}

Property changes on: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/ApplicationWorkbenchWindowAdvisor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Perspective.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Perspective.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Perspective.java	(revision 88)
@@ -0,0 +1,10 @@
+package ___wordcloudrcp;
+
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class Perspective implements IPerspectiveFactory {
+
+	public void createInitialLayout(IPageLayout layout) {
+	}
+}

Property changes on: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/Perspective.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/messages_fr.properties
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/messages_fr.properties	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/___wordcloudrcp/messages_fr.properties	(revision 88)
@@ -0,0 +1,25 @@
+WordCloudTitle=Nuage de mot
+ComputeVocabulary_0=Ouverture du r�sultat
+ComputeWordCloud_0=Le moteur de statistique n'est pas pr�t. Abandon.
+ComputeWordCloud_11=Les packages n�c�ssaires au fonctionnement de la fonctionnalit� n'ont pas pu �tre install�s. Voir les instructions pour installation manuelle � l'adresse https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud
+ComputeWordCloud_12=Abandon du calcul.
+ComputeWordCloud_2=Les packages R ont �t� charg�s. Lancement du calcul.
+ComputeWordCloud_3=Le package R {0} n'a pas pu �tre install�. Raison : {1} 
+ComputeWordCloud_4=Installation du package R {0}...
+ComputeWordCloud_5=Chargement du package : 
+ComputeWordCloud_6=Echec de l'installation du package {0}.
+ComputeWordCloud_7=Annulation par l'utilisateur.
+WordCloudEditor_0=Vmax : 
+WordCloudEditor_1=Fmin : 
+WordCloudEditor_2=% de labels verticaux : 
+WordCloudEditor_3=Position al�atoire
+WordCloudEditor_4=Calculer
+WordCloudEditor_5=Object non-compatible avec la fonctionnalit� Nuage de mot
+WordCloudEditor_6=WordCloud est pr�t : 
+WordCloudEditor_7=Dessin en cours...
+WordCloudEditor_8=Sauvegarde dans le fichier {0} 
+WordCloudEditor_9=Rafra�chissement 
+WordCloudPreferencePage_0=Filtre en nombre de mot � utiliser
+WordCloudPreferencePage_1=Filtre en fr�quence minimal des mots � utiliser frequency
+WordCloudPreferencePage_2=Pourcentage de mot verticaux
+WordCloudPreferencePage_3=Position al�atoire des mots
\ No newline at end of file

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

Index: tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/handlers/ComputeWordCloud.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/handlers/ComputeWordCloud.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/handlers/ComputeWordCloud.java	(revision 88)
@@ -0,0 +1,161 @@
+// 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.wordcloud.rcp.handlers;
+
+import java.io.IOException;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.Toolbox;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.functions.index.Index;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.rcpapplication.commands.OpenBrowser;
+import org.txm.rcpapplication.views.CorporaView;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.Lexicon;
+import org.txm.searchengine.cqp.serverException.CqiServerError;
+import org.txm.utils.logger.Log;
+import org.txm.wordcloud.core.functions.WordCloud;
+import org.txm.wordcloud.core.messages.TBXWordCloudMessages;
+import org.txm.wordcloud.rcp.editors.WordCloudEditorInput;
+
+// TODO: Auto-generated Javadoc
+/**
+ * open the WordCloud Editor 
+ * @author mdecorde
+ * @author sjacquot
+ */
+public class ComputeWordCloud extends AbstractHandler {
+	
+
+	// FIXME: should be put in an Activator? or better in an extension point loaded by the corpora view?
+	// adds a double click listener to the Corpus View
+	static	{
+		CorporaView.addDoubleClickListener(WordCloud.class, "ComputeWordCloud"); //$NON-NLS-1$
+	}
+	
+	
+
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(final ExecutionEvent event) throws ExecutionException {
+		if (!Toolbox.isStatEngineInitialized()) {
+			System.out.println(TBXWordCloudMessages.Log_Stats_Engine_not_ready);
+			return null;
+		};
+
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		Object s = selection.getFirstElement();
+		
+		boolean newResult = true;
+		Corpus corpus = null;
+		WordCloud wordCloud = null;
+		
+		// opens existing result
+		if (s instanceof WordCloud) {
+			wordCloud = (WordCloud) s;
+			corpus = wordCloud.getCorpus();
+			newResult = false;
+		}
+		else	{
+				// Inits R packages
+				if(!WordCloud.initPackages())	{
+					OpenBrowser.openfile("https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud"); //$NON-NLS-1$
+					//return Status.CANCEL_STATUS;
+				}
+
+				// creates new result
+				if (s instanceof Corpus) {
+					try {
+						corpus = (Corpus)s;
+						wordCloud = new WordCloud(corpus);
+					}
+					catch (CqiClientException e) {
+						Log.printStackTrace(e);
+						//return null;
+					}
+					catch(IOException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+					catch(CqiServerError e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+				// creates new result
+				else if (s instanceof Index) {
+					wordCloud = new WordCloud((Index)s);
+					corpus = ((Index)s).getCorpus();
+				}
+				// creates new result
+				else if (s instanceof Lexicon) {
+					wordCloud = new WordCloud((Lexicon)s);
+					corpus = ((Lexicon)s).getCorpus();
+				}
+			}
+		
+			if(wordCloud != null)	{
+				StatusLine.setMessage(TBXWordCloudMessages.StatusBar_Opening_result);
+
+				WordCloudEditorInput editorInput = new WordCloudEditorInput(s, wordCloud);
+				SWTChartsComponentsProvider.getCurrent().openEditor(editorInput);
+				
+				if(newResult && corpus != null)	{
+					CorporaView.storeResult(corpus, wordCloud);
+				}
+			}
+							
+		return null;
+	}
+
+//	public static void openEditor(Object obj) {
+//		if (obj instanceof Index || 
+//				obj instanceof Lexicon || 
+//				//obj instanceof QueryIndex || 
+//				obj instanceof Corpus) {
+//			IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
+//			WordCloudEditorInput editorInput = new WordCloudEditorInput(Application.swtComponentProvider2, obj, null);
+//			try {
+//				StatusLine.setMessage(TBXWordCloudMessages.StatusBar_Opening_result);
+//				WordCloudEditor wceditor = (WordCloudEditor) page.openEditor(editorInput,WordCloudEditor.ID); //$NON-NLS-1$
+//				//voceditor.initializeFields();
+//			} catch (Exception e) {
+//				Log.printStackTrace(e);
+//			}
+//		}
+//	}
+}

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

Index: tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/preferences/WordCloudPreferencePage.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/preferences/WordCloudPreferencePage.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/preferences/WordCloudPreferencePage.java	(revision 88)
@@ -0,0 +1,100 @@
+package org.txm.wordcloud.rcp.preferences;
+
+// 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:$ 
+//
+
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbench;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.rcp.preferences.TXMPreferencePage;
+import org.txm.rcp.preferences.TXMPreferenceStore;
+import org.txm.wordcloud.core.preferences.WordCloudPreferences;
+import org.txm.wordcloud.rcp.adapters.WordCloudAdapterFactory;
+import org.txm.wordcloud.rcp.messages.Messages;
+
+/**
+ * Word cloud preference page.
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class WordCloudPreferencePage extends TXMPreferencePage {
+
+
+	/**
+	 * The Constant ID.
+	 */
+	public static final String ID = "org.txm.wordcloud.rcp.preferences.WordCloudPreferencePage"; //$NON-NLS-1$
+
+	/**
+	 * Instantiates a new Wordcloud preference page.
+	 */
+	public WordCloudPreferencePage() {
+		super();
+	}
+
+	/**
+	 * 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() {
+		
+		// Charts rendering
+		Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent());
+		
+		this.addField(new IntegerFieldEditor(WordCloudPreferences.MAX_WORDS, Messages.PreferencePage_Number_of_used_words, chartsTab));
+		this.addField(new IntegerFieldEditor(WordCloudPreferences.FMIN, Messages.PreferencePage_Minimal_frequency, chartsTab));
+		this.addField(new IntegerFieldEditor(WordCloudPreferences.ROT, Messages.PreferencePage_Percent_of_rotated_words, chartsTab));
+		this.addField(new BooleanFieldEditor(WordCloudPreferences.RANDOM_POSITION, Messages.PreferencePage_Random_word_positions, chartsTab));
+		
+		// other shared preferences
+		SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab);
+
+	}
+	
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	@Override
+	public void init(IWorkbench workbench) {
+		this.setPreferenceStore(new TXMPreferenceStore(WordCloudPreferences.PREFERENCES_NODE));
+		//this.setTitle("WordCloud");
+		this.setImageDescriptor(WordCloudAdapterFactory.ICON);
+	}
+
+
+}

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

Index: tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/adapters/WordCloudAdapterFactory.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/adapters/WordCloudAdapterFactory.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/adapters/WordCloudAdapterFactory.java	(revision 88)
@@ -0,0 +1,66 @@
+// Copyright © 2010-2013 ENS de Lyon.
+package org.txm.wordcloud.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.rcp.adapters.BaseAdapterFactory;
+import org.txm.wordcloud.core.functions.WordCloud;
+
+/**
+ * A factory for creating Adapter objects.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ */
+public class WordCloudAdapterFactory extends BaseAdapterFactory {
+
+	
+	public static final ImageDescriptor ICON =
+			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(WordCloudAdapterFactory.class).getSymbolicName(),
+					"platform:/plugin/"+ FrameworkUtil.getBundle(WordCloudAdapterFactory.class).getSymbolicName() + "/icons/functions/wordcloud.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 WordCloud)	{
+				return new IWorkbenchAdapter() {
+					@Override
+					public Object[] getChildren(Object resultData) {
+						return new Object[0];
+					}
+	
+					@Override
+					public ImageDescriptor getImageDescriptor(Object object) {
+						return ICON;
+					}
+	
+					@Override
+					public String getLabel(Object resultData) {
+						return ((WordCloud) resultData).getName();
+					}
+	
+					@Override
+					public Object getParent(Object resultData) {
+						return ((WordCloud) resultData).getCorpus();
+					}
+				};
+			}
+		}
+		return null;
+	}
+
+
+}

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

Index: tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/messages/Messages.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/messages/Messages.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/messages/Messages.java	(revision 88)
@@ -0,0 +1,36 @@
+package org.txm.wordcloud.rcp.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+	
+
+	//private static final String BUNDLE_NAME = "org.txm.rcp.wordcloud.messages.messages"; //$NON-NLS-1$
+	// FIXME: use the same properties file than the bundle	
+	private static final String BUNDLE_NAME = "l10n.bundle"; //$NON-NLS-1$
+	
+	
+	
+	public static String EditorName;
+	public static String EditorToolBar_vmin;
+	public static String EditorToolBar_fmin;
+	public static String EditorToolBar_Percent_of_rotated_labels;
+	public static String EditorToolBar_Randomize_positions;
+	public static String EditorToolBar_Draw;
+	public static String Log_Wrong_input_object;
+	public static String Log_WordCloud_ready;
+	public static String WordCloudEditor_7;
+	public static String WordCloudEditor_8;
+	public static String WordCloudEditor_9;
+	public static String PreferencePage_Number_of_used_words;
+	public static String PreferencePage_Minimal_frequency;
+	public static String PreferencePage_Percent_of_rotated_words;
+	public static String PreferencePage_Random_word_positions;
+	static {
+		// initialize resource bundle
+		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+	}
+
+	private Messages() {
+	}
+}

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

Index: tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditor.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditor.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditor.java	(revision 88)
@@ -0,0 +1,225 @@
+package org.txm.wordcloud.rcp.editors;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.chartsengine.rcp.editors.ChartEditorInput;
+import org.txm.chartsengine.rcp.editors.ChartEditorPart;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.rcpapplication.views.CorporaView;
+import org.txm.utils.logger.Log;
+import org.txm.wordcloud.core.functions.WordCloud;
+import org.txm.wordcloud.core.preferences.WordCloudPreferences;
+import org.txm.wordcloud.rcp.messages.Messages;
+
+/**
+ * Word cloud editor. 
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class WordCloudEditor extends ChartEditorPart {
+	
+	
+	/**
+	 * 
+	 */
+	public WordCloudEditor() {
+	}
+
+	
+	
+	/**
+	 * 
+	 * @param swtComponentsProvider
+	 * @param chartEditorInput
+	 */
+	public WordCloudEditor(SWTChartsComponentsProvider swtComponentsProvider, ChartEditorInput chartEditorInput) {
+		super(swtComponentsProvider, chartEditorInput);
+	}
+	
+	
+	@Override
+	public void createPartControl(Composite parent) {
+		super.createPartControl(parent);
+		
+		//Composite paramPanel = new Composite(parent, SWT.NONE);
+		
+//		FormData fdata = new FormData();
+//		fdata.top = new FormAttachment(0);
+//		fdata.left = new FormAttachment(0);
+//		fdata.right = new FormAttachment(100);
+//		this.getParametersComposite().setLayoutData(fdata);
+
+//		FormData fdata = new FormData();
+//		fdata.top = new FormAttachment(this.getParametersComposite());
+//		fdata.left = new FormAttachment(0);
+//		fdata.right = new FormAttachment(100);
+//		fdata.bottom = new FormAttachment(100);
+
+		// fill param Area
+//		RowLayout layout = new RowLayout();
+//		layout.wrap = true;
+//		layout.center = true;
+//		this.getParametersComposite().setLayout(layout);
+
+		// max words
+		new Label(this.getParametersGroup(), SWT.NONE).setText(Messages.EditorToolBar_vmin);
+		final Spinner maxWordsSpinner = new Spinner(this.getParametersGroup(), SWT.BORDER);
+		maxWordsSpinner.setMinimum(10);
+		maxWordsSpinner.setIncrement(1);
+		maxWordsSpinner.setMaximum(100000);
+		maxWordsSpinner.setSelection(TXMPreferences.getInt(WordCloudPreferences.PREFERENCES_NODE, this.getResultData(), WordCloudPreferences.MAX_WORDS));
+		
+		// fmin
+		new Label(this.getParametersGroup(), SWT.NONE).setText(Messages.EditorToolBar_fmin);
+		final Spinner minFreqSpinner = new Spinner(this.getParametersGroup(), SWT.BORDER);
+		minFreqSpinner.setMinimum(1);
+		minFreqSpinner.setIncrement(1);
+		minFreqSpinner.setMaximum(100000000);
+		minFreqSpinner.setSelection(TXMPreferences.getInt(WordCloudPreferences.PREFERENCES_NODE, this.getResultData(), WordCloudPreferences.FMIN));
+		
+		// rotation percent
+		new Label(this.getParametersGroup(), SWT.NONE).setText(Messages.EditorToolBar_Percent_of_rotated_labels);
+		final Spinner rotPerSpinner = new Spinner(this.getParametersGroup(), SWT.BORDER);
+		rotPerSpinner.setMinimum(0);
+		rotPerSpinner.setIncrement(1);
+		rotPerSpinner.setMaximum(100);
+		rotPerSpinner.setSelection(TXMPreferences.getInt(WordCloudPreferences.PREFERENCES_NODE, this.getResultData(), WordCloudPreferences.ROT));
+		
+		// random positions
+		final Button randomOrderButton = new Button(this.getParametersGroup(), SWT.CHECK);
+		randomOrderButton.setText(Messages.EditorToolBar_Randomize_positions);
+		randomOrderButton.setSelection(TXMPreferences.getBoolean(WordCloudPreferences.PREFERENCES_NODE, this.getResultData(), WordCloudPreferences.RANDOM_POSITION));
+
+		
+		// compute button
+		Button okButton = new Button(this.getParametersGroup(), SWT.PUSH);
+		okButton.setText(Messages.EditorToolBar_Draw);
+		okButton.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+					
+					// persistence
+					TXMPreferences.putLocalInt(getResultData(), WordCloudPreferences.MAX_WORDS, maxWordsSpinner.getSelection());
+					TXMPreferences.putLocalInt(getResultData(), WordCloudPreferences.FMIN, minFreqSpinner.getSelection());
+					TXMPreferences.putLocalFloat(getResultData(), WordCloudPreferences.ROT, rotPerSpinner.getSelection());
+					TXMPreferences.putLocalBoolean(getResultData(), WordCloudPreferences.RANDOM_POSITION, randomOrderButton.getSelection());
+					
+
+					compute(true);
+			}
+					
+					
+			
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) { }
+		});
+
+		
+		this.compute(false);
+		Log.info(Messages.Log_WordCloud_ready + this.getResultData());
+
+	}
+
+	
+	/**
+	 * Computes.
+	 */
+	public void compute(final boolean update) {
+
+		Job job = new Job("Compute Word Cloud") {
+
+		    @Override
+		    protected IStatus run(IProgressMonitor monitor) {
+
+		    	// creating
+				monitor.beginTask("Computing", IProgressMonitor.UNKNOWN);
+		    	
+				if(update)	{
+					updateChart();
+				}
+				else	{
+					createChart();
+				}
+
+				// cancel
+				if(monitor.isCanceled())	{
+					close();
+					return Status.CANCEL_STATUS;
+				}
+				
+				// loading
+				monitor.setTaskName("Loading");
+				loadChart();
+				
+				
+				setPartName(((WordCloud)getResultData()).getCorpus().getName() + " - " + ((WordCloud)getResultData()).getName());
+				
+				
+				// FIXME: persistence test, saving local preferences/parameters to file
+				//WordCloudPreferences.flush((WordCloud)getResultData());
+
+				// refreshes the view to update the node label
+				getSite().getShell().getDisplay().syncExec(new Runnable() {
+					@Override
+					public void run() {
+						CorporaView.refresh();
+					}
+				});
+
+				
+				// done
+				monitor.done(); 
+				return Status.OK_STATUS;
+	    }
+
+		};
+		job.setUser(true); // show progress bar, without that the progress is located to bottom right
+		job.schedule();
+	}
+	
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	@Override
+	public void doSave(IProgressMonitor monitor) { }
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+	 */
+	@Override
+	public void doSaveAs() { }
+
+	/* (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;
+	}
+
+	
+
+}

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

Index: tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditorInput.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditorInput.java	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditorInput.java	(revision 88)
@@ -0,0 +1,129 @@
+// 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.wordcloud.rcp.editors;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.chartsengine.rcp.editors.ChartEditorInput;
+import org.txm.rcpapplication.Application;
+import org.txm.rcpapplication.IImageKeys;
+import org.txm.wordcloud.core.functions.WordCloud;
+import org.txm.wordcloud.core.preferences.WordCloudPreferences;
+import org.txm.wordcloud.rcp.messages.Messages;
+
+
+/**
+ *
+ *
+ * @author sloiseau
+ */
+public class WordCloudEditorInput extends ChartEditorInput {
+	
+		
+	/**
+	 * 
+	 * @param src
+	 * @param wc
+	 */
+	public WordCloudEditorInput(Object src, WordCloud wc) {
+		super(wc, WordCloudPreferences.PREFERENCES_NODE);
+	}
+	
+	/**
+	 * 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_WORDCLOUD);
+	}
+
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 * @see org.eclipse.ui.IEditorInput#getName()
+	 */
+	@Override
+	public String getName() {
+		return Messages.EditorName;
+	}
+
+	/**
+	 * 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;
+	}
+
+
+}
+

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

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

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

Index: tmp/org.txm.wordcloud.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- tmp/org.txm.wordcloud.rcp/OSGI-INF/l10n/bundle.properties	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/OSGI-INF/l10n/bundle.properties	(revision 88)
@@ -0,0 +1,21 @@
+Bundle-Name=WordCloudRCP
+command.label=WordCloud
+command.name=WordCloud
+editor.name=WordCloud
+EditorToolBar_Draw=Compute
+EditorToolBar_fmin=Fmin: 
+EditorToolBar_Percent_of_rotated_labels=% of rotated labels: 
+EditorToolBar_Randomize_positions=Randomize positions
+EditorToolBar_vmin=Vmax: 
+Log_WordCloud_ready=WordCloud ready: 
+Log_Wrong_input_object=Wrong WordCloud input object
+page.name = WordCloud
+perspective.name = RCP Perspective
+PreferencePage_Minimal_frequency=Minimal frequency for used words
+PreferencePage_Number_of_used_words=Number of used words
+PreferencePage_Percent_of_rotated_words=Percent of rotated words
+PreferencePage_Random_word_positions=Random word positions
+WordCloudEditor_7=WordClouding...
+WordCloudEditor_8=Drawing in {0}
+WordCloudEditor_9=WordCloud refreshed
+EditorName=WordCloud
\ No newline at end of file

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

Index: tmp/org.txm.wordcloud.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- tmp/org.txm.wordcloud.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 88)
@@ -0,0 +1,21 @@
+Bundle-Name = WordCloudRCP
+command.label = Nuage de mots
+command.name = Nuage de mots
+editor.name = Nuage de mots
+EditorToolBar_Draw=Calculer
+EditorToolBar_fmin=Fmin : 
+EditorToolBar_Percent_of_rotated_labels=% de labels verticaux : 
+EditorToolBar_Randomize_positions=Position al�atoire
+EditorToolBar_vmin=Vmax : 
+Log_WordCloud_ready=WordCloud est pr�t : 
+Log_Wrong_input_object=Object non-compatible avec la fonctionnalit� Nuage de mots
+page.name = Nuage de mots
+perspective.name = RCP Perspective
+PreferencePage_Minimal_frequency=Filtre en fr�quence minimal des mots � utiliser frequency
+PreferencePage_Number_of_used_words=Filtre en nombre de mot � utiliser
+PreferencePage_Percent_of_rotated_words=Pourcentage de mot verticaux
+PreferencePage_Random_word_positions=Position al�atoire des mots
+WordCloudEditor_7=Dessin en cours...
+WordCloudEditor_8=Sauvegarde dans le fichier {0} 
+WordCloudEditor_9=Rafra�chissement 
+EditorName=Nuage de mots
\ No newline at end of file

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

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

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

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

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

Index: tmp/org.txm.wordcloud.rcp/icons/alt_launcher.xpm
===================================================================
--- tmp/org.txm.wordcloud.rcp/icons/alt_launcher.xpm	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/icons/alt_launcher.xpm	(revision 88)
@@ -0,0 +1,307 @@
+/* XPM */
+static char * icon48_xpm[] = {
+"48 48 256 2",
+"  	c #4B4B3B3B9090",
+". 	c #0D0D0E0E5454",
+"X 	c #11110E0E5B5B",
+"o 	c #17170F0F6363",
+"O 	c #1D1D13136969",
+"+ 	c #212114146C6C",
+"@ 	c #252514147171",
+"# 	c #282811116C6C",
+"$ 	c #26260D0D6363",
+"% 	c #22220B0B5E5E",
+"& 	c #1C1C0B0B5A5A",
+"* 	c #1C1C0B0B5252",
+"= 	c #1B1B05055353",
+"- 	c #161606064D4D",
+"; 	c #161605054949",
+": 	c #111104044848",
+"> 	c #131304044545",
+", 	c #131305054242",
+"< 	c #141410105E5E",
+"1 	c #2C2C15157373",
+"2 	c #2B2B1B1B7575",
+"3 	c #343416167272",
+"4 	c #313113136E6E",
+"5 	c #222209095757",
+"6 	c #1B1B06064D4D",
+"7 	c #15150B0B4242",
+"8 	c #13130C0C5555",
+"9 	c #2E2E1B1B7878",
+"0 	c #33331F1F7C7C",
+"q 	c #343418187878",
+"w 	c #3B3B1C1C7575",
+"e 	c #2E2E10106767",
+"r 	c #1B1B07074747",
+"t 	c #18180B0B4646",
+"y 	c #151513136262",
+"u 	c #1A1A15156464",
+"i 	c #34341F1F7777",
+"p 	c #40401E1E8080",
+"a 	c #42421B1B7A7A",
+"s 	c #3B3B15157474",
+"d 	c #2B2B0B0B5B5B",
+"f 	c #222207075252",
+"g 	c #373727277A7A",
+"h 	c #474724248484",
+"j 	c #393915156E6E",
+"k 	c #373711116A6A",
+"l 	c #343413136363",
+"z 	c #232319196E6E",
+"x 	c #292919197070",
+"c 	c #3C3C2C2C8282",
+"v 	c #444431318585",
+"b 	c #494934348A8A",
+"n 	c #505026268A8A",
+"m 	c #3D3D1B1B6E6E",
+"M 	c #31310E0E5C5C",
+"N 	c #2B2B0D0D5353",
+"B 	c #222207074A4A",
+"V 	c #52523C3C9292",
+"C 	c #58583C3C9494",
+"Z 	c #5D5D44449797",
+"A 	c #5C5C2E2E9292",
+"S 	c #676733339595",
+"D 	c #424228287575",
+"F 	c #29290A0A4F4F",
+"G 	c #6C6C4A4A9E9E",
+"H 	c #72725454A7A7",
+"J 	c #8C8C6D6DB2B2",
+"K 	c #343424246E6E",
+"L 	c #3A3A23236A6A",
+"P 	c #3A3A1C1C6767",
+"I 	c #24240A0A4B4B",
+"U 	c #151518186161",
+"Y 	c #76766F6FA5A5",
+"T 	c #ADAD9191CCCC",
+"R 	c #98988989D3D3",
+"E 	c #45453B3B8686",
+"W 	c #3C3C35357979",
+"Q 	c #363631317575",
+"! 	c #32322D2D6B6B",
+"~ 	c #323229296363",
+"^ 	c #30301F1F6262",
+"/ 	c #323218185E5E",
+"( 	c #272707074B4B",
+") 	c #202028286C6C",
+"_ 	c #1E1E1D1D6868",
+"` 	c #9A9A8282BBBB",
+"' 	c #C8C8B3B3D3D3",
+"] 	c #B3B3AFAFE7E7",
+"[ 	c #84847272C6C6",
+"{ 	c #58585757A3A3",
+"} 	c #3F3F3C3C8A8A",
+"| 	c #3B3B3A3A8484",
+" .	c #414139397D7D",
+"..	c #3D3D39397A7A",
+"X.	c #37372E2E6E6E",
+"o.	c #2C2C21215A5A",
+"O.	c #2E2E1B1B5B5B",
+"+.	c #F5F5EFEFF5F5",
+"@.	c #656566669A9A",
+"#.	c #47474B4B8E8E",
+"$.	c #3C3C44447B7B",
+"%.	c #444442428080",
+"&.	c #45453E3E8181",
+"*.	c #40403C3C8181",
+"=.	c #3D3D33337474",
+"-.	c #3B3B30306E6E",
+";.	c #38382D2D6969",
+":.	c #303026265D5D",
+">.	c #2C2C15155A5A",
+",.	c #1F1F1C1C7070",
+"<.	c #25251E1E7171",
+"1.	c #59595C5C9191",
+"2.	c #4D4D53538989",
+"3.	c #4C4C49498484",
+"4.	c #484845458585",
+"5.	c #494941418585",
+"6.	c #494940408181",
+"7.	c #2F2F1C1C5353",
+"8.	c #2B2B28287676",
+"9.	c #323231317F7F",
+"0.	c #545452528B8B",
+"q.	c #51514E4E8989",
+"w.	c #4E4E4B4B8C8C",
+"e.	c #4C4C47478686",
+"r.	c #46463D3D7E7E",
+"t.	c #434336367A7A",
+"y.	c #2B2B13135555",
+"u.	c #47473D3D8D8D",
+"i.	c #575757578E8E",
+"p.	c #48483E3E7F7F",
+"a.	c #46463A3A7D7D",
+"s.	c #424235357575",
+"d.	c #404034347171",
+"f.	c #BFBFCBCBFAFA",
+"g.	c #B8B8A8A8DDDD",
+"h.	c #5E5E60609292",
+"j.	c #565655558C8C",
+"k.	c #4B4B44448282",
+"l.	c #454539397B7B",
+"z.	c #434338387878",
+"x.	c #3F3F32326D6D",
+"c.	c #3D3D30306969",
+"v.	c #3A3A2E2E6363",
+"b.	c #36362A2A5C5C",
+"n.	c #343424245555",
+"m.	c #30301E1E4D4D",
+"M.	c #49493C3C8282",
+"N.	c #5E5E4F4F8C8C",
+"B.	c #56563B3B8B8B",
+"V.	c #545407078585",
+"C.	c #424234347272",
+"Z.	c #9797A4A4F7F7",
+"A.	c #444436367676",
+"S.	c #7D7D7979D5D5",
+"D.	c #464640408A8A",
+"F.	c #44444B4B8282",
+"G.	c #414107077777",
+"H.	c #71716161C1C1",
+"J.	c #303039397979",
+"K.	c #8E8E8E8EE6E6",
+"L.	c #404033338B8B",
+"P.	c #4A4A45458C8C",
+"I.	c #46463A3A8080",
+"U.	c #363629295454",
+"Y.	c #303022224848",
+"T.	c #424237377575",
+"R.	c #2E2E1D1D6363",
+"E.	c #79798383EAEA",
+"W.	c #74747B7BE4E4",
+"Q.	c #6D6D7676D6D6",
+"!.	c #6A6A7171CECE",
+"~.	c #66666969C6C6",
+"^.	c #62626565BCBC",
+"/.	c #5F5F6060B5B5",
+"(.	c #5B5B5B5BACAC",
+").	c #535353539898",
+"_.	c #4F4F4F4FA4A4",
+"`.	c #54544D4DA4A4",
+"'.	c #323204046B6B",
+"].	c #303035357979",
+"[.	c #313122224343",
+"{.	c #5A5A5B5BB7B7",
+"}.	c #484846468080",
+"|.	c #454541417575",
+" X	c #4B4B31318282",
+".X	c #47473C3C8484",
+"XX	c #3E3E35356E6E",
+"oX	c #2F2F26264040",
+"OX	c #2B2B23233A3A",
+"+X	c #262619195C5C",
+"@X	c #252515155A5A",
+"#X	c #55555151B3B3",
+"$X	c #3C3C2D2D5D5D",
+"%X	c #39392F2F5656",
+"&X	c #37372D2D5050",
+"*X	c #25251F1F3030",
+"=X	c #24241D1D4343",
+"-X	c #202013135656",
+";X	c #41413B3B6C6C",
+":X	c #444442429696",
+">X	c #212100005E5E",
+",X	c #444436367272",
+"<X	c #444436366F6F",
+"1X	c #424236366868",
+"2X	c #3F3F34346161",
+"3X	c #3C3C32325A5A",
+"4X	c #34342A2A4A4A",
+"5X	c #21211B1B2121",
+"6X	c #22221C1C6363",
+"7X	c #2D2D01015E5E",
+"8X	c #20201B1B2525",
+"9X	c #49492F2F7B7B",
+"0X	c #434334346C6C",
+"qX	c #323229294545",
+"wX	c #1C1C10104F4F",
+"eX	c #222217176363",
+"rX	c #37371E1E6B6B",
+"tX	c #424232326E6E",
+"yX	c #444433336969",
+"uX	c #424233336565",
+"iX	c #1E1E1A1A1E1E",
+"pX	c #161601014C4C",
+"aX	c #1C1C11115454",
+"sX	c #252503035B5B",
+"dX	c #414131316A6A",
+"fX	c #22221F1F7878",
+"gX	c #272724246767",
+"hX	c #1D1D16165E5E",
+"jX	c #131305055151",
+"kX	c #40402F2F6464",
+"lX	c #111107074E4E",
+"zX	c #0C0C05054B4B",
+"xX	c #22221E1E5757",
+"cX	c #1A1A0D0D4D4D",
+"vX	c #16160B0B4D4D",
+"bX	c #060604044747",
+"nX	c #040403034343",
+"mX	c #3B3B27276565",
+"MX	c #0E0E03034141",
+"NX	c #111106064A4A",
+"BX	c #0E0E04044646",
+"VX	c #111105053B3B",
+"CX	c #0D0D01013A3A",
+"ZX	c #030305053F3F",
+"AX	c #0F0F0F0F4C4C",
+"SX	c #020207073B3B",
+"DX	c #0D0D03034646",
+"FX	c #0B0B02023F3F",
+"GX	c #0D0D02023434",
+"HX	c #0A0A0E0E4444",
+"JX	c #161614145252",
+"KX	c #0B0B04044646",
+"LX	c #0A0A03034444",
+"PX	c #1D1D21215757",
+"IX	c #090910104040",
+"UX	c #18181E1E5353",
+"                                                                                                ",
+"  . . . . X X o o o o O + + @ @ @ @ @ @ @ # # # # # # $ $ % % & & & & * = - - - ; : > > , , ,   ",
+"  . . X X < < o o O O + @ 1 2 2 1 1 1 1 1 1 1 1 3 4 # # $ $ $ % % % 5 = = 6 6 - ; ; > > , , 7   ",
+"  . 8 < < < o O O + @ @ 2 9 9 0 0 q q q q q q q w 3 4 4 e e $ $ $ $ % 5 = = 6 6 6 ; ; > > r t   ",
+"  . X < y u O O + @ 1 2 i 0 0 p p p p p p p a a p a s 3 4 4 e e e e d 5 5 f f 6 6 6 ; ; r r t   ",
+"  X < y u O + + @ 2 9 0 g p p h h h h h h h p h h a a s s j k k j l d d 5 5 f f 6 6 r r r r r   ",
+"  X < y O z x x 9 0 g c v b n n n n n n n n n n n h a a s s j j m l M d d N f f B B B B r r r   ",
+"  < y u + z 2 0 c c b V C Z C C A A A A A S S S n h D w w m m m m k l M d d N f F F F B r r r   ",
+"  < y O z z 9 c b V Z G H H H G S G G J J H V v c g g K K K K L P l l l M M N N N N I B B r r   ",
+"  U u + z x i v C H Y J J J J H J T R H V E W W Q Q Q Q ! ! ! ~ ^ ^ / / M M M M M N ( B B r r   ",
+"  ) _ z x 9 g b Z Y ` ' ' ' T T ] [ { } |  .........W W Q Q X.! ~ ~ o.O./ / / / N F ( B B B r   ",
+"  ) ) z x i c V G J ' +.+.+.+.] [ @.#.$.%.%.%.&.*. . .....W =.-.X.;.~ :.o.O.^ >.N F ( B B B B   ",
+"  ) ,.<.2 g v C H J ' +.+.+.+.T Y 1.2.3.4.4.4.5.6.&.&. . ...W =.=.-.;.~ :.o.7.>.N F F ( B I I   ",
+"  ) ,.<.8.9.b C H J T +.+.+.' J @.1.0.q.q.w.e.4.5.6.&.r. . .t.W =.=.-.;.~ :.o.7.y.N F ( ( I I   ",
+"  8.8.8.9.| u.C G J T +.+.' ` Y @.1.i.0.q.q.e.e.5.6.p.r.a. .t.t.s.d.d.-.;.~ :.7.7.y.F F ( I I   ",
+"  9.c c c v b A S H ' f.g.` Y @.h.1.i.j.0.q.q.e.k.6.p.r.a.l.t.z.s.s.d.x.c.v.b.n.m.7.N F F F I   ",
+"  <.g M.N.B.B.n V.J f.R J @.h.h.1.i.i.j.j.0.q.3.k.6.p.r.a.l.l.z.s.C.d.x.x.c.v.b.n.m.y.N F F F   ",
+"  + x i v B.Z Z G g.Z.[ @.2.i.i.j.j.j.j.j.0.q.3.k.6.p.p.a.l.l.A.s.C.C.d.x.c.v.b.n.m.7.y.N N y.  ",
+"  O # 3 w p n Z ` f.S.H D.F.q.0.0.0.0.j.0.q.q.3.k.6.p.r.a.a.l.A.s.s.C.d.x.x.c.v.b.n.m.y.y.y.y.  ",
+"  O # 4 s a G.V.T Z.H.V J.%.e.w.q.0.0.0.0.q.q.e.k.6.p.r.a.a.l.z.A.s.C.d.d.x.c.v.b.n.m.7.>.y.y.  ",
+"  O # 4 s w G.A f.K.H L...4.P.w.w.w.q.q.q.q.e.e.5.6.M.I.I.a.a.l.z.A.s.d.d.x.c.v.v.U.Y.7.O.>.y.  ",
+"  $ # 4 3 s G.G f.S.Z 9.*.D.P.P.w.w.w.w.w.e.e.5.5.M.M.I.I.a.a.l.z.T.s.d.d.x.x.c.v.U.Y.m.R.>.>.  ",
+"  E.E.W.W.W.W.E.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { )._.`._.  ",
+"  + # 3 w s '.` f.H.V ].*.D.P.P.P.P.P.P.P.5.5.5.M.M.M.I.I.a.l.z.z.T.T.s.d.d.x.c.v.U.Y.[.^ O.>.  ",
+"  ~.~.~.~.~.~.K.Z.S.~.{.^.^.^.^.^.^.^.^././././././.(.(.(.(.(.(.{ { { { { ).).).w.w.}.|.P.u.}   ",
+"   .I.6. X X XT f.H.b ].*.E D.D.D.D.5.5..X.XM.M.I.I.a.a.l.l.z.z.T.T.T.d.XXx.c.v.b.U.oXOXR.+X@X  ",
+"  E.E.E.W.W.W.K.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { ).).#X_._.  ",
+"  & % $ e '.= H f.H.b 8.W *.E E E .X.X.XI.I.I.I.a.a.l.l.z.z.T.T.T.C.XXXXc.v.$X%X&XY.*X=X2 @X-X  ",
+"  {.{.{.{.{.#X~.Z.W.~.{.{./././././././././.(.(.(.(.(.(.(.{ { { { { { ).).).w.w.3.}.;X%.:X} }   ",
+"  & & % $ e >XV.f.S.C K X.W t. . .l.l.t.t.t.t.A.A.A.,X,X,X,X,X<X;X1X1X2X3X%X&X4XoX*X5Xo.6X-X-X  ",
+"  & & % $ $ >X7X` Z.Z D ! =.=.s.t.t.t.A.A.s.A.,X,X,X,X<X<X<X<X;X1X2X2X3X%X&X4XoXOX8X5X<.@X-X-X  ",
+"  8 & & $ e K 9XJ f.^. XK X.=.=.s.s.s.s.s.C.C.C.C.<X0X0X0X1X1X1X2X2X3X%X&X4XqXOX*X8X=X<.-X-XwX  ",
+"  8 & eXK k.@.M. Xg.E.B.rX~ -.d.d.C.C.C.C.C.tX0X0X0XyXyX1X1XuX2X2X3X%X&X4XqXoXOX8XiX6XeX-X-XwX  ",
+"  6XQ h.Y N.K e pXB.f./.9Xo.;.-.x.d.tXtXtXtXtX0X0XyXyXyXuXuX2X2X3X%X&X4XqXoXOX*XiX=X_ aX-XaXwX  ",
+"  Y Y  .R.@X% sX= 7XT Z.V P :.;.c.x.x.x.tXdXdXdXyXyXuXuX2X2X3X3X%X&X4XqXoXOX*X8X*XfXaXaXaXwXwX  ",
+"  gXhX& * & 5 5 sXjXa ] S.9X/ ~ v.c.dXdXdXdXdXuXuXuXkX2X2X3X%X%X&X4XqXoXOX*X8XiX<.hXwXwXaXwXwX  ",
+"  8 lXlXjX= * 5 5 = zX9X] H.D 7.b.v.v.kXc.kXkXkXkXkX2X$X3X%X&X&X4XqXoXOX*X8XiXxXhXwXcXcXwXwXwX  ",
+"  zXzXlXlXjX= = f f sXD Y ] ~.D 7.n.b.v.v.kXkXkXkX$X$X%X%X&X4XqXoXoXOX*X8X5XgXu cXvXvXcXcXwXwX  ",
+"  bXbXzXlXlX- = * @XX.h.e D T S.D n.m.b.$X$X$X$X$X%X%X&X&X4XqXoXOX*X8X8X*X<.hXvX; ; vXvXvXcXwX  ",
+"  nXbXzXzXlXlX- -XX.Y R.pXpXP J K.Z mXm.n.U.U.U.U.U.4X4XY.oXOX*X8X8X8X=X,.aXvX; > > > t t t cX  ",
+"  nXbXbXzXzXlXaXXXY +Xf = f = 7XtXR R   mXn.Y.[.[.[.[.OX*X*X8X5X*X=X,.u vXvX; > > MXMX, 7 t t   ",
+"  nXnXnXbXzXvX-.Y +XcX6 6 = = = d L B.G H `.X.:.7.m.=X=X=X=X=X6X,.u cXvXNX: BX> MXVXCXVX7 7 7   ",
+"  ZXZXnXbXAXgX@.+XvX; - - - - * @XR.>.sX>.R.i 0 x eXeXeXeXO hXaXcXvXNX: BXMXMXMXVXCXCXCXVX7 7   ",
+"  SXZXZXAXgXN.aXNX: : NXNXNX- * +X+X* 6 6 6 * * * * * * * vXvX- NX: DXBXMXMXFXCXCXCXCXGXVXVX7   ",
+"  SXSXHXgX0.JXKXLXKXKXDX: : NX* @X-X- - - - - - - - - - - NX: DXDXDXMXMXFXFXCXCXCXCXGXGXGXVXVX  ",
+"  SXHXPX3.JXnXnXnXnXbXLXKXKXNXaX-XvX: : NX: : : : : : : BXDXDXLXMXMXFXFXCXCXCXCXGXGXGXGXGXGXGX  ",
+"  IXUX$.AXZXZXZXZXnXnXnXLXLXNXJXvXBXDXBXBXBXBXDXDXDXDXLXDXLXLXFXFXFXFXCXCXCXCXGXGXGXGXGXGXGXGX  ",
+"                                                                                                "};
Index: tmp/org.txm.wordcloud.rcp/icons/functions/wordcloud.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

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

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

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

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

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

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

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

Index: tmp/org.txm.wordcloud.rcp/plugin.xml
===================================================================
--- tmp/org.txm.wordcloud.rcp/plugin.xml	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/plugin.xml	(revision 88)
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+   <extension
+         id="application"
+         point="org.eclipse.core.runtime.applications">
+      <application>
+         <run
+               class="___wordcloudrcp.Application">
+         </run>
+      </application>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            name="%perspective.name"
+            class="___wordcloudrcp.Perspective"
+            id="WordCloudRCP.perspective">
+      </perspective>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            categoryId="org.txm.rcpapplication.category.txm"
+            defaultHandler="org.txm.wordcloud.rcp.handlers.ComputeWordCloud"
+            id="ComputeWordCloud"
+            name="%command.name">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            allPopups="false"
+            locationURI="toolbar:org.txm.rcpapplication.toolbartools">
+         <command
+               commandId="ComputeWordCloud"
+               icon="icons/functions/wordcloud.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OneLexiconSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneIndexSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneCorpusSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
+         <command
+               commandId="ComputeWordCloud"
+               icon="icons/functions/wordcloud.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OneLexiconSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneIndexSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneCorpusSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:menu.tools">
+         <command
+               commandId="ComputeWordCloud"
+               icon="icons/functions/wordcloud.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OneLexiconSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneIndexSelected">
+                  </reference>
+                  <reference
+                        definitionId="OneCorpusSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:menu.help.plugins">
+         <command
+               commandId="org.txm.rcpapplication.commands.OpenBrowser"
+               icon="icons/functions/wordcloud.png"
+               label="%command.name"
+               style="push">
+            <parameter
+                  name="org.txm.rcpapplication.commands.commandParameter2"
+                  value="https://groupes.renater.fr/wiki/txm-users/public/extensions#wordcloud">
+            </parameter>
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.editors">
+      <editor
+            class="org.txm.wordcloud.rcp.editors.WordCloudEditor"
+            default="false"
+            icon="icons/functions/wordcloud.png"
+            id="org.txm.wordcloud.core.functions.WordCloud"
+            name="%editor.name">
+      </editor>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.adapters">
+      <factory
+            adaptableType="org.txm.wordcloud.core.functions.WordCloud"
+            class="org.txm.wordcloud.rcp.adapters.WordCloudAdapterFactory">
+         <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.wordcloud.rcp.preferences.WordCloudPreferencePage"
+            id="org.txm.wordcloud.rcp.preferences.WordCloudPreferencePage"
+            name="%page.name">
+      </page>
+   </extension>
+   <extension
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="OneWordCloudSelected">
+         <with
+               variable="selection">
+            <iterate
+                  ifEmpty="false"
+                  operator="and">
+               <instanceof
+                     value="org.txm.wordcloud.core.functions.WordCloud">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
+   </extension>
+</plugin>

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

Index: tmp/org.txm.wordcloud.rcp/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.wordcloud.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 88)
@@ -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.wordcloud.rcp/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.wordcloud.rcp/.settings/org.eclipse.core.resources.prefs
===================================================================
--- tmp/org.txm.wordcloud.rcp/.settings/org.eclipse.core.resources.prefs	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/.settings/org.eclipse.core.resources.prefs	(revision 88)
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding//OSGI-INF/l10n/bundle.properties=UTF-8

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

Index: tmp/org.txm.wordcloud.rcp/.classpath
===================================================================
--- tmp/org.txm.wordcloud.rcp/.classpath	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/.classpath	(revision 88)
@@ -0,0 +1,8 @@
+<?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="src" path="OSGI-INF"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

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

Index: tmp/org.txm.wordcloud.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.wordcloud.rcp/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.wordcloud.rcp/META-INF/MANIFEST.MF	(revision 88)
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: WordCloud RCP
+Bundle-SymbolicName: org.txm.wordcloud.rcp;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.txm.wordcloud.core;bundle-version="1.0.0",
+ org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0",
+ org.txm.chartsengine.r.core;bundle-version="1.0.0",
+ org.txm.chartsengine.rcp,
+ org.eclipse.core.runtime;bundle-version="3.10.0",
+ org.eclipse.ui;bundle-version="3.106.1",
+ org.txm.core;bundle-version="0.7.0",
+ org.txm.rcp;bundle-version="0.7.8"
+Bundle-Vendor: TXM

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

Index: tmp/org.txm.textsbalance.rcp/.classpath
===================================================================
--- tmp/org.txm.textsbalance.rcp/.classpath	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/.classpath	(revision 88)
@@ -0,0 +1,11 @@
+<?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.7"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

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

Index: tmp/org.txm.textsbalance.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.textsbalance.rcp/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/META-INF/MANIFEST.MF	(revision 88)
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Texts Balance RCP
+Bundle-SymbolicName: org.txm.textsbalance.rcp;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: TXM
+Require-Bundle: org.txm.rcp;bundle-version="0.7.7",
+ org.eclipse.core.runtime;bundle-version="3.10.0",
+ org.eclipse.ui;bundle-version="3.106.1",
+ org.eclipse.jface.text,
+ org.eclipse.ui.editors,
+ org.txm.core;bundle-version="0.7.0",
+ org.txm.chartsengine.r.core,
+ org.eclipse.core.expressions;bundle-version="3.4.600",
+ org.txm.textsbalance.core;bundle-version="1.0.0",
+ org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0",
+ org.txm.chartsengine.rcp;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.txm.textsbalance.rcp.adapters,
+ org.txm.textsbalance.rcp.editors,
+ org.txm.textsbalance.rcp.handlers,
+ org.txm.textsbalance.rcp.preferences

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

Index: tmp/org.txm.textsbalance.rcp/.project
===================================================================
--- tmp/org.txm.textsbalance.rcp/.project	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/.project	(revision 88)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.textsbalance.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.textsbalance.rcp/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/preferences/TextsBalancePreferencePage.java
===================================================================
--- tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/preferences/TextsBalancePreferencePage.java	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/preferences/TextsBalancePreferencePage.java	(revision 88)
@@ -0,0 +1,101 @@
+package org.txm.textsbalance.rcp.preferences;
+
+// 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:$ 
+//
+
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.ComboFieldEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbench;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.rcp.preferences.TXMPreferencePage;
+import org.txm.rcp.preferences.TXMPreferenceStore;
+import org.txm.textsbalance.core.preferences.TextsBalancePreferences;
+import org.txm.textsbalance.rcp.adapters.TextsBalanceAdapterFactory;
+
+/**
+ * Texts balance preference page.
+ * @author sjacquot
+ *
+ */
+public class TextsBalancePreferencePage extends TXMPreferencePage {
+
+
+	/**
+	 * 
+	 */
+	public TextsBalancePreferencePage() {
+		super();
+	}
+
+	@Override
+	public void createFieldEditors() {
+
+		
+		// Charts rendering
+		Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent());
+		
+		
+		// FIXME: input text
+//		IntegerFieldEditor method = new IntegerFieldEditor(TextsBalancePreferencesInitializer.METHOD, "Method", this.getFieldEditorParent());
+//		method.setValidRange(1, 2);
+//		method.setTextLimit(1);
+//		method.getTextControl(getFieldEditorParent()).setToolTipText("Method (1: uses CQL to solve matches, 2 uses corpus struct indexes, 2 is faster!)");
+//		this.addField(method);
+		
+		String[][] methods = new String[2][2];
+		for(int i = 0; i < 2; i++) {
+			methods[i][0] = String.valueOf(i + 1);
+			methods[i][1] = String.valueOf(i + 1);
+		}
+
+		this.addField(new ComboFieldEditor(TextsBalancePreferences.METHOD, "Method", methods, chartsTab));
+		this.addField(new BooleanFieldEditor(TextsBalancePreferences.GROUP_BY_WORDS, "Group by words", chartsTab));
+		
+		// other shared preferences
+		SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab);
+		
+	}
+	
+	
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	@Override
+	public void init(IWorkbench workbench) {
+		this.setPreferenceStore(new TXMPreferenceStore(TextsBalancePreferences.PREFERENCES_NODE));
+		this.setDescription("Texts balance charts.");
+		this.setImageDescriptor(TextsBalanceAdapterFactory.ICON);
+	}
+
+}

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

Index: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/adapters/TextsBalanceAdapterFactory.java
===================================================================
--- tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/adapters/TextsBalanceAdapterFactory.java	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/adapters/TextsBalanceAdapterFactory.java	(revision 88)
@@ -0,0 +1,66 @@
+// Copyright © 2010-2013 ENS de Lyon.
+package org.txm.textsbalance.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.rcp.adapters.BaseAdapterFactory;
+import org.txm.textsbalance.core.functions.TextsBalance;
+
+
+/**
+ * A factory for creating Adapter objects.
+ *  
+ * @author mdecorde
+ * @author sjacquot
+ */
+public class TextsBalanceAdapterFactory extends BaseAdapterFactory {
+
+	
+	public static final ImageDescriptor ICON =
+			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(TextsBalanceAdapterFactory.class).getSymbolicName(),
+					"platform:/plugin/"+ FrameworkUtil.getBundle(TextsBalanceAdapterFactory.class).getSymbolicName() + "/icons/balance.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 TextsBalance)	{
+				return new IWorkbenchAdapter() {
+					@Override
+					public Object[] getChildren(Object resultData) {
+						return new Object[0];
+					}
+	
+					@Override
+					public ImageDescriptor getImageDescriptor(Object object) {
+						return ICON;
+					}
+	
+					@Override
+					public String getLabel(Object resultData) {
+						return ((TextsBalance) resultData).getName();
+					}
+	
+					@Override
+					public Object getParent(Object resultData) {
+						return ((TextsBalance) resultData).getCorpus();
+					}
+				};
+			}
+		}
+		return null;
+	}
+
+
+}

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

Index: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/BalanceEditor.java
===================================================================
--- tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/BalanceEditor.java	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/BalanceEditor.java	(revision 88)
@@ -0,0 +1,363 @@
+package org.txm.textsbalance.rcp.editors;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.txm.chartsengine.rcp.editors.ChartEditorPart;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.rcpapplication.views.CorporaView;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.textsbalance.core.functions.TextsBalance;
+import org.txm.textsbalance.core.preferences.TextsBalancePreferences;
+
+/**
+ * Texts balance editor.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class BalanceEditor extends ChartEditorPart {
+
+	private Combo supCombo;
+
+	private Button groupByTexts;
+
+	private Button groupByWords;
+
+	private Combo suCombo;
+
+	/**
+	 * Structural unit properties to not display.
+	 */
+	protected String[] supsToSkip;
+	
+	
+	/**
+	 * 
+	 */
+	public BalanceEditor() {
+		
+		this.supsToSkip = new String[] {"id", "base", "project"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+	}
+
+	
+	@Override
+	public void createPartControl(Composite parent) {
+		super.createPartControl(parent);
+		
+		if (((TextsBalance)this.getResultData()).getCorpus() == null) {
+			System.out.println("Error: no corpus");
+			return;
+		}
+
+		Group group = new Group(this.getParametersGroup(), SWT.NONE);
+
+		group.setText("Group by:");
+		//group.setLayout(new RowLayout(SWT.VERTICAL));
+		group.setLayout(new RowLayout());
+		
+//		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
+//		gridData.horizontalSpan = 2;
+//		gridData.verticalIndent = 10;
+//		group.setLayoutData(gridData);
+
+		
+		groupByTexts = new Button(group, SWT.RADIO);
+		groupByTexts.setText("text");
+		groupByTexts.setSelection(!TXMPreferences.getBoolean(TextsBalancePreferences.PREFERENCES_NODE, this.getResultData(), TextsBalancePreferences.GROUP_BY_WORDS));	
+		
+		
+		groupByWords = new Button(group, SWT.RADIO);
+		groupByWords.setText("word");
+		groupByWords.setSelection(!groupByTexts.getSelection());
+
+		
+		suCombo = new Combo(this.getParametersGroup(), SWT.READ_ONLY);
+		supCombo = new Combo(this.getParametersGroup(), SWT.READ_ONLY);
+
+		try {
+			loadSU();
+		}
+		catch (CqiClientException e) {
+			e.printStackTrace();
+		}
+
+		
+		
+		suCombo.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				// persistence
+				TXMPreferences.putLocalString(getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT, suCombo.getText());
+				TXMPreferences.putLocalInt(getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX, 0);
+				
+				try {
+					loadSUP(((TextsBalance)getResultData()).getCorpus().getStructuralUnit(suCombo.getText()));
+
+					compute();
+					loadChart();
+				}
+				catch(CqiClientException e1) {
+					// TODO Auto-generated catch block
+					e1.printStackTrace();
+				}
+
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				// TODO Auto-generated method stub
+				
+			}
+		});
+		
+
+		
+		SelectionListener listener = new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				
+			
+				// persistence
+				TXMPreferences.putLocalInt(getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX, supCombo.getSelectionIndex());
+				TXMPreferences.putLocalBoolean(getResultData(), TextsBalancePreferences.GROUP_BY_WORDS, !groupByTexts.getSelection());
+				
+				compute();
+				loadChart();
+
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				
+			}
+		};
+		
+		supCombo.addSelectionListener(listener);
+		groupByTexts.addSelectionListener(listener);
+		groupByWords.addSelectionListener(listener);
+		
+		
+		this.compute();
+		
+	}
+
+	
+	/**
+	 * Computes the balance using local or default parameters.
+	 */
+	public void compute()	{
+		try {
+			
+			String suName = TXMPreferences.getString(TextsBalancePreferences.PREFERENCES_NODE, (TextsBalance) getEditorInput().getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT);
+
+			// gets the structural unit property name
+			String supName = null;
+			int i = 0;
+			for(StructuralUnitProperty p : ((TextsBalance) this.getResultData()).getCorpus().getStructuralUnit(suName).getOrderedProperties()) {
+				if(Arrays.asList(this.supsToSkip).contains(p.getName()))	{ 
+					continue;
+				}
+				if(i == TXMPreferences.getInt(TextsBalancePreferences.PREFERENCES_NODE, this.getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX))	{
+					supName = p.getName();
+					break;
+				}
+				i++;
+			}
+			
+			this.compute(TXMPreferences.getInt(TextsBalancePreferences.PREFERENCES_NODE, TextsBalancePreferences.METHOD),
+					((TextsBalance) this.getResultData()).getCorpus().getStructuralUnit(suName), supName,
+					!TXMPreferences.getBoolean(TextsBalancePreferences.PREFERENCES_NODE, this.getResultData(), TextsBalancePreferences.GROUP_BY_WORDS)
+					);
+			
+			
+		}
+		catch(CqiClientException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+	
+	
+	/**
+	 * 
+	 * @param method 1: use CQL to solve matches, 2 uses corpus struct indexes, 2 is faster !
+	 * @throws CqiClientException
+	 */
+	public void compute(final int method, final StructuralUnit su, final String propertyName, final boolean groupByTexts) {
+
+		
+		
+		Job job = new Job("Compute Texts Balance") {
+
+		    @Override
+		    protected IStatus run(IProgressMonitor monitor) {
+
+		    	// creating
+				monitor.beginTask("Computing", IProgressMonitor.UNKNOWN);
+				
+				TextsBalance textsBalance = (TextsBalance)getResultData();
+				try {
+					textsBalance.compute(method, su, propertyName, groupByTexts);
+				}
+				catch(CqiClientException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				createChart();
+				
+				// cancel
+				if(monitor.isCanceled())	{
+					close();
+					return Status.CANCEL_STATUS;
+				}
+				
+				
+				// loading
+				monitor.setTaskName("Loading");
+				loadChart();
+
+				
+				setPartName(textsBalance.getCorpus().getName() + " - " + textsBalance.getName());
+				
+				
+				// FIXME: persistence test, saving local preferences/parameters to file
+				//TextsBalancePreferences.flush((TextsBalance) getEditorInput().getResultData());
+
+				// refreshes the view to update the node label
+				getSite().getShell().getDisplay().syncExec(new Runnable() {
+					@Override
+					public void run() {
+						CorporaView.refresh();
+					}
+				});
+
+				
+				// done
+				monitor.done(); 
+				return Status.OK_STATUS;
+	    }
+
+		};
+		//job.setUser(true); // show progress bar, without that the progress is located to bottom right
+		job.schedule();
+	}
+
+	
+	
+	/**
+	 * Fills the SU combo box from the corpus.
+	 * @throws CqiClientException
+	 */
+	private void loadSU() throws CqiClientException {
+		
+		String selectedSuName = TextsBalancePreferences.getString(TextsBalancePreferences.PREFERENCES_NODE, (TextsBalance) this.getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT);
+		int selectedIndex = 0;
+		int i = 0;
+		
+		for (StructuralUnit p : ((TextsBalance) this.getResultData()).getCorpus().getOrderedStructuralUnits()) {
+			if (p.getName().equals("txmcorpus"))	{ //$NON-NLS-1$
+				continue;
+			}
+			suCombo.add(p.getName());
+			if (selectedSuName.equals(p.getName()))	{
+				selectedIndex = i;
+			}
+			i++;
+		}
+		suCombo.select(selectedIndex);
+		loadSUP(((TextsBalance)this.getResultData()).getCorpus().getStructuralUnit(suCombo.getText()));
+	}
+
+	/**
+	 * Fills the SUP combo box from the specified structural unit.
+	 * @param su
+	 * @throws CqiClientException
+	 */
+	private void loadSUP(StructuralUnit su) throws CqiClientException {
+		supCombo.removeAll();
+		for (StructuralUnitProperty p : su.getOrderedProperties()) {
+			if (Arrays.asList(this.supsToSkip).contains(p.getName()))	{ 
+				continue;
+			}
+			supCombo.add(p.getName());
+		}
+		if (supCombo.getItemCount() > 0) {
+			supCombo.select(TextsBalancePreferences.getInt(TextsBalancePreferences.PREFERENCES_NODE, this.getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX));
+		}
+	}
+	
+	/**
+	 * 
+	 * @param corpus
+	 * @param structs
+	 * @return
+	 */
+	public ArrayList<Integer> intersect(List<Match> corpus, List<Match> structs) {
+		int ai=0, bi=0;
+		ArrayList<Integer> result = new ArrayList<Integer>();
+
+		while (ai < corpus.size() && bi < structs.size() ) {
+			if (structs.get(bi).contains(corpus.get(ai))) { 
+				result.add(bi);
+				ai++; 
+			} else if (corpus.get(ai).contains(structs.get(bi))) { 
+				result.add(bi);
+				bi++; 
+			} else { 
+				if (structs.get(bi).getStart() < corpus.get(ai).getStart()) {
+					bi++;
+				} else {
+					ai++;	
+				}
+			} 
+		}
+
+		return result;
+	}
+
+	@Override
+	public void doSave(IProgressMonitor monitor) {
+		// Do the Save operation
+	}
+
+	@Override
+	public void doSaveAs() {
+		// Do the Save As operation
+	}
+
+
+	@Override
+	public boolean isDirty() {
+		return false;
+	}
+
+	@Override
+	public boolean isSaveAsAllowed() {
+		return false;
+	}
+
+
+}

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

Index: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/BalanceEditorInput.java
===================================================================
--- tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/BalanceEditorInput.java	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/BalanceEditorInput.java	(revision 88)
@@ -0,0 +1,124 @@
+// 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.textsbalance.rcp.editors;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IPersistableElement;
+import org.txm.chartsengine.rcp.editors.ChartEditorInput;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.textsbalance.core.functions.TextsBalance;
+import org.txm.textsbalance.core.preferences.TextsBalancePreferences;
+/**
+ * Editor input for TextBalance.
+ *
+ * @author mdecorde
+ * @author sjacquot
+ */
+public class BalanceEditorInput extends ChartEditorInput {
+	
+	/** The corpus. */
+	private Corpus corpus;
+	
+	/**
+	 * Instantiates a new index editor input.
+	 *
+	 * @param corpus the corpus
+	 */
+	public BalanceEditorInput(TextsBalance textBalance) {
+		super(textBalance, TextsBalancePreferences.PREFERENCES_NODE);
+		this.corpus = textBalance.getCorpus();
+	}
+
+	/**
+	 * 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 null;
+	}
+
+	/**
+	 * 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 corpus.
+	 *
+	 * @return the corpus
+	 */
+	public Corpus getCorpus() {
+		return corpus;
+	}
+
+
+}

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

Index: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/handlers/ComputeBalance.java
===================================================================
--- tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/handlers/ComputeBalance.java	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/handlers/ComputeBalance.java	(revision 88)
@@ -0,0 +1,130 @@
+// 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.textsbalance.rcp.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.rcpapplication.Application;
+import org.txm.rcpapplication.views.CorporaView;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.textsbalance.core.functions.TextsBalance;
+import org.txm.textsbalance.rcp.editors.BalanceEditorInput;
+
+/**
+ * Computes and opens a texts balance editor.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ * 
+ */
+public class ComputeBalance extends AbstractHandler {
+
+
+	
+	// FIXME: should be put in an Activator? or better in an extension point loaded by the corpora view?
+	// adds a double click listener to the Corpus View
+	static	{
+		CorporaView.addDoubleClickListener(TextsBalance.class, "ComputeBalance"); //$NON-NLS-1$
+	}
+	
+	
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+
+		
+		ISelection sel = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		if(!(sel instanceof IStructuredSelection)) {
+			return null;
+		}
+		IStructuredSelection selection = (IStructuredSelection) sel;
+
+		Object selectedObject = selection.getFirstElement();
+
+		TextsBalance balance = null;
+		boolean newResult = false;
+		
+		// creates new result
+		if(selectedObject instanceof Corpus) {
+			balance = new TextsBalance((Corpus) selectedObject);
+			newResult = true;
+		}
+		// opens existing result
+		else if(selectedObject instanceof TextsBalance) {
+			balance = (TextsBalance) selectedObject;
+		}
+		
+		if(balance != null)	{
+			BalanceEditorInput editorInput = new BalanceEditorInput(balance);
+			SWTChartsComponentsProvider.getCurrent().openEditor(editorInput);
+
+			if(newResult)	{
+				CorporaView.storeResult(balance.getCorpus(), balance);
+			}
+		}
+		else	{
+			System.err.println("Cannot open Balance editor with " + selectedObject);
+		}
+		
+
+
+		// FIXME: test d'utilisation de la même commande pour la création d'un nouvel éditeur et pour la mise à jour d'un graphique, avec une commande paramétrée (voir plugin.xml)
+//		if(event.getParameter("TextsBalance.createNewEditor") == null)	{
+//			ISelection sel = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+//			if (!(sel instanceof IStructuredSelection)) return null;
+//			selection = (IStructuredSelection) sel;
+//	
+//			Object s = selection.getFirstElement();
+//			if (s instanceof Corpus) {
+//				Corpus corpus = (Corpus) s;
+//				if (!openEditor(corpus)) {
+//					System.out.println("Cannot open Balance editor with "+s);
+//				}
+//			}
+//		}
+//		else	{
+//			//System.out.println("ComputeBalance.execute() " + ((Event)event.getTrigger()).widget);
+//			((BalanceEditor)((ChartEditorToolBar)((ToolItem)((Event)event.getTrigger()).widget).getParent()).getEditorPart()).compute();
+//			((BalanceEditor)((ChartEditorToolBar)((ToolItem)((Event)event.getTrigger()).widget).getParent()).getEditorPart()).reloadChart();
+//			
+//		}
+		
+		
+		
+		return null;
+	}
+
+
+
+
+}

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

Index: tmp/org.txm.textsbalance.rcp/build.properties
===================================================================
--- tmp/org.txm.textsbalance.rcp/build.properties	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/build.properties	(revision 88)
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               icons/,\
+               OSGI-INF/l10n/bundle.properties

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

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

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

Index: tmp/org.txm.textsbalance.rcp/plugin.xml
===================================================================
--- tmp/org.txm.textsbalance.rcp/plugin.xml	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/plugin.xml	(revision 88)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+   <extension
+         point="org.eclipse.ui.editors">
+      <editor
+            class="org.txm.textsbalance.rcp.editors.BalanceEditor"
+            icon="icons/balance.png"
+            id="org.txm.textsbalance.core.functions.TextsBalance"
+            name="Texts Balance">
+      </editor>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="org.txm.textsbalance.rcp.handlers.ComputeBalance"
+            id="ComputeBalance"
+            name="Texts balance">
+         <commandParameter
+               id="TextsBalance.createNewEditor"
+               name="%commandParameter.name"
+               optional="true">
+         </commandParameter>
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            allPopups="false"
+            locationURI="toolbar:org.txm.rcpapplication.toolbartools">
+         <command
+               commandId="ComputeBalance"
+               icon="icons/balance.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <reference
+                     definitionId="OneCorpusSelected">
+               </reference>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
+         <command
+               commandId="ComputeBalance"
+               icon="icons/balance.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <reference
+                     definitionId="OneCorpusSelected">
+               </reference>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:menu.tools">
+         <command
+               commandId="ComputeBalance"
+               icon="icons/balance.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <reference
+                     definitionId="OneCorpusSelected">
+               </reference>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="InstanceOfBalanceEditor">
+         <with
+               variable="activeEditor">
+            <instanceof
+                  value="org.txm.textsbalance.rcp.editors.BalanceEditor">
+            </instanceof>
+         </with>
+      </definition>
+   </extension>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            category="org.txm.rcpapplication.preferences.UserPreferencePage"
+            class="org.txm.textsbalance.rcp.preferences.TextsBalancePreferencePage"
+            id="org.txm.rcp.textsbalance.preferences.TextsBalancePreferencePage"
+            name="Texts balance">
+      </page>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.adapters">
+      <factory
+            adaptableType="org.txm.textsbalance.core.functions.TextsBalance"
+            class="org.txm.textsbalance.rcp.adapters.TextsBalanceAdapterFactory">
+         <adapter
+               type="org.eclipse.ui.model.IWorkbenchAdapter">
+         </adapter>
+      </factory>
+   </extension>
+
+</plugin>

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

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

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

Index: tmp/org.txm.textsbalance.core/plugin.xml
===================================================================
--- tmp/org.txm.textsbalance.core/plugin.xml	(revision 0)
+++ tmp/org.txm.textsbalance.core/plugin.xml	(revision 88)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.txm.textsbalance.core.preferences.TextsBalancePreferences">
+      </initializer>
+   </extension>
+   <extension
+         point="org.txm.chartsengine.chartcreator">
+      <ChartCreator
+            class="org.txm.textsbalance.core.chartsengine.jfreechart.JFCBalanceSpiderChartCreator"
+            fileNamePrefix="texts_balance">
+      </ChartCreator>
+      <ChartCreator
+            class="org.txm.textsbalance.core.chartsengine.r.RBalanceSpiderChartCreator"
+            fileNamePrefix="texts_balance">
+      </ChartCreator>
+   </extension>
+
+</plugin>

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

Index: tmp/org.txm.textsbalance.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.textsbalance.core/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.textsbalance.core/.settings/org.eclipse.jdt.core.prefs	(revision 88)
@@ -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.textsbalance.core/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.textsbalance.core/.classpath
===================================================================
--- tmp/org.txm.textsbalance.core/.classpath	(revision 0)
+++ tmp/org.txm.textsbalance.core/.classpath	(revision 88)
@@ -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.textsbalance.core/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.textsbalance.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.textsbalance.core/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.textsbalance.core/META-INF/MANIFEST.MF	(revision 88)
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Texts Balance TBX
+Bundle-SymbolicName: org.txm.textsbalance.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.txm.textsbalance.core.chartsengine.jfreechart,
+ org.txm.textsbalance.core.chartsengine.r,
+ org.txm.textsbalance.core.functions,
+ org.txm.textsbalance.core.preferences
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.10.0",
+ org.txm.chartsengine.jfreechart.rcp;bundle-version="1.0.0",
+ org.txm.chartsengine.r.rcp;bundle-version="1.0.0",
+ org.txm.core;bundle-version="0.7.0"
+Bundle-Vendor: TXM

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

Index: tmp/org.txm.textsbalance.core/.project
===================================================================
--- tmp/org.txm.textsbalance.core/.project	(revision 0)
+++ tmp/org.txm.textsbalance.core/.project	(revision 88)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.textsbalance.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.textsbalance.core/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java
===================================================================
--- tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 0)
+++ tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 88)
@@ -0,0 +1,282 @@
+/**
+ * 
+ */
+package org.txm.textsbalance.core.functions;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.txm.HasResults;
+import org.txm.Toolbox;
+import org.txm.functions.Function;
+import org.txm.functions.TXMResult;
+import org.txm.searchengine.cqp.AbstractCqiClient;
+import org.txm.searchengine.cqp.NetCqiClient;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.QueryResult;
+import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.searchengine.cqp.corpus.query.Query;
+import org.txm.utils.logger.Log;
+
+/**
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class TextsBalance extends Function implements TXMResult {
+
+	
+	
+	protected Corpus corpus;
+	
+	
+	HashMap<Integer, Comparable[]> dataset;
+	
+	
+	protected String propertyName;
+	protected List<String> values;
+	protected int fMin;
+	protected int fMax;
+	
+	protected String name;
+	
+	/**
+	 * 
+	 */
+	public TextsBalance(Corpus corpus) {
+		this.corpus = corpus;
+		
+		this.fMin = 999999999;
+		this.fMax = 0;
+	}
+
+	
+	/**
+	 * @param method 1: use CQL to solve matches, 2 uses corpus struct indexes, 2 is faster !
+	 * @param method
+	 * @param su
+	 * @param suPropertyName
+	 * @param groupByTexts
+	 * @throws CqiClientException
+	 */
+	public void compute(int method, StructuralUnit su, String suPropertyName, boolean groupByTexts) throws CqiClientException {
+		
+		this.name = su.getName() + "@" + suPropertyName + " (group by texts = " + groupByTexts + ")";
+		
+		Log.warning("Compute balance with metadata propertyName = " + suPropertyName + ", structural unit = " + su.getName() + " and count_texts = " + groupByTexts);
+		try {
+			if (suPropertyName == null || suPropertyName.length() == 0) return;
+			
+			
+			this.dataset = new HashMap<Integer, Comparable[]>();
+
+			this.propertyName = suPropertyName;
+			StructuralUnitProperty p = su.getProperty(suPropertyName);
+			this.values = p.getValues();
+			Collections.sort(values);
+
+
+			//int method = 2;
+			//System.out.println("Method: "+method);
+			//long time = System.currentTimeMillis();
+			if (method == 1) { // using CQL to solve matches
+				for (String value : values) {
+					int v = 0;
+					if (groupByTexts) {
+						QueryResult r = corpus.query(new Query("<"+p.getFullName()+"=\""+value+"\">[]"), "tmp", false);
+						v = r.getNMatch();
+						r.drop();
+					} else {
+						QueryResult r = corpus.query(new Query("[_."+p.getFullName()+"=\""+value+"\"] expand to text"), "tmp", false);
+						int t = 0;
+						for (Match m : r.getMatches()) t += m.getLength();
+						v = t;
+						r.drop();
+					}
+					if (v < fMin) fMin=v;
+					if (v > fMax) fMax=v;
+					dataset.put(v, new Comparable[]{p.getName(), value});
+				}
+			} else {
+				AbstractCqiClient CQI = Toolbox.getCqiClient();
+				if (CQI instanceof NetCqiClient) {
+					System.out.println("Error: CQP eval method only available with CQP memory mode");
+					return;
+				}
+
+				String supqn = p.getQualifiedName();
+				int nsup = CQI.attributeSize(supqn);
+
+				ArrayList<Match> sup_limits = new ArrayList<Match>(nsup);
+				for (int i = 0 ; i < nsup ; i++) {
+					int[] l = CQI.struc2Cpos(supqn, i);
+					sup_limits.add(new Match(l[0], l[1]));
+				}
+				//System.out.println("All sup limits are "+sup_limits);
+				List<Match> corpus_matches = corpus.getMatches();
+				//System.out.println("corpus matches: "+corpus_matches);
+				ArrayList<Integer> inter = intersect(corpus_matches, sup_limits);
+				//System.out.println( "No of $sup that covers $corpus: "+inter);
+				int[] structid = new int[inter.size()];
+				for (int i = 0 ; i < structid.length ; i++) structid[i] = inter.get(i);
+
+				String[] inter_values = CQI.struc2Str(supqn, structid);
+				//System.out.println( " with values: "+Arrays.toString(inter_values));
+				HashMap<String, Integer> inter_uniq = new HashMap<String, Integer>();
+
+				if (groupByTexts) {
+					for (String o : inter_values) {
+						if (!inter_uniq.containsKey(o)) {
+							inter_uniq.put(o, 0);
+						}
+						inter_uniq.put(o, inter_uniq.get(o) +1);
+					}
+				} else {
+					for (int imatch = 0 ; imatch < inter.size() ; imatch++) {
+						String o = inter_values[imatch];
+						if (!inter_uniq.containsKey(o)) {
+							inter_uniq.put(o, 0);
+						}
+						int s = sup_limits.get(inter.get(imatch)).getLength();
+						inter_uniq.put(o, inter_uniq.get(o) + s);
+
+					}
+				}
+				Object[] sortedkeys = inter_uniq.keySet().toArray();
+				Arrays.sort(sortedkeys);
+				for (Object k : sortedkeys) {
+					int v = inter_uniq.get(k);
+					if (v < fMin) fMin=v;
+					if (v > fMax) fMax=v;
+					dataset.put(v, new Comparable[]{p.getName(), k.toString()});
+					
+				}
+			}
+		}
+		catch(Exception e) {
+			System.out.println("Error while computing text informations: "+e);
+			e.printStackTrace();
+		}
+	}
+	
+	
+	/**
+	 * 
+	 * @param corpus
+	 * @param structs
+	 * @return
+	 */
+	public static ArrayList<Integer> intersect(List<Match> corpus, List<Match> structs) {
+		int ai=0, bi=0;
+		ArrayList<Integer> result = new ArrayList<Integer>();
+
+		while (ai < corpus.size() && bi < structs.size() ) {
+			if (structs.get(bi).contains(corpus.get(ai))) { 
+				result.add(bi);
+				ai++; 
+			} else if (corpus.get(ai).contains(structs.get(bi))) { 
+				result.add(bi);
+				bi++; 
+			} else { 
+				if (structs.get(bi).getStart() < corpus.get(ai).getStart()) {
+					bi++;
+				} else {
+					ai++;	
+				}
+			} 
+		}
+
+		return result;
+	}
+
+
+	/**
+	 * @return the dataset
+	 */
+	public HashMap<Integer, Comparable[]> getDataset() {
+		return dataset;
+	}
+
+
+	/**
+	 * @return the corpus
+	 */
+	public Corpus getCorpus() {
+		return corpus;
+	}
+
+
+	/**
+	 * @return the propertyName
+	 */
+	public String getPropertyName() {
+		return propertyName;
+	}
+
+
+	/**
+	 * @return the values
+	 */
+	public List<String> getValues() {
+		return values;
+	}
+
+
+	/**
+	 * @return the fMin
+	 */
+	public int getFMin() {
+		return fMin;
+	}
+
+
+	/**
+	 * @return the fMax
+	 */
+	public int getFMax() {
+		return fMax;
+	}
+
+
+	@Override
+	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+
+	@Override
+	public void clean() {
+		// TODO Auto-generated method stub
+		
+	}
+
+
+	@Override
+	public boolean delete() {
+		return this.corpus.removeResult(this);
+	}
+
+
+	@Override
+	public HasResults getParent() {
+		return this.corpus;
+	}
+
+
+	/**
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+	
+	
+}

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

Index: tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/MultipleSpiderWebPlot.java
===================================================================
--- tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/MultipleSpiderWebPlot.java	(revision 0)
+++ tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/MultipleSpiderWebPlot.java	(revision 88)
@@ -0,0 +1,667 @@
+/* ===========================================================
+ * JFreeChart : a free chart library for the Java(tm) platform
+ * ===========================================================
+ *
+ * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors.
+ *
+ * Project Info:  http://www.jfree.org/jfreechart/index.html
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+ * USA.
+ *
+ * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 
+ * Other names may be trademarks of their respective owners.]
+ *
+ * --------------------
+ * MultipleSpiderWebPlot.java
+ * --------------------
+ * (C) Copyright 2004-2013, by Object Refinery Limited.
+ *
+ * Original Author:  David Gilbert (for Object Refinery Limited);
+ * Contributor(s):   Brian Cabana (patch 1943021);
+ *
+ * Changes
+ * -------
+ * 29-Jan-2004 : Version 1 (DG);
+ * 31-Mar-2004 : Added setPieIndex() call during drawing (DG);
+ * 20-Apr-2005 : Small change for update to LegendItem constructors (DG);
+ * 05-May-2005 : Updated draw() method parameters (DG);
+ * 16-Jun-2005 : Added get/setDataset() and equals() methods (DG);
+ * ------------- JFREECHART 1.0.x ---------------------------------------------
+ * 06-Apr-2006 : Fixed bug 1190647 - legend and section colors not consistent
+ *               when aggregation limit is specified (DG);
+ * 27-Sep-2006 : Updated draw() method for deprecated code (DG);
+ * 17-Jan-2007 : Updated prefetchSectionPaints() to check settings in
+ *               underlying SpiderWebPlot (DG);
+ * 17-May-2007 : Added argument check to setPieChart() (DG);
+ * 18-May-2007 : Set dataset for LegendItem (DG);
+ * 18-Apr-2008 : In the constructor, register the plot as a dataset listener -
+ *               see patch 1943021 from Brian Cabana (DG);
+ * 30-Dec-2008 : Added legendItemShape field, and fixed cloning bug (DG);
+ * 09-Jan-2009 : See ignoreNullValues to true for sub-chart (DG);
+ * 01-Jun-2009 : Set series key in getLegendItems() (DG);
+ * 03-Jul-2013 : Use ParamChecks (DG);
+ *
+ */
+
+package org.txm.textsbalance.core.chartsengine.jfreechart;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Paint;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.jfree.chart.ChartRenderingInfo;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.LegendItem;
+import org.jfree.chart.LegendItemCollection;
+import org.jfree.chart.event.PlotChangeEvent;
+import org.jfree.chart.plot.Plot;
+import org.jfree.chart.plot.PlotRenderingInfo;
+import org.jfree.chart.plot.PlotState;
+import org.jfree.chart.plot.SpiderWebPlot;
+import org.jfree.chart.title.TextTitle;
+import org.jfree.chart.util.ParamChecks;
+import org.jfree.data.category.CategoryDataset;
+import org.jfree.data.category.CategoryToPieDataset;
+import org.jfree.data.category.DefaultCategoryDataset;
+import org.jfree.data.general.DatasetChangeEvent;
+import org.jfree.data.general.DatasetUtilities;
+import org.jfree.data.general.PieDataset;
+import org.jfree.io.SerialUtilities;
+import org.jfree.ui.RectangleEdge;
+import org.jfree.ui.RectangleInsets;
+import org.jfree.util.ObjectUtilities;
+import org.jfree.util.PaintUtilities;
+import org.jfree.util.ShapeUtilities;
+import org.jfree.util.TableOrder;
+
+/**
+ * A plot that displays multiple pie plots using data from a
+ * {@link CategoryDataset}.
+ */
+public class MultipleSpiderWebPlot extends Plot implements Cloneable, Serializable {
+
+    /** The chart object that draws the individual pie charts. */
+    private JFreeChart spiderChart;
+
+    /** The dataset. */
+    private DefaultCategoryDataset dataset;
+
+    /** The data extract order (by row or by column). */
+    private TableOrder dataExtractOrder;
+
+    /** The pie section limit percentage. */
+    private double limit = 0.0;
+
+    /**
+     * The key for the aggregated items.
+     *
+     * @since 1.0.2
+     */
+    private Comparable aggregatedItemsKey;
+
+    /**
+     * The paint for the aggregated items.
+     *
+     * @since 1.0.2
+     */
+    private transient Paint aggregatedItemsPaint;
+
+    /**
+     * The colors to use for each section.
+     *
+     * @since 1.0.2
+     */
+    private transient Map sectionPaints;
+
+    /**
+     * The legend item shape (never null).
+     *
+     * @since 1.0.12
+     */
+    private transient Shape legendItemShape;
+
+    /**
+     * Creates a new plot with no data.
+     */
+    public MultipleSpiderWebPlot() {
+        this(null);
+    }
+
+    /**
+     * Creates a new plot.
+     *
+     * @param dataset  the dataset (<code>null</code> permitted).
+     */
+    public MultipleSpiderWebPlot(DefaultCategoryDataset dataset) {
+        super();
+        setDataset(dataset);
+        SpiderWebPlot piePlot = new SpiderWebPlot(null);
+        this.spiderChart = new JFreeChart(piePlot);
+        this.spiderChart.removeLegend();
+        this.dataExtractOrder = TableOrder.BY_COLUMN;
+        this.spiderChart.setBackgroundPaint(null);
+        TextTitle seriesTitle = new TextTitle("Series Title",
+                new Font("SansSerif", Font.BOLD, 12));
+        seriesTitle.setPosition(RectangleEdge.BOTTOM);
+        this.spiderChart.setTitle(seriesTitle);
+        this.aggregatedItemsKey = "Other";
+        this.aggregatedItemsPaint = Color.lightGray;
+        this.sectionPaints = new HashMap();
+        this.legendItemShape = new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0);
+    }
+
+    /**
+     * Returns the dataset used by the plot.
+     *
+     * @return The dataset (possibly <code>null</code>).
+     */
+    public CategoryDataset getDataset() {
+        return this.dataset;
+    }
+
+    /**
+     * Sets the dataset used by the plot and sends a {@link PlotChangeEvent}
+     * to all registered listeners.
+     *
+     * @param dataset  the dataset (<code>null</code> permitted).
+     */
+    public void setDataset(DefaultCategoryDataset dataset) {
+        // if there is an existing dataset, remove the plot from the list of
+        // change listeners...
+        if (this.dataset != null) {
+            this.dataset.removeChangeListener(this);
+        }
+
+        // set the new dataset, and register the chart as a change listener...
+        this.dataset = dataset;
+        if (dataset != null) {
+            setDatasetGroup(dataset.getGroup());
+            dataset.addChangeListener(this);
+        }
+
+        // send a dataset change event to self to trigger plot change event
+        datasetChanged(new DatasetChangeEvent(this, dataset));
+    }
+
+    /**
+     * Returns the pie chart that is used to draw the individual pie plots.
+     * Note that there are some attributes on this chart instance that will
+     * be ignored at rendering time (for example, legend item settings).
+     *
+     * @return The pie chart (never <code>null</code>).
+     *
+     * @see #setPieChart(JFreeChart)
+     */
+    public JFreeChart getPieChart() {
+        return this.spiderChart;
+    }
+
+    /**
+     * Sets the chart that is used to draw the individual pie plots.  The
+     * chart's plot must be an instance of {@link SpiderWebPlot}.
+     *
+     * @param pieChart  the pie chart (<code>null</code> not permitted).
+     *
+     * @see #getPieChart()
+     */
+    public void setPieChart(JFreeChart pieChart) {
+        ParamChecks.nullNotPermitted(pieChart, "pieChart");
+        if (!(pieChart.getPlot() instanceof SpiderWebPlot)) {
+            throw new IllegalArgumentException("The 'pieChart' argument must "
+                    + "be a chart based on a SpiderWebPlot.");
+        }
+        this.spiderChart = pieChart;
+        fireChangeEvent();
+    }
+
+    /**
+     * Returns the data extract order (by row or by column).
+     *
+     * @return The data extract order (never <code>null</code>).
+     */
+    public TableOrder getDataExtractOrder() {
+        return this.dataExtractOrder;
+    }
+
+    /**
+     * Sets the data extract order (by row or by column) and sends a
+     * {@link PlotChangeEvent} to all registered listeners.
+     *
+     * @param order  the order (<code>null</code> not permitted).
+     */
+    public void setDataExtractOrder(TableOrder order) {
+        ParamChecks.nullNotPermitted(order, "order");
+        this.dataExtractOrder = order;
+        fireChangeEvent();
+    }
+
+    /**
+     * Returns the limit (as a percentage) below which small pie sections are
+     * aggregated.
+     *
+     * @return The limit percentage.
+     */
+    public double getLimit() {
+        return this.limit;
+    }
+
+    /**
+     * Sets the limit below which pie sections are aggregated.
+     * Set this to 0.0 if you don't want any aggregation to occur.
+     *
+     * @param limit  the limit percent.
+     */
+    public void setLimit(double limit) {
+        this.limit = limit;
+        fireChangeEvent();
+    }
+
+    /**
+     * Returns the key for aggregated items in the pie plots, if there are any.
+     * The default value is "Other".
+     *
+     * @return The aggregated items key.
+     *
+     * @since 1.0.2
+     */
+    public Comparable getAggregatedItemsKey() {
+        return this.aggregatedItemsKey;
+    }
+
+    /**
+     * Sets the key for aggregated items in the pie plots.  You must ensure
+     * that this doesn't clash with any keys in the dataset.
+     *
+     * @param key  the key (<code>null</code> not permitted).
+     *
+     * @since 1.0.2
+     */
+    public void setAggregatedItemsKey(Comparable key) {
+        ParamChecks.nullNotPermitted(key, "key");
+        this.aggregatedItemsKey = key;
+        fireChangeEvent();
+    }
+
+    /**
+     * Returns the paint used to draw the pie section representing the
+     * aggregated items.  The default value is <code>Color.lightGray</code>.
+     *
+     * @return The paint.
+     *
+     * @since 1.0.2
+     */
+    public Paint getAggregatedItemsPaint() {
+        return this.aggregatedItemsPaint;
+    }
+
+    /**
+     * Sets the paint used to draw the pie section representing the aggregated
+     * items and sends a {@link PlotChangeEvent} to all registered listeners.
+     *
+     * @param paint  the paint (<code>null</code> not permitted).
+     *
+     * @since 1.0.2
+     */
+    public void setAggregatedItemsPaint(Paint paint) {
+        ParamChecks.nullNotPermitted(paint, "paint");
+        this.aggregatedItemsPaint = paint;
+        fireChangeEvent();
+    }
+
+    /**
+     * Returns a short string describing the type of plot.
+     *
+     * @return The plot type.
+     */
+    @Override
+    public String getPlotType() {
+        return "Multiple Pie Plot";
+         // TODO: need to fetch this from localised resources
+    }
+
+    /**
+     * Returns the shape used for legend items.
+     *
+     * @return The shape (never <code>null</code>).
+     *
+     * @see #setLegendItemShape(Shape)
+     *
+     * @since 1.0.12
+     */
+    public Shape getLegendItemShape() {
+        return this.legendItemShape;
+    }
+
+    /**
+     * Sets the shape used for legend items and sends a {@link PlotChangeEvent}
+     * to all registered listeners.
+     *
+     * @param shape  the shape (<code>null</code> not permitted).
+     *
+     * @see #getLegendItemShape()
+     *
+     * @since 1.0.12
+     */
+    public void setLegendItemShape(Shape shape) {
+        ParamChecks.nullNotPermitted(shape, "shape");
+        this.legendItemShape = shape;
+        fireChangeEvent();
+    }
+
+    /**
+     * Draws the plot on a Java 2D graphics device (such as the screen or a
+     * printer).
+     *
+     * @param g2  the graphics device.
+     * @param area  the area within which the plot should be drawn.
+     * @param anchor  the anchor point (<code>null</code> permitted).
+     * @param parentState  the state from the parent plot, if there is one.
+     * @param info  collects info about the drawing.
+     */
+    @Override
+    public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
+            PlotState parentState, PlotRenderingInfo info) {
+
+        // adjust the drawing area for the plot insets (if any)...
+        RectangleInsets insets = getInsets();
+        insets.trim(area);
+        drawBackground(g2, area);
+        drawOutline(g2, area);
+
+        // check that there is some data to display...
+        if (DatasetUtilities.isEmptyOrNull(this.dataset)) {
+            drawNoDataMessage(g2, area);
+            return;
+        }
+
+        int pieCount;
+        if (this.dataExtractOrder == TableOrder.BY_ROW) {
+            pieCount = this.dataset.getRowCount();
+        }
+        else {
+            pieCount = this.dataset.getColumnCount();
+        }
+
+        // the columns variable is always >= rows
+        int displayCols = (int) Math.ceil(Math.sqrt(pieCount));
+        int displayRows
+            = (int) Math.ceil((double) pieCount / (double) displayCols);
+
+        // swap rows and columns to match plotArea shape
+        if (displayCols > displayRows && area.getWidth() < area.getHeight()) {
+            int temp = displayCols;
+            displayCols = displayRows;
+            displayRows = temp;
+        }
+
+        prefetchSectionPaints();
+
+        int x = (int) area.getX();
+        int y = (int) area.getY();
+        int width = ((int) area.getWidth()) / displayCols;
+        int height = ((int) area.getHeight()) / displayRows;
+        int row = 0;
+        int column = 0;
+        int diff = (displayRows * displayCols) - pieCount;
+        int xoffset = 0;
+        Rectangle rect = new Rectangle();
+
+        for (int pieIndex = 0; pieIndex < pieCount; pieIndex++) {
+            rect.setBounds(x + xoffset + (width * column), y + (height * row),
+                    width, height);
+
+            String title;
+            if (this.dataExtractOrder == TableOrder.BY_ROW) {
+                title = this.dataset.getRowKey(pieIndex).toString();
+            }
+            else {
+                title = this.dataset.getColumnKey(pieIndex).toString();
+            }
+            this.spiderChart.setTitle(title);
+
+            DefaultCategoryDataset piedataset = new DefaultCategoryDataset();
+            for (int irow = 0 ; irow < this.dataset.getRowCount() ; irow++) {
+            	this.dataset.getValue(irow, pieIndex);
+            }
+            
+            SpiderWebPlot piePlot = (SpiderWebPlot) this.spiderChart.getPlot();
+            piePlot.setDataset(piedataset);
+            
+
+            ChartRenderingInfo subinfo = null;
+            if (info != null) {
+                subinfo = new ChartRenderingInfo();
+            }
+            this.spiderChart.draw(g2, rect, subinfo);
+            if (info != null) {
+                assert subinfo != null;
+                info.getOwner().getEntityCollection().addAll(
+                        subinfo.getEntityCollection());
+                info.addSubplotInfo(subinfo.getPlotInfo());
+            }
+
+            ++column;
+            if (column == displayCols) {
+                column = 0;
+                ++row;
+
+                if (row == displayRows - 1 && diff != 0) {
+                    xoffset = (diff * width) / 2;
+                }
+            }
+        }
+
+    }
+
+    /**
+     * For each key in the dataset, check the <code>sectionPaints</code>
+     * cache to see if a paint is associated with that key and, if not,
+     * fetch one from the drawing supplier.  These colors are cached so that
+     * the legend and all the subplots use consistent colors.
+     */
+    private void prefetchSectionPaints() {
+
+//        // pre-fetch the colors for each key...this is because the subplots
+//        // may not display every key, but we need the coloring to be
+//        // consistent...
+//
+//        SpiderWebPlot piePlot = (SpiderWebPlot) getPieChart().getPlot();
+//
+//        if (this.dataExtractOrder == TableOrder.BY_ROW) {
+//            // column keys provide potential keys for individual pies
+//            for (int c = 0; c < this.dataset.getColumnCount(); c++) {
+//                Comparable key = this.dataset.getColumnKey(c);
+//                Paint p = piePlot.getSeriesPaint(key);
+//                if (p == null) {
+//                    p = (Paint) this.sectionPaints.get(key);
+//                    if (p == null) {
+//                        p = getDrawingSupplier().getNextPaint();
+//                    }
+//                }
+//                this.sectionPaints.put(key, p);
+//            }
+//        }
+//        else {
+//            // row keys provide potential keys for individual pies
+//            for (int r = 0; r < this.dataset.getRowCount(); r++) {
+//                Comparable key = this.dataset.getRowKey(r);
+//                Paint p = piePlot.getSeriesPaint(key);
+//                if (p == null) {
+//                    p = (Paint) this.sectionPaints.get(key);
+//                    if (p == null) {
+//                        p = getDrawingSupplier().getNextPaint();
+//                    }
+//                }
+//                this.sectionPaints.put(key, p);
+//            }
+//        }
+
+    }
+
+    /**
+     * Returns a collection of legend items for the pie chart.
+     *
+     * @return The legend items.
+     */
+    @Override
+    public LegendItemCollection getLegendItems() {
+
+        LegendItemCollection result = new LegendItemCollection();
+        if (this.dataset == null) {
+            return result;
+        }
+
+        List keys = null;
+        prefetchSectionPaints();
+        if (this.dataExtractOrder == TableOrder.BY_ROW) {
+            keys = this.dataset.getColumnKeys();
+        }
+        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
+            keys = this.dataset.getRowKeys();
+        }
+        if (keys == null) {
+            return result;
+        }
+        int section = 0;
+        Iterator iterator = keys.iterator();
+        while (iterator.hasNext()) {
+            Comparable key = (Comparable) iterator.next();
+            String label = key.toString();  // TODO: use a generator here
+            String description = label;
+            Paint paint = (Paint) this.sectionPaints.get(key);
+            LegendItem item = new LegendItem(label, description, null,
+                    null, getLegendItemShape(), paint,
+                    Plot.DEFAULT_OUTLINE_STROKE, paint);
+            item.setSeriesKey(key);
+            item.setSeriesIndex(section);
+            item.setDataset(getDataset());
+            result.add(item);
+            section++;
+        }
+        if (this.limit > 0.0) {
+            LegendItem a = new LegendItem(this.aggregatedItemsKey.toString(),
+                    this.aggregatedItemsKey.toString(), null, null,
+                    getLegendItemShape(), this.aggregatedItemsPaint,
+                    Plot.DEFAULT_OUTLINE_STROKE, this.aggregatedItemsPaint);
+            result.add(a);
+        }
+        return result;
+    }
+
+    /**
+     * Tests this plot for equality with an arbitrary object.  Note that the
+     * plot's dataset is not considered in the equality test.
+     *
+     * @param obj  the object (<code>null</code> permitted).
+     *
+     * @return <code>true</code> if this plot is equal to <code>obj</code>, and
+     *     <code>false</code> otherwise.
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (!(obj instanceof MultipleSpiderWebPlot)) {
+            return false;
+        }
+        MultipleSpiderWebPlot that = (MultipleSpiderWebPlot) obj;
+        if (this.dataExtractOrder != that.dataExtractOrder) {
+            return false;
+        }
+        if (this.limit != that.limit) {
+            return false;
+        }
+        if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) {
+            return false;
+        }
+        if (!PaintUtilities.equal(this.aggregatedItemsPaint,
+                that.aggregatedItemsPaint)) {
+            return false;
+        }
+        if (!ObjectUtilities.equal(this.spiderChart, that.spiderChart)) {
+            return false;
+        }
+        if (!ShapeUtilities.equal(this.legendItemShape, that.legendItemShape)) {
+            return false;
+        }
+        if (!super.equals(obj)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Returns a clone of the plot.
+     *
+     * @return A clone.
+     *
+     * @throws CloneNotSupportedException if some component of the plot does
+     *         not support cloning.
+     */
+    @Override
+    public Object clone() throws CloneNotSupportedException {
+        MultipleSpiderWebPlot clone = (MultipleSpiderWebPlot) super.clone();
+        clone.spiderChart = (JFreeChart) this.spiderChart.clone();
+        clone.sectionPaints = new HashMap(this.sectionPaints);
+        clone.legendItemShape = ShapeUtilities.clone(this.legendItemShape);
+        return clone;
+    }
+
+    /**
+     * Provides serialization support.
+     *
+     * @param stream  the output stream.
+     *
+     * @throws IOException  if there is an I/O error.
+     */
+    private void writeObject(ObjectOutputStream stream) throws IOException {
+        stream.defaultWriteObject();
+        SerialUtilities.writePaint(this.aggregatedItemsPaint, stream);
+        SerialUtilities.writeShape(this.legendItemShape, stream);
+    }
+
+    /**
+     * Provides serialization support.
+     *
+     * @param stream  the input stream.
+     *
+     * @throws IOException  if there is an I/O error.
+     * @throws ClassNotFoundException  if there is a classpath problem.
+     */
+    private void readObject(ObjectInputStream stream)
+        throws IOException, ClassNotFoundException {
+        stream.defaultReadObject();
+        this.aggregatedItemsPaint = SerialUtilities.readPaint(stream);
+        this.legendItemShape = SerialUtilities.readShape(stream);
+        this.sectionPaints = new HashMap();
+    }
+
+}

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

Index: tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/JFCBalanceSpiderChartCreator.java
===================================================================
--- tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/JFCBalanceSpiderChartCreator.java	(revision 0)
+++ tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/JFCBalanceSpiderChartCreator.java	(revision 88)
@@ -0,0 +1,84 @@
+package org.txm.textsbalance.core.chartsengine.jfreechart;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.labels.CategoryToolTipGenerator;
+import org.jfree.chart.plot.SpiderWebPlot;
+import org.jfree.data.category.CategoryDataset;
+import org.jfree.data.category.DefaultCategoryDataset;
+import org.txm.chartsengine.core.ChartsEngine;
+import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
+import org.txm.chartsengine.jfreechart.core.themes.base.Theme;
+import org.txm.textsbalance.core.functions.TextsBalance;
+
+public class JFCBalanceSpiderChartCreator extends JFCChartCreator {
+
+	public JFCBalanceSpiderChartCreator() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public JFreeChart createChart(Object resultData, String preferencesNode) {
+
+		final TextsBalance balance = (TextsBalance) resultData;
+		
+		HashMap<Integer, Comparable[]> data = balance.getDataset();
+		
+		
+		JFreeChart chart = null;
+
+		DefaultCategoryDataset dataset = new DefaultCategoryDataset();
+		
+		Set<Integer> keys = data.keySet();
+		Iterator<Integer> it = keys.iterator();
+		while (it.hasNext()){
+		   int key = it.next();
+		   Comparable[] value = data.get(key);
+		   dataset.addValue(key, value[0], value[1]);
+		}
+		
+		
+		SpiderWebPlot plot = new SpiderWebPlot(dataset);
+		plot.setToolTipGenerator(new CategoryToolTipGenerator() {
+			@Override
+			public String generateToolTip(CategoryDataset dataset, int row, int col) {
+				// FIXME: tests
+//				System.out.println("JFCBalanceSpiderChartCreator.createChart(...).new CategoryToolTipGenerator() {...}.generateToolTip() row = " + row + " col = " + col);
+//				System.out.println("JFCBalanceSpiderChartCreator.createChart(...).new CategoryToolTipGenerator() {...}.generateToolTip() " + dataset.getValue(row, col));
+				
+//				if(balance.getValues().size() > col)	{
+//					 balance.getValues().get(col);
+//				}
+//				return "error";
+				return String.valueOf(dataset.getValue(row, col).intValue());
+			}
+		});
+
+
+		chart = new JFreeChart(plot);
+		chart.setTitle("metadata = " + balance.getPropertyName() + ", N = " +  balance.getValues().size() + ", fmin = " + balance.getFMin() + ", fmax = " + balance.getFMax());
+
+		// FIXME: tests
+		//this.getChartsEngine().getTheme().apply(chart);
+//		this.getChartsEngine().getTheme().applyThemeToChart(chart, ChartsEngine.RENDERING_GRAYSCALE_MODE);
+		
+		return chart;
+		
+	}
+
+
+	@Override
+	public Class getResultDataClass() {
+		return TextsBalance.class;
+	}
+
+
+
+
+
+	
+
+}

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

Index: tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/r/RBalanceSpiderChartCreator.java
===================================================================
--- tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/r/RBalanceSpiderChartCreator.java	(revision 0)
+++ tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/r/RBalanceSpiderChartCreator.java	(revision 88)
@@ -0,0 +1,91 @@
+package org.txm.textsbalance.core.chartsengine.r;
+
+import java.io.File;
+
+import org.txm.chartsengine.r.core.RChartCreator;
+import org.txm.chartsengine.r.core.RChartsEngine;
+import org.txm.textsbalance.core.functions.TextsBalance;
+
+public class RBalanceSpiderChartCreator extends RChartCreator {
+
+	public RBalanceSpiderChartCreator() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@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) {
+		
+//		try {
+	
+			
+//			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+//	System.out.println("load wordcloud...");
+//			rw.eval("library(wordcloud)"); //$NON-NLS-1$
+			//System.out.println("tmpfreqs...");
+//			rw.addVectorToWorkspace("tmpfreqs", wordCloud.getFreqs()); //$NON-NLS-1$
+			//System.out.println("tmplabels...");
+//			rw.addVectorToWorkspace("tmplabels", wordCloud.getLabels()); //$NON-NLS-1$
+			
+			//wordcloud(words,freq,
+			// scale : A vector of length 2 indicating the range of the size of the words.
+			// min.freq:  words with frequency below min.freq will not be plotted
+			// max.words : Maximum number of words to be plotted. least frequent terms dropped
+			// random.order : plot words in random order. If false, they will be plotted in decreasing frequency
+			// random.color : choose colors randomly from the colors. If false, the color is chosen based on the frequency
+			// rot.per : proportion words with 90 degree rotation
+			// colors : color words from least to most frequent
+			// ordered.colors : if true, then colors are assigned to words in order
+			//System.out.println("wordcloud...");
+			
+			// FIXME : stars plot tests
+			//String cmd = "stars(mtcars[, 1:7], key.loc = c(14, 2), main = \"Motor Trend Cars : stars(*, full = F)\", full = FALSE)"; //$NON-NLS-1$
+			String cmd = "stars(USJudgeRatings, locations = c(0, 0), scale = FALSE, radius  =  FALSE, col.stars = 1:10, key.loc = c(0, 0), main = \"US Judges rated\")";
+			//String cmd = "stars(cbind(1:16, 10*(16:1)), draw.segments = TRUE, main = \"A Joke -- do *not* use symbols on 2D data!\")";
+			
+			
+
+			//rw.plot(file, cmd, ((RChartsEngine) this.chartsEngine).getRDevice());
+			
+			((RChartsEngine) this.chartsEngine).plot(file, cmd);
+			
+				//System.out.println("cleaning");
+//				rw.eval("rm(tmplabels)"); //$NON-NLS-1$
+//				rw.eval("rm(tmpfreqs)"); //$NON-NLS-1$
+//		}
+//		catch(RWorkspaceException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//		catch(REXPMismatchException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//		catch(StatException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+		
+		return file;
+	}
+
+	
+	@Override
+	// FIXME: to not load the chart creator, to remove when implemented 
+	public Class getChartsEngineClass() {
+		return null;
+	}
+	
+	@Override
+	public Class getResultDataClass() {
+		return TextsBalance.class;
+	}
+
+
+
+}

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

Index: tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/preferences/TextsBalancePreferences.java
===================================================================
--- tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/preferences/TextsBalancePreferences.java	(revision 0)
+++ tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/preferences/TextsBalancePreferences.java	(revision 88)
@@ -0,0 +1,53 @@
+package org.txm.textsbalance.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;
+
+/**
+ * Preferences initializer and manager.
+ * @author sjacquot
+ *
+ */
+public class TextsBalancePreferences extends TXMPreferences {
+
+
+	// auto populate the preference node qualifier from the current bundle id
+	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(TextsBalancePreferences.class).getSymbolicName();
+
+	
+	public static final String PREFERENCES_PREFIX = "texts_balance_"; //$NON-NLS-1$
+	
+	public static final String GROUP_BY_WORDS = PREFERENCES_PREFIX + "count_by_words"; //$NON-NLS-1$
+	public static final String METHOD = PREFERENCES_PREFIX + "method"; //$NON-NLS-1$
+	
+	// local result preferences
+	public static final String STRUCTURAL_UNIT = PREFERENCES_PREFIX + "structural_unit"; //$NON-NLS-1$
+	public static final String STRUCTURAL_UNIT_PROPERTY_INDEX = PREFERENCES_PREFIX + "structural_unit_property_index"; //$NON-NLS-1$
+	
+	
+	public TextsBalancePreferences() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public void initializeDefaultPreferences() {
+
+		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
+		preferences.putBoolean(GROUP_BY_WORDS, true);
+		preferences.putInt(METHOD, 2);
+		
+		preferences.put(STRUCTURAL_UNIT, "text");
+		preferences.putInt(STRUCTURAL_UNIT_PROPERTY_INDEX, 0);
+
+		// shared charts rendering preferences
+		super.initializeChartsEngineSharedPreferences(preferences);
+	}
+	
+	
+
+}
+
+

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

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

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

Index: tmp/org.txm.synopticeditor.feature/.project
===================================================================
--- tmp/org.txm.synopticeditor.feature/.project	(revision 0)
+++ tmp/org.txm.synopticeditor.feature/.project	(revision 88)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.synopticeditor.feature</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.FeatureBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.FeatureNature</nature>
+	</natures>
+</projectDescription>

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

Index: tmp/org.txm.synopticeditor.feature/build.properties
===================================================================
--- tmp/org.txm.synopticeditor.feature/build.properties	(revision 0)
+++ tmp/org.txm.synopticeditor.feature/build.properties	(revision 88)
@@ -0,0 +1 @@
+bin.includes = feature.xml

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

Index: tmp/org.txm.synopticeditor.feature/feature.xml
===================================================================
--- tmp/org.txm.synopticeditor.feature/feature.xml	(revision 0)
+++ tmp/org.txm.synopticeditor.feature/feature.xml	(revision 88)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="SynopticEditor.feature"
+      label="Edition"
+      version="1.0.0.qualifier"
+      provider-name="Textometrie.org">
+
+   <description url="http://www.example.com/description">
+      Edition editor for multi-edition corpora
+   </description>
+
+   <copyright url="http://www.example.com/copyright">
+      TXM 0.7.8 BETA
+Copyright © 2013-2016 ENS de Lyon, University of Franche-Comté.
+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
+   </copyright>
+
+   <license url="">
+      &lt;TXM Software User Agreement&gt;
+
+TXM 0.7.8 Copyright © 2010-2016 ENS de Lyon, University of Franche-Comté, CNRS
+
+&lt;English version below&gt;
+
+EN ACCEPTANT CETTE MISE À JOUR ET EN UTILISANT TXM, VOUS VOUS ENGAGEZ À CITER L&apos;ARTICLE DE RÉFÉRENCE DE LA PLATEFORME* DANS VOS PUBLICATIONS DE RÉSULTATS OBTENUS À PARTIR D&apos;ELLE. CELA EST ESSENTIEL POUR NOUS PERMETTRE DE JUSTIFIER LE BESOIN DE PÉRENNISATION DE CET INSTRUMENT DE TRAVAIL POUR LA COMMUNAUTÉ SCIENTIFIQUE.
+
+Le logiciel TXM est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier suivant les termes de la Licence publique générale GNU telle que publiée par la Free Software Foundation, soit la version 2 de cette License, soit une version ultérieure.
+
+Le logiciel TXM est distribué dans l&apos;espoir qu&apos;il sera utile, mais sans aucune garantie, y compris mais non de façon limitative les garanties implicites de qualité marchande et de convenance à un usage particulier. Consultez la version 2 et la version 3 de la Licence publique générale GNU pour plus de détails.
+
+Vous devriez avoir reçu une copie de la Licence publique générale GNU en accompagnement du logiciel TXM ; si ce n&apos;est pas le cas, veuillez consulter la page http://www.gnu.org/licenses/gpl-2.0.html.
+_______________
+* Serge Heiden, Jean-Philippe Magué, Bénédicte Pincemin.
+TXM : Une plateforme logicielle open-source pour la textométrie - conception et développement. Sergio Bolasco, Isabella Chiari, Luca Giuliano. 10th International Conference on the Statistical Analysis of Textual Data - JADT 2010, Jun 2010, Rome, Italie.
+Edizioni Universitarie di Lettere Economia Diritto, 2 (3), pp.1021-1032, 2010. &lt;halshs-00549779&gt;
+
+
+ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH
+
+
+By accepting this update and by using TXM, you agree to cite the TXM platform reference article** in your publications of results obtained from it. That is essential for us to justify the need for sustainability of this instrument for the scientific community.
+
+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/gpl-2.0.html.
+_______________
+** Serge Heiden. The TXM Platform: Building Open-Source Textual
+Analysis Software Compatible with the TEI Encoding Scheme. Ryo Otoguro, Kiyoshi Ishikawa, Hiroshi Umemoto, Kei Yoshimoto and Yasunari Harada. 24th Pacific Asia Conference on Language, Information and Computation, Nov 2010, Sendai, Japan. Institute for Digital Enhancement of Cognitive Development, Waseda University, pp.389-398, 2010. &lt;halshs-00549764&gt;
+   </license>
+
+   <requires>
+      <import plugin="org.eclipse.ui"/>
+      <import plugin="org.eclipse.core.runtime"/>
+      <import plugin="org.txm.rcp" version="0.7.5" match="greaterOrEqual"/>
+      <import plugin="org.txm.core" version="0.7.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.ui.browser" version="3.4.100" match="greaterOrEqual"/>
+   </requires>
+
+   <plugin
+         id="SynopticEditorRCP"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+</feature>

Property changes on: tmp/org.txm.synopticeditor.feature/feature.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

