Index: tmp/org.txm.chartsengine.graphstream.core/plugin.xml
===================================================================
--- tmp/org.txm.chartsengine.graphstream.core/plugin.xml	(revision 0)
+++ tmp/org.txm.chartsengine.graphstream.core/plugin.xml	(revision 901)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.txm.chartsengine.chartsengine">
+      <ChartsEngine
+            class="org.txm.chartsengine.graphstream.core.GSChartsEngine"
+            description="GraphStream"
+            name="graphstream_charts_engine">
+      </ChartsEngine>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.txm.chartsengine.graphstream.core.preferences.GSChartsEnginePreferences">
+      </initializer>
+   </extension>
+</plugin>

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

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

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

Index: tmp/org.txm.chartsengine.graphstream.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.chartsengine.graphstream.core/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.chartsengine.graphstream.core/META-INF/MANIFEST.MF	(revision 901)
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: GraphStream Charts Engine Core
+Bundle-SymbolicName: org.txm.chartsengine.graphstream.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Textometrie.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.txm.libs.graphstream;bundle-version="1.3.0";visibility:=reexport,
+ org.eclipse.core.runtime;visibility:=reexport,
+ org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.core;visibility:=reexport
+Export-Package: org.txm.chartsengine.graphstream.core,
+ org.txm.chartsengine.graphstream.core.preferences

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

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

Index: tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartsEngine.java
===================================================================
--- tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartsEngine.java	(revision 0)
+++ tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartsEngine.java	(revision 901)
@@ -0,0 +1,130 @@
+/**
+ * 
+ */
+package org.txm.chartsengine.graphstream.core;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.txm.chartsengine.core.ChartsEngine;
+import org.txm.chartsengine.graphstream.core.preferences.GSChartsEnginePreferences;
+import org.txm.core.preferences.TXMPreferences;
+
+/**
+ * GraphStream charts engine.
+ * @author sjacquot
+ *
+ */
+public class GSChartsEngine extends ChartsEngine {
+
+	
+	/**
+	 * Constants for extra output formats.
+	 */
+	public final static String OUTPUT_FORMAT_GRAPHSTREAM = "GraphStream/Java2D"; //$NON-NLS-1$
+
+
+	/**
+	 * The charts engine internal name.
+	 */
+	public final static String NAME = "graphstream_charts_engine"; //$NON-NLS-1$
+
+	/**
+	 * The charts engine description.
+	 */
+	public final static String DESCRIPTION = "GraphStream/Java2D";
+
+	
+	
+	/**
+	 * Creates a GraphStream charts engine with output format from the preferences.
+	 */
+	public GSChartsEngine() {
+		this(TXMPreferences.getString(GSChartsEnginePreferences.OUTPUT_FORMAT, GSChartsEnginePreferences.PREFERENCE_NODE));
+	}
+	
+
+	/**
+	 * Creates a GraphStream charts engine with the specified output format.
+	 * @param outputFormat
+	 */
+	public GSChartsEngine(String outputFormat) {
+		super(DESCRIPTION, outputFormat);
+	}
+
+	
+
+
+	/* (non-Javadoc)
+	 * @see org.txm.core.engines.Engine#getName()
+	 */
+	@Override
+	public String getName() {
+		return GSChartsEngine.NAME;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.core.engines.Engine#getState()
+	 */
+	@Override
+	public boolean isRunning() {
+		// TODO Auto-generated method stub
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.core.engines.Engine#start(org.eclipse.core.runtime.IProgressMonitor)
+	 */
+	@Override
+	public boolean start(IProgressMonitor monitor) throws Exception {
+		// TODO Auto-generated method stub
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.core.engines.Engine#stop()
+	 */
+	@Override
+	public boolean stop() throws Exception {
+		// TODO Auto-generated method stub
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.chartsengine.core.ChartsEngine#createChartFile(java.lang.Object, java.io.File)
+	 */
+	@Override
+	public File createChartFile(Object chart, File file) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.txm.chartsengine.core.ChartsEngine#exportChart(java.lang.Object, java.io.File, java.lang.String, int, int, int, int, int, int)
+	 */
+	@Override
+	public File exportChart(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+
+	@Override
+	public ArrayList<String> getSupportedOutputDisplayFormats() {
+		ArrayList<String> formats = new ArrayList<String>(1);
+		
+		formats.add(OUTPUT_FORMAT_GRAPHSTREAM);
+		
+		return formats;
+	}
+
+
+	@Override
+	public ArrayList<String> getSupportedOutputFileFormats() {
+		ArrayList<String> formats = new ArrayList<String>(1);
+		return formats;
+
+	}
+
+}

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

Index: tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartCreator.java
===================================================================
--- tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartCreator.java	(revision 0)
+++ tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/GSChartCreator.java	(revision 901)
@@ -0,0 +1,131 @@
+package org.txm.chartsengine.graphstream.core;
+
+import java.io.File;
+
+import org.graphstream.graph.Graph;
+import org.txm.chartsengine.core.ChartCreator;
+import org.txm.chartsengine.core.results.ChartResult;
+
+
+
+/**
+ * GraphStream base chart creator.
+ * 
+ * All GSC charts creators should extend this class.
+ * The updateChart(ChartResult result) method implementation of the subclasses must call super.update(result) to benefit to the shared system. 
+ * 
+ * @author sjacquot
+ *
+ */
+public abstract class GSChartCreator extends ChartCreator {
+
+	
+	
+	@Override
+	public void updateChart(ChartResult result) {
+		// Java object
+		if(result.getChart() instanceof Graph)	{
+			Graph graph = (Graph) result.getChart();
+			
+			
+			// FIXME: Debug
+			System.out.println("GSChartCreator.updateChart() style sheet dump: " + graph.getAttribute("ui.stylesheet"));
+			
+			// Add the current shared preferences as Font size, etc.
+			graph.addAttribute("ui.stylesheet", graph.getAttribute("ui.stylesheet") + "node {"
+					+ " text-size: " + result.getFont().split("\\|")[2] + ";" 
+					+ " text-font: \"" + result.getFont().split("\\|")[1] + "\";" 
+							
+							+ " }");
+
+			// FIXME: Debug
+			System.out.println("GSChartCreator.updateChart() style sheet dump: " + graph.getAttribute("ui.stylesheet"));
+
+			
+			
+			
+			
+			
+			
+			
+			
+			
+//			// freeze rendering
+//			chart.setNotify(false);
+//
+//			
+//			// applying full theme 
+//			if(applyTheme)	{
+//				this.getChartsEngine().getJFCTheme().applyThemeToChart(result);
+//			}
+//
+//			
+//			// rendering color mode
+//			this.getChartsEngine().getJFCTheme().applySeriesPaint(result);
+//
+//			// multiple line strokes
+//			this.getChartsEngine().getJFCTheme().applySeriesStrokes(result);
+//
+//			// title visibility
+//			if(chart.getTitle() != null && result.hasParameterChanged(ChartsEnginePreferences.SHOW_TITLE))	{
+//				chart.getTitle().setVisible(result.isTitleVisible());
+//			}
+//			// legend visibility
+//			if(chart.getLegend() != null && result.hasParameterChanged(ChartsEnginePreferences.SHOW_LEGEND))	{
+//				chart.getLegend().setVisible(result.isLegendVisible());
+//			}
+//			// CategoryPlot
+//			if(chart.getPlot() instanceof CategoryPlot)	{
+//				CategoryPlot plot = (CategoryPlot) chart.getPlot();
+//				// grid visibility
+//				plot.setDomainGridlinesVisible(result.isGridVisible());
+//				plot.setRangeGridlinesVisible(result.isGridVisible());
+//				
+//				// force the renderer initialization to override theme settings
+//				if(plot.getRenderer() instanceof IRendererWithItemSelection)	{
+//					((IRendererWithItemSelection) plot.getRenderer()).init();
+//				}
+//			}
+//			// XYPlot
+//			else if(chart.getPlot() instanceof XYPlot)	{
+//				XYPlot plot = (XYPlot) chart.getPlot();
+//				// grid visibility
+//				plot.setRangeGridlinesVisible(result.isGridVisible());
+//				plot.setDomainGridlinesVisible(result.isGridVisible());
+//				
+//				// force the renderer initialization to override theme settings
+//				if(plot.getRenderer() instanceof IRendererWithItemSelection)	{
+//					((IRendererWithItemSelection) plot.getRenderer()).init();
+//				}
+//			}
+//			
+//			chart.setNotify(true);
+		}
+		// File
+		else if(result.getChart() instanceof File)	{
+			// creates a new chart but using the same file
+			this.createChartFile(result, (File)result.getChart());
+				
+			// FIXME: using new file
+			//this.createChartFile(result, preferencesNode);
+				
+		}
+	}
+	
+
+
+
+	@Override
+	public Class getChartsEngineClass() {
+		return GSChartsEngine.class;
+	}
+	
+	/**
+	 * Convenience method.
+	 * @return the casted charts engine.
+	 */
+	protected GSChartsEngine getChartsEngine()	{
+		return (GSChartsEngine) this.chartsEngine;
+	}
+	
+}

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

Index: tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/preferences/GSChartsEnginePreferences.java
===================================================================
--- tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/preferences/GSChartsEnginePreferences.java	(revision 0)
+++ tmp/org.txm.chartsengine.graphstream.core/src/org/txm/chartsengine/graphstream/core/preferences/GSChartsEnginePreferences.java	(revision 901)
@@ -0,0 +1,41 @@
+package org.txm.chartsengine.graphstream.core.preferences;
+
+
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.service.prefs.Preferences;
+import org.txm.chartsengine.graphstream.core.GSChartsEngine;
+import org.txm.core.preferences.TXMPreferences;
+
+/**
+ * Preferences initializer and manager.
+ * 
+ * @author sjacquot
+ *
+ */
+public class GSChartsEnginePreferences extends TXMPreferences {
+
+
+	public static final String PREFERENCE_NODE = FrameworkUtil.getBundle(GSChartsEnginePreferences.class).getSymbolicName();
+	
+	
+	public final static String PREFERENCES_PREFIX = GSChartsEngine.NAME + "_";
+	
+	
+	public static final String OUTPUT_FORMAT = PREFERENCES_PREFIX + "output_format"; //$NON-NLS-1$
+	
+	
+	/**
+	 * 
+	 */
+	public GSChartsEnginePreferences() {
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public void initializeDefaultPreferences() {
+		Preferences defaultPreferences = DefaultScope.INSTANCE.getNode(PREFERENCE_NODE);
+		defaultPreferences.put(OUTPUT_FORMAT, GSChartsEngine.OUTPUT_FORMAT_GRAPHSTREAM);
+	}
+	
+}

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

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

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

