Révision 207

tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/preferences/WordCloudPreferences.java (revision 207)
43 43
		preferences.putBoolean(RANDOM_POSITION, false);
44 44

  
45 45
		// shared charts rendering preferences
46
		ChartsEnginePreferences.initializeChartsEngineSharedPreferences(preferences);
46
		//ChartsEnginePreferences.initializeChartsEngineSharedPreferences(preferences);
47
		
47 48
	}
48 49
	
49 50
}
tmp/CWBInstaller/bin/cqpserver.init (revision 207)
1
host *;               # allow access from any host (including localhost)
2

  
3
# users must login with name "anonymous" and explicit "" as password!
4
user anonymous "";
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.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);
172
	}
173
	
174

  
175
//	/**
176
//	 * 
177
//	 * @param ___ChartCreator
178
//	 */
179
//	public void addChartCreator(Class resultDataType, ChartCreator chartCreator)	{
180
//		this.chartCreators.put(resultDataType, chartCreator);
181
//		chartCreator.setChartsEngine(this);
182
//	}
183
//	
184
//	
185
	
186
//	/**
187
//	 * Creates a charts engine with the specified output format;
188
//	 * @param outputFormat
189
//	 */
190
//	protected ChartsEngine(String outputFormat) {
191
//		this.outputFormat = outputFormat;
192
//	}
193
//
194
//
195
	/**
196
	 * Creates a charts engine according to the specified name.
197
	 * @param name
198
	 * @return
199
	 */
200
//	// FIXME : see if the extension point mechanism could be replace this factory pattern
201
//	// FIXME : else use reflection to dynamically instantiate the right charts engine implementation
202
//	public static ChartsEngine createChartsEngine(String name)	{
203
//		return createChartsEngine(name, ChartsEngine.OUTPUT_FORMAT_SVG); //$NON-NLS-1$
204
//		// FIXME : tests for other file formats
205
//		//return createChartsEngine(name, "PNG"); //$NON-NLS-1$
206
//	}
207

  
208
	/**
209
	 * Creates a charts engine according to the specified name and output format.
210
	 * @param name
211
	 * @param outputFormat
212
	 * @return
213
	 */
214
	// FIXME : see if the extension point mechanism could be replace this factory pattern
215
	// FIXME : else use reflection to dynamically instantiate the right charts engine implementation
216
	public static ___ChartsEngine createChartsEngine(String name, String outputFormat)	{
217
//		if (name.equals(___JFCChartsEngine.NAME)) {
218
//			return new ___JFCChartsEngine(outputFormat);
219
//		} else if (name.equals(___RChartsEngine.NAME)) {
220
//			return new ___RChartsEngine(outputFormat);
221
//		}
222
//		// Default charts engine
223
//		return new ___RChartsEngine(outputFormat);
224
		return null;
225
	}
226

  
227

  
228
	/**
229
	 * Creates a temporary file in USER_TXM_HOME\results with the specified prefix for writing the chart.
230
	 * The suffix is computed according to the current output format of the charts engine.
231
	 * @return
232
	 */
233
	public File createTmpFile(String prefix)	{
234
		File file = null;
235
		try {
236
			File resultsDir = new File(userdir, "results"); //$NON-NLS-1$
237
			resultsDir.mkdirs();
238
			file = File.createTempFile(prefix, "." + getOutputFormatDefinition(this.outputFormat), resultsDir);
239
			// FIXME : to remove when ok
240
			//tmpFile = File.createTempFile(prefix, this.rDevice.getExt(), resultsDir);
241
		}
242
		catch (IOException e) {
243
			Log.severe(ChartsEngineCoreMessages.ChartsEngine_CANT_CREATE_TMP_FILE_CHART + e);
244
		}
245

  
246
		// TODO : old code, useful ? and/or return null instead of the file if canWrite() return false ?
247
		if(!file.canWrite()) {
248
			Log.severe(ChartsEngineCoreMessages.ChartsEngine_CANT_WRITE_IN_FILE + file);
249
		}
250

  
251

  
252
		// TODO : old code, useless ?
253
		// System.out.println(tmp.getAbsolutePath());
254
//		try {
255
//			this.path = Path.fromOSString(tmp.getCanonicalPath());
256
//		} catch (IOException e) {
257
//			Log.txm.severe(Messages.CANT_CREATE_GRAPHIC + e);
258
//		}
259
		return file;
260

  
261
	}
262

  
263

  
264
	/**
265
	 * Creates a temporary file in USER_TXM_HOME\results.
266
	 * The prefix and the suffix are computed according to the specified chart type and the current output format of the charts engine.
267
	 * @param chartType
268
	 * @return
269
	 */
270
	public File createTmpFile(int chartType)	{
271
		if(chartType == ___ChartsEngine.CHART_TYPE_PARTITION_DIMENSIONS)	{
272
			return this.createTmpFile("info");
273
		}
274
		else if(chartType == ___ChartsEngine.CHART_TYPE_SPECIFICITIES)	{
275
			return this.createTmpFile("specif");
276
		}
277
		else if(chartType == ___ChartsEngine.CHART_TYPE_CA_SINGULAR_VALUES)	{
278
			return this.createTmpFile("casingularvalues");
279
		}
280
		else if(chartType == ___ChartsEngine.CHART_TYPE_CA_FACTORIAL_MAP)	{
281
			return this.createTmpFile("cafactorialmap");
282
		}
283
		else if(chartType == ___ChartsEngine.CHART_TYPE_PROGRESSION)	{
284
			return this.createTmpFile("progression");
285
		}
286
		else if(chartType == ___ChartsEngine.CHART_TYPE_CAH_2D)	{
287
			return this.createTmpFile("cah2d");
288
		}
289
		else if(chartType == ___ChartsEngine.CHART_TYPE_CAH_3D)	{
290
			return this.createTmpFile("cah3d");
291
		}
292

  
293

  
294
		return this.createTmpFile("unknown");
295
	}
296

  
297

  
298
//	/**
299
//	 * Creates a factorial map chart from the specified CA result.
300
//	 * @param ca
301
//	 * @return the factorial map chart object
302
//	 */
303
//	public abstract Object createCAFactorialMapChart(CA ca);
304
//
305
//
306
//	/**
307
//	 * Creates a factorial map chart from the specified CA result and writes it in the specified file.
308
//	 * @param ca
309
//	 * @param file
310
//	 * @return the generated file containing the chart
311
//	 */
312
//	public abstract File createCAFactorialMapChartFile(CA ca, File file);
313
//
314
//
315
//	/**
316
//	 * Creates a factorial map chart from the specified CA result and writes it in a temporary file in USER_TXM_HOME\results.
317
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
318
//	 * @param ca
319
//	 * @return
320
//	 */
321
//	public File createCAFactorialMapChartFile(CA ca)	{
322
//		return this.createCAFactorialMapChartFile(ca, this.createTmpFile(___ChartsEngine.CHART_TYPE_CA_FACTORIAL_MAP));
323
//	}
324

  
325

  
326
//	/**
327
//	 * Creates a string title, shared by charts engine implementations, for the CA factorial map chart from the specified result.
328
//	 * @param ca
329
//	 * @return
330
//	 */
331
//	public String createCAFactorialMapChartTitle(CA ca)	{
332
//
333
//		String partitionName;
334
//		if (ca.getPartition() == null) {
335
//			partitionName = "<no partition>";
336
//		}
337
//		else	{
338
//			partitionName = ca.getPartition().getName();
339
//		}
340
//
341
//		String corpusName;
342
//		if (ca.getCorpus() == null) {
343
//			corpusName = "<no corpus>";
344
//		}
345
//		else	{
346
//			corpusName = ca.getCorpus().getName();
347
//		}
348
//
349
//		return ChartsEngineMessages.bind(CAC.ChartsEngine_CA_FACTORIAL_MAP_TITLE, partitionName, corpusName);
350
//	}
351

  
352
//	/**
353
//	 * Creates a bar plot with singular values of the specified CA result.
354
//	 * @param ca
355
//	 * @return the singular values bar plot object
356
//	 */
357
//	public abstract Object createCASingularValuesBarChart(CA ca);
358
//
359
//	/**
360
//	 * Creates a bar plot with singular values of the specified CA result and writes it in the specified file.
361
//	 * @param ca
362
//	 * @return
363
//	 */
364
//	public abstract File createCASingularValuesBarChartFile(CA ca, File file);
365
//
366
//
367
//	/**
368
//	 * Creates a bar plot with singular values of the specified CA result and writes it in a temporary file in USER_TXM_HOME\results.
369
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
370
//	 * @param ca
371
//	 * @return
372
//	 */
373
//	public File createCASingularValuesBarChartFile(CA ca)	{
374
//		return this.createCASingularValuesBarChartFile(ca, this.createTmpFile(___ChartsEngine.CHART_TYPE_CA_SINGULAR_VALUES));
375
//	}
376

  
377

  
378
// FIXME
379
//	/**
380
//	 * Creates a chart from the specified CAH result.
381
//	 * @param cah
382
//	 * @return
383
//	 */
384
//	public Object createCAHChart(CAH cah)	{
385
//		return this.createCAHChart(cah, cah.isDisplay2D());
386
//	}
387
//
388

  
389
//	/**
390
//	 * Creates a chart from the specified CAH result.
391
//	 * @param cah
392
//	 * @return
393
//	 */
394
//	public Object createCAHChart(CAH cah, boolean chart2d)	{
395
//		if(chart2d)	{
396
//			return this.createCAH2dChart(cah);
397
//		}
398
//		else	{
399
//			return this.createCAH3dChart(cah);
400
//		}
401
//	}
402

  
403
// FIXME
404
//
405
//	/**
406
//	 * Creates a chart from the specified CAH result and writes it in a temporary file in USER_TXM_HOME\results
407
//	 * @param cah
408
//	 * @return
409
//	 */
410
//	public File createCAHChartFile(CAH cah)	{
411
//		return this.createCAHChartFile(cah, cah.isDisplay2D());
412
//	}
413
//
414
//
415
//	/**
416
//	 * Creates a chart from the specified CAH result and writes it in the specified file.
417
//	 * @param cah
418
//	 * @param file
419
//	 * @return
420
//	 */
421
//	public File createCAHChartFile(CAH cah, File file)	{
422
//		return this.createCAHChartFile(cah, cah.isDisplay2D(), file);
423
//	}
424

  
425

  
426
//	/**
427
//	 * Creates a chart from the specified CAH result and writes it in the specified file.
428
//	 * @param cah
429
//	 * @param file
430
//	 * @return
431
//	 */
432
//	public File createCAHChartFile(CAH cah, boolean display2D, File file)	{
433
//		if(display2D)	{
434
//			return this.createCAH2dChartFile(cah, file);
435
//		}
436
//		else	{
437
//			return this.createCAH3dChartFile(cah, file);
438
//		}
439
//	}
440
//
441
//	/**
442
//	 * Creates a chart from the specified CAH result and writes it in a temporary file in USER_TXM_HOME\results
443
//	 * @param cah
444
//	 * @param display2D
445
//	 * @return
446
//	 */
447
//	public File createCAHChartFile(CAH cah, boolean display2D)	{
448
//		if(display2D)	{
449
//			return this.createCAH2dChartFile(cah);
450
//		}
451
//		else	{
452
//			return this.createCAH3dChartFile(cah);
453
//		}
454
//	}
455
//
456
//	/**
457
//	 * Creates a 2d chart from the specified CAH result.
458
//	 * @param cah
459
//	 * @return
460
//	 */
461
//	public abstract Object createCAH2dChart(CAH cah);
462
//
463
//
464
//	/**
465
//	 * Creates a 2d chart from the specified CAH result and writes it in the specified file.
466
//	 * @param cah
467
//	 * @param file
468
//	 * @return
469
//	 */
470
//	public abstract File createCAH2dChartFile(CAH cah, File file);
471
//
472
//
473
//	/**
474
//	 * Creates a 2d chart from the specified CAH result and writes it in a temporary file in USER_TXM_HOME\results.
475
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
476
//	 * @param cah
477
//	 * @return
478
//	 */
479
//	public File createCAH2dChartFile(CAH cah)	{
480
//		return this.createCAH2dChartFile(cah, this.createTmpFile(___ChartsEngine.CHART_TYPE_CAH_2D));
481
//	}
482
//
483
//	/**
484
//	 * Creates a 3d chart from the specified CAH result.
485
//	 * @param cah
486
//	 * @return
487
//	 */
488
//	public abstract Object createCAH3dChart(CAH cah);
489
//
490
//
491
//	/**
492
//	 * Creates a 3d chart from the specified CAH result and writes it in the specified file.
493
//	 * @param cah
494
//	 * @param file
495
//	 * @return
496
//	 */
497
//	public abstract File createCAH3dChartFile(CAH cah, File file);
498
//
499
//
500
//	/**
501
//	 * Creates a 3d chart from the specified CAH result and writes it in a temporary file in USER_TXM_HOME\results.
502
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
503
//	 * @param cah
504
//	 * @return
505
//	 */
506
//	public File createCAH3dChartFile(CAH cah)	{
507
//		return this.createCAH3dChartFile(cah, this.createTmpFile(___ChartsEngine.CHART_TYPE_CAH_3D));
508
//	}
509

  
510
//	/**
511
//	 * Creates a chart from the specified specificities result.
512
//	 * @param specificitesResult the specificities result
513
//	 * @return
514
//	 */
515
//	public abstract Object createSpecificitiesChart(SpecificitesResult specificitiesResult, boolean transpose, boolean drawBars, boolean drawLines, float banalite, boolean grayscale);
516
//
517
//
518
//	/**
519
//	 * Creates a chart from the specified specificities result and writes it in the specified file.
520
//	 * @param specificitesResult the specificities result
521
//	 * @param file
522
//	 * @return
523
//	 */
524
//	public abstract File createSpecificitiesChartFile(SpecificitesResult specificitiesResult, boolean transpose, boolean drawBars, boolean drawLines, float banalite, boolean grayscale, File file);
525
//
526
//
527
//	/**
528
//	 * Creates a chart from the specified specificities result and writes it in a temporary file in USER_TXM_HOME\results.
529
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
530
//	 * @param specificitiesResult
531
//	 * @param typeNames
532
//	 * @param partNames
533
//	 * @param specIndex
534
//	 * @param transpose
535
//	 * @param drawBars
536
//	 * @param drawLines
537
//	 * @param banalite
538
//	 * @param monochrome
539
//	 * @return
540
//	 */
541
//	public File createSpecificitiesChartFile(SpecificitesResult specificitiesResult, boolean transpose, boolean drawBars, boolean drawLines, float banalite, boolean monochrome)	{
542
//		return this.createSpecificitiesChartFile(specificitiesResult, transpose, drawBars, drawLines, banalite, monochrome, this.createTmpFile(___ChartsEngine.CHART_TYPE_SPECIFICITIES));
543
//	}
544

  
545

  
546
//	/**
547
//	 * Creates a dimensions partition bar chart from the specified <code>Partition</code> result.
548
//	 * @param partition
549
//	 * @param sortPartsBySize
550
//	 * @return
551
//	 */
552
//	public abstract Object createPartitionDimensionsChart(Partition partition, boolean sortPartsBySize);
553
//
554
//
555
//	/**
556
//	 * Creates a dimensions partition bar chart from the specified <code>Partition</code> result and writes it in the specified file.
557
//	 * @param partition
558
//	 * @param sortPartsBySize
559
//	 * @param file
560
//	 * @return
561
//	 */
562
//	public abstract File createPartitionDimensionsChartFile(Partition partition, boolean sortPartsBySize, File file);
563

  
564

  
565
//	/**
566
//	 * Creates a dimensions partition bar chart from the specified <code>Partition</code> result and writes it in a temporary file in USER_TXM_HOME\results.
567
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
568
//	 * @param partition
569
//	 * @param sortPartsBySize
570
//	 * @return
571
//	 */
572
//	public File createDimensionsPartitionChartFile(Partition partition, boolean sortPartsBySize)	{
573
//		return this.createPartitionDimensionsChartFile(partition, sortPartsBySize, this.createTmpFile(___ChartsEngine.CHART_TYPE_PARTITION_DIMENSIONS));
574
//	}
575
//
576
//	/**
577
//	 *
578
//	 * @param partition
579
//	 * @param file
580
//	 * @return
581
//	 */
582
//	public File createDimensionsPartitionChartFile(Partition partition, File file)	{
583
//		return this.createPartitionDimensionsChartFile(partition, (Boolean) ___ChartsEngine.properties.get(___ChartsEngine.PROP_PARTITION_DIMENSIONS_SORTED_BY_SIZE), file);
584
//	}
585
//
586
//
587
//	/**
588
//	 * Creates a string title, shared by charts engine implementations, for the dimensions partition chart from the specified result.
589
//	 * @param the partition result
590
//	 * @param sortPartsBySize the sort parts by size state
591
//	 * @return the title string
592
//	 */
593
//	public String createPartitionDimensionsChartTitle(Partition partition, boolean sortPartsBySize)	{
594
//
595
//		String title = ChartsEngineCoreMessages.bind(ChartsEngineCoreMessages.ChartsEngine_PARTITION_DIMENSIONS_DIMENSIONS_OF_PARTITION, partition.getName(), partition.getCorpus().getName());
596
//
597
//		if((Boolean) ___ChartsEngine.properties.get(PROP_PARTITION_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE))	{
598
//			title += "\n(" +  partition.getParts().size() + " parts" + ")"; //$NON-NLS-1$ //$NON-NLS-3$
599
//		}
600
//
601
//		if(sortPartsBySize) {
602
//			title += ChartsEngineCoreMessages.ChartsEngine_PARTITION_DIMENSIONS_SORTED_BY_SIZE;
603
//		}
604
//
605
//		return title;
606
//	}
607

  
608

  
609

  
610
//	/**
611
//	 * Creates a progression chart from the specified <code>Progression</code> result and writes it in the specified file.
612
//	 * @param progression
613
//	 * @return
614
//	 */
615
//	public abstract Object createProgressionChart(Progression progression, boolean grayscale, boolean monostyle, boolean cumulative);
616
//
617
//	/**
618
//	 * Creates a progression chart from the specified <code>Progression</code> result and writes it in the specified file.
619
//	 * @param progression
620
//	 * @param file
621
//	 * @return
622
//	 */
623
//	public abstract File createProgressionChartFile(Progression progression, boolean grayscale, boolean monostyle, boolean cumulative, File file);
624
//
625
//
626
//	/**
627
//	 * Creates a progression chart from the specified <code>Progression</code> result and writes it in a temporary file in USER_TXM_HOME\results.
628
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
629
//	 * @param progression
630
//	 * @param grayscale
631
//	 * @param monostyle
632
//	 * @param cumulative
633
//	 * @return
634
//	 */
635
//	public File createProgressionChartFile(Progression progression, boolean grayscale, boolean monostyle, boolean cumulative)	{
636
//		return this.createProgressionChartFile(progression, grayscale, monostyle, cumulative, this.createTmpFile(___ChartsEngine.CHART_TYPE_PROGRESSION));
637
//	}
638
//
639
//
640
//
641
//	/**
642
//	 * Creates a string title, shared by charts engine implementations, for the progression chart from the specified result.
643
//	 * @param the progression result
644
//	 * @param doCumulative
645
//	 * @return the titles string
646
//	 */
647
//	public String createProgressionChartTitle(Progression progression, boolean doCumulative)	{
648
//
649
//		String title = Messages.Progression_9 + " "; //$NON-NLS-1$
650
//
651
//		// Put queries in title
652
//		for(int i = 0; i < progression.getQueries().size(); i++) {
653
//			title +=  progression.getQueries().get(i).getQueryString();
654
//			if(i < progression.getQueries().size() - 1)	{
655
//				title += ", "; //$NON-NLS-1$
656
//			}
657
//		}
658
//
659
//
660
//		title += " " + Messages.Progression_10 + " " + progression.getCorpus().getName(); //$NON-NLS-1$ //$NON-NLS-2$
661
//
662
//		if(!doCumulative)	{
663
//			title += " " + Messages.Progression_11; //$NON-NLS-1$
664
//		}
665
//
666
//
667
//		// FIXME : is this useful ? I needed to create the setName() method for this.
668
//		progression.setName(title);
669
//
670
//		if (progression.getStructure() != null) {
671
//			title += "\n(" + Messages.Progression_12 + progression.getStructure().getName();
672
//			if (progression.getProperty() != null) {
673
//				title += Messages.Progression_13 + progression.getProperty().getName();
674
//				if (progression.getPropertyRegex() != null)	{
675
//					title += Messages.Progression_14 + progression.getPropertyRegex();
676
//				}
677
//			}
678
//			title += ")";
679
//		}
680
//
681
//		return title;
682
//	}
683

  
684

  
685

  
686
//	/**
687
//	 * Creates a chart according to the specified result and current output format and writes it in the specified file.
688
//	 * @param result
689
//	 * @param file
690
//	 * @return
691
//	 */
692
//	public File createChartFile(Object result, File file)	{
693
//
694
//		// Partition dimensions
695
//		if(result instanceof Partition)	{
696
//			return this.createDimensionsPartitionChartFile((Partition)result, file);
697
//		}
698
//		// Specificities
699
////		else if(result instanceof SpecificitesResult)	{
700
////			// FIXME : need to get the rendering properties
701
////			return this.createSpecificitiesChartFile((SpecificitesResult)result, false, true, false, 2, false, file);
702
////		}
703
//		// CA factorial map
704
//		else if(result instanceof CA)	{
705
//			return this.createCAFactorialMapChartFile((CA) result, file);
706
//		}
707
//		// CA singular values bar plot
708
//		// FIXME : j'ai besoin de connaître le type du graphe ici vu que résultat stockée est une CA pour les singular values bar plot
709
//		// Ajouter un champ int graphType dans ChartEditorPart ??? FAIT : le champ a été ajouté dans le ItemSelectionRenderer mais donc uniquement dispo pour JFC
710
////		else if(result instanceof Integer && (Integer)result == ChartsEngine.CHART_TYPE_CA_SINGULAR_VALUES)	{
711
////			return this.createCASingularValuesBarChartFile(((CA) result, file);
712
////		}
713
//
714
//
715
//		return null;
716
//	}
717
//
718
//
719
//	/**
720
//	 * Creates a chart according to the specified result and output format and writes it in the specified file.
721
//	 * @param result
722
//	 * @param file
723
//	 * @param outputFormat
724
//	 * @return
725
//	 */
726
//	public File createChartFile(Object result, File file, String outputFormat)	{
727
//		// FIXME : bad ? Switch the current charts engine output format, export the chart, and then roll back the output format
728
//		int oldOutputFormat = this.outputFormat;
729
//		this.setOutputFormat(outputFormat);
730
//		file = this.createChartFile(result, file);
731
//		this.setOutputFormat(oldOutputFormat);
732
//
733
//		return file;
734
//	}
735

  
736

  
737
	/**
738
	 * Exports the chart to the specified file. Also crops the image according to the specified drawing area values.
739
	 * @param chart
740
	 * @param file
741
	 * @param outputFormat
742
	 * @param imageWidth
743
	 * @param imageHeight
744
	 * @param drawingAreaX
745
	 * @param drawingAreaY
746
	 * @param drawingAreaWidth
747
	 * @param drawingAreaHeight
748
	 * @return
749
	 */
750
	public abstract File exportChart(Object chart, File file, int outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight);
751

  
752

  
753
	/**
754
	 * Exports the chart to the specified file.
755
	 * @param chart
756
	 * @param file
757
	 * @param outputFormat
758
	 * @param imageWidth
759
	 * @param imageHeight
760
	 * @return
761
	 */
762
	public File exportChart(Object chart, File file, int outputFormat, int imageWidth, int imageHeight)	{
763
		return this.exportChart(chart, file, outputFormat, imageWidth, imageHeight, 0, 0, imageWidth, imageHeight);
764
	}
765

  
766

  
767
	/**
768
	 * @return the name
769
	 */
770
	public String getName() {
771
		return name;
772
	}
773

  
774
	/**
775
	 * @param name the name to set
776
	 */
777
	public void setName(String name) {
778
		this.name = name;
779
	}
780

  
781

  
782
	/**
783
	 * @return the output format
784
	 */
785
	public int getOutputFormat() {
786
		return outputFormat;
787
	}
788

  
789

  
790

  
791
	/**
792
	 * Returns the output display formats supported by the implementation.
793
	 * This method is intended to be used in the purpose of knowing all the possible display outputs offered by the charts engine implementation and dedicated to the UI visualization  (ex. Java2D, iplots, etc.).
794
	 * @return
795
	 */
796
	public abstract ArrayList<String> getSupportedOutputDisplayFormats();
797

  
798
	/**
799
	 * Returns the output file formats supported by the implementation.
800
	 * This method is intended to be used in the purpose of knowing all the possible file outputs offered by the charts engine implementation.
801
	 * @return
802
	 */
803
	public abstract ArrayList<String> getSupportedOutputFileFormats();
804

  
805

  
806
	/**
807
	 * Sets the output format for the generated charts.
808
	 * @param outputFormat the output format to set
809
	 */
810
	public void setOutputFormat(int outputFormat) {
811
		this.outputFormat = outputFormat;
812
	}
813

  
814
	/**
815
	 * Sets the output format for the generated charts.
816
	 * @param outputFormat the output format to set
817
	 */
818
	public void setOutputFormat(String outputFormat) {
819
		this.setOutputFormat(___ChartsEngine.getOutputFormatDefinition(outputFormat));
820
	}
821

  
822

  
823

  
824
	/**
825
	 * Replaces all non allowed characters in file name to '_' and returns the cleaned file name.
826
	 * @param fileName the file name to clean
827
	 * @return the cleaned file name
828
	 */
829
	public static String cleanFileName(String fileName)	{
830
		return fileName.replaceAll("[^a-zA-Z0-9\\._-]+", "_");
831
	}
832

  
833

  
834
	/**
835
	 * Checks if the specified properties are defined and if not, initializes them with default values.
836
	 */
837
	public static void initDefaultProperties(Properties props)	{
838
//		// Set Java/JFreeChart charts engine as default
839
//		if(props.getProperty(PROP_CHARTS_ENGINE_NAME) == null || props.getProperty(PROP_CHARTS_ENGINE_NAME).length() == 0)	{
840
//			props.setProperty(PROP_CHARTS_ENGINE_NAME, ___JFCChartsEngine.NAME);
841
//		}
842
//		// Set JFreeChart/Java2D as default charts engine display format
843
//		if(props.getProperty(PROP_CHARTS_ENGINE_OUTPUT_FORMAT) == null || props.getProperty(PROP_CHARTS_ENGINE_OUTPUT_FORMAT).length() == 0)	{
844
//			props.setProperty(PROP_CHARTS_ENGINE_OUTPUT_FORMAT, outputFormatDefinitions.get(___JFCChartsEngine.OUTPUT_FORMAT_JFC_JAVA2D));
845
//		}
846
//		// Default property for partition dimensions charts sorting
847
//		if(props.get(___ChartsEngine.PROP_PARTITION_DIMENSIONS_SORTED_BY_SIZE) == null)	{
848
//			props.put(___ChartsEngine.PROP_PARTITION_DIMENSIONS_SORTED_BY_SIZE, false);
849
//		}
850
//		// Display partition dimensions parts count in chart title
851
//		if(props.get(___ChartsEngine.PROP_PARTITION_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE) == null)	{
852
//			props.put(___ChartsEngine.PROP_PARTITION_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE, false);
853
//		}
854
	}
855

  
856
	/**
857
	 * Returns an output format definition as a string specified by its key.
858
	 * @param key
859
	 * @return
860
	 */
861
	public static String getOutputFormatDefinition(int key)	{
862
		return outputFormatDefinitions.get(key);
863
	}
864

  
865
	/**
866
	 * Returns an output format definition as an integer specified by its string value if it exists otherwise -1.
867
	 * @param outputFormat
868
	 * @return
869
	 */
870
	public static int getOutputFormatDefinition(String outputFormat)	{
871
		int index = -1;
872

  
873
		for (Map.Entry<Integer, String> e : outputFormatDefinitions.entrySet()) {
874
		    if(e.getValue().equals(outputFormat) || e.getValue().equals(outputFormat.toLowerCase()))	{
875
		    	index = e.getKey();
876
		    	break;
877
		    }
878
		}
879

  
880
		return index;
881
	}
882

  
883
	/**
884
	 * Auto-populate supported output file raster formats list from available system image writers.
885
	 * @param supportedOutputFileFormats
886
	 * @return
887
	 */
888
	// FIXME: this method is useful but can lead to a deadlock when call during the SWT initialization maybe because of a multi-thread problem
889
	public static ArrayList<String> populateSupportedOutputRasterFileFormats(ArrayList<String> supportedOutputFileFormats)	{
890
		String[] writerFormatNames = javax.imageio.ImageIO.getWriterFormatNames();
891

  
892
		for(int i = 0; i < writerFormatNames.length; i++) {
893
			int outputFormat = getOutputFormatDefinition(writerFormatNames[i]);
894
			if(outputFormat != -1 && !supportedOutputFileFormats.contains(writerFormatNames[i]) && !supportedOutputFileFormats.contains(writerFormatNames[i].toLowerCase()))	 {
895
				supportedOutputFileFormats.add(writerFormatNames[i].toLowerCase());
896
			}
897
		}
898
		return supportedOutputFileFormats;
899
	}
900

  
901
//	/**
902
//	 * Sets the CA factorial map rows visibility and refreshes the chart.
903
//	 * @param ca
904
//	 * @param visible
905
//	 */
906
//	public void updateChartCAFactorialMapSetRowsVisible(Object chart, CA ca, boolean visible)	{
907
//		ca.setShown(ca.isShowIndividuals(), visible);
908
//	}
909
//
910
//	/**
911
//	 * Sets the CA factorial map columns visibility and refreshes the chart.
912
//	 * @param ca
913
//	 * @param visible
914
//	 */
915
//	public void updateChartCAFactorialMapSetColumnsVisible(Object chart, CA ca, boolean visible)	{
916
//		ca.setShown(visible, ca.isShowVariables());
917
//	}
918
//
919
//
920
//	/**
921
//	 * Sets the CA factorial map dimensions.
922
//	 * @param editorPart
923
//	 * @param dimension1
924
//	 * @param dimension2
925
//	 */
926
//	public void updateChartCAFactorialMapSetDimensions(Object chart, CA ca, int dimension1, int dimension2)	{
927
//		ca.setDimensions(dimension1, dimension2);
928
//	}
929

  
930
//	/**
931
//	 * Highlights points in the CA factorial map chart according to the specified labels.
932
//	 * @param chart
933
//	 * @param rows
934
//	 * @param labels
935
//	 */
936
//	public abstract void updateChartCAFactorialMapHighlightPoints(Object chart, boolean rows, String[] labels);
937
//
938
//	/**
939
//	 * Sets the items selection order on label.
940
//	 * @param chart
941
//	 * @param itemsSelectionOrder
942
//	 */
943
//	public abstract void updateChartCAFactorialMapSetLabelItemsSelectionOrder(Object chart, String[] rowLabels, String[] colLabels);
944
//	
945
//	/**
946
//	 * Gets the rows points currently selected in the CA factorial map chart.
947
//	 * @return
948
//	 */
949
//	public abstract ArrayList<String> getCAFactorialMapChartSelectedRowPoints(Object chart);
950
//
951
//	/**
952
//	 * Gets the columns points currently selected in the CA factorial map chart.
953
//	 * @return
954
//	 */
955
//	public abstract ArrayList<String> getCAFactorialMapChartSelectedColumnPoints(Object chart);
956
//	
957
//	
958
}
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartCreator.java (revision 207)
4 4
import java.io.File;
5 5
import java.util.ArrayList;
6 6

  
7
import org.txm.utils.logger.Log;
7 8

  
9

  
10

  
8 11
/**
9 12
 * Abstract base for chart creation in command plugins from a result data.
10 13
 * @author sjacquot
......
93 96

  
94 97
	/**
95 98
	 * Creates a chart file according to the specified result data.
96
	 * This method should be overridden in implementations to define a prefix file name.
97 99
	 * @param resultData
98 100
	 * @param params
99 101
	 * @return
......
113 115
	 * @param preferencesNode
114 116
	 */
115 117
	public void updateChart(Object chart, Object resultData, String preferencesNode)	{
116
		System.out.println("ChartCreator.updateChart(): not implemented. This method is intended to be overridden in subclasses."); //$NON-NLS-1$
118
		Log.severe("ChartCreator.updateChart(): not implemented. This method is intended to be overridden in subclasses."); //$NON-NLS-1$
117 119
	}
118 120
	
119 121
	/**
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/preferences/ChartsEnginePreferences.java (revision 207)
84 84
		preferences.putBoolean(ChartsEnginePreferences.SHOW_GRID, true);
85 85
		preferences.putInt(ChartsEnginePreferences.RENDERING_COLORS_MODE, ChartsEngine.RENDERING_COLORS_MODE);
86 86
	}
87
	
88
	
87 89
}
88 90

  
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java (revision 207)
374 374
		try {
375 375
			File resultsDir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME), "results"); //$NON-NLS-1$
376 376
			resultsDir.mkdirs();
377
			
378
			// right padding to 3 characters long
379
			if(prefix.length() < 3)	{
380
				prefix =  String.format("%1$-3s", prefix).replace(' ', '_'); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
381
			}
382
			
377 383
			file = File.createTempFile(prefix, "." + this.outputFormat, resultsDir);
378 384
		}
379 385
		catch (IOException e) {
......
387 393
		return file;
388 394
	}
389 395

  
390

  
391
//	/**
392
//	 * Creates a temporary file in USER_TXM_HOME\results.
393
//	 * The prefix and the suffix are computed according to the specified chart type and the current output format of the charts engine.
394
//	 * @param chartType
395
//	 * @return
396
//	 */
397
//	// FIXME: stop to use and remove the chart static types in ChartsEngine? Cause this is now delegate to the chart creator extensions? 
398
//	public File createTmpFile(int chartType)	{
399
//		if(chartType == ChartsEngine.CHART_TYPE_PARTITION_DIMENSIONS)	{
400
//			return this.createTmpFile("info");
401
//		}
402
//		else if(chartType == ChartsEngine.CHART_TYPE_SPECIFICITIES)	{
403
//			return this.createTmpFile("specif");
404
//		}
405
//		else if(chartType == ChartsEngine.CHART_TYPE_CA_SINGULAR_VALUES)	{
406
//			return this.createTmpFile("casingularvalues");
407
//		}
408
//		else if(chartType == ChartsEngine.CHART_TYPE_CA_FACTORIAL_MAP)	{
409
//			return this.createTmpFile("cafactorialmap");
410
//		}
411
//		else if(chartType == ChartsEngine.CHART_TYPE_PROGRESSION)	{
412
//			return this.createTmpFile("progression");
413
//		}
414
//		else if(chartType == ChartsEngine.CHART_TYPE_CAH_2D)	{
415
//			return this.createTmpFile("cah2d");
416
//		}
417
//		else if(chartType == ChartsEngine.CHART_TYPE_CAH_3D)	{
418
//			return this.createTmpFile("cah3d");
419
//		}
420
//
421
//		return this.createTmpFile("unknown");
422
//	}
423

  
424

  
425

  
426

  
427
// FIXME
428
//	/**
429
//	 * Creates a chart from the specified CAH result.
430
//	 * @param cah
431
//	 * @return
432
//	 */
433
//	public Object createCAHChart(CAH cah)	{
434
//		return this.createCAHChart(cah, cah.isDisplay2D());
435
//	}
436
//
437

  
438
//	/**
439
//	 * Creates a chart from the specified CAH result.
440
//	 * @param cah
441
//	 * @return
442
//	 */
443
//	public Object createCAHChart(CAH cah, boolean chart2d)	{
444
//		if(chart2d)	{
445
//			return this.createCAH2dChart(cah);
446
//		}
447
//		else	{
448
//			return this.createCAH3dChart(cah);
449
//		}
450
//	}
451

  
452
// FIXME
453
//
454
//	/**
455
//	 * Creates a chart from the specified CAH result and writes it in a temporary file in USER_TXM_HOME\results
456
//	 * @param cah
457
//	 * @return
458
//	 */
459
//	public File createCAHChartFile(CAH cah)	{
460
//		return this.createCAHChartFile(cah, cah.isDisplay2D());
461
//	}
462
//
463
//
464
//	/**
465
//	 * Creates a chart from the specified CAH result and writes it in the specified file.
466
//	 * @param cah
467
//	 * @param file
468
//	 * @return
469
//	 */
470
//	public File createCAHChartFile(CAH cah, File file)	{
471
//		return this.createCAHChartFile(cah, cah.isDisplay2D(), file);
472
//	}
473

  
474

  
475
//	/**
476
//	 * Creates a chart from the specified CAH result and writes it in the specified file.
477
//	 * @param cah
478
//	 * @param file
479
//	 * @return
480
//	 */
481
//	public File createCAHChartFile(CAH cah, boolean display2D, File file)	{
482
//		if(display2D)	{
483
//			return this.createCAH2dChartFile(cah, file);
484
//		}
485
//		else	{
486
//			return this.createCAH3dChartFile(cah, file);
487
//		}
488
//	}
489
//
490
//	/**
491
//	 * Creates a chart from the specified CAH result and writes it in a temporary file in USER_TXM_HOME\results
492
//	 * @param cah
493
//	 * @param display2D
494
//	 * @return
495
//	 */
496
//	public File createCAHChartFile(CAH cah, boolean display2D)	{
497
//		if(display2D)	{
498
//			return this.createCAH2dChartFile(cah);
499
//		}
500
//		else	{
501
//			return this.createCAH3dChartFile(cah);
502
//		}
503
//	}
504
//
505
//	/**
506
//	 * Creates a 2d chart from the specified CAH result.
507
//	 * @param cah
508
//	 * @return
509
//	 */
510
//	public abstract Object createCAH2dChart(CAH cah);
511
//
512
//
513
//	/**
514
//	 * Creates a 2d chart from the specified CAH result and writes it in the specified file.
515
//	 * @param cah
516
//	 * @param file
517
//	 * @return
518
//	 */
519
//	public abstract File createCAH2dChartFile(CAH cah, File file);
520
//
521
//
522
//	/**
523
//	 * Creates a 2d chart from the specified CAH result and writes it in a temporary file in USER_TXM_HOME\results.
524
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
525
//	 * @param cah
526
//	 * @return
527
//	 */
528
//	public File createCAH2dChartFile(CAH cah)	{
529
//		return this.createCAH2dChartFile(cah, this.createTmpFile(ChartsEngine.CHART_TYPE_CAH_2D));
530
//	}
531
//
532
//	/**
533
//	 * Creates a 3d chart from the specified CAH result.
534
//	 * @param cah
535
//	 * @return
536
//	 */
537
//	public abstract Object createCAH3dChart(CAH cah);
538
//
539
//
540
//	/**
541
//	 * Creates a 3d chart from the specified CAH result and writes it in the specified file.
542
//	 * @param cah
543
//	 * @param file
544
//	 * @return
545
//	 */
546
//	public abstract File createCAH3dChartFile(CAH cah, File file);
547
//
548
//
549
//	/**
550
//	 * Creates a 3d chart from the specified CAH result and writes it in a temporary file in USER_TXM_HOME\results.
551
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
552
//	 * @param cah
553
//	 * @return
554
//	 */
555
//	public File createCAH3dChartFile(CAH cah)	{
556
//		return this.createCAH3dChartFile(cah, this.createTmpFile(ChartsEngine.CHART_TYPE_CAH_3D));
557
//	}
558

  
559
//	/**
560
//	 * Creates a chart from the specified specificities result.
561
//	 * @param specificitesResult the specificities result
562
//	 * @return
563
//	 */
564
//	public abstract Object createSpecificitiesChart(SpecificitesResult specificitiesResult, boolean transpose, boolean drawBars, boolean drawLines, float banalite, boolean grayscale);
565
//
566
//
567
//	/**
568
//	 * Creates a chart from the specified specificities result and writes it in the specified file.
569
//	 * @param specificitesResult the specificities result
570
//	 * @param file
571
//	 * @return
572
//	 */
573
//	public abstract File createSpecificitiesChartFile(SpecificitesResult specificitiesResult, boolean transpose, boolean drawBars, boolean drawLines, float banalite, boolean grayscale, File file);
574
//
575
//
576
//	/**
577
//	 * Creates a chart from the specified specificities result and writes it in a temporary file in USER_TXM_HOME\results.
578
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
579
//	 * @param specificitiesResult
580
//	 * @param typeNames
581
//	 * @param partNames
582
//	 * @param specIndex
583
//	 * @param transpose
584
//	 * @param drawBars
585
//	 * @param drawLines
586
//	 * @param banalite
587
//	 * @param monochrome
588
//	 * @return
589
//	 */
590
//	public File createSpecificitiesChartFile(SpecificitesResult specificitiesResult, boolean transpose, boolean drawBars, boolean drawLines, float banalite, boolean monochrome)	{
591
//		return this.createSpecificitiesChartFile(specificitiesResult, transpose, drawBars, drawLines, banalite, monochrome, this.createTmpFile(ChartsEngine.CHART_TYPE_SPECIFICITIES));
592
//	}
593

  
594

  
595 396
	/**
596
	 * Creates a dimensions partition bar chart from the specified <code>Partition</code> result.
597
	 * @param partition
598
	 * @param sortPartsBySize
599
	 * @return
600
	 */
601
	//public abstract Object createPartitionDimensionsChart(Partition partition, boolean sortPartsBySize);
602

  
603

  
604
	/**
605
	 * Creates a dimensions partition bar chart from the specified <code>Partition</code> result and writes it in the specified file.
606
	 * @param partition
607
	 * @param sortPartsBySize
608
	 * @param file
609
	 * @return
610
	 */
611
	//public abstract File createPartitionDimensionsChartFile(Partition partition, boolean sortPartsBySize, File file);
612

  
613

  
614
	/**
615
	 * Creates a dimensions partition bar chart from the specified <code>Partition</code> result and writes it in a temporary file in USER_TXM_HOME\results.
616
	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
617
	 * @param partition
618
	 * @param sortPartsBySize
619
	 * @return
620
	 */
621
//	public File createDimensionsPartitionChartFile(Partition partition, boolean sortPartsBySize)	{
622
//		return this.createPartitionDimensionsChartFile(partition, sortPartsBySize, this.createTmpFile(ChartsEngine.CHART_TYPE_PARTITION_DIMENSIONS));
623
//	}
624

  
625
	/**
626
	 *
627
	 * @param partition
628
	 * @param file
629
	 * @return
630
	 */
631
//	public File createDimensionsPartitionChartFile(Partition partition, File file)	{
632
//		return this.createPartitionDimensionsChartFile(partition, (Boolean) ChartsEngine.properties.get(ChartsEngine.PROP_PARTITION_DIMENSIONS_SORTED_BY_SIZE), file);
633
//	}
634

  
635

  
636
	/**
637
	 * Creates a string title, shared by charts engine implementations, for the dimensions partition chart from the specified result.
638
	 * @param the partition result
639
	 * @param sortPartsBySize the sort parts by size state
640
	 * @return the title string
641
	 */
642
//	public String createPartitionDimensionsChartTitle(Partition partition, boolean sortPartsBySize)	{
643
//
644
//		String title = ChartsEngineMessages.bind(ChartsEngineMessages.ChartsEngine_PARTITION_DIMENSIONS_DIMENSIONS_OF_PARTITION, partition.getName(), partition.getCorpus().getName());
645
//
646
//		if((Boolean) ChartsEngine.properties.get(PROP_PARTITION_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE))	{
647
//			title += "\n(" +  partition.getParts().size() + " parts" + ")"; //$NON-NLS-1$ //$NON-NLS-3$
648
//		}
649
//
650
//		if(sortPartsBySize) {
651
//			title += ChartsEngineMessages.ChartsEngine_PARTITION_DIMENSIONS_SORTED_BY_SIZE;
652
//		}
653
//
654
//		return title;
655
//	}
656

  
657

  
658
//
659
//	/**
660
//	 * Creates a progression chart from the specified <code>Progression</code> result and writes it in the specified file.
661
//	 * @param progression
662
//	 * @return
663
//	 */
664
//	public abstract Object createProgressionChart(Progression progression, boolean grayscale, boolean monostyle, boolean cumulative);
665
//
666
//	/**
667
//	 * Creates a progression chart from the specified <code>Progression</code> result and writes it in the specified file.
668
//	 * @param progression
669
//	 * @param file
670
//	 * @return
671
//	 */
672
//	public abstract File createProgressionChartFile(Progression progression, boolean grayscale, boolean monostyle, boolean cumulative, File file);
673
//
674
//
675
//	/**
676
//	 * Creates a progression chart from the specified <code>Progression</code> result and writes it in a temporary file in USER_TXM_HOME\results.
677
//	 * The prefix and the suffix are computed according to the chart type and the current output format of the charts engine.
678
//	 * @param progression
679
//	 * @param grayscale
680
//	 * @param monostyle
681
//	 * @param cumulative
682
//	 * @return
683
//	 */
684
//	public File createProgressionChartFile(Progression progression, boolean grayscale, boolean monostyle, boolean cumulative)	{
685
//		return this.createProgressionChartFile(progression, grayscale, monostyle, cumulative, this.createTmpFile(ChartsEngine.CHART_TYPE_PROGRESSION));
686
//	}
687
//
688
//
689
//
690
//	/**
691
//	 * Creates a string title, shared by charts engine implementations, for the progression chart from the specified result.
692
//	 * @param the progression result
693
//	 * @param doCumulative
694
//	 * @return the titles string
695
//	 */
696
//	public String createProgressionChartTitle(Progression progression, boolean doCumulative)	{
697
//
698
//		String title = Messages.Progression_9 + " "; //$NON-NLS-1$
699
//
700
//		// Put queries in title
701
//		for(int i = 0; i < progression.getQueries().size(); i++) {
702
//			title +=  progression.getQueries().get(i).getQueryString();
703
//			if(i < progression.getQueries().size() - 1)	{
704
//				title += ", "; //$NON-NLS-1$
705
//			}
706
//		}
707
//
708
//
709
//		title += " " + Messages.Progression_10 + " " + progression.getCorpus().getName(); //$NON-NLS-1$ //$NON-NLS-2$
710
//
711
//		if(!doCumulative)	{
712
//			title += " " + Messages.Progression_11; //$NON-NLS-1$
713
//		}
714
//
715
//
716
//		// FIXME : is this useful ? I needed to create the setName() method for this.
717
//		progression.setName(title);
718
//
719
//		if (progression.getStructure() != null) {
720
//			title += "\n(" + Messages.Progression_12 + progression.getStructure().getName();
721
//			if (progression.getProperty() != null) {
722
//				title += Messages.Progression_13 + progression.getProperty().getName();
723
//				if (progression.getPropertyRegex() != null)	{
724
//					title += Messages.Progression_14 + progression.getPropertyRegex();
725
//				}
726
//			}
727
//			title += ")";
728
//		}
729
//
730
//		return title;
731
//	}
732

  
733

  
734

  
735
	/**
736
	 * Creates a chart according to the specified result and current output format and writes it in the specified file.
737
	 * @param result
738
	 * @param file
739
	 * @return
740
	 */
741
//	public File createChartFile(Object result, File file)	{
742
//
743
//		// Partition dimensions
744
//		if(result instanceof Partition)	{
745
//			return this.createDimensionsPartitionChartFile((Partition)result, file);
746
//		}
747
//		// Specificities
748
//		else if(result instanceof SpecificitesResult)	{
749
//			// FIXME : need to get the rendering properties
750
//			return this.createSpecificitiesChartFile((SpecificitesResult)result, false, true, false, 2, false, file);
751
//		}
752
//		// CA factorial map
753
//		else if(result instanceof CA)	{
754
//			return this.createCAFactorialMapChartFile((CA) result, file);
755
//		}
756
//		// CA singular values bar plot
757
//		// FIXME : j'ai besoin de connaître le type du graphe ici vu que résultat stockée est une CA pour les singular values bar plot
758
//		// Ajouter un champ int graphType dans ChartEditorPart ??? FAIT : le champ a été ajouté dans le ItemSelectionRenderer mais donc uniquement dispo pour JFC
759
////		else if(result instanceof Integer && (Integer)result == ChartsEngine.CHART_TYPE_CA_SINGULAR_VALUES)	{
760
////			return this.createCASingularValuesBarChartFile(((CA) result, file);
761
////		}
762
//
763
//
764
//		return null;
765
//	}
766

  
767
	/**
768 397
	 * Creates a file form the specified chart object.
769 398
	 * @param chart
770 399
	 * @param file
tmp/org.txm.chartsengine.core/META-INF/MANIFEST.MF (revision 207)
3 3
Bundle-Name: Charts Engine Core
4 4
Bundle-SymbolicName: org.txm.chartsengine.core;singleton:=true
5 5
Bundle-Version: 1.0.0.qualifier
6
Require-Bundle: org.txm.core;bundle-version="0.7.0",
6
Require-Bundle: org.txm.utils,
7
 org.txm.core;bundle-version="0.7.0",
7 8
 org.eclipse.core.runtime
8 9
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
9 10
Bundle-ActivationPolicy: lazy
tmp/org.txm.chartsengine.core/schema/org.txm.chartsengine.chartcreator.exsd (revision 207)
69 69
         <attribute name="fileNamePrefix" type="string" use="required">
70 70
            <annotation>
71 71
               <documentation>
72
                  The prefix that will be added to the generated file name.
72
                  The prefix that will be added to the generated file name. File java class needs prefix at least three characters long. It will be right padded with underscore characters by the chats engine if it&apos;s shorten.
73 73
               </documentation>
74 74
            </annotation>
75 75
         </attribute>
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CorrespondanceAnalysisEditorInput.java (revision 207)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
//
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
//
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
//
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
//
22
//
23
//
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff