Révision 3836
TXM/trunk/bundles/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java (revision 3836) | ||
---|---|---|
41 | 41 |
/** |
42 | 42 |
* Constants for output formats and file extensions. |
43 | 43 |
*/ |
44 |
public final static String OUTPUT_FORMAT_NONE = "NONE", OUTPUT_FORMAT_JPEG = "jpeg", OUTPUT_FORMAT_PDF = "pdf", OUTPUT_FORMAT_PNG = "png", OUTPUT_FORMAT_PS = "ps", OUTPUT_FORMAT_SVG = "svg", |
|
45 |
OUTPUT_FORMAT_BMP = "bmp", OUTPUT_FORMAT_GIF = "gif"; |
|
44 |
public final static String OUTPUT_FORMAT_NONE = "NONE", OUTPUT_FORMAT_JPEG = "jpeg", OUTPUT_FORMAT_PDF = "pdf", OUTPUT_FORMAT_PNG = "png", OUTPUT_FORMAT_PS = "ps", OUTPUT_FORMAT_SVG = "svg", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
|
|
45 |
OUTPUT_FORMAT_BMP = "bmp", OUTPUT_FORMAT_GIF = "gif"; //$NON-NLS-1$ //$NON-NLS-2$
|
|
46 | 46 |
|
47 | 47 |
/** |
48 | 48 |
* Constants for the colors rendering modes. |
... | ... | |
54 | 54 |
* Font styles definition. |
55 | 55 |
*/ |
56 | 56 |
//FIXME: SJ: see if we move this in another class to share it |
57 |
public final static String[] FONT_STYLES = {"Regular", "Bold", "Italic", "Bold italic"}; |
|
57 |
public final static String[] FONT_STYLES = {"Regular", "Bold", "Italic", "Bold italic"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
|
58 | 58 |
|
59 | 59 |
/** |
60 | 60 |
* Logical font names definition. |
... | ... | |
135 | 135 |
} |
136 | 136 |
|
137 | 137 |
if (chartCreator == null && showLogWarning) { |
138 |
Log.fine(this.getName() + ": No chart creator can be found for result: " + result.getClass() + " and chart type: " + chartType + "."); //$NON-NLS-1$ |
|
138 |
Log.fine(this.getName() + ": No chart creator can be found for result: " + result.getClass() + " and chart type: " + chartType + "."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
139 | 139 |
} |
140 | 140 |
return chartCreator; |
141 | 141 |
} |
... | ... | |
361 | 361 |
*/ |
362 | 362 |
public static Font createFont(String encodedStr) { |
363 | 363 |
String[] data = encodedStr.split("\\|");///$NON-NLS-1$ |
364 |
Font font = new Font(data[1], Integer.valueOf(data[3]), Integer.parseInt(data[2].split("\\.")[0])); // font name, font style, font size |
|
364 |
Font font = new Font(data[1], Integer.valueOf(data[3]), Integer.parseInt(data[2].split("\\.")[0])); // font name, font style, font size //$NON-NLS-1$
|
|
365 | 365 |
return font; |
366 | 366 |
} |
367 | 367 |
|
... | ... | |
391 | 391 |
prefix = String.format("%1$-3s", prefix).replace(' ', '_'); //$NON-NLS-1$ |
392 | 392 |
} |
393 | 393 |
|
394 |
file = File.createTempFile(prefix, "." + this.outputFormat, resultsDir); |
|
394 |
file = File.createTempFile(prefix, "." + this.outputFormat, resultsDir); //$NON-NLS-1$
|
|
395 | 395 |
} |
396 | 396 |
catch (IOException e) { |
397 | 397 |
Log.severe(NLS.bind(ChartsEngineCoreMessages.error_cantCreateTmpChartFileP0, e)); |
... | ... | |
433 | 433 |
prefix = String.format("%1$-3s", prefix).replace(' ', '_'); //$NON-NLS-1$ |
434 | 434 |
} |
435 | 435 |
|
436 |
file = new File(resultsDir, result.getChartCreator().getFileNamePrefix() + result.getParametersNodePath().replaceAll("/", "_") + "." + this.outputFormat); |
|
436 |
file = new File(resultsDir, result.getChartCreator().getFileNamePrefix() + result.getParametersNodePath().replaceAll("/", "_") + "." + this.outputFormat); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
437 | 437 |
|
438 | 438 |
// TODO : old code, useful ? and/or return null instead of the file if canWrite() return false ? |
439 | 439 |
if (!resultsDir.canWrite()) { |
... | ... | |
620 | 620 |
|
621 | 621 |
@Override |
622 | 622 |
public String toString() { |
623 |
String str = this.getName() + " (description: " + this.description + ", current output format: " + this.outputFormat; |
|
623 |
String str = this.getName() + " (description: " + this.description + ", current output format: " + this.outputFormat; //$NON-NLS-1$ //$NON-NLS-2$
|
|
624 | 624 |
|
625 |
str += ", supported output display formats: " + this.getSupportedOutputDisplayFormats().toString().replaceAll("\\[|\\]", ""); //$NON-NLS-2$ //$NON-NLS-3$ |
|
626 |
str += ", supported output file formats: " + this.getSupportedOutputFileFormats().toString().replaceAll("\\[|\\]", ""); //$NON-NLS-2$ //$NON-NLS-3$ |
|
625 |
str += ", supported output display formats: " + this.getSupportedOutputDisplayFormats().toString().replaceAll("\\[|\\]", ""); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
|
626 |
str += ", supported output file formats: " + this.getSupportedOutputFileFormats().toString().replaceAll("\\[|\\]", ""); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
|
|
627 | 627 |
|
628 |
str += ")"; |
|
628 |
str += ")"; //$NON-NLS-1$
|
|
629 | 629 |
|
630 | 630 |
return str; |
631 | 631 |
} |
TXM/trunk/bundles/org.txm.chartsengine.core/src/org/txm/chartsengine/core/preferences/ChartsEnginePreferences.java (revision 3836) | ||
---|---|---|
136 | 136 |
// } |
137 | 137 |
|
138 | 138 |
// FIXME: SJ: new version, but actually the should not be based on JFace format |
139 |
String defaultFont = "1|SansSerif|14|0"; |
|
139 |
String defaultFont = "1|SansSerif|14|0"; //$NON-NLS-1$
|
|
140 | 140 |
|
141 | 141 |
|
142 | 142 |
preferences.put(FONT, defaultFont); |
TXM/trunk/bundles/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java (revision 3836) | ||
---|---|---|
189 | 189 |
boolean computingState = true; |
190 | 190 |
|
191 | 191 |
try { |
192 |
Log.finest("*** ChartResult._compute(): " + this.getClass().getSimpleName() + ": starting computing process..."); |
|
192 |
Log.finest("*** ChartResult._compute(): " + this.getClass().getSimpleName() + ": starting computing process..."); //$NON-NLS-1$ //$NON-NLS-2$
|
|
193 | 193 |
|
194 | 194 |
boolean computingParametersChanged = super.hasParametersChanged(); |
195 | 195 |
boolean renderingParametersChanged = this.hasRenderingParameterChanged(); |
... | ... | |
197 | 197 |
if (this.isDirty()) { |
198 | 198 |
|
199 | 199 |
// Debug |
200 |
Log.finest("+++ ChartResult._compute(): " + this.getClass().getSimpleName() + ": computing result of type " + this.getClass() + "..."); |
|
200 |
Log.finest("+++ ChartResult._compute(): " + this.getClass().getSimpleName() + ": computing result of type " + this.getClass() + "..."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
201 | 201 |
|
202 | 202 |
computingState = this.__compute(monitor.createNewMonitor(90)) && this.renderChart(monitor.createNewMonitor(10)); |
203 | 203 |
} |
... | ... | |
205 | 205 |
if (computingParametersChanged) { // no parameter changed but result is dirty |
206 | 206 |
|
207 | 207 |
// Debug |
208 |
Log.finest("+++ ChartResult._compute(): " + this.getClass().getSimpleName() + ": computing result of type " + this.getClass() + "..."); |
|
208 |
Log.finest("+++ ChartResult._compute(): " + this.getClass().getSimpleName() + ": computing result of type " + this.getClass() + "..."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
209 | 209 |
|
210 | 210 |
computingState = this.__compute(monitor.createNewMonitor(90)) && this.renderChart(monitor.createNewMonitor(10)); |
211 | 211 |
} |
212 | 212 |
else if (renderingParametersChanged) { |
213 | 213 |
|
214 | 214 |
// Debug |
215 |
Log.finest("--- ChartResult._compute(): " + this.getClass().getSimpleName() + ": result parameters have not changed since last computing, computing skipped."); |
|
215 |
Log.finest("--- ChartResult._compute(): " + this.getClass().getSimpleName() + ": result parameters have not changed since last computing, computing skipped."); //$NON-NLS-1$ //$NON-NLS-2$
|
|
216 | 216 |
|
217 | 217 |
computingState = this.renderChart(monitor.createNewMonitor(100)); |
218 | 218 |
} |
... | ... | |
266 | 266 |
|
267 | 267 |
monitor.setTask("Rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "..."); |
268 | 268 |
|
269 |
Log.finest("*** ChartResult.renderChart(): rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "..."); //$NON-NLS-1$ |
|
269 |
Log.finest("*** ChartResult.renderChart(): rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "..."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
270 | 270 |
|
271 | 271 |
// update the chart dirty state from history if a parameter has changed since last computing |
272 | 272 |
// this.updateChartDirtyFromHistory(); |
... | ... | |
286 | 286 |
} |
287 | 287 |
chartCreator = alternativeEngine.getChartCreator(this); |
288 | 288 |
if (chartCreator != null) { |
289 |
Log.finest("ChartResult.renderChart(): another suitable chart creator has been found in charts engine: " + alternativeEngine + "."); //$NON-NLS-1$ |
|
289 |
Log.finest("ChartResult.renderChart(): another suitable chart creator has been found in charts engine: " + alternativeEngine + "."); //$NON-NLS-1$ //$NON-NLS-2$
|
|
290 | 290 |
this.chartsEngine = alternativeEngine; |
291 | 291 |
break; |
292 | 292 |
} |
... | ... | |
322 | 322 |
// ) |
323 | 323 |
|
324 | 324 |
) { |
325 |
Log.finest("+++ ChartResult.renderChart(): creating chart (charts engine = " + this.chartsEngine + ", output format = " + this.chartsEngine.getOutputFormat() + ")..."); //$NON-NLS-1$ |
|
325 |
Log.finest("+++ ChartResult.renderChart(): creating chart (charts engine = " + this.chartsEngine + ", output format = " + this.chartsEngine.getOutputFormat() + ")..."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
326 | 326 |
|
327 | 327 |
this.chart = chartCreator.createChart(this); |
328 | 328 |
} |
... | ... | |
362 | 362 |
|
363 | 363 |
} |
364 | 364 |
else { |
365 |
Log.severe("ChartResult.renderChart(): can not find any suitable chart creator for result: " + this.getClass() + "."); //$NON-NLS-1$ |
|
365 |
Log.severe("ChartResult.renderChart(): can not find any suitable chart creator for result: " + this.getClass() + "."); //$NON-NLS-1$ //$NON-NLS-2$
|
|
366 | 366 |
return false; |
367 | 367 |
} |
368 | 368 |
} |
... | ... | |
712 | 712 |
fontName = ChartsEngine.FONTS_LOGICAL_NAMES[fontNameIndex]; |
713 | 713 |
} |
714 | 714 |
|
715 |
this.setFont("1|" + fontName + "|" + size + "|" + String.valueOf(styleAsInt)); |
|
715 |
this.setFont("1|" + fontName + "|" + size + "|" + String.valueOf(styleAsInt)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
716 | 716 |
} |
717 | 717 |
|
718 | 718 |
|
TXM/trunk/bundles/org.txm.chartsengine.core/src/org/txm/chartsengine/core/Theme.java (revision 3836) | ||
---|---|---|
57 | 57 |
this.palette16 = new ArrayList<Color>(16); |
58 | 58 |
|
59 | 59 |
// palette 1 |
60 |
this.palette1.add(Color.decode("#2F7ED8")); // Blue |
|
60 |
this.palette1.add(Color.decode("#2F7ED8")); // Blue //$NON-NLS-1$
|
|
61 | 61 |
|
62 | 62 |
// palette 5 |
63 | 63 |
this.palette5.add(new Color(255, 0, 0)); |
Formats disponibles : Unified diff