Révision 1842
| tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGChartComposite.java (revision 1842) | ||
|---|---|---|
| 21 | 21 |
import org.txm.chartsengine.core.ChartsEngine; |
| 22 | 22 |
import org.txm.chartsengine.rcp.IChartComponent; |
| 23 | 23 |
import org.txm.chartsengine.rcp.editors.ChartEditor; |
| 24 |
import org.txm.chartsengine.rcp.editors.ChartEditorInput; |
|
| 25 | 24 |
import org.txm.chartsengine.rcp.swt.SwingChartComposite; |
| 26 | 25 |
import org.txm.chartsengine.svgbatik.rcp.swing.SVGCanvas; |
| 27 | 26 |
import org.txm.core.messages.TXMCoreMessages; |
| ... | ... | |
| 45 | 44 |
|
| 46 | 45 |
|
| 47 | 46 |
/** |
| 48 |
* The loaded SVG file.
|
|
| 47 |
* The chart SVG file.
|
|
| 49 | 48 |
*/ |
| 50 | 49 |
protected File file; |
| 51 | 50 |
|
| ... | ... | |
| 124 | 123 |
} |
| 125 | 124 |
|
| 126 | 125 |
|
| 127 |
@Override |
|
| 128 |
public Object getChart() {
|
|
| 129 |
return this.file; |
|
| 130 |
} |
|
| 131 | 126 |
|
| 132 |
|
|
| 133 | 127 |
@Override |
| 134 | 128 |
public void clearChartItemsSelection() {
|
| 135 |
System.err.println("SVGComposite.clearChartItemsSelection(): not implemented.");
|
|
| 129 |
Log.severe("SVGChartComposite.clearChartItemsSelection(): not implemented.");
|
|
| 136 | 130 |
} |
| 137 | 131 |
|
| 138 | 132 |
|
| tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/swt/JFCComposite.java (revision 1842) | ||
|---|---|---|
| 108 | 108 |
} |
| 109 | 109 |
|
| 110 | 110 |
|
| 111 |
/** |
|
| 112 |
* Gets the chart. |
|
| 113 |
* @return the chart |
|
| 114 |
*/ |
|
| 111 |
@Override |
|
| 115 | 112 |
public JFreeChart getChart() {
|
| 116 |
return ((ChartPanel) this.chartComponent).getChart();
|
|
| 113 |
return (JFreeChart) super.getChart();
|
|
| 117 | 114 |
} |
| 118 | 115 |
|
| 119 | 116 |
|
| tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartComposite.java (revision 1842) | ||
|---|---|---|
| 253 | 253 |
* Gets the chart object. |
| 254 | 254 |
* @return |
| 255 | 255 |
*/ |
| 256 |
public abstract Object getChart(); |
|
| 256 |
public Object getChart() {
|
|
| 257 |
return this.getChartResult().getChart(); |
|
| 258 |
}; |
|
| 257 | 259 |
|
| 258 | 260 |
|
| 259 | 261 |
/** |
| 262 |
* Gets the linked result. |
|
| 263 |
* @return |
|
| 264 |
*/ |
|
| 265 |
public ChartResult getChartResult() {
|
|
| 266 |
return this.chartEditor.getResult(); |
|
| 267 |
} |
|
| 268 |
|
|
| 269 |
/** |
|
| 260 | 270 |
* Gets the charts engine of the linked result. |
| 261 | 271 |
* @return |
| 262 | 272 |
*/ |
| 263 | 273 |
public ChartsEngine getChartsEngine() {
|
| 264 |
return this.chartEditor.getChartsEngine();
|
|
| 274 |
return this.getChartResult().getChartsEngine();
|
|
| 265 | 275 |
} |
| 266 | 276 |
|
| 267 | 277 |
/** |
| tmp/org.txm.chartsengine.graphstream.rcp/src/org/txm/chartsengine/graphstream/rcp/swt/GSComposite.java (revision 1842) | ||
|---|---|---|
| 77 | 77 |
} |
| 78 | 78 |
|
| 79 | 79 |
@Override |
| 80 |
public Object getChart() {
|
|
| 81 |
return ((GSChartComponent) this.chartComponent).getViewer().getGraphicGraph(); |
|
| 82 |
} |
|
| 83 |
|
|
| 84 |
@Override |
|
| 85 | 80 |
protected IChartComponent _createChartComponent() {
|
| 86 | 81 |
|
| 87 | 82 |
//System.setProperty("org.graphstream.ui.renderer", "org.graphstream.ui.j2dviewer.J2DGraphRenderer"); // Pour les fonctionnalités avancées des CSS
|
| tmp/org.txm.cooccurrence.chartsengine/src/org/txm/cooccurrence/chartsengine/CooccurrenceGSChartCreator.java (revision 1842) | ||
|---|---|---|
| 21 | 21 |
* @author sjacquot |
| 22 | 22 |
* |
| 23 | 23 |
*/ |
| 24 |
// FIXME: tests for cooccurrence chart |
|
| 24 | 25 |
public class CooccurrenceGSChartCreator extends GSChartCreator {
|
| 25 | 26 |
|
| 26 | 27 |
/** |
| ... | ... | |
| 30 | 31 |
// TODO Auto-generated constructor stub |
| 31 | 32 |
} |
| 32 | 33 |
|
| 33 |
/* (non-Javadoc) |
|
| 34 |
* @see org.txm.chartsengine.core.ChartCreator#createChart(org.txm.chartsengine.core.results.ChartResult) |
|
| 35 |
*/ |
|
| 36 | 34 |
@Override |
| 37 | 35 |
public Object createChart(ChartResult result) {
|
| 36 |
// |
|
| 37 |
// String styleSheet = |
|
| 38 |
// "node {" +
|
|
| 39 |
// " fill-mode: dyn-plain;" + |
|
| 40 |
// " fill-color: grey;" + |
|
| 41 |
// " size-mode: dyn-size;" + |
|
| 42 |
// " size: 5px;" + |
|
| 43 |
//// " size: 30px, 30px;" + |
|
| 44 |
//// " text-size: 12px;" + |
|
| 45 |
//// " shape: freeplane;" + |
|
| 46 |
//// // " size-mode: fit;" + |
|
| 47 |
//// " fill-mode: none;" + |
|
| 48 |
//// " stroke-mode: plain;" + |
|
| 49 |
// "}" + |
|
| 50 |
// "edge {" +
|
|
| 51 |
// " shape: cubic-curve;" + |
|
| 52 |
// |
|
| 53 |
// |
|
| 54 |
// |
|
| 55 |
//// " stroke-mode: plain;" + |
|
| 56 |
// |
|
| 57 |
// "}" + |
|
| 58 |
// /*"node.marked {" +
|
|
| 59 |
// " fill-color: red;" + |
|
| 60 |
// "}" +*/ |
|
| 61 |
// |
|
| 62 |
// "node.titre {" +
|
|
| 63 |
// " size: 55px, 45px;" + |
|
| 64 |
// " fill-color: blue;" + |
|
| 65 |
// " text-color: red;" + |
|
| 66 |
// " shape: diamond;" + |
|
| 67 |
// "}" + |
|
| 68 |
// |
|
| 69 |
// "node.axe {" +
|
|
| 70 |
// " fill-color: blue;" + |
|
| 71 |
// " text-color: blue;" + |
|
| 72 |
// " shape: box;" + |
|
| 73 |
// "}" + |
|
| 74 |
// /* |
|
| 75 |
// "node.mot {" +
|
|
| 76 |
// " fill-color: green;" + |
|
| 77 |
// " text-color: green;" + |
|
| 78 |
// "}" +*/ |
|
| 79 |
// "node.auteur {" +
|
|
| 80 |
// " fill-color: red;" + |
|
| 81 |
// " text-color: gray;" + |
|
| 82 |
// " shape: diamond;" + |
|
| 83 |
// "}"; |
|
| 84 |
// |
|
| 85 |
|
|
| 86 |
Cooccurrence cooccurrence = (Cooccurrence) result.getParent(); |
|
| 87 |
//Graph graph = (Graph) result.getChart(); |
|
| 88 |
|
|
| 89 |
Graph graph = new SingleGraph(cooccurrence.getSimpleName()); |
|
| 90 |
// graph.addAttribute("ui.stylesheet", styleSheet);
|
|
| 38 | 91 |
|
| 92 |
|
|
| 93 |
// graph.clear(); |
|
| 94 |
// graph.clearSinks(); |
|
| 95 |
// |
|
| 96 |
// Generator gen = new DorogovtsevMendesGenerator(); |
|
| 97 |
// gen.addSink(graph); |
|
| 98 |
// gen.begin(); |
|
| 99 |
// for(int i=0; i<500; i++) {
|
|
| 100 |
// gen.nextEvents(); |
|
| 101 |
// } |
|
| 102 |
// gen.end(); |
|
| 103 |
|
|
| 104 |
//graph.addAttribute("ui.stylesheet", styleSheet);
|
|
| 105 |
//System.setProperty("org.graphstream.ui.renderer", "org.graphstream.ui.j2dviewer.J2DGraphRenderer"); // Pour les fonctionnalités avancées des CSS
|
|
| 106 |
|
|
| 107 |
// int maxSize = 20; |
|
| 108 |
// |
|
| 109 |
// // add query node |
|
| 110 |
// Node rootNode = graph.addNode(cooccurrence.getQuery().getQueryString()); |
|
| 111 |
// rootNode.addAttribute("ui.size", 5);
|
|
| 112 |
// rootNode.addAttribute("ui.color", Color.RED);
|
|
| 113 |
// |
|
| 114 |
// // add cooccurrents nodes |
|
| 115 |
// for (int i = 0; i < cooccurrence.getLines().size(); i++) {
|
|
| 116 |
// |
|
| 117 |
// Node n2 = graph.addNode(cooccurrence.getLines().get(i).occ); |
|
| 118 |
// n2.addAttribute("ui.size", cooccurrence.getLines().get(i).freq / 5);
|
|
| 119 |
// |
|
| 120 |
// graph.addEdge(String.valueOf(i), rootNode, n2); |
|
| 121 |
// |
|
| 122 |
// } |
|
| 123 |
// |
|
| 124 |
//// graph.addNode("A");
|
|
| 125 |
//// graph.addNode("B");
|
|
| 126 |
//// graph.addNode("C");
|
|
| 127 |
//// graph.addEdge("AB", "A", "B");
|
|
| 128 |
//// graph.addEdge("BC", "B", "C");
|
|
| 129 |
//// graph.addEdge("CA", "C", "A");
|
|
| 130 |
// |
|
| 131 |
// // set text labels |
|
| 132 |
// for (Node n : graph) {
|
|
| 133 |
// n.setAttribute("ui.label", n.getId());
|
|
| 134 |
// } |
|
| 135 |
|
|
| 136 |
|
|
| 137 |
// FIXME: tests (opening a Frame with the graph but be careful, closing the Frame closes the entire RCP app) |
|
| 138 |
//graph.display(); |
|
| 139 |
|
|
| 140 |
return graph; |
|
| 141 |
} |
|
| 142 |
|
|
| 143 |
@Override |
|
| 144 |
public void updateChart(ChartResult result) {
|
|
| 145 |
|
|
| 146 |
Cooccurrence cooccurrence = (Cooccurrence) result.getParent(); |
|
| 147 |
Graph graph = (Graph) result.getChart(); |
|
| 148 |
|
|
| 149 |
graph.clear(); |
|
| 150 |
|
|
| 39 | 151 |
String styleSheet = |
| 40 | 152 |
"node {" +
|
| 41 | 153 |
" fill-mode: dyn-plain;" + |
| ... | ... | |
| 85 | 197 |
"}"; |
| 86 | 198 |
|
| 87 | 199 |
|
| 88 |
Cooccurrence cooccurrence = (Cooccurrence) result.getParent(); |
|
| 89 |
//Graph graph = (Graph) result.getChart(); |
|
| 200 |
graph.addAttribute("ui.stylesheet", styleSheet);
|
|
| 90 | 201 |
|
| 91 |
Graph graph = new SingleGraph(cooccurrence.getSimpleName()); |
|
| 92 |
graph.addAttribute("ui.stylesheet", styleSheet);
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
// graph.clear(); |
|
| 96 |
// graph.clearSinks(); |
|
| 97 |
// |
|
| 98 |
// Generator gen = new DorogovtsevMendesGenerator(); |
|
| 99 |
// gen.addSink(graph); |
|
| 100 |
// gen.begin(); |
|
| 101 |
// for(int i=0; i<500; i++) {
|
|
| 102 |
// gen.nextEvents(); |
|
| 103 |
// } |
|
| 104 |
// gen.end(); |
|
| 105 |
|
|
| 106 |
//graph.addAttribute("ui.stylesheet", styleSheet);
|
|
| 107 |
//System.setProperty("org.graphstream.ui.renderer", "org.graphstream.ui.j2dviewer.J2DGraphRenderer"); // Pour les fonctionnalités avancées des CSS
|
|
| 108 |
|
|
| 109 | 202 |
int maxSize = 20; |
| 110 | 203 |
|
| 111 | 204 |
// add query node |
| ... | ... | |
| 134 | 227 |
for (Node n : graph) {
|
| 135 | 228 |
n.setAttribute("ui.label", n.getId());
|
| 136 | 229 |
} |
| 137 |
|
|
| 138 | 230 |
|
| 139 |
// FIXME: tests (opening a Frame with the graph but be careful, closing the Frame closes the entire RCP app) |
|
| 140 |
//graph.display(); |
|
| 141 | 231 |
|
| 142 |
return graph;
|
|
| 232 |
super.updateChart(result);
|
|
| 143 | 233 |
} |
| 144 | 234 |
|
| 145 | 235 |
/* (non-Javadoc) |
| tmp/org.txm.chartsengine.raster.rcp/src/org/txm/chartsengine/raster/rcp/swt/RasterComposite.java (revision 1842) | ||
|---|---|---|
| 167 | 167 |
} |
| 168 | 168 |
|
| 169 | 169 |
|
| 170 |
@Override |
|
| 171 |
public Object getChart() {
|
|
| 172 |
return this.file; |
|
| 173 |
} |
|
| 174 |
|
|
| 175 | 170 |
|
| 176 | 171 |
@Override |
| 177 | 172 |
public EventCallBackHandler getMouseCallBackHandler() {
|
Formats disponibles : Unified diff