Revision 207

tmp/org.txm.specificities.core/src/org/txm/specificities/core/chartsengine/r/RSpecificitiesBarChartCreator.java (revision 207)
75 75
			if (transpose)
76 76
				legend = parts.getSymbol();
77 77

  
78
			String title = specificitiesResult.getName();
79 78

  
79
			// Title
80
			String title = "";
81
			if(TXMPreferences.getBoolean(preferencesNode, resultData, ChartsEnginePreferences.SHOW_TITLE))	{
82
				title = specificitiesResult.getName();	
83
			}
84
			
85

  
80 86
			String cmd = ""; //$NON-NLS-1$
81 87

  
82 88
			String[] colors;
......
149 155
//				if (transpose)
150 156
//					cmd += "legend(\"topright\", "+names+", inset = c(-0.2, 0), col = colors, lty = 1, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
151 157
//				else
152
			if (drawBars)
153
				cmd += "legend(\"topright\", "+legend+", inset = c(-0.2,0), col = colors, pch = 0, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
154
			else
155
				cmd += "legend(\"topright\", "+legend+", inset = c(-0.2,0), col = colors, lty = 1, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
158
			// Legend
159
			if(TXMPreferences.getBoolean(preferencesNode, resultData, ChartsEnginePreferences.SHOW_LEGEND))	{
160
				if (drawBars)	{
161
					cmd += "legend(\"topright\", "+legend+", inset = c(-0.2,0), col = colors, pch = 0, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
162
				}
163
				else	{
164
					cmd += "legend(\"topright\", "+legend+", inset = c(-0.2,0), col = colors, lty = 1, xpd=TRUE);\n"; //$NON-NLS-1$ //$NON-NLS-2$
165
				}
166
			}
156 167

  
157 168
			
158 169
			this.getChartsEngine().plot(file, cmd);
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java (revision 207)
152 152
		} else if (s instanceof Partition) {
153 153
			computeWithPartition((Partition) s);
154 154
			return null;
155
//		} else if (s instanceof LexicalTableAble) {
156
//			computeWithLexicalTableAble((LexicalTableAble) s);
157
//			return null;
155
		} else if (s instanceof LexicalTableAble) {
156
			computeWithLexicalTableAble((LexicalTableAble) s);
157
			return null;
158 158
		} else
159 159
			return null;
160 160
	}
161 161

  
162
//	/**
163
//	 * Compute with partition.
164
//	 *
165
//	 * @param partition the partition
166
//	 */
167
//	private void computeWithLexicalTableAble(final LexicalTableAble lexicalTableAble) {
168
//
169
//		JobHandler jobhandler = new JobHandler(
170
//				Messages.ComputeLexicalTable_0) {
171
//			@Override
172
//			protected IStatus run(IProgressMonitor monitor) {
173
//				this.runInit(monitor);
174
//				try {
175
//					JobsTimer.start();
176
//					monitor.beginTask(NLS.bind(Messages.ComputeLexicalTable_1, lexicalTableAble.getName(), "none"), 100);
177
//
178
//					this.acquireSemaphore();
179
//					table = lexicalTableAble.toLexicalTable();
180
//					this.releaseSemaphore();
181
//
182
//					monitor.worked(45);
183
//
184
//					lexicalTableAble.getParent().storeResult(table);
185
//
186
//					monitor.worked(5);
187
//
188
//					//monitor.subTask(Messages.ComputeSpecifities_10);
189
//					syncExec(new Runnable() {
190
//						@Override
191
//						public void run() {
192
//							IWorkbenchPage page = window.getActivePage();
193
//							LexicalTableEditorInput editorInput = new LexicalTableEditorInput(
194
//									table, null, null);
195
//							try {
196
//								StatusLine.setMessage(Messages.ComputeLexicalTable_10);
197
//								page.openEditor(editorInput,
198
//										"org.txm.rcpapplication.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
199
//							} catch (PartInitException e) {
200
//								org.txm.rcpapplication.utils.Logger.printStackTrace(e);
201
//							} 
202
//						}
203
//					});
204
//
205
//					monitor.worked(50);
206
//					if (monitor.isCanceled())
207
//						return Status.CANCEL_STATUS;
208
//
209
//					//monitor.subTask(Messages.ComputeSpecifities_2);
210
//					syncExec(new Runnable() {
211
//						@Override
212
//						public void run() {
213
//							CorporaView.refresh();
214
//							CorporaView.expand(table.getParent());
215
//							QueriesView.refresh();
216
//							RVariablesView.refresh();
217
//						}
218
//					});
219
//
220
//					monitor.worked(100);
221
//				} catch (ThreadDeath td) {
222
//					return Status.CANCEL_STATUS;
223
//				} catch (Exception e) {
224
//					org.txm.rcpapplication.utils.Logger.printStackTrace(e);
225
//				} finally {
226
//					monitor.done();
227
//					JobsTimer.stopAndPrint();
228
//				}
229
//				return Status.OK_STATUS;
230
//			}
231
//		};
232
//		jobhandler.startJob();
233
//
234
//		return;
235
//	}
162
	/**
163
	 * Compute with partition.
164
	 *
165
	 * @param partition the partition
166
	 */
167
	private void computeWithLexicalTableAble(final LexicalTableAble lexicalTableAble) {
236 168

  
169
		JobHandler jobhandler = new JobHandler(
170
				Messages.ComputeLexicalTable_0) {
171
			@Override
172
			protected IStatus run(IProgressMonitor monitor) {
173
				this.runInit(monitor);
174
				try {
175
					JobsTimer.start();
176
					monitor.beginTask(NLS.bind(Messages.ComputeLexicalTable_1, lexicalTableAble.getName(), "none"), 100);
177

  
178
					this.acquireSemaphore();
179
					table = lexicalTableAble.toLexicalTable();
180
					this.releaseSemaphore();
181

  
182
					monitor.worked(45);
183

  
184
					lexicalTableAble.getParent().storeResult(table);
185

  
186
					monitor.worked(5);
187

  
188
					//monitor.subTask(Messages.ComputeSpecifities_10);
189
					syncExec(new Runnable() {
190
						@Override
191
						public void run() {
192
							IWorkbenchPage page = window.getActivePage();
193
							LexicalTableEditorInput editorInput = new LexicalTableEditorInput(
194
									table, null, null);
195
							try {
196
								StatusLine.setMessage(Messages.ComputeLexicalTable_10);
197
								page.openEditor(editorInput,
198
										"org.txm.rcpapplication.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
199
							} catch (PartInitException e) {
200
								org.txm.rcpapplication.utils.Logger.printStackTrace(e);
201
							} 
202
						}
203
					});
204

  
205
					monitor.worked(50);
206
					if (monitor.isCanceled())
207
						return Status.CANCEL_STATUS;
208

  
209
					//monitor.subTask(Messages.ComputeSpecifities_2);
210
					syncExec(new Runnable() {
211
						@Override
212
						public void run() {
213
							CorporaView.refresh();
214
							CorporaView.expand(table.getParent());
215
							QueriesView.refresh();
216
							RVariablesView.refresh();
217
						}
218
					});
219

  
220
					monitor.worked(100);
221
				} catch (ThreadDeath td) {
222
					return Status.CANCEL_STATUS;
223
				} catch (Exception e) {
224
					org.txm.rcpapplication.utils.Logger.printStackTrace(e);
225
				} finally {
226
					monitor.done();
227
					JobsTimer.stopAndPrint();
228
				}
229
				return Status.OK_STATUS;
230
			}
231
		};
232
		jobhandler.startJob();
233

  
234
		return;
235
	}
236

  
237 237
	/**
238 238
	 * Compute with partition.
239 239
	 *
tmp/org.txm.core/src/java/org/txm/Messages.java (revision 207)
110 110
	public static String Corpus_6;
111 111
	public static String Corpus_7;
112 112
	public static String Corpus_8;
113
	public static String CorrespondanceAnalysisEditorInput_21;
114
	public static String CorrespondanceAnalysisEditorInput_22;
115
	public static String CorrespondanceAnalysisEditorInput_23;
116
	public static String CorrespondanceAnalysisEditorInput_24;
117
	public static String CorrespondanceAnalysisEditorInput_25;
118
	public static String CorrespondanceAnalysisEditorInput_26;
119
	public static String CorrespondanceAnalysisEditorInput_27;
120
	public static String CorrespondanceAnalysisEditorInput_29;
121
	public static String CorrespondanceAnalysisEditorInput_30;
122
	public static String CorrespondanceAnalysisEditorInput_32;
123
	public static String CorrespondanceAnalysisEditorInput_33;
124
	public static String CorrespondanceAnalysisEditorInput_34;
125
	public static String CorrespondanceAnalysisEditorInput_4;
126
	public static String CorrespondanceAnalysisEditorInput_44;
127
	public static String CorrespondanceAnalysisEditorInput_46;
128
	public static String CorrespondanceAnalysisEditorInput_47;
129
	public static String CorrespondanceAnalysisEditorInput_48;
130
	public static String CorrespondanceAnalysisEditorInput_49;
131
	public static String CorrespondanceAnalysisEditorInput_5;
132
	public static String CorrespondanceAnalysisEditorInput_50;
133
	public static String CorrespondanceAnalysisEditorInput_52;
134
	public static String CorrespondanceAnalysisEditorInput_53;
135
	public static String CorrespondanceAnalysisEditorInput_55;
136
	public static String CorrespondanceAnalysisEditorInput_56;
137
	public static String CorrespondanceAnalysisEditorInput_57;
138 113
	public static String CqiClient_0;
139 114
	public static String CqiClient_1;
140 115
	public static String CqiClient_3;
tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 207)
391 391
	 * @param key
392 392
	 * @return
393 393
	 */
394
	public static boolean keyExists(String preferencesNode, String key)	{
395
		if(scope.getNode(preferencesNode) != null)	{
394
	public static boolean keyExists(String nodeQualifier, String key)	{
395
		if(scope.getNode(nodeQualifier) != null)	{
396 396
			try {
397
				return Arrays.asList(scope.getNode(preferencesNode).keys()).contains(key);
397
				return Arrays.asList(scope.getNode(nodeQualifier).keys()).contains(key);
398 398
			}
399 399
			catch(BackingStoreException e) {
400 400
				e.printStackTrace();
......
403 403
		return false;
404 404
	}
405 405

  
406
	
407
	/**
408
	 * Checks if a preference is defined as empty.
409
	 * Can be used to determine whatever a functionality is available or not by overriding the preference as empty.
410
	 * @param nodeQualifier
411
	 * @param result
412
	 * @param key
413
	 * @return
414
	 */
415
	public static boolean isEmpty(String nodeQualifier, String key)	{
416
		return getString(nodeQualifier, key).equals("");
417
	}
406 418

  
419
	
407 420
	/**
421
	 * Sets a preference as empty.
422
	 * Can be used to determine whatever a functionality is available or not by overriding the preference as empty.
423
	 * @param nodeQualifier
424
	 * @param key
425
	 */
426
	public static void setEmpty(String nodeQualifier, String key)	{
427
		scope.getNode(nodeQualifier).put(key, "");
428
	}
429
	
430
	
431
	/**
408 432
	 * 
409 433
	 * @param nodeQualifier
410 434
	 */
tmp/org.txm.core/src/java/org/txm/messages_fr.properties (revision 207)
95 95
Corpus_6=** Corpus : la référence au texte 
96 96
Corpus_7=\ est manquante
97 97
Corpus_8=\ dans
98
CorrespondanceAnalysisEditorInput_21=Lignes
99
CorrespondanceAnalysisEditorInput_22=Colonnes
100
CorrespondanceAnalysisEditorInput_23=Q12
101
CorrespondanceAnalysisEditorInput_24=Q13
102
CorrespondanceAnalysisEditorInput_25=Q23
103
CorrespondanceAnalysisEditorInput_26=Mass
104
CorrespondanceAnalysisEditorInput_27=Dist
105
CorrespondanceAnalysisEditorInput_29=Cont
106
CorrespondanceAnalysisEditorInput_30=Cos\u00B2
107
CorrespondanceAnalysisEditorInput_32=c1
108
CorrespondanceAnalysisEditorInput_33=c2
109
CorrespondanceAnalysisEditorInput_34=c3
110
CorrespondanceAnalysisEditorInput_4=Facteur
111
CorrespondanceAnalysisEditorInput_44=Colonnes
112
CorrespondanceAnalysisEditorInput_46=Q12
113
CorrespondanceAnalysisEditorInput_47=Q13
114
CorrespondanceAnalysisEditorInput_48=Q23
115
CorrespondanceAnalysisEditorInput_49=Mass
116
CorrespondanceAnalysisEditorInput_5=Valeurs propres
117
CorrespondanceAnalysisEditorInput_50=Dist
118
CorrespondanceAnalysisEditorInput_52=Cont
119
CorrespondanceAnalysisEditorInput_53=Cos\u00B2
120
CorrespondanceAnalysisEditorInput_55=c1
121
CorrespondanceAnalysisEditorInput_56=c2
122
CorrespondanceAnalysisEditorInput_57=c3
123 98
CqiClient_0=Récupération de la dernière erreur CQP
124 99
CqiClient_1=Lecture de CQI CTRL LAST GENERAL ERROR
125 100
CqiClient_3=** Echec de la lecture de la dernière erreur CQP
tmp/org.txm.core/src/java/org/txm/searchengine/cqp/corpus/Partition.java (revision 207)
456 456
	 */
457 457
	public void storeResult(Object result) {
458 458
		if (!results.containsKey(result.getClass().getName())) results.put(result.getClass().getName(), new ArrayList<Object>());
459
		results.get(result.getClass().getName()).add(result);
459
		if(!results.get(result.getClass().getName()).contains(result))	{
460
			results.get(result.getClass().getName()).add(result);	
461
		}
460 462
	}
461 463

  
462 464
	/**
tmp/org.txm.core/src/java/org/txm/messages.properties (revision 207)
95 95
Corpus_6=** Corpus: the reference to text 
96 96
Corpus_7=\ is broken
97 97
Corpus_8=\ in 								
98
CorrespondanceAnalysisEditorInput_21=Rows
99
CorrespondanceAnalysisEditorInput_22=Cols
100
CorrespondanceAnalysisEditorInput_23=Q12
101
CorrespondanceAnalysisEditorInput_24=Q13
102
CorrespondanceAnalysisEditorInput_25=Q23
103
CorrespondanceAnalysisEditorInput_26=Mass
104
CorrespondanceAnalysisEditorInput_27=Dist
105
CorrespondanceAnalysisEditorInput_29=Cont
106
CorrespondanceAnalysisEditorInput_30=Cos\u00B2
107
CorrespondanceAnalysisEditorInput_32=c1
108
CorrespondanceAnalysisEditorInput_33=c2
109
CorrespondanceAnalysisEditorInput_34=c3
110
CorrespondanceAnalysisEditorInput_4=Factor
111
CorrespondanceAnalysisEditorInput_44=Cols
112
CorrespondanceAnalysisEditorInput_46=Q12
113
CorrespondanceAnalysisEditorInput_47=Q13
114
CorrespondanceAnalysisEditorInput_48=Q23
115
CorrespondanceAnalysisEditorInput_49=Mass
116
CorrespondanceAnalysisEditorInput_5=Singular values
117
CorrespondanceAnalysisEditorInput_50=Dist
118
CorrespondanceAnalysisEditorInput_52=Cont
119
CorrespondanceAnalysisEditorInput_53=Cos\u00B2
120
CorrespondanceAnalysisEditorInput_55=c1
121
CorrespondanceAnalysisEditorInput_56=c2
122
CorrespondanceAnalysisEditorInput_57=c3
123 98
CqiClient_0=Get Last CQP error
124 99
CqiClient_1=Read CQI CTRL LAST GENERAL ERROR
125 100
CqiClient_3=** Failed to get last CQP error
tmp/org.txm.progression.rcp/plugin.xml (revision 207)
84 84
   <extension
85 85
         point="org.eclipse.core.runtime.adapters">
86 86
      <factory
87
            adaptableType="org.txm.progression.core.functions.Progression2"
87
            adaptableType="org.txm.progression.core.functions.Progression"
88 88
            class="org.txm.progression.rcp.adapters.ProgressionAdapterFactory">
89 89
         <adapter
90 90
               type="org.eclipse.ui.model.IWorkbenchAdapter">
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorPart.java (revision 207)
332 332
	/**
333 333
	 * Activate the editor in the UI.
334 334
	 */
335
	//FIXME: this method doesn't work for Multi pages editor, eg. can not activating CAFactorialMapEditor stored in the CAEditor
335 336
	public void activate()	{
336 337
		// Activate the parent multi pages editor instead of this editor if it exists
337 338
		if(this.parentMultiPagesEditor != null)	{
338 339
			PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(this.parentMultiPagesEditor);
339 340
		}
340 341
		else	{
342
			// TODO: for focus and activation debug
343
//			System.out.println("ChartEditorPart.activate(): current active editor = " + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart());
344
//			System.out.println("ChartEditorPart.activate(): activating: " + this);
345
//	//		PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().bringToTop(this);
341 346
			PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(this);
347
//			System.out.println("ChartEditorPart.activate(): new active editor = " + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart());
342 348
		}
343 349
	}
344 350

  
......
349 355
		// FIXME: debug
350 356
		//System.err.println("ChartEditorPart.forceFocus()");
351 357

  
358
		//this.chartComposite.setFocus();
352 359
		this.chartComposite.notifyListeners(SWT.FocusIn, null); // Needed to force the composite listener to handle the focus event
353 360
	}
354 361

  
......
778 785
		return parametersGroup;
779 786
	}
780 787
	
788
	/**
789
	 * Checks whatever the chart composite has the focus or not.
790
	 * @return <code>true</code> if the chart composite has the focus otherwise <code>false</code>
791
	 */
792
	public boolean hasFocus()	{
793
		return this.chartComposite.isFocusControl();
794
	}
781 795
}
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartComposite.java (revision 207)
67 67
	 * Creates the pop up menu dedicated to empty area location click event.
68 68
	 */
69 69
	public void initEmptyAreaContextMenu()	{
70
		
71
		// FIXME: tests de liens vers menu RCP + changement dynamique d'une entrée du menu => ne fonctionne pas pour la modif dynamique
72
//		System.err.println("ChartComposite.initEmptyAreaContextMenu()");
73 70
		MenuManager menuManager = new MenuManager();
74
////		menuManager.setRemoveAllWhenShown(true);
75 71
		IMenuService menuService = (IMenuService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IMenuService.class);
76 72
		menuService.populateContributionManager(menuManager, "popup:" + CONTEXT_MENU_ID); //$NON-NLS-1$
77 73
		Menu menu = menuManager.createContextMenu(this);
78 74
		menuManager.update(true);
79 75
	    this.contextMenus.set(EventCallBack.AREA_EMPTY, menu);
80
		
81
		
82
		
83
		// FIXME: manual creation
84
//		Menu menu = new Menu(this);
85
//		MenuItem exportViewItem = new MenuItem(menu, SWT.CASCADE);
86
//	    exportViewItem.setText(SWTComponentsProviderMessages.ChartEditorToolBar_SHARED_BUTTON_EXPORT_VIEW_LABEL + "...");
87
//	    exportViewItem.setImage(IImageKeys.getImage(IImageKeys.CHARTS_EXPORT_VIEW));
88
//	    if(this.chartComponent != null)	{
89
//	    	exportViewItem.addSelectionListener(new BaseSelectionListener(this.chartComponent.getChartEditor(), BaseSelectionListener.EXPORT_VIEW));
90
//	    }
91
//	    
92
//	    this.contextMenus.set(EventCallBack.AREA_EMPTY, menu);
93 76
	}
94 77

  
95 78
	
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartEditorToolBar.java (revision 207)
9 9
import org.eclipse.swt.events.SelectionEvent;
10 10
import org.eclipse.swt.events.SelectionListener;
11 11
import org.eclipse.swt.widgets.Composite;
12
import org.eclipse.swt.widgets.Display;
13 12
import org.eclipse.swt.widgets.ToolBar;
14 13
import org.eclipse.swt.widgets.ToolItem;
15 14
import org.eclipse.ui.menus.IMenuService;
16
import org.txm.chartsengine.core.ChartCreator;
17 15
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
18 16
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
19 17
import org.txm.chartsengine.rcp.messages.SWTComponentsProviderMessages;
20 18
import org.txm.core.preferences.TXMPreferences;
19
import org.txm.rcpapplication.IImageKeys;
21 20
import org.txm.rcpapplication.views.CorporaView;
22 21

  
23 22
/**
......
49 48

  
50 49
		this.editorPart = chartEditorPart;
51 50

  
51
		// FIXME: tests
52 52
		//this.setLayout(new FormLayout());
53 53
		//this.setLayout(new GridLayout());
54 54
//		 GridData data = new GridData();
......
61 61
		menuService.populateContributionManager(manager, "toolbar:" + ChartEditorToolBar.ID); //$NON-NLS-1$
62 62

  
63 63
		
64
		// FIXME: tests chart updating 
65 64
		new ToolItem(this, SWT.SEPARATOR);
65
		
66 66
		final ToolItem showTitle = new ToolItem(this, SWT.CHECK);
67
		showTitle.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_TITLE);
68
		showTitle.setSelection(TXMPreferences.getBoolean(chartEditorPart.getPreferencesNodeQualifier(), chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_TITLE));
67
		//showTitle.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_TITLE);
68
		showTitle.setImage(IImageKeys.getImage(this, "icons/show_title.png"));
69
		showTitle.setDisabledImage(IImageKeys.getImage(this, "icons/show_title_disabled.png"));
70
		showTitle.setToolTipText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_TITLE);
69 71

  
72
		if(!TXMPreferences.isEmpty(chartEditorPart.getPreferencesNodeQualifier(), ChartsEnginePreferences.SHOW_TITLE))	{
73
			showTitle.setSelection(TXMPreferences.getBoolean(chartEditorPart.getPreferencesNodeQualifier(), chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_TITLE));
74
		}
75
		// disable if not managed
76
		else	{
77
			showTitle.setEnabled(false);
78
		}
79
		
80

  
70 81
		final ToolItem showLegend = new ToolItem(this, SWT.CHECK);
71
		showLegend.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_LEGEND);
72
		showLegend.setSelection(TXMPreferences.getBoolean(chartEditorPart.getPreferencesNodeQualifier(), chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_LEGEND));
82
		//showLegend.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_LEGEND);
83
		showLegend.setImage(IImageKeys.getImage(this, "icons/show_legend.png"));
84
		showLegend.setDisabledImage(IImageKeys.getImage(this, "icons/show_legend_disabled.png"));
85
		showLegend.setToolTipText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_LEGEND);
86

  
87
		if(!TXMPreferences.isEmpty(chartEditorPart.getPreferencesNodeQualifier(), ChartsEnginePreferences.SHOW_LEGEND))	{
88
			showLegend.setSelection(TXMPreferences.getBoolean(chartEditorPart.getPreferencesNodeQualifier(), chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_LEGEND));
89
		}
90
		// disable if not managed
91
		else	{
92
			showLegend.setEnabled(false);
93
		}
94

  
73 95
		
96
		final ToolItem showGrid = new ToolItem(this, SWT.CHECK);
97
		//showGrid.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_GRID);
98
		showGrid.setImage(IImageKeys.getImage(this, "icons/show_grid.png"));
99
		showGrid.setDisabledImage(IImageKeys.getImage(this, "icons/show_grid_disabled.png"));
100
		showGrid.setToolTipText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_GRID);
101
		
102
		if(!TXMPreferences.isEmpty(chartEditorPart.getPreferencesNodeQualifier(), ChartsEnginePreferences.SHOW_GRID))	{
103
			showGrid.setSelection(TXMPreferences.getBoolean(chartEditorPart.getPreferencesNodeQualifier(), chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_GRID));
104
		}
105
		// disable if not managed
106
		else	{
107
			showGrid.setEnabled(false);
108
		}
109

  
110
		
111
		
74 112
		SelectionListener listener = new SelectionListener() {
75 113
			
76 114
			@Override
77 115
			public void widgetSelected(final SelectionEvent e) {
78 116
				
79
				
80 117
				// Accessing the source must be done outside the Job
81 118
				if(e.getSource() == showTitle)	{
82
					// persistence
83 119
					TXMPreferences.putLocalBoolean(chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_TITLE,showTitle.getSelection());
84 120
				}
85
				
86 121
				if(e.getSource() == showLegend)	{
87
					// persistence
88 122
					TXMPreferences.putLocalBoolean(chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_LEGEND, showLegend.getSelection());
89 123
				}
90

  
124
				if(e.getSource() == showGrid)	{
125
					TXMPreferences.putLocalBoolean(chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_GRID, showGrid.getSelection());
126
				}
91 127
				
92 128
				
93
				
94 129
				// updates existing chart 
95 130
				Job job = new Job("Update chart") {
96 131

  
......
156 191
			}
157 192
		};
158 193
		
159
		
160 194
		showTitle.addSelectionListener(listener);
161 195
		showLegend.addSelectionListener(listener);
162
		
163

  
164
		// FIXME : example of drop down tool item
165
//		// Export chart view
166
//		this.toolItemExportChartView = new ToolItem(this, SWT.DROP_DOWN);
167
//		this.toolItemExportChartView.setText("Export view");
168
//
169
//		final Menu menu = new Menu(this.toolItemExportChartView.getParent().getShell(), SWT.POP_UP);
170
//		for (int i = 0; i < Application.swtComponentProvider.getEditorSupportedExportFileFormats().size(); i++) {
171
//		      MenuItem item = new MenuItem(menu, SWT.PUSH);
172
//		      item.setText(Application.swtComponentProvider.getEditorSupportedExportFileFormats().get(i));
173
//	    }
174
//
175
//		this.toolItemExportChartView.addListener (SWT.Selection, new Listener () {
176
//			@Override
177
//			public void handleEvent (Event event) {
178
//				if (event.detail == SWT.ARROW) {
179
//					Rectangle rect = toolItemExportChartView.getBounds ();
180
//					Point pt = new Point(rect.x, rect.y + rect.height);
181
//					pt = toDisplay(pt);
182
//					menu.setLocation(pt.x, pt.y);
183
//					menu.setVisible(true);
184
//				}
185
//			}
186
//		});
187
		
196
		showGrid.addSelectionListener(listener);
197
	
188 198
	}
189 199

  
190 200

  
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ResetChartView.java (revision 207)
3 3
import org.eclipse.core.commands.AbstractHandler;
4 4
import org.eclipse.core.commands.ExecutionEvent;
5 5
import org.eclipse.core.commands.ExecutionException;
6
import org.eclipse.swt.widgets.Event;
7
import org.eclipse.swt.widgets.ToolItem;
6
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
8 7
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
9
import org.txm.chartsengine.rcp.swt.ChartEditorToolBar;
10 8

  
11 9
/**
12 10
 * Resets the chart view of the active chart editor part.
......
16 14
public class ResetChartView extends AbstractHandler {
17 15

  
18 16

  
19
	/* (non-Javadoc)
20
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
21
	 */
22 17
	@Override
23 18
	public Object execute(ExecutionEvent event) throws ExecutionException {
24
		ChartEditorPart chartEditor = ((ChartEditorToolBar)((ToolItem)((Event)event.getTrigger()).widget).getParent()).getEditorPart();
25
		// for information the code below can not be used because it doesn't work in multi page editor, eg. for Singular Values editor in CA editor
26
		//ChartEditorPart chartEditor = (ChartEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
27
		
19
		ChartEditorPart chartEditor = SWTChartsComponentsProvider.getActiveChartEditor(event);
28 20
		chartEditor.resetView();
29 21
		chartEditor.forceFocus();
30 22
		return null;
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChart.java (revision 207)
45 45
import org.eclipse.ui.handlers.HandlerUtil;
46 46
import org.txm.chartsengine.core.ChartsEngine;
47 47
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
48
import org.txm.rcpapplication.Application;
49 48
import org.txm.rcpapplication.JobsTimer;
50 49
import org.txm.rcpapplication.Messages;
51 50
import org.txm.rcpapplication.StatusLine;
......
65 64
 */
66 65
public class ExportChart extends AbstractHandler {
67 66

  
68
	private static final String ID = "org.txm.rcp.chartsengine.base.commands.ExportChart"; //$NON-NLS-1$
67
	private static final String ID = "ExportChart"; //$NON-NLS-1$
69 68

  
70 69
	/** The selection. */
71 70
	private IStructuredSelection selection;
......
106 105
		}
107 106

  
108 107
		if (dialog.open() != null) {
109
			StatusLine.setMessage("Exporting chart.");
108
			StatusLine.setMessage("Exporting chart...");
110 109

  
111 110
			String filepath = dialog.getFilterPath() + "/" + dialog.getFileName(); //$NON-NLS-1$
112 111
			final File file = new File(filepath);
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChartEditorView.java (revision 207)
74 74
	@Override
75 75
	public Object execute(ExecutionEvent event) throws ExecutionException {
76 76

  
77
		final ChartEditorPart chartEditorPart = ((ChartEditorToolBar)((ToolItem)((Event)event.getTrigger()).widget).getParent()).getEditorPart();
78
		// for information the code below can not be used because it doesn't work in multi page editor, eg. for Singular Values editor in CA editor
79
		//final ChartEditorPart chartEditorPart = (ChartEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
80

  
77
		final ChartEditorPart chartEditorPart = SWTChartsComponentsProvider.getActiveChartEditor(event);
81 78
		
82 79
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
83 80
		final FileDialog dialog = new FileDialog(shell, SWT.SAVE);
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/CopyChartViewToClipboard.java (revision 207)
3 3
import org.eclipse.core.commands.AbstractHandler;
4 4
import org.eclipse.core.commands.ExecutionEvent;
5 5
import org.eclipse.core.commands.ExecutionException;
6
import org.eclipse.ui.PlatformUI;
6
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
7 7
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
8 8

  
9 9
/**
......
13 13
 */
14 14
public class CopyChartViewToClipboard extends AbstractHandler {
15 15

  
16
	/**
17
	 * 
18
	 */
19
	public CopyChartViewToClipboard() {
20
	}
21 16

  
22
	/* (non-Javadoc)
23
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
24
	 */
25 17
	@Override
26 18
	public Object execute(ExecutionEvent event) throws ExecutionException {
27
		ChartEditorPart chartEditor = (ChartEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
19
		ChartEditorPart chartEditor = SWTChartsComponentsProvider.getActiveChartEditor(event);
28 20
		chartEditor.copyChartViewToClipboard();
29 21
		return null;
30 22
	}
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/SWTChartsComponentsProvider.java (revision 207)
12 12

  
13 13
import javax.swing.JComponent;
14 14

  
15
import org.eclipse.core.commands.ExecutionEvent;
15 16
import org.eclipse.core.runtime.CoreException;
16 17
import org.eclipse.core.runtime.IConfigurationElement;
17 18
import org.eclipse.core.runtime.Platform;
......
26 27
import org.eclipse.swt.widgets.Group;
27 28
import org.eclipse.swt.widgets.Label;
28 29
import org.eclipse.swt.widgets.Listener;
30
import org.eclipse.swt.widgets.Menu;
31
import org.eclipse.swt.widgets.MenuItem;
32
import org.eclipse.swt.widgets.Shell;
29 33
import org.eclipse.swt.widgets.TabFolder;
30 34
import org.eclipse.swt.widgets.TabItem;
31 35
import org.eclipse.swt.widgets.ToolBar;
36
import org.eclipse.swt.widgets.ToolItem;
32 37
import org.eclipse.ui.IWorkbenchPage;
33 38
import org.eclipse.ui.IWorkbenchWindow;
34 39
import org.eclipse.ui.PartInitException;
35 40
import org.eclipse.ui.PlatformUI;
41
import org.eclipse.ui.part.MultiPageEditorPart;
36 42
import org.txm.chartsengine.core.ChartCreator;
37 43
import org.txm.chartsengine.core.ChartsEngine;
38 44
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
......
43 49
import org.txm.chartsengine.rcp.preferences.___KeyboardBindingProperties;
44 50
import org.txm.chartsengine.rcp.preferences.___MouseBindingProperties;
45 51
import org.txm.chartsengine.rcp.swt.ChartComposite;
52
import org.txm.chartsengine.rcp.swt.ChartEditorToolBar;
46 53
import org.txm.functions.TXMResult;
47 54
import org.txm.rcp.preferences.TXMPreferencePage;
55
import org.txm.rcpapplication.editors.SplitedGenericMultiPageEditor;
48 56
import org.txm.utils.logger.Log;
49 57

  
50 58
/**
......
493 501
		return chartsGroup;
494 502
	}
495 503
	
504
	
496 505
	/**
506
	 * 
507
	 * @param parent
508
	 * @return
509
	 */
510
	public static Composite createChartsRenderingPreferencesTabFolderComposite(Composite parent)	{
511
		return createChartsRenderingPreferencesTabFolderComposite(parent, SWTComponentsProviderMessages.ChartsEngineSharedPreferencePage_CHARTS_RENDERING_DEFAULT_PREFERENCES);
512
	}
513
	
514
	/**
497 515
	 * Creates a tab folder with a tab item for rendering preferences.
498 516
	 * @param parent
499 517
	 * @return
500 518
	 */
501
	public static Composite createChartsRenderingPreferencesTabFolderComposite(Composite parent)	{
519
	public static Composite createChartsRenderingPreferencesTabFolderComposite(Composite parent, String tabTitle)	{
502 520

  
503 521
		
504 522
		TabFolder tabFolder = new TabFolder(parent, SWT.TOP);
......
507 525
		tabFolder.setLayoutData(gridData);
508 526

  
509 527
		TabItem tabItem = new TabItem(tabFolder, SWT.NULL);
510
		tabItem.setText(SWTComponentsProviderMessages.ChartsEngineSharedPreferencePage_CHARTS_RENDERING_DEFAULT_PREFERENCES);
528
		tabItem.setText(tabTitle);
511 529
		Composite composite = new Composite(tabFolder, SWT.NULL);
512 530
		tabItem.setControl(composite);
513 531
		
......
568 586
		return parametersPanel;
569 587
	}
570 588

  
589
	
590

  
591
	
571 592
	/**
572 593
	 * Export the current view of chart editor in the specified file.
573 594
	 * @param chartEditor
......
763 784

  
764 785
	
765 786
	/**
787
	 * Gets the current active chart editor managing the multi pages editor.
788
	 * @param event
789
	 * @return
790
	 */
791
	public static ChartEditorPart getActiveChartEditor(ExecutionEvent event)	{
792
		ChartEditorPart chartEditor = null;
793

  
794
		// Toolbar
795
		if(((Event)event.getTrigger()).widget instanceof ToolItem)	{
796
			chartEditor = ((ChartEditorToolBar)((ToolItem)((Event)event.getTrigger()).widget).getParent()).getEditorPart();
797
		}
798
		// Context menu, multi pages editor
799
		else if(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart() instanceof SplitedGenericMultiPageEditor)	{
800
			// Main editor
801
			if(((SplitedGenericMultiPageEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart()).getMainEditorPart() instanceof ChartEditorPart
802
					&& ((ChartEditorPart)((SplitedGenericMultiPageEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart()).getMainEditorPart()).hasFocus())	{
803
				chartEditor = (ChartEditorPart)((SplitedGenericMultiPageEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart()).getMainEditorPart();
804
			}
805
			else if(((MultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getSelectedPage() instanceof ChartEditorPart
806
					&& ((ChartEditorPart)((MultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getSelectedPage()).hasFocus() )	{
807
				chartEditor = (ChartEditorPart)((MultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getSelectedPage();
808
			}
809
		}
810
		// Context menu, Normal editor
811
		else if(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart() instanceof ChartEditorPart)	{
812
			chartEditor = (ChartEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();	
813
		}
814
		return chartEditor;
815
	}
816
	
817
	/**
766 818
	 * Initializes AWT default events to delegate AWT events to SWT.
767 819
	 * @param chartEditor
768 820
	 * @param swingComponent
......
822 874
							
823 875
						}
824 876
						chartEditor.getComposite().notifyListeners(SWT.MouseUp, SWTChartsComponentsProvider.swingEventToSWT(chartEditor.getComposite(), swingComponent, e, SWT.MouseUp));
877
						//chartEditor.activate();
825 878
					}
826 879
				});
827 880
			}
......
837 890
						chartEditor.getComposite().notifyListeners(SWT.MouseDown, SWTChartsComponentsProvider.swingEventToSWT(chartEditor.getComposite(), swingComponent, e, SWT.MouseDown));
838 891
						
839 892
						// FIXME: Debug
840
						//System.out.println("SWTChartsComponentProvider.initializeAWTDelegationListeners(...).new MouseListener() {...}.mousePressed(...).new Runnable() {...}.run()");
893
//						System.out.println("SWTChartsComponentProvider.initializeAWTDelegationListeners(...).new MouseListener() {...}.mousePressed(...).new Runnable() {...}.run()");
841 894
						// Activate the editor part on AWT mouse pressed event
842
						//chartEditor.activate();
895
						chartEditor.activate();
896
//						chartEditor.forceFocus();
843 897
					}
844 898
				});
845 899

  
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/messages/SWTComponentsProviderMessages.java (revision 207)
27 27
	public static String ChartsEngineSharedPreferencePage_CHARTS_RENDERING_DEFAULT_PREFERENCES;
28 28
	
29 29
	
30
	public static String SWTChartsComponentProvider_CA_TOOLBAR_AXES_SELECTION_COMBO_BOX_LABEL;
31
	public static String SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_LABEL;
32
	public static String SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_TOOLTIP;
33
	public static String SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_LABEL;
34
	public static String SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_TOOLTIP;
35 30

  
36 31
	
37 32
	public static String SWTChartsComponentProvider_CAH_TOOLBAR_BUTTON_NUMBER_OF_CLUSTERS;
......
45 40
	public static String SWTChartsComponentProvider_SHOW_TITLE;
46 41
	public static String SWTChartsComponentProvider_SHOW_LEGEND;
47 42
	public static String SWTChartsComponentProvider_SHOW_GRID;
43

  
44
	public static String SWTChartsComponentProvider_SHOW_HIDE_TITLE;
45
	public static String SWTChartsComponentProvider_SHOW_HIDE_LEGEND;
46
	public static String SWTChartsComponentProvider_SHOW_HIDE_GRID;
47

  
48 48
	
49 49
	
50 50
	static {
tmp/org.txm.chartsengine.rcp/OSGI-INF/l10n/bundle.properties (revision 207)
14 14
command.description = Reset the chart view
15 15
command.description.0 = Export the current view
16 16
command.description.1 = Copy the current view to clipboard
17
command.label.42 = Chart...
17 18
command.name = Reset view
18 19
command.name.0 = Export view
19 20
command.name.1 = Copy chart view to clipboard
21
command.name.92 = Export chart...
20 22
page.name = Charts Engine
21
SWTChartsComponentProvider_CA_TOOLBAR_AXES_SELECTION_COMBO_BOX_LABEL=Axes: 
22
SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_LABEL=Show columns
23
SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_TOOLTIP=Show/hide the column points
24
SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_LABEL=Show rows
25
SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_TOOLTIP=Show/hide the row points
26 23
SWTChartsComponentProvider_CAH_TOOLBAR_BUTTON_NUMBER_OF_CLUSTERS=Number of clusters: 
27 24
SWTChartsComponentProvider_SHARED_SEND_SELECTION_TO_CONCORDANCE=Send selection to concordance
28 25
SWTChartsComponentProvider_SHARED_SEND_SELECTION_TO_COOCCURRENCE=Send selection to cooccurrence
29 26
SWTChartsComponentProvider_SHARED_SEND_SELECTION_TO_INDEX=Send selection to index
30 27
SWTChartsComponentProvider_SHOW_GRID=Show grid
28
SWTChartsComponentProvider_SHOW_HIDE_GRID=Show/hide grid
29
SWTChartsComponentProvider_SHOW_HIDE_LEGEND=Show/hide legend
30
SWTChartsComponentProvider_SHOW_HIDE_TITLE=Show/hide title
31 31
SWTChartsComponentProvider_SHOW_LEGEND=Show legend
32 32
SWTChartsComponentProvider_SHOW_TITLE=Show title
tmp/org.txm.chartsengine.rcp/OSGI-INF/l10n/bundle_ru.properties (revision 207)
1
command.label.42=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442
0 2

  
tmp/org.txm.chartsengine.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 207)
17 17
command.name.0 = Exporter la vue
18 18
command.name.1 = Copier la vue dans le presse-papier
19 19
page.name = Moteur de Graphiques 2
20
SWTChartsComponentProvider_CA_TOOLBAR_AXES_SELECTION_COMBO_BOX_LABEL=Axes : 
21
SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_LABEL=Afficher les colonnes
22
SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_TOOLTIP=Afficher/masquer les points-colonnes
23
SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_LABEL=Afficher les lignes
24
SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_TOOLTIP=Afficher/masquer les points-lignes
25 20
SWTChartsComponentProvider_CAH_TOOLBAR_BUTTON_NUMBER_OF_CLUSTERS=Nombre de clusters : 
26 21
SWTChartsComponentProvider_SHARED_SEND_SELECTION_TO_CONCORDANCE=Envoyer la sélection vers la concordance
27 22
SWTChartsComponentProvider_SHARED_SEND_SELECTION_TO_COOCCURRENCE=Envoyer la sélection vers la cooccurrence
28 23
SWTChartsComponentProvider_SHARED_SEND_SELECTION_TO_INDEX=Envoyer la s�lection vers l'index
29 24
SWTChartsComponentProvider_SHOW_GRID=Afficher la grille
30 25
SWTChartsComponentProvider_SHOW_LEGEND=Afficher la légende
31
SWTChartsComponentProvider_SHOW_TITLE=Afficher le titre
26
SWTChartsComponentProvider_SHOW_TITLE=Afficher le titre
27
SWTChartsComponentProvider_SHOW_HIDE_GRID=Afficher/masquer la grille
28
SWTChartsComponentProvider_SHOW_HIDE_LEGEND=Afficher/masquer la légende
29
SWTChartsComponentProvider_SHOWHIDE__TITLE=Afficher/masquer le titre
30
command.label.42 = Graphique...
31
command.name.92 = Exporter le graphique...
tmp/org.txm.chartsengine.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties (revision 207)
1
command.label.42=Удалить текст
0 2

  
tmp/org.txm.chartsengine.rcp/plugin.xml (revision 207)
49 49
            locationURI="toolbar:ChartEditorToolBar">
50 50
         <command
51 51
               commandId="ExportChartEditorView"
52
               icon="icons/charts_export_view.png"
52
               icon="icons/export_view.png"
53 53
               style="push">
54 54
         </command>
55 55
         <command
56 56
               commandId="ResetChartView"
57
               icon="icons/charts_reset_view.png"
57
               icon="icons/reset_view.png"
58 58
               style="push">
59 59
         </command>
60 60
         <command
61 61
               commandId="CopyChartViewToClipboard"
62
               icon="icons/charts_copy_view.gif"
62
               icon="icons/copy_view.gif"
63 63
               style="push">
64 64
         </command>
65 65
      </menuContribution>
......
68 68
            locationURI="popup:ChartEditorContextMenu">
69 69
         <command
70 70
               commandId="ExportChartEditorView"
71
               icon="icons/charts_export_view.png"
71
               icon="icons/export_view.png"
72 72
               style="push">
73 73
         </command>
74 74
         <command
75 75
               commandId="ResetChartView"
76
               icon="icons/charts_reset_view.png"
76
               icon="icons/reset_view.png"
77 77
               style="push">
78 78
         </command>
79 79
         <command
80 80
               commandId="CopyChartViewToClipboard"
81
               icon="icons/charts_copy_view.gif"
81
               icon="icons/copy_view.gif"
82 82
               style="push">
83 83
         </command>
84 84
      </menuContribution>
85
      <menuContribution
86
            allPopups="false"
87
            locationURI="toolbar:org.txm.rcpapplication.toolbarcorpus">
88
         <command
89
               commandId="ExportChart"
90
               icon="icons/export_chart.png"
91
               style="push"
92
               tooltip="%command.name.92">
93
            <visibleWhen
94
                  checkEnabled="false">
95
               <or>
96
                  <reference
97
                        definitionId="OneCASelected">
98
                  </reference>
99
                  <reference
100
                        definitionId="OneProgressionSelected">
101
                  </reference>
102
               </or>
103
            </visibleWhen>
104
         </command>
105
      </menuContribution>
106
      <menuContribution
107
            allPopups="false"
108
            locationURI="menu:menu.file.export">
109
         <command
110
               commandId="ExportChart"
111
               icon="icons/export_chart.png"
112
               label="%command.label.42"
113
               style="push">
114
            <visibleWhen
115
                  checkEnabled="false">
116
               <or>
117
                  <reference
118
                        definitionId="OneCASelected">
119
                  </reference>
120
                  <reference
121
                        definitionId="OneProgressionSelected">
122
                  </reference>
123
               </or>
124
            </visibleWhen>
125
         </command>
126
      </menuContribution>
127
      <menuContribution
128
            allPopups="false"
129
            locationURI="popup:corporaview.menu.file.export">
130
         <command
131
               commandId="ExportChart"
132
               icon="icons/export_chart.png"
133
               label="%command.label.42"
134
               style="push">
135
            <visibleWhen
136
                  checkEnabled="false">
137
               <or>
138
                  <reference
139
                        definitionId="OneCASelected">
140
                  </reference>
141
                  <reference
142
                        definitionId="OneProgressionSelected">
143
                  </reference>
144
               </or>
145
            </visibleWhen>
146
         </command>
147
      </menuContribution>
85 148
   </extension>
86 149
   <extension
87 150
         point="org.eclipse.ui.commands">
......
100 163
            id="CopyChartViewToClipboard"
101 164
            name="%command.name.1">
102 165
      </command>
166
      <command defaultHandler="org.txm.chartsengine.rcp.handlers.ExportChart" id="ExportChart" name="%command.name.92">
167
      </command>
103 168
   </extension>
104 169

  
105 170
</plugin>
tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/jfreechart/JFCPartitionDimensionsPieChartCreator.java (revision 207)
40 40
			// Creating the data set from the partition result
41 41
			DefaultPieDataset dataset = new DefaultPieDataset();
42 42

  
43
			XYSeries series = new XYSeries(PartitionCoreMessages.CHARTSENGINE_PARTITION_DIMENSIONS_CATEGORY);
44

  
45 43
			List<Part> parts;
46 44

  
47 45
			// Sort parts by descendant size order
tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/r/RPartitionDimensionsPieChartCreator.java (revision 207)
3 3
import java.io.File;
4 4
import java.util.List;
5 5

  
6
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
6 7
import org.txm.chartsengine.r.core.RChartCreator;
7 8
import org.txm.chartsengine.r.core.RChartsEngine;
8 9
import org.txm.core.preferences.TXMPreferences;
......
41 42
			boolean sortPartsBySize = TXMPreferences.getBoolean(preferencesNode, resultData, PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE);
42 43
			boolean displayPartsCountInTitle = TXMPreferences.getBoolean(preferencesNode, resultData, PartitionDimensionsPreferences.CHART_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE);
43 44
			
44
			RWorkspace r = RWorkspace.getRWorkspaceInstance();
45

  
46 45
			List<Part> parts;
47 46

  
48 47
			// Sort parts by descendant size order
......
76 75
			}
77 76
			ssizes += ")"; //$NON-NLS-1$
78 77

  
79
			// Create chart title
80
			String title = Utils.createPartitionDimensionsChartTitle(partition, sortPartsBySize, displayPartsCountInTitle);
81

  
78
			String title = "";
79
			if(TXMPreferences.getBoolean(preferencesNode, resultData, ChartsEnginePreferences.SHOW_TITLE))	{
80
				title = Utils.createPartitionDimensionsChartTitle(partition, sortPartsBySize, displayPartsCountInTitle);
81
			}
82
			
82 83
			String ylab = PartitionCoreMessages.CHARTSENGINE_PARTITION_DIMENSIONS_Y_AXIS_LABEL;
83 84

  
84 85
			String cmd = "pie(" + ssizes + ", labels=" + snames + //$NON-NLS-1$ //$NON-NLS-2$
tmp/org.txm.partition.core/src/org/txm/partition/core/chartsengine/r/RPartitionDimensionsBarChartCreator.java (revision 207)
3 3
import java.io.File;
4 4
import java.util.List;
5 5

  
6
import org.txm.chartsengine.core.ChartsEngine;
7
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
6 8
import org.txm.chartsengine.r.core.RChartCreator;
7 9
import org.txm.chartsengine.r.core.RChartsEngine;
8 10
import org.txm.core.preferences.TXMPreferences;
......
41 43
			boolean sortPartsBySize = TXMPreferences.getBoolean(preferencesNode, resultData, PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE);
42 44
			boolean displayPartsCountInTitle = TXMPreferences.getBoolean(preferencesNode, resultData, PartitionDimensionsPreferences.CHART_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE);
43 45
			
44
			
45
			RWorkspace r = RWorkspace.getRWorkspaceInstance();
46

  
47 46
			List<Part> parts;
48 47

  
49 48
			// Sort parts by descendant size order
......
78 77
			ssizes += ")"; //$NON-NLS-1$
79 78

  
80 79
			// Create chart title
81
			String title = Utils.createPartitionDimensionsChartTitle(partition, sortPartsBySize, displayPartsCountInTitle);
80
			String title = "";
81
			if(TXMPreferences.getBoolean(preferencesNode, resultData, ChartsEnginePreferences.SHOW_TITLE))	{
82
				title = Utils.createPartitionDimensionsChartTitle(partition, sortPartsBySize, displayPartsCountInTitle);
83
			}
82 84

  
83 85
			String ylab = PartitionCoreMessages.CHARTSENGINE_PARTITION_DIMENSIONS_Y_AXIS_LABEL;
84 86

  
tmp/org.txm.partition.core/src/org/txm/partition/core/preferences/PartitionDimensionsPreferences.java (revision 207)
37 37
		
38 38
		// shared charts rendering preferences
39 39
		ChartsEnginePreferences.initializeChartsEngineSharedPreferences(preferences);
40
		
41
		// disable unavailable functionality
42
		TXMPreferences.setEmpty(PREFERENCES_NODE, ChartsEnginePreferences.SHOW_LEGEND);
43
		
40 44
	}
41 45
	
42 46
}
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/___ChartsEngine.java (revision 207)
1
package org.txm.chartsengine.core;
2

  
3
import java.io.File;
4
import java.io.IOException;
5
import java.util.ArrayList;
6
import java.util.HashMap;
7
import java.util.Map;
8
import java.util.Properties;
9

  
10
import org.txm.chartsengine.core.messages.ChartsEngineCoreMessages;
11
import org.txm.utils.logger.Log;
12

  
13

  
14
/**
15
 * Common charts engine. This is the superclass of all chart engine implementations.
16
 * This class provides methods to create charts from variable data such as CA, CAH, Singular values, etc. results.
17
 * @author Sebastien Jacquot
18
 *
19
 */
20
public abstract class ___ChartsEngine {
21

  
22
	/**
23
	 * Chart type constants.
24
	 */
25
	public final static int CHART_TYPE_PARTITION_DIMENSIONS = 0, CHART_TYPE_SPECIFICITIES = 1, CHART_TYPE_PROGRESSION = 2, CHART_TYPE_CA_FACTORIAL_MAP = 3, CHART_TYPE_CA_SINGULAR_VALUES = 4,
26
			CHART_TYPE_CAH_2D = 5, CHART_TYPE_CAH_3D = 6;
27

  
28
	/**
29
	 * Constants for output formats and file extensions.
30
	 */
31
	public final static int OUTPUT_FORMAT_JPEG = 0, OUTPUT_FORMAT_PDF = 1, OUTPUT_FORMAT_PNG = 2, OUTPUT_FORMAT_PS = 3, OUTPUT_FORMAT_SVG = 4, OUTPUT_FORMAT_BMP = 5, OUTPUT_FORMAT_GIF = 6;
32

  
33

  
34
	/**
35
	 * Output formats and file extensions.
36
	 */
37
	public static HashMap<Integer, String> outputFormatDefinitions = new HashMap<Integer, String>();
38

  
39
	/**
40
	 * Initializes output formats definition and descriptions.
41
	 */
42
	static	{
43
		outputFormatDefinitions.put(OUTPUT_FORMAT_JPEG, "jpeg");	//$NON-NLS-1$
44
		outputFormatDefinitions.put(OUTPUT_FORMAT_PDF, "pdf");		//$NON-NLS-1$
45
		outputFormatDefinitions.put(OUTPUT_FORMAT_PNG, "png");		//$NON-NLS-1$
46
		outputFormatDefinitions.put(OUTPUT_FORMAT_PS, "ps");		//$NON-NLS-1$
47
		outputFormatDefinitions.put(OUTPUT_FORMAT_SVG, "svg");		//$NON-NLS-1$
48
		outputFormatDefinitions.put(OUTPUT_FORMAT_BMP, "bmp");		//$NON-NLS-1$
49
		outputFormatDefinitions.put(OUTPUT_FORMAT_GIF, "gif");		//$NON-NLS-1$
50
	}
51

  
52

  
53

  
54
	/**
55
	 * Prefix to use for properties names.
56
	 */
57
	public final static String propertiesPrefix = "charts_engine_";
58

  
59
	/**
60
	 * Constant for showing title or not in the charts.
61
	 */
62
	public final static String PROP_CHARTS_SHOW_TITLE = propertiesPrefix +  "show_title"; //$NON-NLS-1$
63

  
64

  
65
	/**
66
	 * Constant for showing legend or not in the charts.
67
	 */
68
	public final static String PROP_CHARTS_SHOW_LEGEND = propertiesPrefix +  "show_legend"; //$NON-NLS-1$
69

  
70

  
71
	/**
72
	 * Constant for showing grid/lines or not in the charts.
73
	 */
74
	public final static String PROP_CHARTS_SHOW_GRID_LINES = propertiesPrefix +  "show_grid"; //$NON-NLS-1$
75

  
76

  
77
	/**
78
	 * Constant for the partition dimensions parts order in chart.
79
	 */
80
	//public final static String PROP_PARTITION_DIMENSIONS_SORTED_BY_SIZE = propertiesPrefix + "partition_dimensions_sort_by_size";
81
	// FIXME : rename this property according to the line above
82
	public final static String PROP_PARTITION_DIMENSIONS_SORTED_BY_SIZE = "diag_partssort"; //$NON-NLS-1$
83

  
84
	/**
85
	 * Constant for the partition dimensions display parts count in chart title.
86
	 */
87
	public final static String PROP_PARTITION_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE = propertiesPrefix +  "partition_dimensions_display_parts_count_in_title"; //$NON-NLS-1$
88

  
89
	/**
90
	 * Constant for the current charts engine used by the tool box.
91
	 */
92
	public static final String PROP_CHARTS_ENGINE_NAME = propertiesPrefix +  "name"; //$NON-NLS-1$
93

  
94
	/**
95
	 * Constant for the output format of the current charts engine.
96
	 */
97
	public static final String PROP_CHARTS_ENGINE_OUTPUT_FORMAT = propertiesPrefix + "output_format"; //$NON-NLS-1$
98

  
99

  
100
	/**
101
	 * Properties for each type of result data (as <code>Partition</code> : sort by size, <code>SpecificitesResult</code> : draw bars, draw lines, etc.)
102
	 */
103
	 // FIXME: creates a specific class for this extending Properties ? then put all the constant property names in it ?
104
	// FIXME: see that when we'll discuss about using RCP store for TBX plugin.
105
	public static Properties properties;
106

  
107
	/**
108
	 * The engine name.
109
	 */
110
	protected String name;
111
	
112
	protected String userdir;
113

  
114

  
115
	/**
116
	 * The engine description.
117
	 */
118
	protected String description;
119

  
120

  
121
	/**
122
	 * The current output format.
123
	 */
124
	protected int outputFormat;
125

  
126
	
127
	
128
	protected HashMap<Class, ChartCreator> chartCreators;
129

  
130
	/**
131
	 * Creates a charts engine.
132
	 */
133
	// FIXME : useless ?
134
//	protected ChartsEngine() {
135
//		this("abstract_charts_engine", "Abstract Charts Engine"); //$NON-NLS-1$
136
//	}
137

  
138
	/**
139
	 * Creates a charts engine with the specified name, description and output format.
140
	 * @param name
141
	 * @param description
142
	 * @param outputFormat
143
	 */
144
	protected ___ChartsEngine(String name, String description, String outputFormat) {
145
		this(name, description, ___ChartsEngine.getOutputFormatDefinition(outputFormat));
146
	}
147

  
148

  
149
	/**
150
	 * Creates a charts engine with the specified name, description and output format.
151
	 * @param name
152
	 * @param description
153
	 * @param outputFormat
154
	 */
155
	protected ___ChartsEngine(String name, String description, int outputFormat) {
156
		this.name = name;
157
		this.description = description;
158
		this.setOutputFormat(outputFormat);
159
		
160
		this.chartCreators = new HashMap<Class, ChartCreator>();
161
	}
162

  
163

  
164

  
165
	/**
166
	 * 
167
	 * @param type
168
	 * @return
169
	 */
170
	public ChartCreator getChartCreator(Class resultDataType)	{
171
		return this.chartCreators.get(resultDataType);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff