Révision 404
tmp/org.txm.chartsengine.raster.rcp/src/org/txm/chartsengine/raster/rcp/RasterImageChartsComponentProvider.java (revision 404) | ||
---|---|---|
17 | 17 |
import org.txm.chartsengine.rcp.editors.ChartEditorInput; |
18 | 18 |
import org.txm.chartsengine.rcp.editors.ChartEditorPart; |
19 | 19 |
import org.txm.chartsengine.rcp.swt.ChartComposite; |
20 |
import org.txm.core.results.ITXMResult;
|
|
20 |
import org.txm.core.results.TXMResult; |
|
21 | 21 |
import org.txm.rcp.commands.OpenBrowser; |
22 | 22 |
import org.txm.rcp.editors.TXMWebBrowserEditor; |
23 | 23 |
import org.txm.rcp.utils.OpenURI; |
... | ... | |
43 | 43 |
|
44 | 44 |
|
45 | 45 |
@Override |
46 |
public ChartEditorPart createChartEditor(ITXMResult result, String preferencesNode, String chartType) {
|
|
46 |
public ChartEditorPart createChartEditor(TXMResult result, String chartType) {
|
|
47 | 47 |
ChartCreator chartCreator = this.getChartsEngine().getChartCreator(result.getClass(), chartType); |
48 |
File file = chartCreator.createChartFile(result, preferencesNode);
|
|
48 |
File file = chartCreator.createChartFile(result); |
|
49 | 49 |
// FIXME : to temporary restore the PS and PDF formats : need to be recoded if we decide to keep the PDF and PS view else to remove if we decide to keep only the feature as export |
50 | 50 |
if(this.chartsEngine.getOutputFormat() == ChartsEngine.OUTPUT_FORMAT_PS || this.chartsEngine.getOutputFormat() == ChartsEngine.OUTPUT_FORMAT_PDF) { |
51 | 51 |
OpenURI.open(file); |
... | ... | |
54 | 54 |
|
55 | 55 |
//return (ChartEditorPart) this.openFile(editorInputName, null, file); |
56 | 56 |
|
57 |
ChartEditorInput chartEditorInput = new ChartEditorInput(this, result, preferencesNode, chartType, null);
|
|
58 |
this.createChart(chartEditorInput, result, preferencesNode, chartType);
|
|
57 |
ChartEditorInput chartEditorInput = new ChartEditorInput(this, result, chartType, null); |
|
58 |
this.createChart(chartEditorInput, result, chartType); |
|
59 | 59 |
ChartEditorPart editor = new ChartEditorPart(this, chartEditorInput); |
60 | 60 |
|
61 | 61 |
//ChartEditorPart editor = new ChartEditorPart(this, editorInputName, resultData, preferencesNode, chartType, this.getChartsEngine().getChartCreator(resultData.getClass(), chartType).createChartFile(resultData, preferencesNode)); |
... | ... | |
68 | 68 |
} |
69 | 69 |
|
70 | 70 |
@Override |
71 |
public boolean createChart(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput, ITXMResult result, String preferencesNode, String chartType) {
|
|
71 |
public boolean createChart(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput, TXMResult result, String chartType) {
|
|
72 | 72 |
ChartCreator chartCreator = chartsEngine.getChartCreator(result.getClass(), chartType); |
73 | 73 |
if(chartCreator != null) { |
74 |
chartEditorInput.setChartContainer(chartCreator.createChartFile(result, preferencesNode));
|
|
74 |
chartEditorInput.setChartContainer(chartCreator.createChartFile(result)); |
|
75 | 75 |
|
76 | 76 |
// sets and updates the local preferences node qualifier from the result data |
77 | 77 |
chartEditorInput.syncLocalPreferencesNode(); |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/preferences/ChartsEnginePreferencePage.java (revision 404) | ||
---|---|---|
144 | 144 |
|
145 | 145 |
// Set the new monochrome color for all charts engine theme |
146 | 146 |
for(int i = 0; i < ChartsEngine.getChartsEngines().size(); i++) { |
147 |
ChartsEngine.getChartsEngines().get(i).getTheme().setMonochromeColor(TXMPreferences.getString(ChartsEnginePreferences.PREFERENCES_NODE, ChartsEnginePreferences.MONOCHROME_COLOR));
|
|
147 |
ChartsEngine.getChartsEngines().get(i).getTheme().setMonochromeColor(TXMPreferences.getString(ChartsEnginePreferences.MONOCHROME_COLOR, ChartsEnginePreferences.PREFERENCES_NODE));
|
|
148 | 148 |
} |
149 | 149 |
|
150 | 150 |
// FIXME: doesn't work, works only when we quit the page and go back to it |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/SWTChartsComponentsProvider.java (revision 404) | ||
---|---|---|
48 | 48 |
import org.txm.chartsengine.rcp.swt.AdvancedChartEditorToolBar; |
49 | 49 |
import org.txm.chartsengine.rcp.swt.ChartComposite; |
50 | 50 |
import org.txm.chartsengine.rcp.swt.ChartEditorToolBar; |
51 |
import org.txm.core.results.ITXMResult;
|
|
51 |
import org.txm.core.results.TXMResult; |
|
52 | 52 |
import org.txm.rcp.editors.SplitedGenericMultiPageEditor; |
53 | 53 |
import org.txm.rcp.editors.TXMEditorPart; |
54 | 54 |
import org.txm.rcp.preferences.TXMPreferencePage; |
... | ... | |
168 | 168 |
* @param chartType |
169 | 169 |
* @return |
170 | 170 |
*/ |
171 |
public ChartEditorPart createChartEditor(ITXMResult result, String preferencesNode, String chartType) {
|
|
172 |
ChartEditorInput chartEditorInput = new ChartEditorInput(this, result, preferencesNode, chartType, null);
|
|
171 |
public ChartEditorPart createChartEditor(TXMResult result, String chartType) {
|
|
172 |
ChartEditorInput chartEditorInput = new ChartEditorInput(this, result, chartType, null); |
|
173 | 173 |
|
174 |
//FIXME: need to try to do the chart creation in openEditor() with computeChart() (tested without success... need to check again) |
|
174 | 175 |
// create the chart from the charts engine chart creator extension |
175 |
this.createChart(chartEditorInput, result, preferencesNode, chartType);
|
|
176 |
this.createChart(chartEditorInput, result, chartType); |
|
176 | 177 |
|
177 | 178 |
ChartEditorPart editor = new ChartEditorPart(this, chartEditorInput); |
178 | 179 |
return editor; |
... | ... | |
186 | 187 |
* @param preferencesNode |
187 | 188 |
* @return |
188 | 189 |
*/ |
189 |
public ChartEditorPart createChartEditor(ITXMResult result, String preferencesNode) {
|
|
190 |
return this.createChartEditor(result, preferencesNode, null);
|
|
190 |
public ChartEditorPart createChartEditor(TXMResult result) {
|
|
191 |
return this.createChartEditor(result, null); |
|
191 | 192 |
} |
192 | 193 |
|
193 | 194 |
// /** |
... | ... | |
197 | 198 |
// * @param chartType |
198 | 199 |
// * @return |
199 | 200 |
// */ |
200 |
// public ChartEditorPart createChartEditor(ITXMResult result, String preferencesNode, String chartType) {
|
|
201 |
// public ChartEditorPart createChartEditor(TXMResult result, String preferencesNode, String chartType) { |
|
201 | 202 |
// return this.createChartEditor(this.getChartsEngine().getChartCreator(result.getClass(), chartType).getFileNamePrefix(), result, preferencesNode, chartType); |
202 | 203 |
// } |
203 | 204 |
|
... | ... | |
209 | 210 |
* @param result |
210 | 211 |
* @param preferencesNode |
211 | 212 |
*/ |
212 |
public void createChart(ChartEditorInput chartEditorInput, ITXMResult result, String preferencesNode) {
|
|
213 |
this.createChart(chartEditorInput, result, preferencesNode, chartEditorInput.getChartType());
|
|
213 |
public void createChart(ChartEditorInput chartEditorInput, TXMResult result) {
|
|
214 |
this.createChart(chartEditorInput, result, chartEditorInput.getChartType()); |
|
214 | 215 |
} |
215 | 216 |
|
216 | 217 |
/** |
... | ... | |
223 | 224 |
* @param chartType |
224 | 225 |
* @return |
225 | 226 |
*/ |
226 |
protected abstract boolean createChart(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput, ITXMResult result, String preferencesNode, String chartType);
|
|
227 |
protected abstract boolean createChart(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput, TXMResult result, String chartType);
|
|
227 | 228 |
|
228 | 229 |
/** |
229 | 230 |
* Creates a new chart for the specified result data and chart type and save it in the specified editor input. |
... | ... | |
234 | 235 |
* @param chartType |
235 | 236 |
* @return |
236 | 237 |
*/ |
237 |
protected boolean createChart(ChartEditorInput chartEditorInput, ITXMResult result, String preferencesNode, String chartType) {
|
|
238 |
return this.createChart(this.getChartsEngine(), chartEditorInput, result, preferencesNode, chartType);
|
|
238 |
protected boolean createChart(ChartEditorInput chartEditorInput, TXMResult result, String chartType) {
|
|
239 |
return this.createChart(this.getChartsEngine(), chartEditorInput, result, chartType); |
|
239 | 240 |
} |
240 | 241 |
|
241 | 242 |
|
... | ... | |
247 | 248 |
* @param chartType |
248 | 249 |
* @return <code>True</code>, if a chart creator has been found and the chart has been updated, otherwise <code>false</code> |
249 | 250 |
*/ |
250 |
public boolean updateChart(ChartEditorPart editor, String preferencesNode, String chartType) {
|
|
251 |
public boolean updateChart(ChartEditorPart editor, String chartType) { |
|
251 | 252 |
ChartCreator chartCreator = this.chartsEngine.getChartCreator(editor.getResultData().getClass(), chartType); |
252 | 253 |
if(chartCreator != null) { |
253 |
chartCreator.updateChart(editor.getChart(), editor.getResultData(), preferencesNode);
|
|
254 |
chartCreator.updateChart(editor.getChart(), editor.getResultData()); |
|
254 | 255 |
return true; |
255 | 256 |
} |
256 | 257 |
return false; |
... | ... | |
265 | 266 |
* @return <code>True</code>, if a chart creator has been found and the chart has been updated, otherwise <code>false</code> |
266 | 267 |
*/ |
267 | 268 |
public boolean updateChart(ChartEditorPart editor) { |
268 |
return this.updateChart(editor, editor.getPreferencesNodeQualifier(), editor.getChartType());
|
|
269 |
return this.updateChart(editor, editor.getChartType()); |
|
269 | 270 |
} |
270 | 271 |
|
271 | 272 |
|
... | ... | |
680 | 681 |
return openedChartEditorPart; |
681 | 682 |
} |
682 | 683 |
|
684 |
// compute the chart |
|
685 |
//openedChartEditorPart.computeChart(false); |
|
686 |
|
|
687 |
|
|
683 | 688 |
// FIXME: directly close the editor if it contains no chart |
684 | 689 |
// if(openedChartEditorPart.getChart() == null) { |
685 | 690 |
// page.closeEditor(openedChartEditorPart, false); |
... | ... | |
736 | 741 |
* @param params |
737 | 742 |
* @return |
738 | 743 |
*/ |
739 |
public ChartEditorPart openEditor(ITXMResult result, String preferencesNode, String chartType) {
|
|
740 |
return this.openEditor(this.createChartEditor(result, preferencesNode, chartType), chartType);
|
|
744 |
public ChartEditorPart openEditor(TXMResult result, String chartType) {
|
|
745 |
return this.openEditor(this.createChartEditor(result, chartType), chartType); |
|
741 | 746 |
} |
742 | 747 |
|
743 |
|
|
744 | 748 |
/** |
745 | 749 |
* |
746 |
* @param result |
|
747 |
* @param preferencesNode |
|
748 |
* @param chartType |
|
749 |
* @return |
|
750 |
*/ |
|
751 |
// public ChartEditorPart openEditor(ITXMResult result, String preferencesNode, String chartType) { |
|
752 |
// return this.openEditor(result.getName(), result, preferencesNode, chartType); |
|
753 |
// } |
|
754 |
|
|
755 |
|
|
756 |
// public ChartEditorPart openEditor(ITXMResult result, String preferencesNode) { |
|
757 |
// return this.openEditor(result, preferencesNode, null); |
|
758 |
// } |
|
759 |
|
|
760 |
/** |
|
761 |
* |
|
762 | 750 |
* @param editorInputName |
763 | 751 |
* @param result |
764 | 752 |
* @param params |
765 | 753 |
* @return |
766 | 754 |
*/ |
767 |
public ChartEditorPart openEditor(ITXMResult result, String preferencesNode) {
|
|
768 |
return this.openEditor(result, preferencesNode, null);
|
|
755 |
public ChartEditorPart openEditor(TXMResult result) {
|
|
756 |
return this.openEditor(result, null); |
|
769 | 757 |
} |
770 | 758 |
|
771 | 759 |
|
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorPart.java (revision 404) | ||
---|---|---|
28 | 28 |
import org.txm.chartsengine.rcp.swt.AdvancedChartEditorToolBar; |
29 | 29 |
import org.txm.chartsengine.rcp.swt.ChartComposite; |
30 | 30 |
import org.txm.chartsengine.rcp.swt.ChartEditorToolBar; |
31 |
import org.txm.core.results.ITXMResult;
|
|
31 |
import org.txm.core.results.TXMResult; |
|
32 | 32 |
import org.txm.rcp.editors.TXMEditorPart; |
33 | 33 |
import org.txm.rcp.editors.TXMEditorToolBar; |
34 | 34 |
import org.txm.rcp.utils.JobHandler; |
... | ... | |
103 | 103 |
* @param result |
104 | 104 |
* @param chartContainer |
105 | 105 |
*/ |
106 |
public ChartEditorPart(SWTChartsComponentsProvider swtComponentsProvider, ITXMResult result, String preferencesNodeQualifier, String chartType, Object chartContainer) {
|
|
107 |
this(swtComponentsProvider, new ChartEditorInput(swtComponentsProvider, result, preferencesNodeQualifier, chartType, chartContainer));
|
|
106 |
public ChartEditorPart(SWTChartsComponentsProvider swtComponentsProvider, TXMResult result, String chartType, Object chartContainer) {
|
|
107 |
this(swtComponentsProvider, new ChartEditorInput(swtComponentsProvider, result, chartType, chartContainer)); |
|
108 | 108 |
} |
109 | 109 |
|
110 | 110 |
|
... | ... | |
465 | 465 |
// done |
466 | 466 |
monitor.done(); |
467 | 467 |
} |
468 |
// for direct canceling |
|
468 |
// for user direct canceling
|
|
469 | 469 |
catch(ThreadDeath td) { |
470 | 470 |
close(true); |
471 | 471 |
return Status.CANCEL_STATUS; |
... | ... | |
586 | 586 |
* @param result |
587 | 587 |
* @param preferencesNode |
588 | 588 |
*/ |
589 |
public void createChart(ITXMResult result, String preferencesNode) {
|
|
590 |
this.getSWTChartsComponentsProvider().createChart(this.getEditorInput(), result, preferencesNode);
|
|
589 |
public void createChart(TXMResult result) {
|
|
590 |
this.getSWTChartsComponentsProvider().createChart(this.getEditorInput(), result); |
|
591 | 591 |
} |
592 | 592 |
|
593 | 593 |
/** |
594 | 594 |
* Creates a new chart for current stored result and save it in the current editor input. |
595 | 595 |
*/ |
596 | 596 |
public void createChart() { |
597 |
this.createChart(this.getResultData(), this.getPreferencesNodeQualifier());
|
|
597 |
this.createChart(this.getResultData()); |
|
598 | 598 |
} |
599 | 599 |
|
600 | 600 |
/** |
... | ... | |
606 | 606 |
super.dispose(); |
607 | 607 |
} |
608 | 608 |
|
609 |
/** |
|
610 |
* Returns the preferences node qualifier linked to the chart of this editor. |
|
611 |
* @return |
|
612 |
*/ |
|
613 |
public String getPreferencesNodeQualifier() { |
|
614 |
return this.getEditorInput().getPreferencesNodeQualifier(); |
|
615 |
} |
|
616 | 609 |
|
617 | 610 |
|
618 | 611 |
/** |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorInput.java (revision 404) | ||
---|---|---|
6 | 6 |
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences; |
7 | 7 |
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider; |
8 | 8 |
import org.txm.core.preferences.TXMPreferences; |
9 |
import org.txm.core.results.ITXMResult;
|
|
9 |
import org.txm.core.results.TXMResult; |
|
10 | 10 |
import org.txm.rcp.editors.TXMResultEditorInput; |
11 | 11 |
|
12 | 12 |
/** |
... | ... | |
26 | 26 |
protected String chartType; |
27 | 27 |
|
28 | 28 |
/** |
29 |
* |
|
30 |
*/ |
|
31 |
protected String preferencesNodeQualifier; |
|
32 |
|
|
33 |
/** |
|
34 | 29 |
* SWT chart components provider used to create the chart editor. |
35 | 30 |
* Store it allows the switch of component provider in the RCP in keeping the chart editors in a coherent state. |
36 | 31 |
*/ |
... | ... | |
48 | 43 |
* @param result |
49 | 44 |
* @param preferencesNodeQualifier |
50 | 45 |
*/ |
51 |
public ChartEditorInput(ITXMResult result, String preferencesNodeQualifier) {
|
|
52 |
this(SWTChartsComponentsProvider.getCurrent(), result, preferencesNodeQualifier);
|
|
46 |
public ChartEditorInput(TXMResult result) {
|
|
47 |
this(SWTChartsComponentsProvider.getCurrent(), result); |
|
53 | 48 |
} |
54 | 49 |
|
55 | 50 |
/** |
... | ... | |
58 | 53 |
* @param result |
59 | 54 |
* @param preferencesNodeQualifier |
60 | 55 |
*/ |
61 |
public ChartEditorInput(SWTChartsComponentsProvider swtComponentsProvider, ITXMResult result, String preferencesNodeQualifier) {
|
|
62 |
this(swtComponentsProvider, result, preferencesNodeQualifier, null);
|
|
56 |
public ChartEditorInput(SWTChartsComponentsProvider swtComponentsProvider, TXMResult result) {
|
|
57 |
this(swtComponentsProvider, result, null); |
|
63 | 58 |
} |
64 | 59 |
|
65 | 60 |
/** |
... | ... | |
69 | 64 |
* @param preferencesNodeQualifier |
70 | 65 |
* @param chartType |
71 | 66 |
*/ |
72 |
public ChartEditorInput(SWTChartsComponentsProvider swtComponentsProvider, ITXMResult result, String preferencesNodeQualifier, String chartType) {
|
|
73 |
this(swtComponentsProvider, result, preferencesNodeQualifier, chartType, null);
|
|
67 |
public ChartEditorInput(SWTChartsComponentsProvider swtComponentsProvider, TXMResult result, String chartType) {
|
|
68 |
this(swtComponentsProvider, result, chartType, null); |
|
74 | 69 |
} |
75 | 70 |
|
76 | 71 |
/** |
... | ... | |
82 | 77 |
* @param chartType |
83 | 78 |
* @param chartContainer |
84 | 79 |
*/ |
85 |
public ChartEditorInput(SWTChartsComponentsProvider swtComponentsProvider, ITXMResult result, String preferencesNodeQualifier, String chartType, Object chartContainer) {
|
|
80 |
public ChartEditorInput(SWTChartsComponentsProvider swtComponentsProvider, TXMResult result, String chartType, Object chartContainer) {
|
|
86 | 81 |
super(result); |
87 | 82 |
this.swtChartsComponentsProvider = swtComponentsProvider; |
88 |
this.preferencesNodeQualifier = preferencesNodeQualifier; |
|
89 | 83 |
this.chartType = chartType; |
90 | 84 |
this.chartContainer = chartContainer; |
91 | 85 |
} |
... | ... | |
202 | 196 |
return chartType; |
203 | 197 |
} |
204 | 198 |
|
205 |
/** |
|
206 |
* @return the preferencesNodeQualifier |
|
207 |
*/ |
|
208 |
public String getPreferencesNodeQualifier() { |
|
209 |
return preferencesNodeQualifier; |
|
210 |
} |
|
211 | 199 |
|
212 | 200 |
|
213 |
|
|
214 | 201 |
/** |
215 | 202 |
* Sets and updates the local preferences node qualifier from the result data. |
216 | 203 |
* Synchronizes the local preferences node with the result data type, chart type, etc. |
217 | 204 |
*/ |
205 |
// FIXME; should be move to TXMResultEditorInput class |
|
218 | 206 |
public void syncLocalPreferencesNode() { |
207 |
//FIXME: to call when implemented in parent class |
|
208 |
//super.syncLocalPreferencesNode(); |
|
219 | 209 |
// FIXME: persistence test |
220 | 210 |
if(this.chartType != null) { |
221 | 211 |
TXMPreferences.putLocalString(this.result, ChartsEnginePreferences.CHART_TYPE, this.chartType); |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java (revision 404) | ||
---|---|---|
50 | 50 |
showTitle.setToolTipText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_TITLE); |
51 | 51 |
|
52 | 52 |
if(!TXMPreferences.isEmpty(chartEditorPart.getPreferencesNodeQualifier(), ChartsEnginePreferences.SHOW_TITLE)) { |
53 |
showTitle.setSelection(TXMPreferences.getBoolean(chartEditorPart.getPreferencesNodeQualifier(), chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_TITLE));
|
|
53 |
showTitle.setSelection(TXMPreferences.getBoolean(ChartsEnginePreferences.SHOW_TITLE, chartEditorPart.getResultData(), chartEditorPart.getPreferencesNodeQualifier()));
|
|
54 | 54 |
} |
55 | 55 |
// disable if not managed |
56 | 56 |
else { |
... | ... | |
65 | 65 |
showLegend.setToolTipText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_LEGEND); |
66 | 66 |
|
67 | 67 |
if(!TXMPreferences.isEmpty(chartEditorPart.getPreferencesNodeQualifier(), ChartsEnginePreferences.SHOW_LEGEND)) { |
68 |
showLegend.setSelection(TXMPreferences.getBoolean(chartEditorPart.getPreferencesNodeQualifier(), chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_LEGEND));
|
|
68 |
showLegend.setSelection(chartEditorPart.getBooleanParameterValue(ChartsEnginePreferences.SHOW_LEGEND));
|
|
69 | 69 |
} |
70 | 70 |
// disable if not managed |
71 | 71 |
else { |
... | ... | |
80 | 80 |
showGrid.setToolTipText(SWTComponentsProviderMessages.SWTChartsComponentProvider_SHOW_HIDE_GRID); |
81 | 81 |
|
82 | 82 |
if(!TXMPreferences.isEmpty(chartEditorPart.getPreferencesNodeQualifier(), ChartsEnginePreferences.SHOW_GRID)) { |
83 |
showGrid.setSelection(TXMPreferences.getBoolean(chartEditorPart.getPreferencesNodeQualifier(), chartEditorPart.getResultData(), ChartsEnginePreferences.SHOW_GRID));
|
|
83 |
showGrid.setSelection(chartEditorPart.getBooleanParameterValue(ChartsEnginePreferences.SHOW_GRID));
|
|
84 | 84 |
} |
85 | 85 |
// disable if not managed |
86 | 86 |
else { |
... | ... | |
105 | 105 |
renderingComboItem.setWidth(renderingModeCombo.getBounds().width); |
106 | 106 |
|
107 | 107 |
if(!TXMPreferences.isEmpty(chartEditorPart.getPreferencesNodeQualifier(), ChartsEnginePreferences.RENDERING_COLORS_MODE)) { |
108 |
renderingModeCombo.select(TXMPreferences.getInt(chartEditorPart.getPreferencesNodeQualifier(), chartEditorPart.getResultData(), ChartsEnginePreferences.RENDERING_COLORS_MODE));
|
|
108 |
renderingModeCombo.select(chartEditorPart.getIntParameterValue(ChartsEnginePreferences.RENDERING_COLORS_MODE));
|
|
109 | 109 |
} |
110 | 110 |
// disable if not managed |
111 | 111 |
else { |
... | ... | |
114 | 114 |
|
115 | 115 |
|
116 | 116 |
// Font selection |
117 |
final Font currentFont = ChartsEngine.createFont(TXMPreferences.getString(ChartsEnginePreferences.PREFERENCES_NODE, chartEditorPart.getResultData(), ChartsEnginePreferences.FONT));
|
|
117 |
final Font currentFont = ChartsEngine.createFont(chartEditorPart.getStringParameterValue(ChartsEnginePreferences.FONT));
|
|
118 | 118 |
|
119 | 119 |
final Combo fontCombo = new Combo(this, SWT.READ_ONLY); |
120 | 120 |
String fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChartEditorView.java (revision 404) | ||
---|---|---|
84 | 84 |
extensions[i] = "*." + SWTChartsComponentsProvider.getCurrent().getEditorSupportedExportFileFormats().get(i); //$NON-NLS-1$ |
85 | 85 |
|
86 | 86 |
// Store the default chart export file format index |
87 |
if(TXMPreferences.getString(ChartsEnginePreferences.PREFERENCES_NODE, ChartsEnginePreferences.DEFAULT_EXPORT_FORMAT).equals(SWTChartsComponentsProvider.getCurrent().getEditorSupportedExportFileFormats().get(i))) {
|
|
87 |
if(TXMPreferences.getString(ChartsEnginePreferences.DEFAULT_EXPORT_FORMAT, ChartsEnginePreferences.PREFERENCES_NODE).equals(SWTChartsComponentsProvider.getCurrent().getEditorSupportedExportFileFormats().get(i))) {
|
|
88 | 88 |
defaultChartFormatIndex = i; |
89 | 89 |
} |
90 | 90 |
} |
... | ... | |
139 | 139 |
System.out.println(NLS.bind(Messages.ExportResult_2, file.getAbsolutePath(), outputFormat.toUpperCase())); |
140 | 140 |
|
141 | 141 |
// Open internal editor in the UI thread |
142 |
if(TXMPreferences.getBoolean(TBXPreferences.PREFERENCES_NODE, TBXPreferences.EXPORT_SHOW)) {
|
|
142 |
if(TXMPreferences.getBoolean(TBXPreferences.EXPORT_SHOW, TBXPreferences.PREFERENCES_NODE)) {
|
|
143 | 143 |
this.syncExec(new Runnable() { |
144 | 144 |
@Override |
145 | 145 |
public void run() { |
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChart.java (revision 404) | ||
---|---|---|
30 | 30 |
import java.io.File; |
31 | 31 |
import java.io.IOException; |
32 | 32 |
|
33 |
import org.eclipse.core.commands.AbstractHandler; |
|
34 | 33 |
import org.eclipse.core.commands.ExecutionEvent; |
35 | 34 |
import org.eclipse.core.commands.ExecutionException; |
36 | 35 |
import org.eclipse.core.runtime.IProgressMonitor; |
37 | 36 |
import org.eclipse.core.runtime.IStatus; |
38 | 37 |
import org.eclipse.core.runtime.Status; |
39 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
40 | 38 |
import org.eclipse.osgi.util.NLS; |
41 | 39 |
import org.eclipse.swt.SWT; |
42 | 40 |
import org.eclipse.swt.widgets.FileDialog; |
43 | 41 |
import org.eclipse.swt.widgets.Shell; |
44 | 42 |
import org.eclipse.ui.PlatformUI; |
45 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
46 | 43 |
import org.txm.chartsengine.core.ChartsEngine; |
47 | 44 |
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences; |
48 |
import org.txm.chartsengine.core.results.IChartResult;
|
|
45 |
import org.txm.chartsengine.core.results.ChartResult; |
|
49 | 46 |
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider; |
50 | 47 |
import org.txm.core.preferences.TBXPreferences; |
51 | 48 |
import org.txm.core.preferences.TXMPreferences; |
52 | 49 |
import org.txm.rcp.JobsTimer; |
53 | 50 |
import org.txm.rcp.Messages; |
54 | 51 |
import org.txm.rcp.StatusLine; |
55 |
import org.txm.rcp.TxmPreferences; |
|
56 | 52 |
import org.txm.rcp.commands.OpenGraph; |
53 |
import org.txm.rcp.handlers.BaseAbstractHandler; |
|
57 | 54 |
import org.txm.rcp.swt.dialog.LastOpened; |
58 | 55 |
import org.txm.rcp.utils.JobHandler; |
59 | 56 |
|
... | ... | |
65 | 62 |
* @author sjacquot |
66 | 63 |
* |
67 | 64 |
*/ |
68 |
public class ExportChart extends AbstractHandler { |
|
65 |
public class ExportChart extends BaseAbstractHandler {
|
|
69 | 66 |
|
70 | 67 |
private static final String ID = "ExportChart"; //$NON-NLS-1$ |
71 | 68 |
|
72 |
/** The selection. */ |
|
73 |
private IStructuredSelection selection; |
|
74 | 69 |
|
75 | 70 |
@Override |
76 | 71 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
77 | 72 |
|
78 |
selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); |
|
79 |
Object s = selection.getFirstElement(); |
|
73 |
Object selection = this.getSelection(); |
|
80 | 74 |
|
81 |
if(!(s instanceof IChartResult)) {
|
|
75 |
if(!(selection instanceof ChartResult)) {
|
|
82 | 76 |
return null; |
83 | 77 |
} |
84 | 78 |
|
85 |
final IChartResult chartResult = (IChartResult) s;
|
|
79 |
final ChartResult chartResult = (ChartResult) selection;
|
|
86 | 80 |
|
87 | 81 |
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); |
88 | 82 |
|
... | ... | |
95 | 89 |
extensions[i] = "*." + SWTChartsComponentsProvider.getCurrent().getChartsEngineSupportedExportFileFormats().get(i); //$NON-NLS-1$ |
96 | 90 |
|
97 | 91 |
// Store the default chart export file format index |
98 |
if(TXMPreferences.getString(ChartsEnginePreferences.PREFERENCES_NODE, ChartsEnginePreferences.DEFAULT_EXPORT_FORMAT, "svg").equals(SWTChartsComponentsProvider.getCurrent().getEditorSupportedExportFileFormats().get(i))) {
|
|
92 |
if(TXMPreferences.getString(ChartsEnginePreferences.DEFAULT_EXPORT_FORMAT, ChartsEnginePreferences.PREFERENCES_NODE).equals(SWTChartsComponentsProvider.getCurrent().getEditorSupportedExportFileFormats().get(i))) {
|
|
99 | 93 |
defaultChartFormatIndex = i; |
100 | 94 |
} |
101 | 95 |
} |
... | ... | |
104 | 98 |
// Select default chart export file format |
105 | 99 |
dialog.setFilterIndex(defaultChartFormatIndex); |
106 | 100 |
|
107 |
// FIXME: how to define a default name here from Object s ? We may need to add a getName() method in TXMResult and check that every results in TXM implements TXMResult.
|
|
101 |
// FIXME: how to define a default name here from Object s ? We may need to add a getName() method in TXMResult and check that every results in TXM. |
|
108 | 102 |
// It could be useful for other purposes too |
109 | 103 |
// dialog.setFileName(ChartsEngine.cleanFileName(chartEditorPart.getPartName())); |
110 | 104 |
dialog.setOverwrite(true); |
... | ... | |
150 | 144 |
System.out.println(NLS.bind(Messages.ExportResult_2, file.getAbsolutePath(), outputFormat.toUpperCase())); |
151 | 145 |
|
152 | 146 |
// Open internal editor in the UI thread |
153 |
if (TXMPreferences.getBoolean(TBXPreferences.PREFERENCES_NODE, TBXPreferences.EXPORT_SHOW)) {
|
|
147 |
if (TXMPreferences.getBoolean(TBXPreferences.EXPORT_SHOW, TBXPreferences.PREFERENCES_NODE)) {
|
|
154 | 148 |
this.syncExec(new Runnable() { |
155 | 149 |
@Override |
156 | 150 |
public void run() { |
tmp/org.txm.chartsengine.rcp/META-INF/MANIFEST.MF (revision 404) | ||
---|---|---|
4 | 4 |
Bundle-SymbolicName: org.txm.chartsengine.rcp;singleton:=true |
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 | 6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
7 |
Require-Bundle: org.txm.rcp;bundle-version="0.7.8", |
|
7 |
Require-Bundle: org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexport, |
|
8 |
org.txm.core;bundle-version="0.7.0", |
|
9 |
org.txm.rcp;bundle-version="0.7.8", |
|
8 | 10 |
org.eclipse.core.resources, |
9 |
org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexport, |
|
10 | 11 |
org.eclipse.ui;bundle-version="3.106.1";visibility:=reexport, |
11 | 12 |
org.eclipse.core.runtime;bundle-version="3.10.0", |
12 |
org.txm.core;bundle-version="0.7.0", |
|
13 | 13 |
org.eclipse.swt, |
14 | 14 |
org.eclipse.core.expressions;bundle-version="3.4.600" |
15 | 15 |
Export-Package: org.txm.chartsengine.rcp, |
tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartCreator.java (revision 404) | ||
---|---|---|
5 | 5 |
import java.util.ArrayList; |
6 | 6 |
|
7 | 7 |
import org.txm.chartsengine.core.ChartCreator; |
8 |
import org.txm.core.results.ITXMResult;
|
|
8 |
import org.txm.core.results.TXMResult; |
|
9 | 9 |
import org.txm.utils.logger.Log; |
10 | 10 |
|
11 | 11 |
|
... | ... | |
26 | 26 |
} |
27 | 27 |
|
28 | 28 |
@Override |
29 |
public Object createChart(ITXMResult result, String preferencesNode) {
|
|
29 |
public Object createChart(TXMResult result) {
|
|
30 | 30 |
// TODO Auto-generated method stub |
31 | 31 |
return null; |
32 | 32 |
} |
33 | 33 |
|
34 | 34 |
|
35 | 35 |
@Override |
36 |
public void updateChart(Object chart, ITXMResult result, String preferencesNode) {
|
|
36 |
public void updateChart(Object chart, TXMResult result) {
|
|
37 | 37 |
|
38 | 38 |
// creates a new chart but using the same file |
39 |
this.createChartFile(result, (File)chart, preferencesNode);
|
|
39 |
this.createChartFile(result, (File)chart); |
|
40 | 40 |
|
41 | 41 |
// FIXME: using new file |
42 | 42 |
//this.createChartFile(resultData, preferencesNode); |
tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/RChartsEngine.java (revision 404) | ||
---|---|---|
61 | 61 |
* Creates a R charts engine implementation. |
62 | 62 |
*/ |
63 | 63 |
public RChartsEngine() { |
64 |
this(TXMPreferences.getString(RChartsEnginePreferences.PREFERENCE_NODE, RChartsEnginePreferences.OUTPUT_FORMAT));
|
|
64 |
this(TXMPreferences.getString(RChartsEnginePreferences.OUTPUT_FORMAT, RChartsEnginePreferences.PREFERENCE_NODE));
|
|
65 | 65 |
} |
66 | 66 |
|
67 | 67 |
|
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java (revision 404) | ||
---|---|---|
88 | 88 |
* Creates a JFreeChart charts engine with default Highcharts theme and output format from the preferences. |
89 | 89 |
*/ |
90 | 90 |
public JFCChartsEngine() { |
91 |
this(TXMPreferences.getString(JFCChartsEnginePreferences.PREFERENCE_NODE, JFCChartsEnginePreferences.OUTPUT_FORMAT));
|
|
91 |
this(TXMPreferences.getString(JFCChartsEnginePreferences.OUTPUT_FORMAT, JFCChartsEnginePreferences.PREFERENCE_NODE));
|
|
92 | 92 |
} |
93 | 93 |
|
94 | 94 |
|
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartCreator.java (revision 404) | ||
---|---|---|
10 | 10 |
import org.txm.chartsengine.core.ChartCreator; |
11 | 11 |
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences; |
12 | 12 |
import org.txm.core.preferences.TXMPreferences; |
13 |
import org.txm.core.results.ITXMResult;
|
|
13 |
import org.txm.core.results.TXMResult; |
|
14 | 14 |
|
15 | 15 |
|
16 | 16 |
|
... | ... | |
31 | 31 |
|
32 | 32 |
|
33 | 33 |
@Override |
34 |
public void updateChart(Object chart, ITXMResult result, String preferencesNode) {
|
|
35 |
this.updateChart(chart, result, preferencesNode, true);
|
|
34 |
public void updateChart(Object chart, TXMResult result) {
|
|
35 |
this.updateChart(chart, result, true); |
|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
|
... | ... | |
43 | 43 |
* @param preferencesNode |
44 | 44 |
* @param applyTheme |
45 | 45 |
*/ |
46 |
public void updateChart(Object chart, ITXMResult result, String preferencesNode, boolean applyTheme) {
|
|
46 |
public void updateChart(Object chart, TXMResult result, boolean applyTheme) {
|
|
47 | 47 |
|
48 | 48 |
// Java object |
49 | 49 |
if(chart instanceof JFreeChart) { |
... | ... | |
54 | 54 |
|
55 | 55 |
|
56 | 56 |
if(c.getTitle() != null) { |
57 |
c.getTitle().setVisible(TXMPreferences.getBoolean(preferencesNode, result, ChartsEnginePreferences.SHOW_TITLE));
|
|
57 |
c.getTitle().setVisible(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_TITLE));
|
|
58 | 58 |
} |
59 | 59 |
if(c.getLegend() != null) { |
60 |
c.getLegend().setVisible(TXMPreferences.getBoolean(preferencesNode, result, ChartsEnginePreferences.SHOW_LEGEND));
|
|
60 |
c.getLegend().setVisible(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_LEGEND));
|
|
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
// CategoryPlot |
64 | 64 |
if(c.getPlot() instanceof CategoryPlot) { |
65 | 65 |
CategoryPlot plot = (CategoryPlot) c.getPlot(); |
66 |
plot.setDomainGridlinesVisible(TXMPreferences.getBoolean(preferencesNode, result, ChartsEnginePreferences.SHOW_GRID));
|
|
67 |
plot.setRangeGridlinesVisible(TXMPreferences.getBoolean(preferencesNode, result, ChartsEnginePreferences.SHOW_GRID));
|
|
66 |
plot.setDomainGridlinesVisible(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_GRID));
|
|
67 |
plot.setRangeGridlinesVisible(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_GRID));
|
|
68 | 68 |
} |
69 | 69 |
// XYPlot |
70 | 70 |
else if(c.getPlot() instanceof XYPlot) { |
71 | 71 |
XYPlot plot = (XYPlot) c.getPlot(); |
72 |
plot.setRangeGridlinesVisible(TXMPreferences.getBoolean(preferencesNode, result, ChartsEnginePreferences.SHOW_GRID));
|
|
73 |
plot.setDomainGridlinesVisible(TXMPreferences.getBoolean(preferencesNode, result, ChartsEnginePreferences.SHOW_GRID));
|
|
72 |
plot.setRangeGridlinesVisible(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_GRID));
|
|
73 |
plot.setDomainGridlinesVisible(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_GRID));
|
|
74 | 74 |
} |
75 | 75 |
|
76 | 76 |
if(applyTheme) { |
77 |
this.getChartsEngine().getJFCTheme().applyThemeToChart(c, result, preferencesNode, false);
|
|
77 |
this.getChartsEngine().getJFCTheme().applyThemeToChart(c, result, false); |
|
78 | 78 |
} |
79 | 79 |
|
80 | 80 |
c.setNotify(true); |
... | ... | |
82 | 82 |
// File |
83 | 83 |
else if(chart instanceof File) { |
84 | 84 |
// creates a new chart but using the same file |
85 |
this.createChartFile(result, (File)chart, preferencesNode);
|
|
85 |
this.createChartFile(result, (File)chart); |
|
86 | 86 |
|
87 | 87 |
// FIXME: using new file |
88 | 88 |
//this.createChartFile(resultData, preferencesNode); |
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/base/JFCTheme.java (revision 404) | ||
---|---|---|
37 | 37 |
import org.txm.chartsengine.jfreechart.core.JFCChartsEngine; |
38 | 38 |
import org.txm.chartsengine.jfreechart.core.renderers.XYCardinalSplineRenderer; |
39 | 39 |
import org.txm.core.preferences.TXMPreferences; |
40 |
import org.txm.core.results.ITXMResult;
|
|
40 |
import org.txm.core.results.TXMResult; |
|
41 | 41 |
|
42 | 42 |
public class JFCTheme extends StandardChartTheme { |
43 | 43 |
|
... | ... | |
129 | 129 |
* @param preferencesNode |
130 | 130 |
* @param applySeriesStrokes |
131 | 131 |
*/ |
132 |
public void applyThemeToChart(JFreeChart chart, ITXMResult resultData, String preferencesNode, boolean applySeriesStrokes) {
|
|
132 |
public void applyThemeToChart(JFreeChart chart, TXMResult result, boolean applySeriesStrokes) {
|
|
133 | 133 |
// FIXME |
134 | 134 |
} |
135 | 135 |
|
... | ... | |
138 | 138 |
/** |
139 | 139 |
* |
140 | 140 |
* @param chart |
141 |
* @param resultData
|
|
141 |
* @param result |
|
142 | 142 |
* @param preferencesNode |
143 | 143 |
*/ |
144 |
public void applyThemeToChart(JFreeChart chart, ITXMResult resultData, String preferencesNode) {
|
|
145 |
this.applyThemeToChart(chart, resultData, preferencesNode, false);
|
|
144 |
public void applyThemeToChart(JFreeChart chart, TXMResult result) {
|
|
145 |
this.applyThemeToChart(chart, result, false); |
|
146 | 146 |
} |
147 | 147 |
|
148 | 148 |
/** |
149 | 149 |
* Creates fonts from the charts engine preferences current font. |
150 | 150 |
*/ |
151 |
protected void createFonts(ITXMResult resultData, String preferencesNode) {
|
|
151 |
protected void createFonts(TXMResult result) {
|
|
152 | 152 |
|
153 |
Font baseFont = ChartsEngine.createFont(TXMPreferences.getString(preferencesNode, resultData, ChartsEnginePreferences.FONT));
|
|
153 |
Font baseFont = ChartsEngine.createFont(result.getStringParameterValue(ChartsEnginePreferences.FONT));
|
|
154 | 154 |
|
155 | 155 |
// Titles |
156 | 156 |
this.setExtraLargeFont(baseFont.deriveFont(Font.BOLD, baseFont.getSize() + 5)); |
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/HighchartsDefaultTheme.java (revision 404) | ||
---|---|---|
48 | 48 |
import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.renderers.ItemSelectionXYSplineRenderer; |
49 | 49 |
import org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.renderers.ItemSelectionXYStepRenderer; |
50 | 50 |
import org.txm.core.preferences.TXMPreferences; |
51 |
import org.txm.core.results.ITXMResult;
|
|
51 |
import org.txm.core.results.TXMResult; |
|
52 | 52 |
|
53 | 53 |
/** |
54 | 54 |
* Highcharts GWT library default rendering theme. |
... | ... | |
144 | 144 |
* (The theme can not be used with ChartFactory.setChartTheme() because of additional plot, renderer and chart settings according to the type of chart.) |
145 | 145 |
* @param chart |
146 | 146 |
*/ |
147 |
public void applyThemeToChart(JFreeChart chart, ITXMResult resultData, String preferencesNode, boolean applySeriesStrokes) {
|
|
147 |
public void applyThemeToChart(JFreeChart chart, TXMResult result, boolean applySeriesStrokes) {
|
|
148 | 148 |
|
149 |
this.createFonts(resultData, preferencesNode);
|
|
149 |
this.createFonts(result); |
|
150 | 150 |
|
151 | 151 |
|
152 | 152 |
super.apply(chart); |
153 | 153 |
|
154 | 154 |
|
155 | 155 |
|
156 |
int itemsColorsRenderingMode = TXMPreferences.getInt(preferencesNode, resultData, ChartsEnginePreferences.RENDERING_COLORS_MODE);
|
|
156 |
int itemsColorsRenderingMode = result.getIntParameterValue(ChartsEnginePreferences.RENDERING_COLORS_MODE);
|
|
157 | 157 |
|
158 | 158 |
// FIXME : UI settings |
159 | 159 |
// UIManager.put("ToolTip.background", Color.gray); |
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java (revision 404) | ||
---|---|---|
57 | 57 |
//showColumns.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_LABEL); |
58 | 58 |
showColumns.setToolTipText(CAUIMessages.CHART_TOOLBAR_BUTTON_SHOW_COLUMS_TOOLTIP); |
59 | 59 |
showColumns.setImage(IImageKeys.getImage(CAFactorialMapChartEditor.class, "icons/show_columns.png")); |
60 |
showColumns.setSelection(TXMPreferences.getBoolean(CAPreferences.PREFERENCES_NODE, this.getResultData(), CAPreferences.SHOW_INDIVIDUALS));
|
|
60 |
showColumns.setSelection(this.getBooleanParameterValue(CAPreferences.SHOW_INDIVIDUALS));
|
|
61 | 61 |
|
62 | 62 |
// Show/hide rows |
63 | 63 |
final ToolItem showRows = new ToolItem(this.toolBar, SWT.CHECK); |
... | ... | |
65 | 65 |
//this.showRows.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_LABEL); |
66 | 66 |
showRows.setToolTipText(CAUIMessages.CHART_TOOLBAR_BUTTON_SHOW_ROWS_TOOLTIP); |
67 | 67 |
showRows.setImage(IImageKeys.getImage(CAFactorialMapChartEditor.class, "icons/show_rows.png")); |
68 |
showRows.setSelection(TXMPreferences.getBoolean(CAPreferences.PREFERENCES_NODE, this.getResultData(), CAPreferences.SHOW_VARIABLES));
|
|
68 |
showRows.setSelection(this.getBooleanParameterValue(CAPreferences.SHOW_VARIABLES));
|
|
69 | 69 |
|
70 | 70 |
// Show/hide point shapes |
71 | 71 |
final ToolItem showPointShapes = new ToolItem(this.toolBar, SWT.CHECK); |
... | ... | |
73 | 73 |
//showPointShapes.setText(CAUIMessages.SHOW_HIDE_POINT_SHAPES); |
74 | 74 |
showPointShapes.setToolTipText(CAUIMessages.CHART_TOOLBAR_BUTTON_SHOW_HIDE_POINT_SHAPES); |
75 | 75 |
showPointShapes.setImage(IImageKeys.getImage(CAFactorialMapChartEditor.class, "icons/show_point_shapes.png")); |
76 |
showPointShapes.setSelection(TXMPreferences.getBoolean(CAPreferences.PREFERENCES_NODE, this.getResultData(), CAPreferences.SHOW_POINT_SHAPES));
|
|
76 |
showPointShapes.setSelection(this.getBooleanParameterValue(CAPreferences.SHOW_POINT_SHAPES));
|
|
77 | 77 |
|
78 | 78 |
|
79 | 79 |
|
... | ... | |
118 | 118 |
plansCombo.setItems(items); |
119 | 119 |
|
120 | 120 |
// Preselect the plan from the CA data |
121 |
if(TXMPreferences.getInt(CAPreferences.PREFERENCES_NODE, this.getResultData(), CAPreferences.FIRST_DIMENSION) == 2) {
|
|
121 |
if(this.getIntParameterValue(CAPreferences.FIRST_DIMENSION) == 2) {
|
|
122 | 122 |
plansCombo.select(2); |
123 | 123 |
} |
124 |
else if(TXMPreferences.getInt(CAPreferences.PREFERENCES_NODE, this.getResultData(), CAPreferences.SECOND_DIMENSION) == 3) {
|
|
124 |
else if(this.getIntParameterValue(CAPreferences.SECOND_DIMENSION) == 3) {
|
|
125 | 125 |
plansCombo.select(1); |
126 | 126 |
} |
127 | 127 |
else { |
... | ... | |
153 | 153 |
return; |
154 | 154 |
} |
155 | 155 |
|
156 |
// FIXME: persistence |
|
156 | 157 |
TXMPreferences.putLocalBoolean(getResultData(), CAPreferences.SHOW_INDIVIDUALS, ((ToolItem) e.getSource()).getSelection()); |
157 | 158 |
} |
158 | 159 |
//Show/hide rows |
... | ... | |
164 | 165 |
return; |
165 | 166 |
} |
166 | 167 |
|
168 |
// FIXME: persistence |
|
167 | 169 |
TXMPreferences.putLocalBoolean(getResultData(), CAPreferences.SHOW_VARIABLES, ((ToolItem) e.getSource()).getSelection()); |
168 | 170 |
} |
169 | 171 |
//Show/hide rows |
170 | 172 |
else if(e.getSource() == showPointShapes) { |
173 |
|
|
174 |
// FIXME: persistence |
|
171 | 175 |
TXMPreferences.putLocalBoolean(getResultData(), CAPreferences.SHOW_POINT_SHAPES, ((ToolItem) e.getSource()).getSelection()); |
172 | 176 |
} |
173 | 177 |
// Change factors |
... | ... | |
189 | 193 |
dimension1 = Integer.parseInt(split[0]); |
190 | 194 |
dimension2 = Integer.parseInt(split[1]); |
191 | 195 |
|
196 |
// FIXME: persistence |
|
192 | 197 |
TXMPreferences.putLocalInt(getResultData(), CAPreferences.FIRST_DIMENSION, dimension1); |
193 | 198 |
TXMPreferences.putLocalInt(getResultData(), CAPreferences.SECOND_DIMENSION, dimension2); |
194 | 199 |
|
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/ColRowInfosLabelProvider.java (revision 404) | ||
---|---|---|
79 | 79 |
this.names = names; |
80 | 80 |
for (int i = 0; i < names.length; i++) { |
81 | 81 |
if (names[i].startsWith(CACoreMessages.mass)) { |
82 |
String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.MASS_DISPLAY_FORMAT);
|
|
82 |
String pattern = TXMPreferences.getString(CAPreferences.MASS_DISPLAY_FORMAT, CAPreferences.PREFERENCES_NODE);
|
|
83 | 83 |
if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$ |
84 | 84 |
masspattern = new DecimalFormat(pattern); |
85 | 85 |
} else if (names[i].startsWith(Messages.ColRowInfosLabelProvider_9)) { |
86 |
String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.CHI_DISPLAY_FORMAT);
|
|
86 |
String pattern = TXMPreferences.getString(CAPreferences.CHI_DISPLAY_FORMAT, CAPreferences.PREFERENCES_NODE);
|
|
87 | 87 |
if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$ |
88 | 88 |
chipattern = new DecimalFormat(pattern); |
89 | 89 |
} else if (names[i].startsWith(CACoreMessages.dist)) { |
90 |
String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.DIST_DISPLAY_FORMAT);
|
|
90 |
String pattern = TXMPreferences.getString(CAPreferences.DIST_DISPLAY_FORMAT, CAPreferences.PREFERENCES_NODE);
|
|
91 | 91 |
if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$ |
92 | 92 |
distpattern = new DecimalFormat(pattern); |
93 | 93 |
} else if (names[i].startsWith(CACoreMessages.cos2)) { |
94 |
String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.COS2_DISPLAY_FORMAT);
|
|
94 |
String pattern = TXMPreferences.getString(CAPreferences.COS2_DISPLAY_FORMAT, CAPreferences.PREFERENCES_NODE);
|
|
95 | 95 |
if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$ |
96 | 96 |
cos2pattern = new DecimalFormat(pattern); |
97 | 97 |
} else if (names[i].startsWith("c") && names[i].length() == 2) //$NON-NLS-1$ |
98 | 98 |
{ |
99 |
String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.COORD_DISPLAY_FORMAT);
|
|
99 |
String pattern = TXMPreferences.getString(CAPreferences.COORD_DISPLAY_FORMAT, CAPreferences.PREFERENCES_NODE);
|
|
100 | 100 |
if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$ |
101 | 101 |
coordpattern = new DecimalFormat(pattern); |
102 | 102 |
} else if (names[i].startsWith(CACoreMessages.cont)) { |
103 |
String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.CONTRIB_DISPLAY_FORMAT);
|
|
103 |
String pattern = TXMPreferences.getString(CAPreferences.CONTRIB_DISPLAY_FORMAT, CAPreferences.PREFERENCES_NODE);
|
|
104 | 104 |
if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$ |
105 | 105 |
contribpattern = new DecimalFormat(pattern); |
106 | 106 |
} else if (names[i].startsWith(Messages.ColRowInfosLabelProvider_19) && names[i].length() == 3) { |
107 |
String pattern = TXMPreferences.getString(CAPreferences.PREFERENCES_NODE, CAPreferences.QUALITY_DISPLAY_FORMAT);
|
|
107 |
String pattern = TXMPreferences.getString(CAPreferences.QUALITY_DISPLAY_FORMAT, CAPreferences.PREFERENCES_NODE);
|
|
108 | 108 |
if (pattern != null && !pattern.trim().equals("")) //$NON-NLS-1$ |
109 | 109 |
qualitypattern = new DecimalFormat(pattern); |
110 | 110 |
} |
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java (revision 404) | ||
---|---|---|
323 | 323 |
public void initCAFactorialMapEditor() { |
324 | 324 |
|
325 | 325 |
// Editor part |
326 |
ChartEditorPart caFactorialMapEditorPart = new CAFactorialMapChartEditor(new ChartEditorInput(ca, CAPreferences.PREFERENCES_NODE));
|
|
326 |
ChartEditorPart caFactorialMapEditorPart = new CAFactorialMapChartEditor(new ChartEditorInput(ca)); |
|
327 | 327 |
editors.add(caFactorialMapEditorPart); |
328 | 328 |
|
329 | 329 |
// Editor input |
... | ... | |
339 | 339 |
public void initCASingularValuesBarChartEditor() { |
340 | 340 |
|
341 | 341 |
// Editor part |
342 |
EditorPart caSingularValuesEditorPart = SWTChartsComponentsProvider.getCurrent().createChartEditor(ca, CAPreferences.PREFERENCES_NODE, "Singular Values"); //$NON-NLS-1$
|
|
342 |
EditorPart caSingularValuesEditorPart = SWTChartsComponentsProvider.getCurrent().createChartEditor(ca, "Singular Values"); //$NON-NLS-1$ |
|
343 | 343 |
editors.add(caSingularValuesEditorPart); |
344 | 344 |
|
345 | 345 |
// Editor input |
tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/SVGSWTChartsComponentsProvider.java (revision 404) | ||
---|---|---|
19 | 19 |
import org.eclipse.swt.widgets.Composite; |
20 | 20 |
import org.txm.chartsengine.core.ChartCreator; |
21 | 21 |
import org.txm.chartsengine.core.ChartsEngine; |
22 |
import org.txm.core.results.ITXMResult;
|
|
22 |
import org.txm.core.results.TXMResult; |
|
23 | 23 |
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider; |
24 | 24 |
import org.txm.chartsengine.rcp.editors.ChartEditorInput; |
25 | 25 |
import org.txm.chartsengine.rcp.editors.ChartEditorPart; |
... | ... | |
50 | 50 |
|
51 | 51 |
|
52 | 52 |
@Override |
53 |
public boolean createChart(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput, ITXMResult result, String preferencesNode, String chartType) {
|
|
53 |
public boolean createChart(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput, TXMResult result, String chartType) {
|
|
54 | 54 |
ChartCreator chartCreator = chartsEngine.getChartCreator(result.getClass(), chartType); |
55 | 55 |
if(chartCreator != null) { |
56 |
chartEditorInput.setChartContainer(chartCreator.createChartFile(result, preferencesNode));
|
|
56 |
chartEditorInput.setChartContainer(chartCreator.createChartFile(result)); |
|
57 | 57 |
|
58 | 58 |
// sets and updates the local preferences node qualifier from the result data |
59 | 59 |
chartEditorInput.syncLocalPreferencesNode(); |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/JFCSWTChartsComponentsProvider.java (revision 404) | ||
---|---|---|
11 | 11 |
import org.jfree.chart.plot.XYPlot; |
12 | 12 |
import org.txm.chartsengine.core.ChartCreator; |
13 | 13 |
import org.txm.chartsengine.core.ChartsEngine; |
14 |
import org.txm.core.results.ITXMResult;
|
|
14 |
import org.txm.core.results.TXMResult; |
|
15 | 15 |
import org.txm.chartsengine.jfreechart.core.JFCChartsEngine; |
16 | 16 |
import org.txm.chartsengine.jfreechart.core.renderers.MouseOverItemSelector; |
17 | 17 |
import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection; |
... | ... | |
56 | 56 |
|
57 | 57 |
|
58 | 58 |
@Override |
59 |
public boolean createChart(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput, ITXMResult result, String preferencesNode, String chartType) {
|
|
59 |
public boolean createChart(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput, TXMResult result, String chartType) {
|
|
60 | 60 |
ChartCreator chartCreator = chartsEngine.getChartCreator(result.getClass(), chartType); |
61 | 61 |
if(chartCreator != null) { |
62 |
JFreeChart chart = (JFreeChart) chartCreator.createChart(result, preferencesNode);
|
|
62 |
JFreeChart chart = (JFreeChart) chartCreator.createChart(result); |
|
63 | 63 |
ChartPanel chartPanel = ((JFCChartsEngine) chartsEngine).getJFCTheme().createChartPanel(this, chart); |
64 | 64 |
chartEditorInput.setChartContainer(chartPanel); |
65 | 65 |
|
... | ... | |
72 | 72 |
} |
73 | 73 |
|
74 | 74 |
// update for shared preferences, show title, show legend, colors rendering mode, etc. |
75 |
chartCreator.updateChart(chart, result, preferencesNode);
|
|
75 |
chartCreator.updateChart(chart, result); |
|
76 | 76 |
|
77 | 77 |
// sets and updates the local preferences node qualifier from the result data |
78 | 78 |
chartEditorInput.syncLocalPreferencesNode(); |
Formats disponibles : Unified diff