Révision 3869
TXM/trunk/bundles/org.txm.cooccurrence.chartsengine/src/org/txm/cooccurrence/chartsengine/CooccurrenceGSChartCreator.java (revision 3869) | ||
---|---|---|
148 | 148 |
|
149 | 149 |
graph.clear(); |
150 | 150 |
|
151 |
String styleSheet = "node {" + |
|
152 |
" fill-mode: dyn-plain;" + |
|
153 |
" fill-color: grey;" + |
|
154 |
" size-mode: dyn-size;" + |
|
155 |
" size: 5px;" + |
|
151 |
String styleSheet = "node {" + //$NON-NLS-1$
|
|
152 |
" fill-mode: dyn-plain;" + //$NON-NLS-1$
|
|
153 |
" fill-color: grey;" + //$NON-NLS-1$
|
|
154 |
" size-mode: dyn-size;" + //$NON-NLS-1$
|
|
155 |
" size: 5px;" + //$NON-NLS-1$
|
|
156 | 156 |
// " size: 30px, 30px;" + |
157 | 157 |
// " text-size: 12px;" + |
158 | 158 |
// " shape: freeplane;" + |
159 | 159 |
// // " size-mode: fit;" + |
160 | 160 |
// " fill-mode: none;" + |
161 | 161 |
// " stroke-mode: plain;" + |
162 |
"}" + |
|
163 |
"edge {" + |
|
164 |
" shape: cubic-curve;" + |
|
162 |
"}" + //$NON-NLS-1$
|
|
163 |
"edge {" + //$NON-NLS-1$
|
|
164 |
" shape: cubic-curve;" + //$NON-NLS-1$
|
|
165 | 165 |
|
166 | 166 |
|
167 | 167 |
|
168 | 168 |
// " stroke-mode: plain;" + |
169 | 169 |
|
170 |
"}" + |
|
170 |
"}" + //$NON-NLS-1$
|
|
171 | 171 |
/* |
172 | 172 |
* "node.marked {" + |
173 | 173 |
* " fill-color: red;" + |
174 | 174 |
* "}" + |
175 | 175 |
*/ |
176 | 176 |
|
177 |
"node.titre {" + |
|
178 |
" size: 55px, 45px;" + |
|
179 |
" fill-color: blue;" + |
|
180 |
" text-color: red;" + |
|
181 |
" shape: diamond;" + |
|
182 |
"}" + |
|
177 |
"node.titre {" + //$NON-NLS-1$
|
|
178 |
" size: 55px, 45px;" + //$NON-NLS-1$
|
|
179 |
" fill-color: blue;" + //$NON-NLS-1$
|
|
180 |
" text-color: red;" + //$NON-NLS-1$
|
|
181 |
" shape: diamond;" + //$NON-NLS-1$
|
|
182 |
"}" + //$NON-NLS-1$
|
|
183 | 183 |
|
184 |
"node.axe {" + |
|
185 |
" fill-color: blue;" + |
|
186 |
" text-color: blue;" + |
|
187 |
" shape: box;" + |
|
188 |
"}" + |
|
184 |
"node.axe {" + //$NON-NLS-1$
|
|
185 |
" fill-color: blue;" + //$NON-NLS-1$
|
|
186 |
" text-color: blue;" + //$NON-NLS-1$
|
|
187 |
" shape: box;" + //$NON-NLS-1$
|
|
188 |
"}" + //$NON-NLS-1$
|
|
189 | 189 |
/* |
190 | 190 |
* "node.mot {" + |
191 | 191 |
* " fill-color: green;" + |
192 | 192 |
* " text-color: green;" + |
193 | 193 |
* "}" + |
194 | 194 |
*/ |
195 |
"node.auteur {" + |
|
196 |
" fill-color: red;" + |
|
197 |
" text-color: gray;" + |
|
198 |
" shape: diamond;" + |
|
199 |
"}"; |
|
195 |
"node.auteur {" + //$NON-NLS-1$
|
|
196 |
" fill-color: red;" + //$NON-NLS-1$
|
|
197 |
" text-color: gray;" + //$NON-NLS-1$
|
|
198 |
" shape: diamond;" + //$NON-NLS-1$
|
|
199 |
"}"; //$NON-NLS-1$
|
|
200 | 200 |
|
201 | 201 |
|
202 |
graph.addAttribute("ui.stylesheet", styleSheet); |
|
202 |
graph.addAttribute("ui.stylesheet", styleSheet); //$NON-NLS-1$
|
|
203 | 203 |
|
204 | 204 |
int maxSize = 20; |
205 | 205 |
|
206 | 206 |
// add query node |
207 | 207 |
Node rootNode = graph.addNode(cooccurrence.getQuery().getQueryString()); |
208 |
rootNode.addAttribute("ui.size", 5); |
|
209 |
rootNode.addAttribute("ui.color", Color.RED); |
|
208 |
rootNode.addAttribute("ui.size", 5); //$NON-NLS-1$
|
|
209 |
rootNode.addAttribute("ui.color", Color.RED); //$NON-NLS-1$
|
|
210 | 210 |
|
211 | 211 |
// add cooccurrents nodes |
212 | 212 |
for (int i = 0; i < cooccurrence.getLines().size(); i++) { |
213 | 213 |
|
214 | 214 |
Node n2 = graph.addNode(cooccurrence.getLines().get(i).occ); |
215 |
n2.addAttribute("ui.size", cooccurrence.getLines().get(i).freq / 5); |
|
215 |
n2.addAttribute("ui.size", cooccurrence.getLines().get(i).freq / 5); //$NON-NLS-1$
|
|
216 | 216 |
|
217 | 217 |
graph.addEdge(String.valueOf(i), rootNode, n2); |
218 | 218 |
|
... | ... | |
227 | 227 |
|
228 | 228 |
// set text labels |
229 | 229 |
for (Node n : graph) { |
230 |
n.setAttribute("ui.label", n.getId()); |
|
230 |
n.setAttribute("ui.label", n.getId()); //$NON-NLS-1$
|
|
231 | 231 |
} |
232 | 232 |
|
233 | 233 |
|
TXM/trunk/bundles/org.txm.cooccurrence.chartsengine/src/org/txm/cooccurrence/functions/CooccurrenceGraph.java (revision 3869) | ||
---|---|---|
27 | 27 |
// Since the command has no preferences, the default charts engine preferences are not loaded in TXMResult constructor, so the code above is needed to reload the parameters |
28 | 28 |
// It also problematic for persistence to pass "org.txm.chartsengine.core" because it is saved as bundle ID and the deserialisation can not be done since "org.txm.chartsengine.core" does not |
29 | 29 |
// found the class CooccurrenceGraph |
30 |
this.commandPreferencesNodePath = "org.txm.chartsengine.core"; |
|
30 |
this.commandPreferencesNodePath = "org.txm.chartsengine.core"; //$NON-NLS-1$
|
|
31 | 31 |
try { |
32 | 32 |
this.autoLoadParametersFromAnnotations(); |
33 | 33 |
} |
... | ... | |
47 | 47 |
// Since the command has no preferences, the default charts engine preferences are not loaded in TXMResult constructor, so the code above is needed to reload the parameters |
48 | 48 |
// It also problematic for persistence to pass "org.txm.chartsengine.core" because it is saved as bundle ID and the deserialisation can not be done since "org.txm.chartsengine.core" does not |
49 | 49 |
// found the class CooccurrenceGraph |
50 |
this.commandPreferencesNodePath = "org.txm.chartsengine.core"; |
|
50 |
this.commandPreferencesNodePath = "org.txm.chartsengine.core"; //$NON-NLS-1$
|
|
51 | 51 |
try { |
52 | 52 |
this.autoLoadParametersFromAnnotations(); |
53 | 53 |
} |
... | ... | |
86 | 86 |
@Override |
87 | 87 |
public String getName() { |
88 | 88 |
// TODO Auto-generated method stub |
89 |
return "graph"; |
|
89 |
return "graph"; //$NON-NLS-1$
|
|
90 | 90 |
} |
91 | 91 |
|
92 | 92 |
/* |
... | ... | |
96 | 96 |
@Override |
97 | 97 |
public String getSimpleName() { |
98 | 98 |
// TODO Auto-generated method stub |
99 |
return "graph"; |
|
99 |
return "graph"; //$NON-NLS-1$
|
|
100 | 100 |
} |
101 | 101 |
|
102 | 102 |
/* |
... | ... | |
106 | 106 |
@Override |
107 | 107 |
public String getDetails() { |
108 | 108 |
// TODO Auto-generated method stub |
109 |
return "graph"; |
|
109 |
return "graph"; //$NON-NLS-1$
|
|
110 | 110 |
} |
111 | 111 |
|
112 | 112 |
/* |
... | ... | |
151 | 151 |
|
152 | 152 |
@Override |
153 | 153 |
public String getResultType() { |
154 |
return "Cooccurrence graph"; |
|
154 |
return "Cooccurrence graph"; //$NON-NLS-1$
|
|
155 | 155 |
} |
156 | 156 |
|
157 | 157 |
} |
Formats disponibles : Unified diff