Révision 1787
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java (revision 1787) | ||
---|---|---|
178 | 178 |
|
179 | 179 |
try { |
180 | 180 |
if (this.getLexicalTable().getNRows() == 0) { |
181 |
Log.warning("** Empty Lexical table. Aborting.");
|
|
181 |
Log.warning("** Empty Lexical table. Computing aborted.");
|
|
182 | 182 |
return false; |
183 | 183 |
} |
184 | 184 |
|
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/SVGGraphicEditor.java (revision 1787) | ||
---|---|---|
38 | 38 |
import org.eclipse.ui.IEditorInput; |
39 | 39 |
import org.eclipse.ui.IEditorSite; |
40 | 40 |
import org.eclipse.ui.PartInitException; |
41 |
import org.txm.core.results.TXMResult;
|
|
41 |
import org.eclipse.ui.part.EditorPart;
|
|
42 | 42 |
//import org.txm.chartsengine.core.results.ChartResult; |
43 | 43 |
import org.txm.rcp.messages.TXMUIMessages; |
44 | 44 |
import org.txm.rcp.svg.SVGComposite; |
45 |
import org.txm.utils.logger.Log; |
|
45 | 46 |
|
46 | 47 |
/** |
47 | 48 |
* Test the use of the SVGComposite view from Batik_UI_Plugin Show a SVG file in |
... | ... | |
50 | 51 |
* @author Sylvain Loiseau |
51 | 52 |
*/ |
52 | 53 |
//FIXME: SJ: this class doesn't work anymore |
53 |
//FIXME: SJ: this souldn't inherit from TXMEditor |
|
54 |
public abstract class SVGGraphicEditor extends TXMEditor<TXMResult> { |
|
54 |
public class SVGGraphicEditor extends EditorPart { |
|
55 | 55 |
|
56 | 56 |
/** Linking with the OutlineView. */ |
57 | 57 |
// private OverviewOutlinePage overviewOutlinePage; |
... | ... | |
61 | 61 |
/** The svg path. */ |
62 | 62 |
private IPath svgPath; |
63 | 63 |
|
64 |
/** The input. */ |
|
65 |
private IEditorInput input; |
|
66 |
|
|
67 | 64 |
/** The svgfile displayed in the editor */ |
68 | 65 |
private File svgfile; |
69 | 66 |
|
70 |
/** The Constant ID. */ |
|
71 |
public static final String ID = SVGGraphicEditor.class.getName(); |
|
67 |
|
|
72 | 68 |
|
73 |
/** |
|
74 |
* Gets the sVG composite. |
|
75 |
* |
|
76 |
* @return the sVG composite |
|
77 |
*/ |
|
78 |
public SVGComposite getSVGComposite() { |
|
79 |
return svgComp; |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* Do save. |
|
84 |
* |
|
85 |
* @param arg0 the arg0 |
|
86 |
* @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor) |
|
87 |
*/ |
|
88 | 69 |
@Override |
89 |
public void doSave(IProgressMonitor arg0) { |
|
90 |
// TODO Auto-generated method stub |
|
70 |
public void init(IEditorSite site, IEditorInput input) throws PartInitException { |
|
71 |
this.setSite(site); |
|
72 |
this.setInput(input); |
|
73 |
this.setPartName(input.getName()); |
|
91 | 74 |
} |
92 | 75 |
|
93 |
/** |
|
94 |
* Do save as. |
|
95 |
* |
|
96 |
* @see org.eclipse.lyon gournd zeroui.part.EditorPart#doSaveAs() |
|
97 |
*/ |
|
98 |
@Override |
|
99 |
public void doSaveAs() { |
|
100 |
// TODO Auto-generated method stub |
|
101 |
} |
|
102 | 76 |
|
103 |
/** |
|
104 |
* Inits the. |
|
105 |
* |
|
106 |
* @param site the site |
|
107 |
* @param input the input |
|
108 |
* @throws PartInitException the part init exception |
|
109 |
* @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, |
|
110 |
* org.eclipse.ui.IEditorInput) |
|
111 |
*/ |
|
112 | 77 |
@Override |
113 |
public void init(IEditorSite site, IEditorInput input) |
|
114 |
throws PartInitException { |
|
115 |
this.input = input; |
|
116 |
setSite(site); |
|
117 |
setInput(input); |
|
118 |
setPartName(input.getName()); |
|
119 |
} |
|
78 |
public void createPartControl(Composite parent) { |
|
120 | 79 |
|
121 |
/** |
|
122 |
* Checks if is dirty. |
|
123 |
* |
|
124 |
* @return true, if is dirty |
|
125 |
* @see org.eclipse.ui.part.EditorPart#isDirty() |
|
126 |
*/ |
|
127 |
@Override |
|
128 |
public boolean isDirty() { |
|
129 |
return false; |
|
130 |
} |
|
131 |
|
|
132 |
/** |
|
133 |
* Checks if is save as allowed. |
|
134 |
* |
|
135 |
* @return true, if is save as allowed |
|
136 |
* @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed() |
|
137 |
*/ |
|
138 |
@Override |
|
139 |
public boolean isSaveAsAllowed() { |
|
140 |
return false; |
|
141 |
} |
|
142 |
|
|
143 |
/** |
|
144 |
* Creates the part control. |
|
145 |
* |
|
146 |
* @param parent the parent |
|
147 |
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) |
|
148 |
*/ |
|
149 |
@Override |
|
150 |
public void _createPartControl() { |
|
151 |
|
|
152 |
svgComp = new SVGComposite(getResultArea(), SWT.EMBEDDED | SWT.NO_BACKGROUND); |
|
80 |
svgComp = new SVGComposite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND); |
|
153 | 81 |
if (svgPath == null) { |
154 |
if (input instanceof SVGGraphicable) {
|
|
82 |
if (this.getEditorInput() instanceof SVGGraphicable) {
|
|
155 | 83 |
//svgPath = ((SVGGraphicable) input).getIPath().toFile().toURI().toURL().toString(); |
156 | 84 |
try { |
157 |
svgComp.setSVGFile(((SVGGraphicable) input).getIPath().toFile().toURI().toURL()); |
|
158 |
svgfile = ((SVGGraphicable) input).getIPath().toFile(); |
|
159 |
} catch (MalformedURLException e) { |
|
160 |
// TODO Auto-generated catch block |
|
161 |
org.txm.utils.logger.Log.printStackTrace(e); |
|
85 |
svgComp.setSVGFile(((SVGGraphicable) this.getEditorInput()).getIPath().toFile().toURI().toURL()); |
|
86 |
svgfile = ((SVGGraphicable) this.getEditorInput()).getIPath().toFile(); |
|
162 | 87 |
} |
88 |
catch (MalformedURLException e) { |
|
89 |
Log.printStackTrace(e); |
|
90 |
} |
|
163 | 91 |
|
164 |
} else { |
|
165 |
throw new IllegalArgumentException(TXMUIMessages.cannotDrawAGraphicWithTheInformationProvided); |
|
166 | 92 |
} |
93 |
else { |
|
94 |
Log.severe(TXMUIMessages.cannotDrawAGraphicWithTheInformationProvided); |
|
95 |
return; |
|
96 |
} |
|
167 | 97 |
} |
168 | 98 |
svgComp.resetZoom(); |
169 | 99 |
createContextMenu(); |
... | ... | |
244 | 174 |
// public void updateResultFromEditor() { |
245 | 175 |
// |
246 | 176 |
// } |
177 |
// |
|
178 |
// @Override |
|
179 |
// public void updateEditorFromResult(boolean update) { |
|
180 |
// // TODO implement a SVGResult extends TXMResult ? |
|
181 |
//// svgFile = getResultData().getSVGFile(); |
|
182 |
//// svgComp.setSVGFile(svgfile); |
|
183 |
// svgComp.redraw(); |
|
184 |
// } |
|
247 | 185 |
|
186 |
|
|
248 | 187 |
@Override |
249 |
public void updateEditorFromResult(boolean update) { |
|
250 |
// TODO implement a SVGResult extends TXMResult ? |
|
251 |
// svgFile = getResultData().getSVGFile(); |
|
252 |
// svgComp.setSVGFile(svgfile); |
|
253 |
svgComp.redraw(); |
|
188 |
public void doSave(IProgressMonitor monitor) { |
|
189 |
// TODO Auto-generated method stub |
|
190 |
|
|
254 | 191 |
} |
192 |
|
|
193 |
|
|
194 |
@Override |
|
195 |
public void doSaveAs() { |
|
196 |
// TODO Auto-generated method stub |
|
197 |
|
|
198 |
} |
|
199 |
|
|
200 |
|
|
201 |
@Override |
|
202 |
public boolean isDirty() { |
|
203 |
// TODO Auto-generated method stub |
|
204 |
return false; |
|
205 |
} |
|
206 |
|
|
207 |
|
|
208 |
@Override |
|
209 |
public boolean isSaveAsAllowed() { |
|
210 |
// TODO Auto-generated method stub |
|
211 |
return false; |
|
212 |
} |
|
255 | 213 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/input/SVGGraphicEditorInput.java (revision 1787) | ||
---|---|---|
42 | 42 |
* @author Sylvain Loiseau,mdecorde |
43 | 43 |
*/ |
44 | 44 |
// FIXME: SJ: this class doesn't work anymore |
45 |
// FIXME: SJ: this souldn't inherit from TXMResultEditorInput |
|
46 |
public class SVGGraphicEditorInput extends TXMResultEditorInput<TXMResult> implements IEditorInput, SVGGraphicable { |
|
45 |
public class SVGGraphicEditorInput implements IEditorInput, SVGGraphicable { |
|
47 | 46 |
|
48 | 47 |
/** The filename. */ |
49 | 48 |
private String filename; |
... | ... | |
51 | 50 |
/** The name. */ |
52 | 51 |
private String name; |
53 | 52 |
|
54 |
public SVGGraphicEditorInput(TXMResult result) { |
|
55 |
super(null); |
|
56 |
} |
|
57 | 53 |
|
58 |
|
|
59 |
public SVGGraphicEditorInput() { |
|
60 |
super(null); |
|
61 |
} |
|
62 |
|
|
63 | 54 |
/** |
64 | 55 |
* Instantiates a new sVG graphic editor input. |
65 | 56 |
* |
... | ... | |
67 | 58 |
* @param name the name |
68 | 59 |
*/ |
69 | 60 |
public SVGGraphicEditorInput(String filename, String name) { |
70 |
super(null); |
|
71 | 61 |
this.filename = filename; |
72 | 62 |
this.name = name; |
73 | 63 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenSVGGraph.java (revision 1787) | ||
---|---|---|
36 | 36 |
import org.eclipse.swt.widgets.FileDialog; |
37 | 37 |
import org.eclipse.swt.widgets.Shell; |
38 | 38 |
import org.eclipse.ui.IEditorInput; |
39 |
import org.eclipse.ui.IEditorPart; |
|
39 | 40 |
import org.eclipse.ui.IWorkbenchPage; |
40 | 41 |
import org.eclipse.ui.IWorkbenchWindow; |
41 | 42 |
import org.eclipse.ui.PartInitException; |
... | ... | |
102 | 103 |
public static SVGGraphicEditor OpenSVGFile(String filepath, String name) { |
103 | 104 |
//System.out.println("SVGFile path : "+filepath); //$NON-NLS-1$ |
104 | 105 |
SVGGraphicEditorInput editorInput = new SVGGraphicEditorInput(filepath, name); |
105 |
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); |
|
106 |
//IWorkbenchWindow window = TXMWindows.getActiveWindow(); //.getActiveWorkbenchWindow() |
|
107 | 106 |
|
108 | 107 |
// System.out.println("open svg editor" ); |
109 |
TXMEditor editor = TXMEditor.openEditor(editorInput, SVGGraphicEditor.ID); |
|
110 |
if (editor !=null) { |
|
111 |
((SVGGraphicEditor)editor).resetView(); |
|
112 |
return (SVGGraphicEditor)editor; |
|
113 |
} else { |
|
114 |
return null; |
|
108 |
// TXMEditor editor = TXMEditor.openEditor(editorInput, SVGGraphicEditor.ID); |
|
109 |
// if (editor !=null) { |
|
110 |
// ((SVGGraphicEditor)editor).resetView(); |
|
111 |
// return (SVGGraphicEditor)editor; |
|
112 |
// } else { |
|
113 |
// return null; |
|
114 |
// } |
|
115 |
|
|
116 |
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); |
|
117 |
IWorkbenchPage page = window.getActivePage(); |
|
118 |
try { |
|
119 |
SVGGraphicEditor editor = (SVGGraphicEditor) page.openEditor(editorInput, "org.txm.rcp.editors.SVGGraphicEditor"); //$NON-NLS-1$ |
|
120 |
return editor; |
|
115 | 121 |
} |
122 |
catch (Exception e) { |
|
123 |
// TODO Auto-generated catch block |
|
124 |
e.printStackTrace(); |
|
125 |
} |
|
126 |
|
|
127 |
return null; |
|
128 |
|
|
116 | 129 |
} |
117 | 130 |
} |
tmp/org.txm.progression.core/src/org/txm/progression/core/preferences/ProgressionPreferences.java (revision 1787) | ||
---|---|---|
52 | 52 |
preferences.putBoolean(CHART_CUMULATIVE, true); |
53 | 53 |
preferences.putBoolean(REPEAT_SAME_VALUES, false); |
54 | 54 |
preferences.putDouble(BANDE_MULTIPLIER, 1.0d); |
55 |
|
|
56 |
// FIXME: SJ: should find a way to disable functionality only for a specific charts engine, ie. here R implementation doesn't manage the Show/Hide legend |
|
57 |
// disable unavailable functionalities |
|
58 |
//TXMPreferences.setEmpty(this.getPreferencesNodeQualifier(), SHOW_LEGEND); |
|
55 | 59 |
} |
56 | 60 |
} |
tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionBaseChartCreator.java (revision 1787) | ||
---|---|---|
127 | 127 |
|
128 | 128 |
String name = progression.getCorpus().getName(); |
129 | 129 |
|
130 |
// Create chart title |
|
131 |
String title = ""; |
|
132 |
if(result.getBooleanParameterValue(ChartsEnginePreferences.SHOW_TITLE)) { |
|
133 |
title = Utils.createProgressionChartTitle(progression, cumulative); |
|
134 |
} |
|
135 |
|
|
136 |
// Escape title string |
|
137 |
title = StringEscapeUtils.escapeJava(title); |
|
138 |
|
|
139 | 130 |
// System.out.println("BANDE="+bande); |
140 | 131 |
|
141 |
String cmd = "progression(positions, names, colors, styles, widths, \"" + name + "\"," + progression.getXminCorpus() + "," + progression.getXmaxCorpus() + ",\"" + cumulative + "\",structurepositions,structurenames, \"" + title + "\", " + progression.getBande() + ");\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
|
|
132 |
String cmd = "progression(positions, names, colors, styles, widths, \"" + name + "\"," + progression.getXminCorpus() + "," + progression.getXmaxCorpus() + ",\"" + cumulative + "\",structurepositions,structurenames, \"\", " + progression.getBande() + ");\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ |
|
142 | 133 |
|
143 |
this.getChartsEngine().plot(file, cmd); |
|
134 |
this.getChartsEngine().plot(file, cmd, result, StringEscapeUtils.escapeJava(Utils.createProgressionChartTitle(progression, cumulative)), null);
|
|
144 | 135 |
|
145 | 136 |
RWorkspace.getRWorkspaceInstance().eval(Progression.prefixR + Progression.norep + " <- list(positions=positions, names=names, xmin=" + progression.getXminCorpus() + ",xmax=" + progression.getXmaxCorpus() + ", structpositions=structurepositions, structnames=structurenames)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
146 | 137 |
Progression.norep++; |
tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/preferences/WordCloudPreferences.java (revision 1787) | ||
---|---|---|
26 | 26 |
preferences.putBoolean(RANDOM_POSITIONS, false); |
27 | 27 |
|
28 | 28 |
// disable unavailable functionalities |
29 |
TXMPreferences.setEmpty(this.getPreferencesNodeQualifier(), ChartsEnginePreferences.SHOW_TITLE);
|
|
30 |
TXMPreferences.setEmpty(this.getPreferencesNodeQualifier(), ChartsEnginePreferences.SHOW_LEGEND);
|
|
31 |
TXMPreferences.setEmpty(this.getPreferencesNodeQualifier(), ChartsEnginePreferences.SHOW_GRID);
|
|
32 |
TXMPreferences.setEmpty(this.getPreferencesNodeQualifier(), ChartsEnginePreferences.RENDERING_COLORS_MODE);
|
|
29 |
TXMPreferences.setEmpty(this.getPreferencesNodeQualifier(), SHOW_TITLE); |
|
30 |
TXMPreferences.setEmpty(this.getPreferencesNodeQualifier(), SHOW_LEGEND); |
|
31 |
TXMPreferences.setEmpty(this.getPreferencesNodeQualifier(), SHOW_GRID); |
|
32 |
TXMPreferences.setEmpty(this.getPreferencesNodeQualifier(), RENDERING_COLORS_MODE); |
|
33 | 33 |
} |
34 | 34 |
|
35 | 35 |
/** |
Formats disponibles : Unified diff