Révision 3548
TXM/trunk/org.txm.conllu.rcp/src/org/txm/conllu/rcp/preferences/UDTreePreferencePage.java (revision 3548) | ||
---|---|---|
22 | 22 |
|
23 | 23 |
String[][] values = {{"DepTreeViz", UDTreePreferences.DEPTREEVIZ}, {"Brat", UDTreePreferences.BRAT}}; |
24 | 24 |
|
25 |
this.addField(new ComboFieldEditor(UDTreePreferences.ENGINE, "Engine", values, this.getFieldEditorParent()));
|
|
25 |
this.addField(new ComboFieldEditor(UDTreePreferences.VISUALISATION, "Visualisation", values, this.getFieldEditorParent()));
|
|
26 | 26 |
|
27 | 27 |
this.addField(new BooleanFieldEditor(UDTreePreferences.PRINTCONLLUSENTENCES, "Print CoNLL-U sentence when browsing the matches", this.getFieldEditorParent())); |
28 | 28 |
} |
TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/function/UDSearch.java (revision 3548) | ||
---|---|---|
69 | 69 |
try { |
70 | 70 |
//File file = File.createTempFile("txm", ".svg", new File(Toolbox.getTxmHomePath(), "results")); |
71 | 71 |
|
72 |
String engine = UDTreePreferences.getInstance().getString(UDTreePreferences.ENGINE); |
|
72 |
//String engine = UDTreePreferences.getInstance().getString(UDTreePreferences.ENGINE);
|
|
73 | 73 |
|
74 | 74 |
Match match = this.matches.getMatches().get(sent); |
75 | 75 |
org.txm.objects.Match sentence = null; |
... | ... | |
122 | 122 |
} |
123 | 123 |
} |
124 | 124 |
|
125 |
if (UDTreePreferences.BRAT.equals(engine)) {
|
|
125 |
if (UDTreePreferences.BRAT.equals(pVisualisation)) {
|
|
126 | 126 |
return BratPrintTree.print(svgFile, conll, Tvalues, NTvalues) != null; |
127 | 127 |
} else { // if (engine == null || UDTreePreferences.DEPTREEVIZ.equals(engine)) { |
128 | 128 |
return UDPrintTree.print(svgFile, conll, Tvalues, NTvalues) != null; |
... | ... | |
381 | 381 |
return null; |
382 | 382 |
} //$NON-NLS-1$ //$NON-NLS-2$ull; |
383 | 383 |
} |
384 |
|
|
385 |
@Override |
|
386 |
public String[] getAvailableVisualisations() { |
|
387 |
|
|
388 |
return new String[] {UDTreePreferences.DEPTREEVIZ, UDTreePreferences.BRAT}; |
|
389 |
} |
|
384 | 390 |
} |
TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/preferences/UDTreePreferences.java (revision 3548) | ||
---|---|---|
13 | 13 |
*/ |
14 | 14 |
public class UDTreePreferences extends TreeSearchPreferences { |
15 | 15 |
|
16 |
public static final String DEPTREEVIZ = "deptreeviz";
|
|
17 |
public static final String BRAT = "brat";
|
|
16 |
public static final String DEPTREEVIZ = "DepTreeViz";
|
|
17 |
public static final String BRAT = "Brat";
|
|
18 | 18 |
|
19 | 19 |
public static final String ENGINE = "visu_engine"; |
20 | 20 |
public static final String PRINTCONLLUSENTENCES = "print_ud_seentence"; |
... | ... | |
37 | 37 |
super.initializeDefaultPreferences(); |
38 | 38 |
|
39 | 39 |
Preferences preferences = this.getDefaultPreferencesNode(); |
40 |
preferences.put(ENGINE, DEPTREEVIZ);
|
|
40 |
preferences.put(VISUALISATION, DEPTREEVIZ);
|
|
41 | 41 |
preferences.putBoolean(PRINTCONLLUSENTENCES, false); |
42 | 42 |
preferences.put(TFEATURE, ""); |
43 | 43 |
preferences.put(NTFEATURE, "feats"); |
TXM/trunk/org.txm.connlu.core/groovy/org/txm/scripts/importer/conllu/CoNLLUImporter.groovy (revision 3548) | ||
---|---|---|
13 | 13 |
import javax.xml.stream.* |
14 | 14 |
import org.txm.utils.AsciiUtils |
15 | 15 |
import org.txm.utils.ConsoleProgressBar |
16 |
import org.txm.utils.FileUtils |
|
16 | 17 |
import org.txm.conllu.core.preferences.UDPreferences |
17 | 18 |
/** |
18 | 19 |
* Only build the Metadatas object since all XML-TXM files already exists. |
... | ... | |
136 | 137 |
|
137 | 138 |
def content = []; // list of sentence |
138 | 139 |
|
139 |
String text_id = master.getName();
|
|
140 |
String text_id = FileUtils.stripExtension(master);
|
|
140 | 141 |
String sent_id = ""; |
141 | 142 |
String par_id = "1"; |
142 | 143 |
def comments = []; // /text/par/sent |
TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/preferences/TreeSearchPreferences.java (revision 3548) | ||
---|---|---|
19 | 19 |
public static final String TFEATURE = "t"; |
20 | 20 |
|
21 | 21 |
public static final String NTFEATURE = "nt"; |
22 |
|
|
23 |
public static final String VISUALISATION = "visualisation"; |
|
22 | 24 |
|
23 | 25 |
/** |
24 | 26 |
* Gets the instance. |
... | ... | |
40 | 42 |
preferences.put(DEFAULT_VISUALISATION, "TIGER"); |
41 | 43 |
preferences.put(TFEATURE, "word"); |
42 | 44 |
preferences.put(NTFEATURE, "cat"); |
45 |
preferences.put(VISUALISATION, ""); |
|
43 | 46 |
} |
44 | 47 |
} |
TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java (revision 3548) | ||
---|---|---|
37 | 37 |
@Parameter(key = TreeSearchPreferences.NTFEATURE) |
38 | 38 |
protected String NT; |
39 | 39 |
|
40 |
@Parameter(key = TreeSearchPreferences.VISUALISATION) |
|
41 |
protected String pVisualisation; |
|
42 |
|
|
40 | 43 |
|
41 | 44 |
public TreeSearch(CQPCorpus corpus) { |
42 | 45 |
|
... | ... | |
155 | 158 |
public abstract Selection getSelection(); |
156 | 159 |
|
157 | 160 |
public abstract File createTemporaryFile(File resultDir); |
161 |
|
|
162 |
public abstract String[] getAvailableVisualisations(); |
|
163 |
|
|
164 |
public String getVisualisation() { |
|
165 |
return pVisualisation; |
|
166 |
} |
|
158 | 167 |
|
159 | 168 |
} |
TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java (revision 3548) | ||
---|---|---|
346 | 346 |
return null; |
347 | 347 |
} //$NON-NLS-1$ //$NON-NLS-2$ull; |
348 | 348 |
} |
349 |
|
|
350 |
@Override |
|
351 |
public String[] getAvailableVisualisations() { |
|
352 |
|
|
353 |
// TODO Auto-generated method stub |
|
354 |
return null; |
|
355 |
} |
|
349 | 356 |
} |
TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 3548) | ||
---|---|---|
381 | 381 |
|
382 | 382 |
@Override |
383 | 383 |
public String getColumnText(Object element, int columnIndex) { |
384 |
|
|
384 | 385 |
if (!(element instanceof Line)) return EMPTY; |
385 | 386 |
|
386 | 387 |
Line line = (Line) element; |
387 |
return line.getViewRef().format(); |
|
388 |
// if (columnIndex == 0) { |
|
389 |
// return Integer.toString(line.getKeywordPosition()); |
|
390 |
// } else { |
|
391 |
return line.getViewRef().format(); |
|
392 |
// } |
|
388 | 393 |
} |
389 | 394 |
}); |
390 | 395 |
viewerLeft.setContentProvider(new ConcordancesProvider()); |
... | ... | |
394 | 399 |
// firstColumn = new TableColumn(viewer2.getTable(), SWT.LEFT); |
395 | 400 |
// firstColumn.setWidth(10); |
396 | 401 |
|
402 |
// TableColumn nColumn = new TableColumn(viewerLeft.getTable(), SWT.LEFT | SWT.H_SCROLL); |
|
403 |
// nColumn.setText("N"); |
|
404 |
// nColumn.setToolTipText("N"); |
|
405 |
// nColumn.setWidth(30); |
|
406 |
|
|
397 | 407 |
referenceColumn = new TableColumn(viewerLeft.getTable(), SWT.LEFT | SWT.H_SCROLL); |
398 | 408 |
refreshReferenceColumnTitle(); |
399 | 409 |
referenceColumn.setToolTipText(ConcordanceUIMessages.reference); |
TXM/trunk/org.txm.treesearch.rcp/plugin.xml (revision 3548) | ||
---|---|---|
59 | 59 |
point="org.eclipse.ui.menus"> |
60 | 60 |
<menuContribution |
61 | 61 |
allPopups="false" |
62 |
locationURI="popup:org.txm.rcp.views.corpora.CorporaView?after=org.txm.rcp.corporaview.annotation">
|
|
62 |
locationURI="popup:org.txm.rcp.views.corpora.CorporaView?before=org.txm.rcp.corporaview.corpus.manage">
|
|
63 | 63 |
<command |
64 | 64 |
commandId="org.txm.treesearch.command.ComputeTreeSearch" |
65 | 65 |
icon="icons/functions/Tree.png" |
66 |
label="%command.label" |
|
67 | 66 |
style="push"> |
68 | 67 |
<visibleWhen |
69 | 68 |
checkEnabled="true"> |
... | ... | |
79 | 78 |
</menuContribution> |
80 | 79 |
<menuContribution |
81 | 80 |
allPopups="false" |
82 |
locationURI="toolbar:org.txm.rcp.toolbartools">
|
|
81 |
locationURI="toolbar:org.txm.rcp.toolbarcorpus?after=org.txm.rcp.toolbarcorpus.read">
|
|
83 | 82 |
<command |
84 | 83 |
commandId="org.txm.treesearch.command.ComputeTreeSearch" |
85 | 84 |
icon="icons/functions/Tree.png" |
86 |
label="%command.label" |
|
87 | 85 |
style="push"> |
88 | 86 |
<visibleWhen |
89 | 87 |
checkEnabled="false"> |
... | ... | |
97 | 95 |
</visibleWhen> |
98 | 96 |
</command> |
99 | 97 |
</menuContribution> |
98 |
<menuContribution |
|
99 |
allPopups="false" |
|
100 |
locationURI="menu:menu.corpus?before=menu.corpus.build"> |
|
101 |
<command |
|
102 |
commandId="org.txm.treesearch.command.ComputeTreeSearch" |
|
103 |
icon="icons/functions/Tree.png" |
|
104 |
style="push"> |
|
105 |
<visibleWhen |
|
106 |
checkEnabled="false"> |
|
107 |
<or> |
|
108 |
<test |
|
109 |
forcePluginActivation="true" |
|
110 |
property="org.txm.rcp.testers.TreeSearchReady" |
|
111 |
value="TreeSearchReady"> |
|
112 |
</test> |
|
113 |
</or> |
|
114 |
</visibleWhen> |
|
115 |
</command> |
|
116 |
</menuContribution> |
|
100 | 117 |
|
101 | 118 |
</extension> |
102 | 119 |
<extension |
TXM/trunk/org.txm.treesearch.rcp/src/org/txm/treesearch/editor/TreeSearchEditor.java (revision 3548) | ||
---|---|---|
87 | 87 |
|
88 | 88 |
private Label representationLabel; |
89 | 89 |
|
90 |
@Parameter(key = TreeSearchPreferences.VISUALISATION) |
|
91 |
private Combo visuCombo; |
|
92 |
|
|
93 |
private Label visuLabel; |
|
94 |
|
|
90 | 95 |
@Override |
91 | 96 |
public void _createPartControl() { |
92 | 97 |
|
93 |
getMainParametersComposite().getLayout().numColumns = 3;
|
|
98 |
getMainParametersComposite().getLayout().numColumns = 5;
|
|
94 | 99 |
getMainParametersComposite().getLayout().makeColumnsEqualWidth = false; |
95 | 100 |
|
96 | 101 |
SelectionListener selChangedListener = new SelectionListener() { |
... | ... | |
147 | 152 |
representationCombo.setLayoutData(gdataR); |
148 | 153 |
representationCombo.addSelectionListener(selChangedListener); |
149 | 154 |
|
155 |
// System.out.println(parent.getLayout()); |
|
156 |
Composite queryPanel = this.getExtendedParametersGroup(); |
|
157 |
|
|
158 |
// fill query Area |
|
159 |
GridLayout qlayout = new GridLayout(1, false); |
|
160 |
qlayout.horizontalSpacing = 0; |
|
161 |
// qlayout.verticalSpacing = 0; |
|
162 |
queryPanel.setLayout(qlayout); |
|
163 |
|
|
164 |
visuLabel = new Label(getMainParametersComposite(), SWT.NONE); |
|
165 |
visuLabel.setToolTipText("Visualisation mode"); |
|
166 |
visuLabel.setText("Visualisation"); |
|
167 |
|
|
168 |
visuCombo = new Combo(getMainParametersComposite(), SWT.READ_ONLY); |
|
169 |
GridData gdataV = new GridData(SWT.FILL, SWT.CENTER, false, false); |
|
170 |
visuCombo.setLayoutData(gdataV); |
|
171 |
visuCombo.addSelectionListener(selChangedListener); |
|
172 |
|
|
150 | 173 |
Button editionButton = new Button(getMainParametersComposite(), SWT.PUSH); |
151 | 174 |
editionButton.setImage(IImageKeys.getImage(IImageKeys.EDITION)); |
152 | 175 |
editionButton.addSelectionListener(new SelectionListener() { |
... | ... | |
174 | 197 |
public void widgetDefaultSelected(SelectionEvent e) {} |
175 | 198 |
}); |
176 | 199 |
|
177 |
// System.out.println(parent.getLayout()); |
|
178 |
Composite queryPanel = this.getExtendedParametersGroup(); |
|
179 |
|
|
180 |
// fill query Area |
|
181 |
GridLayout qlayout = new GridLayout(1, false); |
|
182 |
qlayout.horizontalSpacing = 0; |
|
183 |
// qlayout.verticalSpacing = 0; |
|
184 |
queryPanel.setLayout(qlayout); |
|
185 |
|
|
186 |
|
|
187 | 200 |
// first line |
188 | 201 |
GLComposite line1 = new GLComposite(queryPanel, SWT.NONE, "line1"); |
189 | 202 |
line1.getLayout().numColumns = 13; |
... | ... | |
314 | 327 |
if (ntFeatures.length > 0) { |
315 | 328 |
NTCombo.setItems(ntFeatures); |
316 | 329 |
NTCombo.setText(ts.getNT()); |
330 |
NTCombo.setEnabled(true); |
|
317 | 331 |
} |
332 |
else { |
|
333 |
NTCombo.removeAll(); |
|
334 |
NTCombo.setText(""); |
|
335 |
NTCombo.setEnabled(false); |
|
336 |
} |
|
318 | 337 |
|
338 |
String[] visuFeatures = ts.getAvailableVisualisations(); |
|
339 |
if (visuFeatures != null && visuFeatures.length > 0) { |
|
340 |
visuCombo.setItems(visuFeatures); |
|
341 |
visuCombo.setText(ts.getVisualisation()); |
|
342 |
visuCombo.setEnabled(true); |
|
343 |
visuCombo.setVisible(true); |
|
344 |
visuLabel.setVisible(true); |
|
345 |
} |
|
346 |
else { |
|
347 |
visuCombo.removeAll(); |
|
348 |
visuCombo.setText(""); |
|
349 |
visuCombo.setEnabled(false); |
|
350 |
visuCombo.setVisible(false); |
|
351 |
visuLabel.setVisible(false); |
|
352 |
} |
|
353 |
|
|
319 | 354 |
if (representationCombo.getItemCount() == 0) { |
320 | 355 |
HashMap<String, TreeSearchSelector> selectors = ComputeTreeSearch.getSelectorsForCorpus(corpus); |
321 | 356 |
Log.fine(Messages.bind(Messages.SyntaxRepresentationP0, selectors)); |
... | ... | |
375 | 410 |
// System.out.println("Corpus '" + id + "' is not ready."); |
376 | 411 |
// return; |
377 | 412 |
// } |
413 |
|
|
414 |
getMainParametersComposite().getParent().layout(); |
|
378 | 415 |
} |
379 | 416 |
|
380 | 417 |
/** |
TXM/trunk/org.txm.rcp/plugin.xml (revision 3548) | ||
---|---|---|
1584 | 1584 |
</visibleWhen> |
1585 | 1585 |
</command> |
1586 | 1586 |
</toolbar> |
1587 |
<separator |
|
1588 |
name="org.txm.rcp.toolbar.separator1" |
|
1589 |
visible="false"> |
|
1590 |
</separator> |
|
1591 | 1587 |
<toolbar |
1592 | 1588 |
id="org.txm.rcp.toolbarcorpus"> |
1593 | 1589 |
<separator |
Formats disponibles : Unified diff