Révision 261
tmp/org.txm.chartsengine.jfreechart.core/META-INF/MANIFEST.MF (revision 261) | ||
---|---|---|
3 | 3 |
Bundle-Name: JFreeChart Charts Engine Core |
4 | 4 |
Bundle-SymbolicName: org.txm.chartsengine.jfreechart.core;singleton:=true |
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 |
Require-Bundle: org.txm.libs.itext,
|
|
7 |
jfreechart;bundle-version="1.0.17";visibility:=reexport,
|
|
6 |
Require-Bundle: org.txm.libs.jfreechart;bundle-version="1.0.17";visibility:=reexport,
|
|
7 |
org.txm.libs.itext,
|
|
8 | 8 |
org.eclipse.core.runtime, |
9 |
org.txm.libs.jfreesvg;bundle-version="1.7.0", |
|
9 | 10 |
org.txm.chartsengine.core;bundle-version="1.0.0";visibility:=reexport, |
10 | 11 |
org.txm.core |
11 | 12 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
... | ... | |
18 | 19 |
org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme, |
19 | 20 |
org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.renderers, |
20 | 21 |
org.txm.chartsengine.jfreechart.core.themes.highcharts.defaulttheme.swing |
22 |
Bundle-Vendor: Textometrie.org |
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/renderers/ItemSelectionXYLineAndShapeRenderer.java (revision 261) | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.jfree.chart.axis.SymbolAxis; |
15 | 15 |
import org.jfree.chart.axis.ValueAxis; |
16 |
import org.jfree.chart.entity.EntityCollection; |
|
16 | 17 |
import org.jfree.chart.labels.XYToolTipGenerator; |
17 | 18 |
import org.jfree.chart.plot.CrosshairState; |
18 | 19 |
import org.jfree.chart.plot.PlotRenderingInfo; |
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/HighchartsDefaultTheme.java (revision 261) | ||
---|---|---|
173 | 173 |
|
174 | 174 |
chart.getPlot().setNoDataMessage("Loading..."); |
175 | 175 |
chart.getPlot().setInsets(new RectangleInsets(10, 10, 10, 10)); |
176 |
chart.getTitle().setMargin(10, 0, 0, 0); |
|
176 |
if(chart.getTitle() != null) { |
|
177 |
chart.getTitle().setMargin(10, 0, 0, 0); |
|
178 |
} |
|
177 | 179 |
|
178 | 180 |
|
179 | 181 |
// Add plot renderer modifications |
tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/themes/highcharts/defaulttheme/RendererUtils.java (revision 261) | ||
---|---|---|
4 | 4 |
import java.awt.Paint; |
5 | 5 |
import java.text.DecimalFormat; |
6 | 6 |
|
7 |
/** |
|
8 |
* |
|
9 |
* @author sjacquot |
|
10 |
* |
|
11 |
*/ |
|
12 |
//FIXME: to complete the code mutualisation work for all renderers |
|
7 | 13 |
public class RendererUtils { |
8 | 14 |
|
9 | 15 |
|
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/preferences/ChartsEnginePreferences.java (revision 261) | ||
---|---|---|
51 | 51 |
public final static String RENDERING_COLORS_MODE = PREFERENCES_PREFIX + "colors_mode"; //$NON-NLS-1$ |
52 | 52 |
|
53 | 53 |
|
54 |
/** |
|
55 |
* Constant for the color to use when in monochrome mode. |
|
56 |
*/ |
|
54 | 57 |
public final static String MONOCHROME_COLOR = PREFERENCES_PREFIX + "monochrome_color"; //$NON-NLS-1$ |
55 | 58 |
|
56 |
|
|
59 |
/** |
|
60 |
* Constant for the font. |
|
61 |
*/ |
|
57 | 62 |
public final static String FONT = PREFERENCES_PREFIX + "font"; //$NON-NLS-1$ |
58 | 63 |
|
59 | 64 |
|
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/messages/ChartsEngineCoreMessages.java (revision 261) | ||
---|---|---|
1 | 1 |
package org.txm.chartsengine.core.messages; |
2 | 2 |
|
3 | 3 |
import org.eclipse.osgi.util.NLS; |
4 |
import org.txm.core.messages.TXMCoreMessages;
|
|
4 |
import org.txm.utils.messages.Utf8NLS;
|
|
5 | 5 |
|
6 | 6 |
|
7 | 7 |
|
... | ... | |
17 | 17 |
|
18 | 18 |
static { |
19 | 19 |
// initialize resource bundle |
20 |
TXMCoreMessages.initializeMessages(BUNDLE_NAME, ChartsEngineCoreMessages.class);
|
|
20 |
Utf8NLS.initializeMessages(BUNDLE_NAME, ChartsEngineCoreMessages.class);
|
|
21 | 21 |
} |
22 | 22 |
|
23 | 23 |
private ChartsEngineCoreMessages() { |
tmp/org.txm.chartsengine.core/META-INF/MANIFEST.MF (revision 261) | ||
---|---|---|
12 | 12 |
org.txm.chartsengine.core.messages, |
13 | 13 |
org.txm.chartsengine.core.preferences, |
14 | 14 |
org.txm.chartsengine.core.results |
15 |
Bundle-Vendor: Textometrie.org |
tmp/org.txm.chartsengine.jfreechart.rcp/plugin.xml (revision 261) | ||
---|---|---|
27 | 27 |
commandId="OpenJFCChartPropertiesEditor" |
28 | 28 |
icon="icons/silk_chart_edit.png" |
29 | 29 |
style="push"> |
30 |
<visibleWhen |
|
31 |
checkEnabled="false"> |
|
32 |
<or> |
|
33 |
<reference |
|
34 |
definitionId="IsJFCComposite"> |
|
35 |
</reference> |
|
36 |
</or> |
|
37 |
</visibleWhen> |
|
38 | 30 |
</command> |
39 | 31 |
</menuContribution> |
40 | 32 |
</extension> |
... | ... | |
47 | 39 |
</command> |
48 | 40 |
</extension> |
49 | 41 |
<extension |
50 |
point="org.eclipse.core.expressions.propertyTesters"> |
|
51 |
<propertyTester |
|
52 |
class="org.txm.chartsengine.jfreechart.rcp.testers.__IsJFCComposite" |
|
53 |
id="org.txm.chartsengine.jfreechart.rcp.testers.IsJFCComposite" |
|
54 |
namespace="org.txm.chartsengine.jfreechart.rcp.testers" |
|
55 |
properties="IsJFCComposite" |
|
56 |
type="java.lang.Object"> |
|
57 |
</propertyTester> |
|
58 |
</extension> |
|
59 |
<extension |
|
60 | 42 |
point="org.eclipse.core.expressions.definitions"> |
61 | 43 |
<definition |
62 |
id="IsJFCComposite"> |
|
63 |
<test |
|
64 |
forcePluginActivation="true" |
|
65 |
property="org.txm.chartsengine.jfreechart.rcp.testers.IsJFCComposite"> |
|
66 |
</test> |
|
44 |
id="JFCCompositeIsActiveContext"> |
|
45 |
<with |
|
46 |
variable="activeContexts"> |
|
47 |
<iterate |
|
48 |
ifEmpty="false" |
|
49 |
operator="or"> |
|
50 |
<equals |
|
51 |
value="org.txm.chartsengine.jfreechart.rcp.swt.JFCComposite"> |
|
52 |
</equals> |
|
53 |
</iterate> |
|
54 |
</with> |
|
67 | 55 |
</definition> |
68 | 56 |
</extension> |
57 |
<extension |
|
58 |
point="org.eclipse.ui.contexts"> |
|
59 |
<context |
|
60 |
id="org.txm.chartsengine.jfreechart.rcp.swt.JFCComposite" |
|
61 |
name="JFC composite context"> |
|
62 |
</context> |
|
63 |
</extension> |
|
69 | 64 |
|
70 | 65 |
</plugin> |
tmp/org.txm.chartsengine.jfreechart.rcp/META-INF/MANIFEST.MF (revision 261) | ||
---|---|---|
1 | 1 |
Manifest-Version: 1.0 |
2 | 2 |
Bundle-ManifestVersion: 2 |
3 |
Bundle-Name: JFreeChart Charts Engine Editors
|
|
3 |
Bundle-Name: JFreeChart Charts Engine RCP
|
|
4 | 4 |
Bundle-SymbolicName: org.txm.chartsengine.jfreechart.rcp;singleton:=true |
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 | 6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
7 |
Require-Bundle: jfreechart, |
|
7 |
Require-Bundle: org.txm.libs.jfreechart,
|
|
8 | 8 |
org.txm.chartsengine.core, |
9 | 9 |
org.txm.core;bundle-version="0.7.0", |
10 | 10 |
org.txm.chartsengine.rcp;bundle-version="1.0.0";visibility:=reexport, |
... | ... | |
20 | 20 |
org.txm.chartsengine.jfreechart.rcp.themes.highcharts, |
21 | 21 |
org.txm.chartsengine.jfreechart.rcp.themes.highcharts.events, |
22 | 22 |
org.txm.chartsengine.jfreechart.rcp.themes.highcharts.swing |
23 |
Bundle-Vendor: TXM |
|
23 |
Bundle-Vendor: Textometrie.org |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/swt/JFCComposite.java (revision 261) | ||
---|---|---|
246 | 246 |
@Override |
247 | 247 |
public void loadChart(Object data) { |
248 | 248 |
this.getChartPanel().setChart((JFreeChart) data); |
249 |
|
|
250 |
// FIXME: tests, restore the zoom from local node |
|
251 |
//this.zoom(x, y, zoomIn); |
|
252 |
// FIXME: tests, restoring current zoom from result node |
|
253 |
// if(this.getChart().getPlot() instanceof XYPlot) { |
|
254 |
// System.err.println("JFCComposite.loadChart(): restoring current zoom."); |
|
255 |
// XYPlot plot = this.getChart().getXYPlot(); |
|
256 |
// plot.getRangeAxis().setLowerBound(-4400); |
|
257 |
// plot.getRangeAxis().setUpperBound(-13000); |
|
258 |
// } |
|
259 |
|
|
249 | 260 |
} |
250 | 261 |
|
251 | 262 |
@Override |
252 | 263 |
public void loadChart() { |
253 | 264 |
|
254 |
// Get a new chart from the editor input
|
|
265 |
// get a new chart from the editor input
|
|
255 | 266 |
this.loadChart(((ChartPanel)this.chartEditor.getComposite().getChartComponent()).getChart()); |
256 | 267 |
|
257 | 268 |
this.forceFocus(); |
... | ... | |
277 | 288 |
|
278 | 289 |
@Override |
279 | 290 |
public void copyChartViewToClipboard() { |
280 |
//FIXME: manual method |
|
281 |
// ChartPanel panel = this.getChartPanel(); |
|
282 |
// Clipboard systemClipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); |
|
283 |
// Insets insets = panel.getInsets(); |
|
284 |
// int w = panel.getWidth() - insets.left - insets.right; |
|
285 |
// int h = panel.getHeight() - insets.top - insets.bottom; |
|
286 |
// ChartTransferable selection = new ChartTransferable(panel.getChart(), w, h, panel.getMinimumDrawWidth(), panel.getMinimumDrawHeight(), panel.getMaximumDrawWidth(), panel.getMaximumDrawHeight(), true); |
|
287 |
// systemClipboard.setContents(selection, null); |
|
288 |
|
|
289 | 291 |
this.getChartPanel().doCopy(); |
290 |
|
|
291 | 292 |
} |
292 | 293 |
|
293 | 294 |
/** |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/JFCChartsSwingComponentsProvider.java (revision 261) | ||
---|---|---|
56 | 56 |
|
57 | 57 |
|
58 | 58 |
/** |
59 |
* |
|
60 |
* @param useSplines |
|
61 |
* @return |
|
62 |
*/ |
|
63 |
// FIXME : test method |
|
64 |
public ChartPanel ___createXYLinesChartPanel(boolean useSplines) { |
|
65 |
return this.___createXYLinesChartPanel(useSplines, true, true); |
|
66 |
} |
|
67 |
|
|
68 |
|
|
69 |
/** |
|
70 |
* |
|
71 |
* @param useSplines |
|
72 |
* @param linesVisible |
|
73 |
* @param shapesVisible |
|
74 |
* @return |
|
75 |
*/ |
|
76 |
// FIXME : test method |
|
77 |
public ChartPanel ___createXYLinesChartPanel(boolean useSplines, boolean linesVisible, boolean shapesVisible) { |
|
78 |
|
|
79 |
ChartPanel chartPanel; |
|
80 |
|
|
81 |
|
|
82 |
// Jeu de données factice |
|
83 |
XYSeries series1 = new XYSeries("faire"); //$NON-NLS-1$ |
|
84 |
series1.add(0.0, 0.2); series1.add(1.0, 0.8); series1.add(2.0, 1.2); series1.add(3.0, 1.9); |
|
85 |
series1.add(4.0, 1.9); series1.add(5.0, 2.4); series1.add(6.0, 2.9); |
|
86 |
|
|
87 |
XYSeries series2 = new XYSeries("voir"); //$NON-NLS-1$ |
|
88 |
series2.add(1.0, 5.0); series2.add(2.0, 7.0); series2.add(3.0, 6.0); series2.add(4.0, 8.0); series2.add(5.0, 4.0); series2.add(6.0, 4.0); |
|
89 |
|
|
90 |
XYSeries series3 = new XYSeries("avoir"); //$NON-NLS-1$ |
|
91 |
series3.add(1.0, 2.0); series3.add(2.0, 3.5); series3.add(3.0, 3.2); series3.add(4.0, 4.5); series3.add(5.0, 1.2); series3.add(6.0, 3); |
|
92 |
|
|
93 |
XYSeries series4 = new XYSeries("être"); //$NON-NLS-1$ |
|
94 |
series4.add(1.0, 4.2); series4.add(2.0, 5); series4.add(3.0, 5.5); series4.add(4.0, 2.2); series4.add(5.0, 4.8); series4.add(6.0, 6.2); |
|
95 |
|
|
96 |
XYSeriesCollection dataset = new XYSeriesCollection(); |
|
97 |
dataset.addSeries(series1); dataset.addSeries(series2); dataset.addSeries(series3); dataset.addSeries(series4); |
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
// Creating the chart from the current charts engine |
|
102 |
JFreeChart chart = this.chartsEngine.createXYLineChart(dataset, "test", "x label", "y label", true, useSplines, linesVisible, shapesVisible); |
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
108 |
|
|
109 |
return chartPanel; |
|
110 |
} |
|
111 |
|
|
112 |
/** |
|
113 |
* |
|
114 |
* @return |
|
115 |
*/ |
|
116 |
// FIXME : test method |
|
117 |
public ChartPanel ___createXYDimensionsBarChartPanel() { |
|
118 |
|
|
119 |
ChartPanel chartPanel; |
|
120 |
|
|
121 |
|
|
122 |
// Jeu de données factice |
|
123 |
XYIntervalSeriesCollection dataset = new XYIntervalSeriesCollection(); |
|
124 |
|
|
125 |
XYIntervalSeries series1 = new XYIntervalSeries("faire"); //$NON-NLS-1$ |
|
126 |
series1.add(0.5, 0.0, 0.2, 0.9, 0.0, 1); |
|
127 |
|
|
128 |
dataset.addSeries(series1); |
|
129 |
|
|
130 |
|
|
131 |
// Creating the chart from the current charts engine |
|
132 |
JFreeChart chart = this.chartsEngine.createXYBarChart(dataset, "Dimensions of partition \"P\" in corpus \"C\"", "Part", "Number of words per part", false, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
|
133 |
|
|
134 |
|
|
135 |
|
|
136 |
chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
137 |
|
|
138 |
return chartPanel; |
|
139 |
} |
|
140 |
|
|
141 |
|
|
142 |
|
|
143 |
/** |
|
144 |
* |
|
145 |
* @return |
|
146 |
*/ |
|
147 |
// FIXME : test method |
|
148 |
public ChartPanel ___createCategoryLinesChartPanel() { |
|
149 |
|
|
150 |
ChartPanel chartPanel; |
|
151 |
|
|
152 |
|
|
153 |
// Jeu de données factice |
|
154 |
// row keys |
|
155 |
final String series1 = "faire"; final String series2 = "voir"; final String series3 = "être"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
|
156 |
|
|
157 |
// column keys |
|
158 |
final String type1 = "années 20"; final String type2 = "années 30"; final String type3 = "années 40"; final String type4 = "années 50"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
|
159 |
final String type5 = "années 60"; final String type6 = "années 70"; final String type7 = "années 80"; final String type8 = "années 90"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
|
160 |
|
|
161 |
// create the dataset |
|
162 |
final DefaultCategoryDataset dataset = new DefaultCategoryDataset(); |
|
163 |
|
|
164 |
dataset.addValue(0.5, series1, type1); dataset.addValue(-0.85, series1, type2); dataset.addValue(0.1, series1, type3); dataset.addValue(0.4, series1, type4); |
|
165 |
dataset.addValue(-0.2, series1, type5); dataset.addValue(-0.3, series1, type6); dataset.addValue(0.48, series1, type7); dataset.addValue(0.56, series1, type8); |
|
166 |
|
|
167 |
dataset.addValue(0.25, series2, type1); dataset.addValue(0.29, series2, type2); dataset.addValue(-0.12, series2, type3); dataset.addValue(0.56, series2, type4); |
|
168 |
dataset.addValue(-0.85, series2, type5); dataset.addValue(-0.23, series2, type6); dataset.addValue(0.8, series2, type7); dataset.addValue(0.4, series2, type8); |
|
169 |
|
|
170 |
dataset.addValue(-0.23, series3, type1); dataset.addValue(0.64, series3, type2); dataset.addValue(0.35, series3, type3); dataset.addValue(0.89, series3, type4); |
|
171 |
dataset.addValue(-0.56, series3, type5); dataset.addValue(0.2, series3, type6); dataset.addValue(-0.36, series3, type7); dataset.addValue(-0.72, series3, type8); |
|
172 |
|
|
173 |
|
|
174 |
|
|
175 |
// Creating the chart from the current charts engine |
|
176 |
JFreeChart chart = this.chartsEngine.createCategoryLineChart(dataset, "Specificities of words \"faire\", \"voir\", \"être\" in partition \"P\" of corpus \"C\"", "Part", "Score", true, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
|
177 |
|
|
178 |
|
|
179 |
// Custom renderer |
|
180 |
chart.getCategoryPlot().setRenderer(new ItemSelectionCategoryLineAndShapeRenderer(true, false)); |
|
181 |
|
|
182 |
// Custom range axis for ticks drawing options |
|
183 |
chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), true, true, -1, 1)); |
|
184 |
|
|
185 |
|
|
186 |
chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
187 |
|
|
188 |
|
|
189 |
// TODO : test markers |
|
190 |
Marker target = new ValueMarker(0.32); |
|
191 |
target.setPaint(Color.red); |
|
192 |
target.setLabel("Score moyen positif"); //$NON-NLS-1$ |
|
193 |
target.setLabelAnchor(RectangleAnchor.TOP_RIGHT); |
|
194 |
target.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); |
|
195 |
((CategoryPlot) chart.getPlot()).addRangeMarker(target); |
|
196 |
|
|
197 |
target = new ValueMarker(-0.45); |
|
198 |
target.setPaint(Color.red); |
|
199 |
target.setLabel("Score moyen négatif"); //$NON-NLS-1$ |
|
200 |
target.setLabelAnchor(RectangleAnchor.TOP_RIGHT); |
|
201 |
target.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); |
|
202 |
((CategoryPlot) chart.getPlot()).addRangeMarker(target); |
|
203 |
|
|
204 |
|
|
205 |
return chartPanel; |
|
206 |
} |
|
207 |
|
|
208 |
|
|
209 |
/** |
|
210 |
* |
|
211 |
* @return |
|
212 |
*/ |
|
213 |
// FIXME : test method |
|
214 |
public ChartPanel ___createCategoryDimensionsBarChartPanel() { |
|
215 |
|
|
216 |
ChartPanel chartPanel; |
|
217 |
|
|
218 |
|
|
219 |
// Jeu de donn�es factice |
|
220 |
DefaultCategoryDataset dataset = new DefaultCategoryDataset(); |
|
221 |
String category = "T"; //$NON-NLS-1$ |
|
222 |
//dataset.setValue(2, "test", "testtt"); |
|
223 |
//dataset.setValue(5, category, "testtt"); |
|
224 |
dataset.setValue(890, category, "Introduction"); //$NON-NLS-1$ |
|
225 |
dataset.setValue(780, category, "Chapter 1"); //$NON-NLS-1$ |
|
226 |
dataset.setValue(1430, category, "Chapter 2"); //$NON-NLS-1$ |
|
227 |
dataset.setValue(700, category, "Chapter 3"); //$NON-NLS-1$ |
|
228 |
dataset.setValue(590, category, "Chapter 4"); //$NON-NLS-1$ |
|
229 |
dataset.setValue(380, category, "Conclusion"); //$NON-NLS-1$ |
|
230 |
|
|
231 |
|
|
232 |
|
|
233 |
// Creating the chart from the current charts engine |
|
234 |
JFreeChart chart = this.chartsEngine.createCategoryBarChart(dataset, "Dimensions of partition \"P\" in corpus \"C\"", "Part", "Number of words per part", false, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
|
235 |
|
|
236 |
// Custom range axis for ticks drawing options |
|
237 |
chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue())); |
|
238 |
|
|
239 |
|
|
240 |
chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
241 |
|
|
242 |
return chartPanel; |
|
243 |
} |
|
244 |
|
|
245 |
|
|
246 |
|
|
247 |
/** |
|
248 |
* Distribution bar chart of multiple words by parts. |
|
249 |
* @return |
|
250 |
*/ |
|
251 |
// FIXME : test method |
|
252 |
public ChartPanel ___createCategoryDistributionBarsChartPanel() { |
|
253 |
|
|
254 |
ChartPanel chartPanel; |
|
255 |
|
|
256 |
|
|
257 |
// Jeu de données factice |
|
258 |
DefaultCategoryDataset dataset = new DefaultCategoryDataset(); |
|
259 |
|
|
260 |
dataset.setValue(3, "faire", "Introduction"); dataset.setValue(4, "voir", "Introduction"); dataset.setValue(1, "avoir", "Introduction"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
|
261 |
dataset.setValue(5, "être", "Introduction"); //$NON-NLS-1$ //$NON-NLS-2$ |
|
262 |
|
|
263 |
dataset.setValue(9, "faire", "Chapter 1"); dataset.setValue(3, "voir", "Chapter 1"); dataset.setValue(7, "avoir", "Chapter 1"); dataset.setValue(2, "être", "Chapter 1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ |
|
264 |
dataset.setValue(1, "faire", "Chapter 2"); dataset.setValue(8, "voir", "Chapter 2"); dataset.setValue(4, "avoir", "Chapter 2"); dataset.setValue(6, "être", "Chapter 2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ |
|
265 |
dataset.setValue(3, "faire", "Chapter 3"); dataset.setValue(5, "voir", "Chapter 3"); dataset.setValue(0, "avoir", "Chapter 3"); dataset.setValue(11, "être", "Chapter 3"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ |
|
266 |
dataset.setValue(5, "faire", "Conclusion"); dataset.setValue(0, "voir", "Conclusion"); dataset.setValue(6, "avoir", "Conclusion"); dataset.setValue(1, "être", "Conclusion"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ |
|
267 |
|
|
268 |
|
|
269 |
|
|
270 |
// Creating the chart from the current charts engine |
|
271 |
JFreeChart chart = this.chartsEngine.createCategoryBarChart(dataset, "Distribution of words \"faire\", \"voir\", \"avoir\", \"être\" in corpus \"C\"", "Part", "Frequency", true, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
|
272 |
|
|
273 |
|
|
274 |
// Custom range axis for ticks drawing options |
|
275 |
chart.getCategoryPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getCategoryPlot().getRangeAxis(), false, true, 0, DatasetUtilities.findMaximumRangeValue(chart.getCategoryPlot().getDataset()).doubleValue())); |
|
276 |
|
|
277 |
|
|
278 |
chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
279 |
|
|
280 |
return chartPanel; |
|
281 |
} |
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
// /** |
|
286 |
// * Creates a chart panel containing a CA scatter plot from the specified CA result. |
|
287 |
// * @param ca |
|
288 |
// * @return the chart panel |
|
289 |
// */ |
|
290 |
// public ChartPanel createCAFactorialMapChartPanel(CA ca) { |
|
291 |
// |
|
292 |
// ChartPanel chartPanel; |
|
293 |
// |
|
294 |
// // Creating the chart from the current charts engine |
|
295 |
// JFreeChart chart = this.chartsEngine.createCAFactorialMapChart(ca); |
|
296 |
// |
|
297 |
// chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
298 |
// |
|
299 |
// // Need to be called after the theme is applied to the chart else the legends of not visible series aren't created |
|
300 |
// chart.getXYPlot().getRenderer().setSeriesVisible(0, ca.isShowVariables()); // Rows |
|
301 |
// chart.getXYPlot().getRenderer().setSeriesVisible(1, ca.isShowIndividuals()); // Columns |
|
302 |
// |
|
303 |
// ((FCAItemSelectionRenderer) chart.getXYPlot().getRenderer()).setChartPanel(chartPanel); |
|
304 |
// |
|
305 |
// |
|
306 |
// return chartPanel; |
|
307 |
// } |
|
308 |
// |
|
309 |
// |
|
310 |
// |
|
311 |
// /** |
|
312 |
// * Creates a chart panel containing a bar chart with the singular values of the specified CA result. |
|
313 |
// * @param ca |
|
314 |
// * @return |
|
315 |
// */ |
|
316 |
// public ChartPanel createCASingularValuesBarChartChartPanel(CA ca) { |
|
317 |
// |
|
318 |
// ChartPanel chartPanel; |
|
319 |
// |
|
320 |
// // Creating the chart from the current charts engine |
|
321 |
// JFreeChart chart = this.chartsEngine.createCASingularValuesBarChart(ca); |
|
322 |
// |
|
323 |
// chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
324 |
// |
|
325 |
// return chartPanel; |
|
326 |
// } |
|
327 |
|
|
328 |
|
|
329 |
|
|
330 |
// /** |
|
331 |
// * Creates a chart panel containing a CAH plot from the specified CAH result. |
|
332 |
// * @param cah |
|
333 |
// * @return the chart panel |
|
334 |
// */ |
|
335 |
// public ChartPanel createCAHChartPanel(CAH cah, boolean display2D) { |
|
336 |
// |
|
337 |
// ChartPanel chartPanel; |
|
338 |
// |
|
339 |
// // Creating the chart from the current charts engine |
|
340 |
// JFreeChart chart = (JFreeChart) this.chartsEngine.createCAHChart(cah, display2D); |
|
341 |
// |
|
342 |
// chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
343 |
// |
|
344 |
// return chartPanel; |
|
345 |
// } |
|
346 |
|
|
347 |
|
|
348 |
// /** |
|
349 |
// * Creates a chart panel containing a bar chart with the dimensions of the specified partition result. |
|
350 |
// * @param partition |
|
351 |
// * @param sortPartsBySize |
|
352 |
// * @return |
|
353 |
// */ |
|
354 |
// public ChartPanel createDimensionsPartitionBarChartChartPanel(Partition partition, boolean sortPartsBySize) { |
|
355 |
// |
|
356 |
// ChartPanel chartPanel; |
|
357 |
// |
|
358 |
// // Creating the chart from the current charts engine |
|
359 |
// JFreeChart chart = this.chartsEngine.createPartitionDimensionsChart(partition, sortPartsBySize); |
|
360 |
// |
|
361 |
// chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
362 |
// |
|
363 |
// // FIXME : pour tests de scrolling sur les diagrammes à bâtons très large |
|
364 |
// //chartPanel.setPreferredSize(new Dimension(20000, 300)); |
|
365 |
// |
|
366 |
//// int panelWidth = chart.getCategoryPlot().getDataset().getColumnCount() * 120; |
|
367 |
//// chartPanel.setPreferredSize(new Dimension(panelWidth, 1)); |
|
368 |
// |
|
369 |
// return chartPanel; |
|
370 |
// } |
|
371 |
|
|
372 |
// /** |
|
373 |
// * Creates a chart panel containing a line chart or a bar chart from the specified Progression result. |
|
374 |
// * @param progression |
|
375 |
// * @param monochrome |
|
376 |
// * @param monostyle |
|
377 |
// * @param doCumulative |
|
378 |
// * @return |
|
379 |
// */ |
|
380 |
// public ChartPanel createProgressionChartPanel(Progression progression, boolean monochrome, boolean monostyle, boolean doCumulative) { |
|
381 |
// |
|
382 |
// ChartPanel chartPanel; |
|
383 |
// |
|
384 |
// // Creating the chart from the current charts engine |
|
385 |
// JFreeChart chart = this.chartsEngine.createProgressionChart(progression, monochrome, monostyle, doCumulative); |
|
386 |
// |
|
387 |
// chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
388 |
// |
|
389 |
// ((ProgressionItemSelectionRenderer) chart.getXYPlot().getRenderer()).setChartPanel(chartPanel); |
|
390 |
// |
|
391 |
// return chartPanel; |
|
392 |
// } |
|
393 |
|
|
394 |
|
|
395 |
// /** |
|
396 |
// * Creates a chart panel containing a chart with the scores of the specified indices. |
|
397 |
// * @param specificitiesResult |
|
398 |
// * @param typeNames |
|
399 |
// * @param partNames |
|
400 |
// * @param specIndex |
|
401 |
// * @param transpose |
|
402 |
// * @param drawBars |
|
403 |
// * @param drawLines |
|
404 |
// * @param banalite |
|
405 |
// * @param monochrome |
|
406 |
// * @return |
|
407 |
// */ |
|
408 |
// public ChartPanel createSpecificitiesChartPanel(SpecificitesResult specificitiesResult, boolean transpose, boolean drawBars, boolean drawLines, float banalite, boolean monochrome) { |
|
409 |
// |
|
410 |
// ChartPanel chartPanel; |
|
411 |
// |
|
412 |
// // Creating the chart from the current charts engine |
|
413 |
// JFreeChart chart = this.chartsEngine.createSpecificitiesChart(specificitiesResult, transpose, drawBars, drawLines, banalite, monochrome); |
|
414 |
// |
|
415 |
// chartPanel = this.getTheme().createChartPanel(this.swtChartsComponentProvider, chart); |
|
416 |
// |
|
417 |
// return chartPanel; |
|
418 |
// } |
|
419 |
|
|
420 |
|
|
421 |
|
|
422 |
/** |
|
423 | 59 |
* Creates an empty chart panel. |
424 | 60 |
* @return |
425 | 61 |
*/ |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/handlers/OpenJFCChartPropertiesEditor.java (revision 261) | ||
---|---|---|
8 | 8 |
import org.eclipse.core.commands.ExecutionEvent; |
9 | 9 |
import org.eclipse.core.commands.ExecutionException; |
10 | 10 |
import org.jfree.chart.ChartPanel; |
11 |
import org.txm.chartsengine.jfreechart.core.JFCChartsEngine; |
|
11 | 12 |
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider; |
12 | 13 |
import org.txm.chartsengine.rcp.editors.ChartEditorPart; |
13 | 14 |
|
... | ... | |
44 | 45 |
|
45 | 46 |
final ChartEditorPart chartEditor = SWTChartsComponentsProvider.getActiveChartEditor(event); |
46 | 47 |
|
47 |
chartEditor.getComposite().getDisplay().asyncExec(new Runnable() { |
|
48 |
if(chartEditor.getChartsEngine() instanceof JFCChartsEngine) { |
|
49 |
chartEditor.getComposite().getDisplay().asyncExec(new Runnable() { |
|
48 | 50 |
|
49 |
@Override |
|
50 |
public void run() { |
|
51 |
SwingUtilities.invokeLater(new Runnable() { |
|
51 |
@Override
|
|
52 |
public void run() {
|
|
53 |
SwingUtilities.invokeLater(new Runnable() {
|
|
52 | 54 |
|
53 |
@Override |
|
54 |
public void run() { |
|
55 |
((ChartPanel) chartEditor.getComposite().getChartComponent()).doEditChartProperties(); |
|
55 |
@Override
|
|
56 |
public void run() {
|
|
57 |
((ChartPanel) chartEditor.getComposite().getChartComponent()).doEditChartProperties();
|
|
56 | 58 |
|
57 |
} |
|
58 |
}); |
|
59 |
} |
|
60 |
}); |
|
59 |
} |
|
60 |
}); |
|
61 |
} |
|
62 |
}); |
|
63 |
} |
|
64 |
else { |
|
65 |
System.err.println("OpenJFCChartPropertiesEditor.execute(): Can not open chart properties interface for the current chart engine."); //$NON-NLS-1$ |
|
66 |
} |
|
61 | 67 |
|
62 | 68 |
return null; |
63 | 69 |
} |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/events/DefaultChartMouseListener.java (revision 261) | ||
---|---|---|
151 | 151 |
} |
152 | 152 |
} |
153 | 153 |
|
154 |
// FIXME: this code must be extract in each plugin (CA, Progression, etc.) and stored in some EventCallBack extensions |
|
154 |
// FIXME: this code must be extracted in each plugin (CA, Progression, etc.) and stored in some EventCallBack extensions
|
|
155 | 155 |
// update text menu according to the current selection |
156 | 156 |
if(renderer.getItemsSelector() instanceof MultipleItemsSelector && ((MultipleItemsSelector) renderer.getItemsSelector()).getSelectedSeriesCount() > 0) { |
157 | 157 |
// XY plot |
... | ... | |
166 | 166 |
for(int j = 0; j < selectedItems.length; j++) { |
167 | 167 |
// Symbol Axis |
168 | 168 |
if(((XYPlot) plot).getDomainAxis() instanceof SymbolAxis) { |
169 |
menuText += (String)((SymbolAxis) ((XYPlot) plot).getDomainAxis()).getSymbols()[selectedItems[j]]; |
|
169 |
menuText += (String)((SymbolAxis) ((XYPlot) plot).getDomainAxis()).getSymbols()[selectedItems[j]] + "\n";
|
|
170 | 170 |
} |
171 | 171 |
// CA |
172 | 172 |
else if(itemEntity.getDataset() instanceof FCAXYDataset) { |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/themes/highcharts/events/JFCItemsKeyboardSelectionCallBack.java (revision 261) | ||
---|---|---|
14 | 14 |
import org.txm.chartsengine.rcp.events.ZoomAndPanCallBack; |
15 | 15 |
|
16 | 16 |
/** |
17 |
* Callback for items selection and extended selection from keyboard. |
|
18 |
* |
|
17 | 19 |
* @author sjacquot |
18 | 20 |
* |
19 | 21 |
*/ |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/themes/highcharts/swing/CustomChartPanel.java (revision 261) | ||
---|---|---|
1 | 1 |
package org.txm.chartsengine.jfreechart.rcp.themes.highcharts.swing; |
2 | 2 |
|
3 | 3 |
import java.awt.Color; |
4 |
import java.awt.Graphics; |
|
5 |
import java.awt.Graphics2D; |
|
6 |
import java.awt.geom.Line2D; |
|
4 | 7 |
|
5 | 8 |
import javax.swing.JToolTip; |
6 | 9 |
|
... | ... | |
97 | 100 |
return tip; |
98 | 101 |
} |
99 | 102 |
|
103 |
|
|
104 |
// public void paint(Graphics gr) { |
|
105 |
// paintComponent(gr); |
|
106 |
// } |
|
107 |
|
|
108 |
// public void paintComponent(Graphics gr) { |
|
109 |
// super.paintComponents(gr); |
|
110 |
// Graphics2D g2 = (Graphics2D) gr; |
|
111 |
// System.out.println("CustomChartPanel.paintComponent()"); |
|
112 |
// //FIXME: dynamic drawing tests |
|
113 |
//// Line2D line = new Line2D.Double(0, 100, 500, 350); |
|
114 |
//// g2.draw(line); |
|
115 |
//// g2.drawRect(50, 100, 800, 2000); |
|
116 |
// } |
|
100 | 117 |
|
101 | 118 |
} |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/themes/base/swing/ItemSelectionJFCChartPanel.java (revision 261) | ||
---|---|---|
104 | 104 |
this.zoomOutBoth(x, y); |
105 | 105 |
} |
106 | 106 |
} |
107 |
|
|
107 | 108 |
|
109 |
@Override |
|
110 |
public void zoomInRange(double x, double y) { |
|
111 |
super.zoomInRange(x, y); |
|
108 | 112 |
|
113 |
// FIXME: store the zoom |
|
114 |
// if(this.getChart().getPlot() instanceof XYPlot) { |
|
115 |
// XYPlot plot = this.getChart().getXYPlot(); |
|
116 |
// System.out.println("ItemSelectionJFCChartPanel.zoomInBoth() range axis lower bound: " + plot.getRangeAxis().getLowerBound()); |
|
117 |
// System.out.println("ItemSelectionJFCChartPanel.zoomInBoth() range axis upper bound: " + plot.getRangeAxis().getUpperBound()); |
|
118 |
// } |
|
119 |
} |
|
120 |
|
|
109 | 121 |
@Override |
122 |
public void zoomOutRange(double x, double y) { |
|
123 |
super.zoomOutRange(x, y); |
|
124 |
|
|
125 |
// FIXME: store the zoom |
|
126 |
// if(this.getChart().getPlot() instanceof XYPlot) { |
|
127 |
// XYPlot plot = this.getChart().getXYPlot(); |
|
128 |
// System.out.println("ItemSelectionJFCChartPanel.zoomInBoth() range axis lower bound: " + plot.getRangeAxis().getLowerBound()); |
|
129 |
// System.out.println("ItemSelectionJFCChartPanel.zoomInBoth() range axis upper bound: " + plot.getRangeAxis().getUpperBound()); |
|
130 |
// } |
|
131 |
|
|
132 |
} |
|
133 |
|
|
134 |
|
|
135 |
@Override |
|
110 | 136 |
public void pan(double srcX, double srcY, double dstX, double dstY, double panFactor) { |
111 | 137 |
|
112 | 138 |
Pannable p = (Pannable)this.getChart().getPlot(); |
tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/JFCSWTChartsComponentsProvider.java (revision 261) | ||
---|---|---|
76 | 76 |
|
77 | 77 |
// sets and updates the local preferences node qualifier from the result data |
78 | 78 |
chartEditorInput.syncLocalPreferencesNode(); |
79 |
|
|
80 | 79 |
return true; |
81 | 80 |
} |
82 | 81 |
return false; |
Formats disponibles : Unified diff