Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/SwingChartComposite.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/SwingChartComposite.java	(revision 2049)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/SwingChartComposite.java	(revision 2050)
@@ -42,11 +42,12 @@
 
 /**
  * Base chart composite with Swing/AWT support.
- * This composite uses the SWT/AWT bridge to add some Swing/AWT chart component.
+ * This composite uses the SWT_AWT bridge to add some Swing/AWT chart components through an AWT Frame.
  * 
  * @author sjacquot
  *
  */
+// FIXME: SJ: this class contains a lot of tests to fix the SWT/AWT focus bugs and need a full clean up
 public abstract class SwingChartComposite extends ChartComposite {
 	
 	
@@ -100,15 +101,8 @@
 		// stops the conflict between AWT and SWT events that freezes the SWT Spinner, TextFields, etc.
 		// (Progression query, Specificities chart banality, etc.)
 		// see: http://forge.cbp.ens-lyon.fr/redmine/issues/2548
-		if(OSDetector.isFamilyUnix()
-				//&& (chartEditor.getClass().getName().equals("org.txm.progression.rcp.editors.ProgressionEditor") //$NON-NLS-1$
-//				|| chartEditor.getClass().getName().equals("org.txm.specificities.rcp.editors.SpecificitiesSelectionEditor") //$NON-NLS-1$
-//				|| chartEditor.getClass().getName().equals("org.txm.ca.rcp.editors.CAFactorialMapChartEditor") //$NON-NLS-1$
-			//	)
-			)	{
-//			Log.finest("SwingChartComposite.SwingChartComposite(): Temporary Linux bug workaround: AWT focusable window state set to false.");
-			//this.frame.setFocusableWindowState(false);
-		this.frame.setAutoRequestFocus(false);
+		if(OSDetector.isFamilyUnix())	{
+			this.frame.setAutoRequestFocus(false);
 		}
 		
 		
@@ -117,6 +111,45 @@
 		this.rootPanel.setBackground(Color.WHITE);
 		this.rootPanel.setBorder(new LineBorder(Color.WHITE, 1));
 		
+
+		// Change the border of the root panel to show to user the chart is focused
+		this.frame.addWindowFocusListener(new WindowFocusListener() {
+			
+			@Override
+			public void windowLostFocus(WindowEvent e) {
+				((JComponent) rootPanel).setBorder(new LineBorder(Color.WHITE, 1));
+			}
+			
+			@Override
+			public void windowGainedFocus(WindowEvent e) {
+				((JComponent) rootPanel).setBorder(new LineBorder(Color.GRAY, 1));
+			
+				// FIXME: SJ: SWT/AWT focus bugs thread tests, need to wait to see how SWT/AWT bugs will be fixed before removing this
+//				getDisplay().asyncExec(new Runnable() {
+//					@Override
+//					public void run() {
+//
+//						//SwingChartComposite.this.notifyListeners(SWT.MouseDown, SWTChartsComponentsProvider.swingEventToSWT(chartEditor.getComposite(), swingComponent, e, SWT.MouseDown));
+//						
+//						// FIXME: Debug
+////						System.out.println("SWTChartsComponentProvider.initializeAWTDelegationListeners(...).new MouseListener() {...}.mousePressed(...).new Runnable() {...}.run()");
+//						// Activate the editor part on AWT mouse pressed event
+//						//SwingChartComposite.this.chartEditor.activate();
+//						//chartEditor.getShell().setFocus();
+////						chartEditor.setFocus();
+//						//chartEditor.getParent().setFocus();
+////						chartEditor.forceFocus();
+//						SwingChartComposite.this.chartEditor.setFocus();
+//						//notifyListeners(SWT.FocusIn, null); // Needed to force the composite listener to handle the focus event
+//					}
+//				});
+//				
+				
+				
+			}
+		});
+		
+
 		 // FIXME: SJ: temporary workaround to Linux focus bugs
 		// part #1: release the focus at mouse exited on the rootPanel, needed for empty charts, eg. Progression
 		// it breaks all the key events in charts (zoom, pan, selection, etc.) but 
@@ -177,298 +210,7 @@
 			});
 		}
 		
-		// SJ: Workaround to fix a bug with some Java version and some OS where the focus of an embedded Swing component does not delegate to SWT, eg. the Part is not activated.
-		// After some tests, doesn't seem to work on Linux and Mac
-		// see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=377104
-		// see: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8203855
-//		this.frame.addWindowListener(new java.awt.event.WindowAdapter() {
-//			@Override
-//			public void windowActivated(java.awt.event.WindowEvent e) {
-//				SwingChartComposite.this.getDisplay().asyncExec(new Runnable() {
-//					@Override
-//					public void run() {
-//						if (Display.getCurrent().getFocusControl() == SwingChartComposite.this) {
-//							Stack<Control> stack = new Stack<Control>();
-//							Control starter = SwingChartComposite.this;
-//							Shell shell = SwingChartComposite.this.getShell();
-//							while (starter != null && !(starter instanceof Shell)) {
-//								stack.push(starter.getParent());
-//								starter = starter.getParent();
-//							}
-//
-//							Method m = null;
-//							try {
-//								// instead of calling the originally proposed
-//								// workaround solution (below),
-//								//
-//								// Event event = new Event();
-//								// event.display = Display.getCurrent();
-//								// event.type = SWT.Activate;
-//								// event.widget = stack.pop();
-//								// event.widget.notifyListeners(SWT.Activate, event);
-//								//
-//								// which should but does NOT set the active
-//								// widget/control on the shell, we had
-//								// to call the setActiveControl method directly.
-//								// Updating the active control on the shell is
-//								// important so that the last active
-//								// control, when selected again, get the proper
-//								// activation events fired.
-//
-//								m = shell.getClass().getDeclaredMethod("setActiveControl", Control.class);// $NON-NLS-1$
-//								m.setAccessible(true);
-//								while (!stack.isEmpty()) {
-//									m.invoke(shell, stack.pop());
-//								}
-//								
-//								// force the Swing component focus
-//								//setFocus();
-//								
-//							}
-//							catch (Exception e) {
-//								Log.severe("** Embedded part was not able to set active control on Shell. This will result in other workbench parts not getting activated."); //$NON-NLS-1$
-//								Log.printStackTrace(e);
-//							}
-//							finally {
-//								if (m != null) {
-//									m.setAccessible(false);
-//								}
-//							}
-//						}
-//					}
-//				});
-//			}
-//		});
 		
-		this.frame.addWindowListener(new WindowListener() {
-			
-			@Override
-			public void windowOpened(WindowEvent e) {
-				// TODO Auto-generated method stub
-				
-			}
-			
-			@Override
-			public void windowIconified(WindowEvent e) {
-				// TODO Auto-generated method stub
-				
-			}
-			
-			@Override
-			public void windowDeiconified(WindowEvent e) {
-				// TODO Auto-generated method stub
-				
-			}
-			
-			@Override
-			public void windowDeactivated(WindowEvent e) {
-				// TODO Auto-generated method stub
-				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowListener() {...}.windowDeactivated()");
-			}
-			
-			@Override
-			public void windowClosing(WindowEvent e) {
-				// TODO Auto-generated method stub
-				
-			}
-			
-			@Override
-			public void windowClosed(WindowEvent e) {
-				// TODO Auto-generated method stub
-				
-			}
-			
-			@Override
-			public void windowActivated(WindowEvent e) {
-				// TODO Auto-generated method stub
-				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowListener() {...}.windowActivated()");
-			}
-		});
-
-
-		
-		// FIXME: For Swing focus debug tests
-		this.frame.addWindowFocusListener(new WindowFocusListener() {
-			
-			@Override
-			public void windowLostFocus(WindowEvent e) {
-				// TODO Auto-generated method stub
-				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowLostFocus()");
-				
-				// FIXME: For Swing focus debug tests
-				//if(RCPPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER))	{
-				((JComponent) rootPanel).setBorder(new LineBorder(Color.WHITE, 1));
-					//((JComponent) rootPanel).setBorder(javax.swing.BorderFactory.createEmptyBorder());
-				//}
-
-				
-			}
-			
-			@Override
-			public void windowGainedFocus(WindowEvent e) {
-				// TODO Auto-generated method stub
-				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowGainedFocus()");
-				
-				// FIXME: For Swing focus debug tests
-				//if(RCPPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER))	{
-					((JComponent) rootPanel).setBorder(new LineBorder(Color.GRAY, 1));
-				//}
-				
-//				// SWT thread
-//				getDisplay().asyncExec(new Runnable() {
-//					@Override
-//					public void run() {
-//
-//						//SwingChartComposite.this.notifyListeners(SWT.MouseDown, SWTChartsComponentsProvider.swingEventToSWT(chartEditor.getComposite(), swingComponent, e, SWT.MouseDown));
-//						
-//						// FIXME: Debug
-////						System.out.println("SWTChartsComponentProvider.initializeAWTDelegationListeners(...).new MouseListener() {...}.mousePressed(...).new Runnable() {...}.run()");
-//						// Activate the editor part on AWT mouse pressed event
-//						//SwingChartComposite.this.chartEditor.activate();
-//						//chartEditor.getShell().setFocus();
-////						chartEditor.setFocus();
-//						//chartEditor.getParent().setFocus();
-////						chartEditor.forceFocus();
-//						SwingChartComposite.this.chartEditor.setFocus();
-//						//notifyListeners(SWT.FocusIn, null); // Needed to force the composite listener to handle the focus event
-//					}
-//				});
-//				
-				
-				
-			}
-		});
-		
-		
-		
-		this.frame.addFocusListener(new FocusListener() {
-			
-			@Override
-			public void focusLost(FocusEvent e) {
-				// TODO Auto-generated method stub
-				Log.finest("SwingChartComposite.SwingChartComposite(...).new FocusListener() {...}.focusLost()");
-			}
-			
-			@Override
-			public void focusGained(FocusEvent e) {
-				// TODO Auto-generated method stub
-				Log.finest("SwingChartComposite.SwingChartComposite(...).new FocusListener() {...}.focusGained()");
-			}
-		});
-
-		
-//		this.frame.addWindowFocusListener(new WindowFocusListener() {
-//			
-//			@Override
-//			public void windowLostFocus(WindowEvent e) {
-//				// TODO Auto-generated method stub
-//				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowLostFocus()");
-//				
-//				// Force the keep the focus if the ChartEditor has the focus
-//				if(!SwingChartComposite.this.isDisposed())	{
-//					SwingChartComposite.this.getDisplay().asyncExec(new Runnable() {
-//						@Override
-//						public void run() {
-//							if (Display.getCurrent().getFocusControl() == SwingChartComposite.this) {
-//								Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowLostFocus(): force focus in chart component.");
-//								requestFocusInChartComponent();
-//							}
-//						}
-//					});
-//				}
-//				
-//				
-//				
-//				// FIXME: For Swing focus debug tests
-//				if(RCPPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER))	{
-//					((JComponent) rootPanel).setBorder(javax.swing.BorderFactory.createEmptyBorder());
-//				}
-//
-//				
-//			}
-//			
-//			@Override
-//			public void windowGainedFocus(WindowEvent e) {
-//				
-//				// FIXME: For Swing focus debug tests
-//				if(RCPPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER))	{
-//					((JComponent) rootPanel).setBorder(new LineBorder(Color.red, 1));
-//				}
-//
-//				
-//				// TODO Auto-generated method stub
-//				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowGainedFocus()");
-//				
-//				
-//				SwingChartComposite.this.getDisplay().asyncExec(new Runnable() {
-//					@Override
-//					public void run() {
-//						if (
-//								Display.getCurrent().getFocusControl() == SwingChartComposite.this
-//								//&&
-//								//SwingChartComposite.this.chartEditor.getContextActivationToken() == null
-////								SwingChartComposite.this.chartEditor != PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()
-//								) {
-//							
-//							Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowGainedFocus(): activate the EditorPart.");
-//							
-//							Stack<Control> stack = new Stack<Control>();
-//							Control starter = SwingChartComposite.this;
-//							Shell shell = SwingChartComposite.this.getShell();
-//							while (starter != null && !(starter instanceof Shell)) {
-//								stack.push(starter.getParent());
-//								starter = starter.getParent();
-//							}
-//
-//							Method m = null;
-//							try {
-//								// instead of calling the originally proposed
-//								// workaround solution (below),
-//								//
-////								 Event event = new Event();
-////								 event.display = Display.getCurrent();
-////								 event.type = SWT.Activate;
-////								 event.widget = stack.pop();
-////								 event.widget.notifyListeners(SWT.Activate, event);
-//								//
-//								// which should but does NOT set the active
-//								// widget/control on the shell, we had
-//								// to call the setActiveControl method directly.
-//								// Updating the active control on the shell is
-//								// important so that the last active
-//								// control, when selected again, get the proper
-//								// activation events fired.
-//
-//								//PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(SwingChartComposite.this.chartEditor);
-//								
-//								m = shell.getClass().getDeclaredMethod("setActiveControl", Control.class);// $NON-NLS-1$
-//								m.setAccessible(true);
-//								while (!stack.isEmpty()) {
-//									m.invoke(shell, stack.pop());
-//								}
-//								
-//								// force the Swing component focus
-//								//setFocus();
-//								
-//							}
-//							catch (Exception e) {
-//								Log.severe("** Embedded part was not able to set active control on Shell. This will result in other workbench parts not getting activated."); //$NON-NLS-1$
-//								Log.printStackTrace(e);
-//							}
-//							finally {
-//								if (m != null) {
-//									m.setAccessible(false);
-//								}
-//							}
-//						}
-//					}
-//				});
-//				
-//			}
-//		});
-		
-		
-		
 	}
 
 	
@@ -787,6 +529,388 @@
 			}
 		});
 
+		
+		// internal method to help tracking the focus events of frame and components to fix SWT/AWT bridge focus bugs
+//		this.debug_initSWTAWTBridgeFocusBugsTests();
+		
+
+
+		
+
+	}
+
+
+	// FIXME: SJ: some code here should be moved to the parent class ChartComposite
+	@Override
+	public void loadChart()	{
+		
+		// loads the chart from the result
+		Object chart = this.chartEditor.getChart();
+		
+		if(chart != null) {
+			
+			// creates components if they not exist
+			if(this.chartComponent == null) {
+
+				// recreates the chart if not of right type
+				if(this.chartEditor.getResult().isChartDirty())	{
+					try {
+						this.chartEditor.getResult().clearLastRenderingParameters();
+						this.chartEditor.getResult().compute();
+					}
+					catch (Exception e) {
+						e.printStackTrace();
+					}
+				}
+
+				this.createChartComponent();
+				
+				this.rootPanel.add((Component) this.chartComponent);
+				
+				this.frame.setVisible(true);
+			}
+			this.loadChart(this.chartEditor.getChart());
+		}
+	}
+	
+	
+
+
+	
+	@Override
+	public void copyChartViewToClipboard() {
+		
+		int w = ((Component) this.chartComponent).getWidth();
+		int h = ((Component) this.chartComponent).getHeight();
+		final BufferedImage bufferedImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+		Graphics2D g = bufferedImg.createGraphics();
+		
+		
+		((Component) this.chartComponent).paint(g);
+		
+		Transferable img = new Transferable() {
+			
+			@Override
+			public boolean isDataFlavorSupported(DataFlavor flavor) {
+				return DataFlavor.imageFlavor.equals(flavor);
+			}
+			
+			@Override
+			public DataFlavor[] getTransferDataFlavors() {
+				return new DataFlavor[] {DataFlavor.imageFlavor};
+			}
+			
+			@Override
+			public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
+				if(!DataFlavor.imageFlavor.equals(flavor))					    {
+					throw new UnsupportedFlavorException(flavor);
+				}
+				return bufferedImg;
+			}
+
+		};
+		
+		Toolkit.getDefaultToolkit().getSystemClipboard().setContents(img, null);
+		
+	}
+
+	
+	
+	@Override
+	public EventCallBackHandler getMouseCallBackHandler() {
+		return super.getMouseCallBackHandler((Component) this.chartComponent);
+	}
+
+
+	@Override
+	public EventCallBackHandler getKeyCallBackHandler() {
+		return super.getKeyCallBackHandler((Component) this.chartComponent);
+	}
+
+
+	/**
+	 * Converts an AWT event to SWT event. Also stores the Swing tool tip source text of the specified Swing component in the SWT event to give it to the SWT composite listener in <code>ChartComposite</code>.
+	 * @param swtComposite
+	 * @param swingComponent
+	 * @param e
+	 * @param eventType
+	 * @return
+	 */
+	// FIXME : SJ: this method is incomplete and not used ATM but may becomes useful later, need to wait to see how the SWT/AWT focus bugs will be fixed
+	public static org.eclipse.swt.widgets.Event swingEventToSWT(Composite swtComposite, JComponent swingComponent, AWTEvent e, int eventType)	{
+
+		Event event = new Event();
+		if(!swtComposite.isDisposed())	{
+			event.display = swtComposite.getDisplay();
+		}
+		event.widget = swtComposite;
+		event.type = eventType;
+
+		if(e instanceof MouseEvent)	{
+			MouseEvent me = (MouseEvent) e;
+			event.button = me.getButton();
+			try {
+				// Store the Swing tool tip source text in the SWT event to give it to the SWT composite listener in ChartComposite
+				// NOTE: this method call sometimes throws a java.lang.IndexOutOfBoundsException
+				event.text = swingComponent.getToolTipText(me);
+			}
+			catch(Exception e1) {
+				//e1.printStackTrace();
+			}
+			event.x = me.getX();
+			event.y = me.getY();
+		}
+		return event;
+	}
+
+	
+	/**
+	 * Internal method to help tracking the focus events of frame and components to fix SWT/AWT bridge focus bugs.
+	 */
+	// FIXME: SJ: please keep this method ATM
+	protected void debug_initSWTAWTBridgeFocusBugsTests()	{
+		
+		
+		this.frame.addFocusListener(new FocusListener() {
+			
+			@Override
+			public void focusLost(FocusEvent e) {
+				// TODO Auto-generated method stub
+				Log.finest("SwingChartComposite.SwingChartComposite(...).new FocusListener() {...}.focusLost()");
+			}
+			
+			@Override
+			public void focusGained(FocusEvent e) {
+				// TODO Auto-generated method stub
+				Log.finest("SwingChartComposite.SwingChartComposite(...).new FocusListener() {...}.focusGained()");
+			}
+		});
+
+		
+		
+		// SJ: Workaround to fix a bug with some Java version and some OS where the focus of an embedded Swing component does not delegate to SWT, eg. the Part is not activated.
+		// After some tests, doesn't seem to work on Linux and Mac
+		// see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=377104
+		// see: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8203855
+//		this.frame.addWindowListener(new java.awt.event.WindowAdapter() {
+//			@Override
+//			public void windowActivated(java.awt.event.WindowEvent e) {
+//				SwingChartComposite.this.getDisplay().asyncExec(new Runnable() {
+//					@Override
+//					public void run() {
+//						if (Display.getCurrent().getFocusControl() == SwingChartComposite.this) {
+//							Stack<Control> stack = new Stack<Control>();
+//							Control starter = SwingChartComposite.this;
+//							Shell shell = SwingChartComposite.this.getShell();
+//							while (starter != null && !(starter instanceof Shell)) {
+//								stack.push(starter.getParent());
+//								starter = starter.getParent();
+//							}
+//
+//							Method m = null;
+//							try {
+//								// instead of calling the originally proposed
+//								// workaround solution (below),
+//								//
+//								// Event event = new Event();
+//								// event.display = Display.getCurrent();
+//								// event.type = SWT.Activate;
+//								// event.widget = stack.pop();
+//								// event.widget.notifyListeners(SWT.Activate, event);
+//								//
+//								// which should but does NOT set the active
+//								// widget/control on the shell, we had
+//								// to call the setActiveControl method directly.
+//								// Updating the active control on the shell is
+//								// important so that the last active
+//								// control, when selected again, get the proper
+//								// activation events fired.
+//
+//								m = shell.getClass().getDeclaredMethod("setActiveControl", Control.class);// $NON-NLS-1$
+//								m.setAccessible(true);
+//								while (!stack.isEmpty()) {
+//									m.invoke(shell, stack.pop());
+//								}
+//								
+//								// force the Swing component focus
+//								//setFocus();
+//								
+//							}
+//							catch (Exception e) {
+//								Log.severe("** Embedded part was not able to set active control on Shell. This will result in other workbench parts not getting activated."); //$NON-NLS-1$
+//								Log.printStackTrace(e);
+//							}
+//							finally {
+//								if (m != null) {
+//									m.setAccessible(false);
+//								}
+//							}
+//						}
+//					}
+//				});
+//			}
+//		});
+		
+		this.frame.addWindowListener(new WindowListener() {
+			
+			@Override
+			public void windowOpened(WindowEvent e) {
+				// TODO Auto-generated method stub
+				
+			}
+			
+			@Override
+			public void windowIconified(WindowEvent e) {
+				// TODO Auto-generated method stub
+				
+			}
+			
+			@Override
+			public void windowDeiconified(WindowEvent e) {
+				// TODO Auto-generated method stub
+				
+			}
+			
+			@Override
+			public void windowDeactivated(WindowEvent e) {
+				// TODO Auto-generated method stub
+				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowListener() {...}.windowDeactivated()");
+			}
+			
+			@Override
+			public void windowClosing(WindowEvent e) {
+				// TODO Auto-generated method stub
+				
+			}
+			
+			@Override
+			public void windowClosed(WindowEvent e) {
+				// TODO Auto-generated method stub
+				
+			}
+			
+			@Override
+			public void windowActivated(WindowEvent e) {
+				// TODO Auto-generated method stub
+				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowListener() {...}.windowActivated()");
+			}
+		});
+
+
+
+		
+//		this.frame.addWindowFocusListener(new WindowFocusListener() {
+//			
+//			@Override
+//			public void windowLostFocus(WindowEvent e) {
+//				// TODO Auto-generated method stub
+//				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowLostFocus()");
+//				
+//				// Force the keep the focus if the ChartEditor has the focus
+//				if(!SwingChartComposite.this.isDisposed())	{
+//					SwingChartComposite.this.getDisplay().asyncExec(new Runnable() {
+//						@Override
+//						public void run() {
+//							if (Display.getCurrent().getFocusControl() == SwingChartComposite.this) {
+//								Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowLostFocus(): force focus in chart component.");
+//								requestFocusInChartComponent();
+//							}
+//						}
+//					});
+//				}
+//				
+//				
+//				
+//				// FIXME: For Swing focus debug tests
+//				if(RCPPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER))	{
+//					((JComponent) rootPanel).setBorder(javax.swing.BorderFactory.createEmptyBorder());
+//				}
+//
+//				
+//			}
+//			
+//			@Override
+//			public void windowGainedFocus(WindowEvent e) {
+//				
+//				// FIXME: For Swing focus debug tests
+//				if(RCPPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER))	{
+//					((JComponent) rootPanel).setBorder(new LineBorder(Color.red, 1));
+//				}
+//
+//				
+//				// TODO Auto-generated method stub
+//				Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowGainedFocus()");
+//				
+//				
+//				SwingChartComposite.this.getDisplay().asyncExec(new Runnable() {
+//					@Override
+//					public void run() {
+//						if (
+//								Display.getCurrent().getFocusControl() == SwingChartComposite.this
+//								//&&
+//								//SwingChartComposite.this.chartEditor.getContextActivationToken() == null
+////								SwingChartComposite.this.chartEditor != PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()
+//								) {
+//							
+//							Log.finest("SwingChartComposite.SwingChartComposite(...).new WindowFocusListener() {...}.windowGainedFocus(): activate the EditorPart.");
+//							
+//							Stack<Control> stack = new Stack<Control>();
+//							Control starter = SwingChartComposite.this;
+//							Shell shell = SwingChartComposite.this.getShell();
+//							while (starter != null && !(starter instanceof Shell)) {
+//								stack.push(starter.getParent());
+//								starter = starter.getParent();
+//							}
+//
+//							Method m = null;
+//							try {
+//								// instead of calling the originally proposed
+//								// workaround solution (below),
+//								//
+////								 Event event = new Event();
+////								 event.display = Display.getCurrent();
+////								 event.type = SWT.Activate;
+////								 event.widget = stack.pop();
+////								 event.widget.notifyListeners(SWT.Activate, event);
+//								//
+//								// which should but does NOT set the active
+//								// widget/control on the shell, we had
+//								// to call the setActiveControl method directly.
+//								// Updating the active control on the shell is
+//								// important so that the last active
+//								// control, when selected again, get the proper
+//								// activation events fired.
+//
+//								//PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(SwingChartComposite.this.chartEditor);
+//								
+//								m = shell.getClass().getDeclaredMethod("setActiveControl", Control.class);// $NON-NLS-1$
+//								m.setAccessible(true);
+//								while (!stack.isEmpty()) {
+//									m.invoke(shell, stack.pop());
+//								}
+//								
+//								// force the Swing component focus
+//								//setFocus();
+//								
+//							}
+//							catch (Exception e) {
+//								Log.severe("** Embedded part was not able to set active control on Shell. This will result in other workbench parts not getting activated."); //$NON-NLS-1$
+//								Log.printStackTrace(e);
+//							}
+//							finally {
+//								if (m != null) {
+//									m.setAccessible(false);
+//								}
+//							}
+//						}
+//					}
+//				});
+//				
+//			}
+//		});
+		
+		
+		
 //		// Swing component focus delegation to the SWT chart composite
 //		swingComponent.addFocusListener(new FocusListener() {
 //			
@@ -839,10 +963,8 @@
 //		});
 //		
 
-		
 
 
-
 		// SWT
 
 		// SWT Tooltips tests
@@ -970,132 +1092,8 @@
 
 
 
-	}
-
-
-	// FIXME: SJ: some code here should be moved to the parent class ChartComposite
-	@Override
-	public void loadChart()	{
 		
-		// loads the chart from the result
-		Object chart = this.chartEditor.getChart();
-		
-		if(chart != null) {
-			
-			// creates components if they not exist
-			if(this.chartComponent == null) {
-
-				// recreates the chart if not of right type
-				if(this.chartEditor.getResult().isChartDirty())	{
-					try {
-						this.chartEditor.getResult().clearLastRenderingParameters();
-						this.chartEditor.getResult().compute();
-					}
-					catch (Exception e) {
-						e.printStackTrace();
-					}
-				}
-
-				this.createChartComponent();
-				
-				this.rootPanel.add((Component) this.chartComponent);
-				
-				this.frame.setVisible(true);
-			}
-			this.loadChart(this.chartEditor.getChart());
-		}
 	}
 	
 	
-
-
-	
-	@Override
-	public void copyChartViewToClipboard() {
-		
-		int w = ((Component) this.chartComponent).getWidth();
-		int h = ((Component) this.chartComponent).getHeight();
-		final BufferedImage bufferedImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
-		Graphics2D g = bufferedImg.createGraphics();
-		
-		
-		((Component) this.chartComponent).paint(g);
-		
-		Transferable img = new Transferable() {
-			
-			@Override
-			public boolean isDataFlavorSupported(DataFlavor flavor) {
-				return DataFlavor.imageFlavor.equals(flavor);
-			}
-			
-			@Override
-			public DataFlavor[] getTransferDataFlavors() {
-				return new DataFlavor[] {DataFlavor.imageFlavor};
-			}
-			
-			@Override
-			public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
-				if(!DataFlavor.imageFlavor.equals(flavor))					    {
-					throw new UnsupportedFlavorException(flavor);
-				}
-				return bufferedImg;
-			}
-
-		};
-		
-		Toolkit.getDefaultToolkit().getSystemClipboard().setContents(img, null);
-		
-	}
-
-	
-	
-	@Override
-	public EventCallBackHandler getMouseCallBackHandler() {
-		return super.getMouseCallBackHandler((Component) this.chartComponent);
-	}
-
-
-	@Override
-	public EventCallBackHandler getKeyCallBackHandler() {
-		return super.getKeyCallBackHandler((Component) this.chartComponent);
-	}
-
-
-	/**
-	 * Converts an AWT event to SWT event. Also stores the Swing tool tip source text of the specified Swing component in the SWT event to give it to the SWT composite listener in <code>ChartComposite</code>.
-	 * @param swtComposite
-	 * @param swingComponent
-	 * @param e
-	 * @param eventType
-	 * @return
-	 */
-	// TODO : SJ: this method is incomplete
-	public static org.eclipse.swt.widgets.Event swingEventToSWT(Composite swtComposite, JComponent swingComponent, AWTEvent e, int eventType)	{
-
-		Event event = new Event();
-		if(!swtComposite.isDisposed())	{
-			event.display = swtComposite.getDisplay();
-		}
-		event.widget = swtComposite;
-		event.type = eventType;
-
-		if(e instanceof MouseEvent)	{
-			MouseEvent me = (MouseEvent) e;
-			event.button = me.getButton();
-			try {
-				// Store the Swing tool tip source text in the SWT event to give it to the SWT composite listener in ChartComposite
-				// NOTE: this method call sometimes throws a java.lang.IndexOutOfBoundsException
-				event.text = swingComponent.getToolTipText(me);
-			}
-			catch(Exception e1) {
-				//e1.printStackTrace();
-			}
-			event.x = me.getX();
-			event.y = me.getY();
-		}
-		return event;
-	}
-
-	
-	
 }
