Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/stats/CAStyleMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/stats/CAStyleMacro.groovy	(revision 3177)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/stats/CAStyleMacro.groovy	(revision 3178)
@@ -1,5 +1,5 @@
 // STANDARD DECLARATIONS
-// @author mdecorde sheiden sjacquot
+// @author mdecorde sjacquot sheiden
 package org.txm.macro
 
 import org.kohsuke.args4j.*
@@ -258,191 +258,188 @@
 
 
 
-// UPDATE THE CHART RENDERER
-
+// Redefine the chart renderer and update the chart
 def chartEditor = editor.getEditors()[0]
-	def chartComposite = chartEditor.getComposite()
-	
-	ddebug = debug
-	monitor.syncExec( new Runnable() {
-	
-		public void run() {
-			println chartComposite
-			def chart = chartEditor.getChart()
+def chartComposite = chartEditor.getComposite()
+
+ddebug = debug
+monitor.syncExec( new Runnable() {
+
+	public void run() {
+		println chartComposite
+		def chart = chartEditor.getChart()
+		
+		/*
+		println "chart: "+chart
+		println "Plot: "+chart.getPlot()
+		println "Dataset: "+chart.getPlot().getDataset()
+		println "Renderer 1: "+chart.getPlot().getRenderer()
+		 */
+		
+		def renderer = new CAItemSelectionRenderer(ica, chart) {
+			Area EMPTYAREA = new Area()
+					
+					@Override
+					public void initItemLabelGenerator() {
+					XYItemLabelGenerator generator = new XYItemLabelGenerator() {
+					
+					@Override
+					public String generateLabel(XYDataset dataset, int series, int item) {
+						if (series == 0 && rowHiddenStyle.contains(item)) {
+							if (ddebug > 1) println "HIDDING ROW LABEL '$item' '${rows[item]}'"
+							return ""
+						} else if (series == 1 && colHiddenStyle.contains(item)) {
+							if (ddebug > 1) println "HIDDING COL LABEL '$item' '${cols[item]}'"
+							return ""
+						} else if (series == 0 && rowLabelStyle.containsKey(item)) {
+							if (ddebug > 1) println "RENAME ROW LABEL '$item' '${rows[item]}' -> '${rowLabelStyle[item]}'"
+							return rowLabelStyle[item]
+						} else if (series == 1 && colLabelStyle.containsKey(item)) {
+							if (ddebug > 1) println "RENAME COL LABEL '$item' '${cols[item]}' -> '${colLabelStyle[item]}'"
+							return colLabelStyle[item]
+						} else {
+							CAXYDataset caDataset = (CAXYDataset) dataset;
+							return caDataset.getLabel(series, item);
+						}
+					}
+				};
+				
+				// don't use setBaseItemLabelGenerator BUT setDefaultItemLabelGenerator
+				this.setDefaultItemLabelGenerator(generator);
+				this.setDefaultItemLabelsVisible(true);
+			}
 			
-			/*
-			println "chart: "+chart
-			println "Plot: "+chart.getPlot()
-			println "Dataset: "+chart.getPlot().getDataset()
-			println "Renderer 1: "+chart.getPlot().getRenderer()
-			 */
 			
-			def renderer = new CAItemSelectionRenderer(ica, chart) {
-				Area EMPTYAREA = new Area()
-						
-						@Override
-						public void initItemLabelGenerator() {
-						XYItemLabelGenerator generator = new XYItemLabelGenerator() {
-						
-						@Override
-						public String generateLabel(XYDataset dataset, int series, int item) {
-							if (series == 0 && rowHiddenStyle.contains(item)) {
-								if (ddebug > 1) println "HIDDING ROW LABEL '$item' '${rows[item]}'"
-								return ""
-							} else if (series == 1 && colHiddenStyle.contains(item)) {
-								if (ddebug > 1) println "HIDDING COL LABEL '$item' '${cols[item]}'"
-								return ""
-							} else if (series == 0 && rowLabelStyle.containsKey(item)) {
-								if (ddebug > 1) println "RENAME ROW LABEL '$item' '${rows[item]}' -> '${rowLabelStyle[item]}'"
-								return rowLabelStyle[item]
-							} else if (series == 1 && colLabelStyle.containsKey(item)) {
-								if (ddebug > 1) println "RENAME COL LABEL '$item' '${cols[item]}' -> '${colLabelStyle[item]}'"
-								return colLabelStyle[item]
-							} else {
-								CAXYDataset caDataset = (CAXYDataset) dataset;
-								return caDataset.getLabel(series, item);
-							}
-						}
-					};
-					
-					// don't use setBaseItemLabelGenerator BUT setDefaultItemLabelGenerator
-					this.setDefaultItemLabelGenerator(generator);
-					this.setDefaultItemLabelsVisible(true);
+			
+			@Override
+			public Font getItemLabelFont(int series, int item) {
+				Font d = super.getItemLabelFont(series, item);
+				Integer style = d.getStyle();
+				Integer size = d.getSize();
+				String family = d.getFontName();
+				
+				// size
+				if (series == 0 && rowFontSizeStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX ROW FONT-SIZE $item ${rows[item]} -> ${rowFontSizeStyle[item]}"
+					size *= rowFontSizeStyle[item];
+				} else if (series == 1 && colFontSizeStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX COL FONT-SIZE $item ${cols[item]} -> ${colFontSizeStyle[item]}"
+					size *= colFontSizeStyle[item];
 				}
 				
+				// family
+				if (series == 0 && rowFontFamilyStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX ROW FONT-Family $item ${rows[item]} -> ${rowFontFamilyStyle[item]}"
+					family = rowFontFamilyStyle[item];
+				} else if (series == 1 && colFontFamilyStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX COL FONT-Family $item ${cols[item]} -> ${colFontFamilyStyle[item]}"
+					family = colFontFamilyStyle[item];
+				}
 				
+				// style
+				if (series == 0 && rowFontStyleStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX ROW FONT-Style $item ${rows[item]} -> ${rowFontStyleStyle[item]}"
+					style = rowFontStyleStyle[item];
+				} else if (series == 1 && colFontFamilyStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX COL FONT-Style $item ${cols[item]} -> ${colFontStyleStyle[item]}"
+					style = colFontStyleStyle[item];
+				}
 				
-				@Override
-				public Font getItemLabelFont(int series, int item) {
-					Font d = super.getItemLabelFont(series, item);
-					Integer style = d.getStyle();
-					Integer size = d.getSize();
-					String family = d.getFontName();
+				
+				return new Font(family, style, size);
+			}
+			
+			
+			@Override
+			public Shape getItemShape(int series, int item) {
+				// Rows (series == 0), Cols (series == 1)
+				if (series == 0 && rowHiddenStyle.contains(item)) {
+					return EMPTYAREA;
+				} else if (series == 1 && colHiddenStyle.contains(item)) {
+					return EMPTYAREA;
+				} else {
 					
-					// size
-					if (series == 0 && rowFontSizeStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX ROW FONT-SIZE $item ${rows[item]} -> ${rowFontSizeStyle[item]}"
-						size *= rowFontSizeStyle[item];
-					} else if (series == 1 && colFontSizeStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX COL FONT-SIZE $item ${cols[item]} -> ${colFontSizeStyle[item]}"
-						size *= colFontSizeStyle[item];
-					}
+					Shape shape =  super.getItemShape(series, item);
 					
-					// family
-					if (series == 0 && rowFontFamilyStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX ROW FONT-Family $item ${rows[item]} -> ${rowFontFamilyStyle[item]}"
-						family = rowFontFamilyStyle[item];
-					} else if (series == 1 && colFontFamilyStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX COL FONT-Family $item ${cols[item]} -> ${colFontFamilyStyle[item]}"
-						family = colFontFamilyStyle[item];
+					// not-visible shapes mode
+					if(!((CA) this.multipleItemsSelector.getResult()).isShowPointShapes())        {
+						return shape;
 					}
 					
-					// style
-					if (series == 0 && rowFontStyleStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX ROW FONT-Style $item ${rows[item]} -> ${rowFontStyleStyle[item]}"
-						style = rowFontStyleStyle[item];
-					} else if (series == 1 && colFontFamilyStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX COL FONT-Style $item ${cols[item]} -> ${colFontStyleStyle[item]}"
-						style = colFontStyleStyle[item];
+					// shape replacement
+					if (series == 0 && rowPointShapeStyle.containsKey(item)) {
+						if (ddebug > 1) println "FIX ROW SHAPE $item ${rows[item]} -> ${rowPointShapeStyle[item]}"
+						shape = rowPointShapeStyle.get(item);
+					} else if (series == 1 && colPointShapeStyle.containsKey(item)) {
+						if (ddebug > 1) println "FIX COL SHAPE $item ${cols[item]} -> ${colPointShapeStyle[item]}"
+						shape = colPointShapeStyle.get(item);
 					}
 					
 					
-					return new Font(family, style, size);
-				}
-				
-				
-				@Override
-				public Shape getItemShape(int series, int item) {
-					// Rows (series == 0), Cols (series == 1)
-					if (series == 0 && rowHiddenStyle.contains(item)) {
-						return EMPTYAREA;
-					} else if (series == 1 && colHiddenStyle.contains(item)) {
-						return EMPTYAREA;
-					} else {
-						
-						Shape shape =  super.getItemShape(series, item);
-						
-						// not-visible shapes mode
-						if(!((CA) this.multipleItemsSelector.getResult()).isShowPointShapes())        {
-							return shape;
-						}
-						
-						// shape replacement
-						if (series == 0 && rowPointShapeStyle.containsKey(item)) {
-							if (ddebug > 1) println "FIX ROW SHAPE $item ${rows[item]} -> ${rowPointShapeStyle[item]}"
-							shape = rowPointShapeStyle.get(item);
-						} else if (series == 1 && colPointShapeStyle.containsKey(item)) {
-							if (ddebug > 1) println "FIX COL SHAPE $item ${cols[item]} -> ${colPointShapeStyle[item]}"
-							shape = colPointShapeStyle.get(item);
-						}
-						
-						
-						// shape scaling
-						AffineTransform t = new AffineTransform();
-						if (series == 0 && rowPointSizeStyle.containsKey(item)) {
-							if (ddebug > 1) println "FIX ROW POINT SIZE $item ${rows[item]} -> ${rowPointSizeStyle[item]}"
-							t.setToScale(rowPointSizeStyle.get(item), rowPointSizeStyle.get(item));
-							shape = t.createTransformedShape(shape);
-						} else if (series == 1 && colPointSizeStyle.containsKey(item)) {
-							if (ddebug > 1) println "FIX COL POINT SIZE $item ${cols[item]} -> ${colPointSizeStyle[item]}"
-							t.setToScale(colPointSizeStyle.get(item), colPointSizeStyle.get(item));
-							shape = t.createTransformedShape(shape);
-						}
-						
-						return shape;
+					// shape scaling
+					AffineTransform t = new AffineTransform();
+					if (series == 0 && rowPointSizeStyle.containsKey(item)) {
+						if (ddebug > 1) println "FIX ROW POINT SIZE $item ${rows[item]} -> ${rowPointSizeStyle[item]}"
+						t.setToScale(rowPointSizeStyle.get(item), rowPointSizeStyle.get(item));
+						shape = t.createTransformedShape(shape);
+					} else if (series == 1 && colPointSizeStyle.containsKey(item)) {
+						if (ddebug > 1) println "FIX COL POINT SIZE $item ${cols[item]} -> ${colPointSizeStyle[item]}"
+						t.setToScale(colPointSizeStyle.get(item), colPointSizeStyle.get(item));
+						shape = t.createTransformedShape(shape);
 					}
-				}
-				
-				
-				@Override
-				public Paint getItemPaint(int series, int item) {
 					
-					// visible shapes mode
-					if (!((CA) this.multipleItemsSelector.getResult()).isShowPointShapes()) {
-						return super.getItemPaint(series, item);
-					}
-					
-					if (series == 0 && rowPointColorStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX ROW POINT COLOR $item ${rows[item]} -> ${rowPointColorStyle[item]}"
-						return rowPointColorStyle.get(item);
-					} else if (series == 1 && colPointColorStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX COL POINT COLOR $item ${cols[item]} -> ${colPointColorStyle[item]}"
-						return colPointColorStyle.get(item);
-					}
-					else {
-						return super.getItemPaint(series, item);
-					}
+					return shape;
 				}
+			}
+			
+			
+			@Override
+			public Paint getItemPaint(int series, int item) {
 				
-				
-				@Override
-				public Paint getItemLabelPaint(int series, int item) {
-					if (series == 0 && rowFontColorStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX ROW LABEL COLOR $item ${rows[item]} -> ${rowFontColorStyle[item]}"
-						return rowFontColorStyle.get(item);
-					} else if (series == 1 && colFontColorStyle.containsKey(item)) {
-						if (ddebug > 1) println "FIX COL LABEL COLOR $item ${cols[item]} -> ${colFontColorStyle[item]}"
-						return colFontColorStyle.get(item);
-					} else {
-						return super.getItemLabelPaint(series, item);
-					}
+				// visible shapes mode
+				if (!((CA) this.multipleItemsSelector.getResult()).isShowPointShapes()) {
+					return super.getItemPaint(series, item);
 				}
 				
-				
-				
-			};
+				if (series == 0 && rowPointColorStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX ROW POINT COLOR $item ${rows[item]} -> ${rowPointColorStyle[item]}"
+					return rowPointColorStyle.get(item);
+				} else if (series == 1 && colPointColorStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX COL POINT COLOR $item ${cols[item]} -> ${colPointColorStyle[item]}"
+					return colPointColorStyle.get(item);
+				}
+				else {
+					return super.getItemPaint(series, item);
+				}
+			}
 			
 			
-			def cp = editor.editors[0].getChart();
-			renderer.chart = cp
-			renderer.setSeriesVisible(0, ica.isShowVariables()); // Rows
-			renderer.setSeriesVisible(1, ica.isShowIndividuals()); // Columns
-			chart.getXYPlot().setRenderer(renderer)
+			@Override
+			public Paint getItemLabelPaint(int series, int item) {
+				if (series == 0 && rowFontColorStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX ROW LABEL COLOR $item ${rows[item]} -> ${rowFontColorStyle[item]}"
+					return rowFontColorStyle.get(item);
+				} else if (series == 1 && colFontColorStyle.containsKey(item)) {
+					if (ddebug > 1) println "FIX COL LABEL COLOR $item ${cols[item]} -> ${colFontColorStyle[item]}"
+					return colFontColorStyle.get(item);
+				} else {
+					return super.getItemLabelPaint(series, item);
+				}
+			}
 			
-			ica.getChartCreator().updateChart(chartEditor.getResult())
-			
-		}
-	});
+		};
+		
+		
+		def cp = editor.editors[0].getChart();
+		renderer.chart = cp // SJ: seems useless
+		renderer.setSeriesVisible(0, ica.isShowVariables()); // Rows  // SJ: seems useless
+		renderer.setSeriesVisible(1, ica.isShowIndividuals()); // Columns  // SJ: seems useless
+		chart.getXYPlot().setRenderer(renderer)
+		
+		ica.getChartCreator().updateChart(chartEditor.getResult())
+		
+	}
+});
 
 
 
