Révision 84
tmp/org.txm.partition.rcp/.classpath (revision 84) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<classpath> |
|
3 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> |
|
4 |
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> |
|
5 |
<classpathentry kind="src" path="src"/> |
|
6 |
<classpathentry kind="src" path="OSGI-INF"/> |
|
7 |
<classpathentry kind="output" path="bin"/> |
|
8 |
</classpath> |
|
0 | 9 |
tmp/org.txm.partition.rcp/META-INF/MANIFEST.MF (revision 84) | ||
---|---|---|
1 |
Manifest-Version: 1.0 |
|
2 |
Bundle-ManifestVersion: 2 |
|
3 |
Bundle-Name: %Bundle-Name |
|
4 |
Bundle-SymbolicName: org.txm.partition.rcp;singleton:=true |
|
5 |
Bundle-Version: 1.0.0.qualifier |
|
6 |
Require-Bundle: org.txm.chartsengine.rcp, |
|
7 |
org.eclipse.ui, |
|
8 |
org.eclipse.core.runtime, |
|
9 |
org.txm.core;bundle-version="0.7.0", |
|
10 |
org.txm.rcp;bundle-version="0.7.8", |
|
11 |
org.txm.partition.core;bundle-version="1.0.0", |
|
12 |
org.txm.chartsengine.core |
|
13 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
|
14 |
Bundle-ActivationPolicy: lazy |
|
15 |
Bundle-Vendor: %Bundle-Vendor |
|
0 | 16 |
tmp/org.txm.partition.rcp/.project (revision 84) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>org.txm.partition.rcp</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
</projects> |
|
7 |
<buildSpec> |
|
8 |
<buildCommand> |
|
9 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
10 |
<arguments> |
|
11 |
</arguments> |
|
12 |
</buildCommand> |
|
13 |
<buildCommand> |
|
14 |
<name>org.eclipse.pde.ManifestBuilder</name> |
|
15 |
<arguments> |
|
16 |
</arguments> |
|
17 |
</buildCommand> |
|
18 |
<buildCommand> |
|
19 |
<name>org.eclipse.pde.SchemaBuilder</name> |
|
20 |
<arguments> |
|
21 |
</arguments> |
|
22 |
</buildCommand> |
|
23 |
<buildCommand> |
|
24 |
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> |
|
25 |
<arguments> |
|
26 |
</arguments> |
|
27 |
</buildCommand> |
|
28 |
</buildSpec> |
|
29 |
<natures> |
|
30 |
<nature>org.eclipse.pde.PluginNature</nature> |
|
31 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
32 |
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> |
|
33 |
</natures> |
|
34 |
</projectDescription> |
|
0 | 35 |
tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/messages/RCPPartitionMessages.java (revision 84) | ||
---|---|---|
1 |
package org.txm.partition.rcp.messages; |
|
2 |
|
|
3 |
import org.eclipse.osgi.util.NLS; |
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
public class RCPPartitionMessages extends NLS { |
|
8 |
|
|
9 |
// FIXME: use the same properties file than the bundle |
|
10 |
private static final String BUNDLE_NAME = "l10n.bundle"; //$NON-NLS-1$ |
|
11 |
|
|
12 |
public static String PreferencesPage_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE; |
|
13 |
public static String PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE; |
|
14 |
|
|
15 |
|
|
16 |
static { |
|
17 |
// initialize resource bundle |
|
18 |
NLS.initializeMessages(BUNDLE_NAME, RCPPartitionMessages.class); |
|
19 |
} |
|
20 |
|
|
21 |
private RCPPartitionMessages() { |
|
22 |
} |
|
23 |
} |
|
0 | 24 |
tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/handlers/ComputePartitionDimensionsBarChart.java (revision 84) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.partition.rcp.handlers; |
|
29 |
|
|
30 |
import java.util.List; |
|
31 |
|
|
32 |
import org.eclipse.core.commands.AbstractHandler; |
|
33 |
import org.eclipse.core.commands.ExecutionEvent; |
|
34 |
import org.eclipse.core.commands.ExecutionException; |
|
35 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
36 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
37 |
import org.txm.Toolbox; |
|
38 |
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider; |
|
39 |
import org.txm.partition.core.preferences.PartitionDimensionsPreferences; |
|
40 |
import org.txm.rcpapplication.JobsTimer; |
|
41 |
import org.txm.rcpapplication.Messages; |
|
42 |
import org.txm.searchengine.cqp.corpus.Part; |
|
43 |
import org.txm.searchengine.cqp.corpus.Partition; |
|
44 |
|
|
45 |
/** |
|
46 |
* Creates and opens a bar chart editor with the dimensions of the selected partition. |
|
47 |
* |
|
48 |
* @author mdecorde |
|
49 |
* @author sjacquot |
|
50 |
* |
|
51 |
*/ |
|
52 |
public class ComputePartitionDimensionsBarChart extends AbstractHandler { |
|
53 |
|
|
54 |
|
|
55 |
/* (non-Javadoc) |
|
56 |
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
57 |
*/ |
|
58 |
@Override |
|
59 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
60 |
if (!Toolbox.isSearchEngineInitialized()) return false; |
|
61 |
|
|
62 |
if (!Toolbox.isStatEngineInitialized()) { |
|
63 |
System.out.println(Messages.PartsSize_0); |
|
64 |
return null; |
|
65 |
} |
|
66 |
|
|
67 |
IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); |
|
68 |
|
|
69 |
if (selection.getFirstElement() instanceof Partition) { |
|
70 |
final Partition partition = (Partition) selection.getFirstElement(); |
|
71 |
try { |
|
72 |
|
|
73 |
JobsTimer.start(); |
|
74 |
|
|
75 |
List<Part> parts = partition.getParts(); |
|
76 |
if(parts.size() == 0) { |
|
77 |
return false; |
|
78 |
} |
|
79 |
|
|
80 |
// Creates and opens the chart editor |
|
81 |
SWTChartsComponentsProvider.getCurrent().openEditor(Messages.bind(Messages.PartsSize_18, partition.getName()), partition, PartitionDimensionsPreferences.PREFERENCES_NODE, |
|
82 |
"Partition Dimensions Bar Chart"); |
|
83 |
|
|
84 |
// FIXME: Pie chart tests |
|
85 |
// SWTChartsComponentsProvider.getCurrent().openEditor(Messages.bind(Messages.PartsSize_18, partition.getName()), partition, PartitionDimensionsPreferences.PREFERENCES_NODE, |
|
86 |
// "Partition Dimensions Pie Chart"); |
|
87 |
|
|
88 |
|
|
89 |
JobsTimer.stopAndPrint(); |
|
90 |
} catch (Exception e) { |
|
91 |
org.txm.rcpapplication.utils.Logger.printStackTrace(e); |
|
92 |
} |
|
93 |
} |
|
94 |
|
|
95 |
return null; |
|
96 |
} |
|
97 |
|
|
98 |
} |
|
0 | 99 |
tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/preferences/PartitionPreferencePage.java (revision 84) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.partition.rcp.preferences; |
|
29 |
|
|
30 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
|
31 |
import org.eclipse.swt.widgets.Composite; |
|
32 |
import org.eclipse.ui.IWorkbench; |
|
33 |
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider; |
|
34 |
import org.txm.partition.core.preferences.PartitionDimensionsPreferences; |
|
35 |
import org.txm.partition.rcp.messages.RCPPartitionMessages; |
|
36 |
import org.txm.rcp.preferences.TXMPreferencePage; |
|
37 |
import org.txm.rcp.preferences.TXMPreferenceStore; |
|
38 |
import org.txm.rcpapplication.Messages; |
|
39 |
|
|
40 |
/** |
|
41 |
* Partition preference page. |
|
42 |
* @author mdecorde |
|
43 |
* @author sjacquot |
|
44 |
* |
|
45 |
*/ |
|
46 |
public class PartitionPreferencePage extends TXMPreferencePage { |
|
47 |
|
|
48 |
|
|
49 |
/** |
|
50 |
* Creates the field editors. Field editors are abstractions of the common |
|
51 |
* GUI blocks needed to manipulate various types of preferences. Each field |
|
52 |
* editor knows how to save and restore itself. |
|
53 |
*/ |
|
54 |
@Override |
|
55 |
public void createFieldEditors() { |
|
56 |
|
|
57 |
// Charts rendering |
|
58 |
Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent()); |
|
59 |
|
|
60 |
this.addField(new BooleanFieldEditor(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE, RCPPartitionMessages.PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE, chartsTab)); |
|
61 |
this.addField(new BooleanFieldEditor(PartitionDimensionsPreferences.CHART_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE, RCPPartitionMessages.PreferencesPage_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE, chartsTab)); |
|
62 |
|
|
63 |
// other shared preferences |
|
64 |
SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab); |
|
65 |
|
|
66 |
} |
|
67 |
|
|
68 |
|
|
69 |
/* |
|
70 |
* (non-Javadoc) |
|
71 |
* |
|
72 |
* @see |
|
73 |
* org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) |
|
74 |
*/ |
|
75 |
@Override |
|
76 |
public void init(IWorkbench workbench) { |
|
77 |
this.setPreferenceStore(new TXMPreferenceStore(PartitionDimensionsPreferences.PREFERENCES_NODE)); |
|
78 |
//this.setDescription(Messages.DiagnosticPreferencePage_1); |
|
79 |
this.setTitle(Messages.DiagnosticPreferencePage_1); |
|
80 |
} |
|
81 |
|
|
82 |
|
|
83 |
} |
|
0 | 84 |
tmp/org.txm.partition.rcp/build.properties (revision 84) | ||
---|---|---|
1 |
source.. = src/ |
|
2 |
output.. = bin/ |
|
3 |
bin.includes = plugin.xml,\ |
|
4 |
META-INF/,\ |
|
5 |
.,\ |
|
6 |
icons/,\ |
|
7 |
OSGI-INF/l10n/bundle.properties |
|
0 | 8 |
tmp/org.txm.partition.rcp/OSGI-INF/l10n/bundle.properties (revision 84) | ||
---|---|---|
1 |
Bundle-Name = Partition RCP |
|
2 |
Bundle-Vendor = TXM |
|
3 |
command.name = Dimensions |
|
4 |
editor.name = Dimensions |
|
5 |
page.name = Partition |
|
6 |
command.tooltip=Dimensions |
|
7 |
PreferencesPage_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE=Display parts count in chart title |
|
8 |
PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE=Sort by part size |
|
0 | 9 |
tmp/org.txm.partition.rcp/OSGI-INF/l10n/bundle_ru.properties (revision 84) | ||
---|---|---|
1 |
command.name=\u0420\u0430\u0437\u043c\u0435\u0440\u044b |
|
2 |
command.tooltip=\u0420\u0430\u0437\u043c\u0435\u0440\u044b |
|
0 | 3 |
tmp/org.txm.partition.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 84) | ||
---|---|---|
1 |
Bundle-Name = Partition RCP |
|
2 |
Bundle-Vendor = TXM |
|
3 |
command.name = Dimensions |
|
4 |
editor.name = Dimensions |
|
5 |
page.name = Partition |
|
6 |
command.tooltip=Visualiser la taille des parties |
|
7 |
PreferencesPage_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE=Afficher le nombre de parties dans le titre du graphique |
|
8 |
PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE=Trier par taille de partie |
|
0 | 9 |
tmp/org.txm.partition.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties (revision 84) | ||
---|---|---|
1 |
command.name=Размеры |
|
2 |
command.tooltip=Размеры |
|
0 | 3 |
tmp/org.txm.partition.rcp/plugin.xml (revision 84) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<?eclipse version="3.4"?> |
|
3 |
<plugin> |
|
4 |
|
|
5 |
<extension |
|
6 |
point="org.eclipse.ui.commands"> |
|
7 |
<command |
|
8 |
categoryId="org.txm.rcpapplication.category.txm" |
|
9 |
defaultHandler="org.txm.partition.rcp.handlers.ComputePartitionDimensionsBarChart" |
|
10 |
id="ComputePartitionDimensionsBarChart" |
|
11 |
name="%command.name"> |
|
12 |
</command> |
|
13 |
</extension> |
|
14 |
<extension |
|
15 |
point="org.eclipse.ui.handlers"> |
|
16 |
<handler |
|
17 |
commandId="ComputePartitionDimensionsBarChart" |
|
18 |
class="org.txm.partition.rcp.handlers.ComputePartitionDimensionsBarChart"> |
|
19 |
</handler> |
|
20 |
</extension> |
|
21 |
<extension |
|
22 |
point="org.eclipse.ui.menus"> |
|
23 |
<menuContribution |
|
24 |
allPopups="false" |
|
25 |
locationURI="toolbar:org.txm.rcpapplication.toolbartools"> |
|
26 |
<command |
|
27 |
commandId="ComputePartitionDimensionsBarChart" |
|
28 |
icon="icons/dimensions.png" |
|
29 |
style="push" |
|
30 |
tooltip="%command.tooltip"> |
|
31 |
<visibleWhen |
|
32 |
checkEnabled="false"> |
|
33 |
<or> |
|
34 |
<reference |
|
35 |
definitionId="OnePartitionSelected"> |
|
36 |
</reference> |
|
37 |
</or> |
|
38 |
</visibleWhen> |
|
39 |
</command> |
|
40 |
</menuContribution> |
|
41 |
<menuContribution |
|
42 |
allPopups="false" |
|
43 |
locationURI="popup:org.txm.rcpapplication.views.CorporaView"> |
|
44 |
<command |
|
45 |
commandId="ComputePartitionDimensionsBarChart" |
|
46 |
icon="icons/dimensions.png" |
|
47 |
style="push"> |
|
48 |
<visibleWhen |
|
49 |
checkEnabled="false"> |
|
50 |
<or> |
|
51 |
<reference |
|
52 |
definitionId="OnePartitionSelected"> |
|
53 |
</reference> |
|
54 |
</or> |
|
55 |
</visibleWhen> |
|
56 |
</command> |
|
57 |
</menuContribution> |
|
58 |
<menuContribution |
|
59 |
locationURI="menu:menu.tools"> |
|
60 |
<command |
|
61 |
commandId="ComputePartitionDimensionsBarChart" |
|
62 |
icon="icons/dimensions.png" |
|
63 |
style="push"> |
|
64 |
<visibleWhen |
|
65 |
checkEnabled="false"> |
|
66 |
<or> |
|
67 |
<reference |
|
68 |
definitionId="OnePartitionSelected"> |
|
69 |
</reference> |
|
70 |
</or> |
|
71 |
</visibleWhen> |
|
72 |
</command> |
|
73 |
</menuContribution> |
|
74 |
</extension> |
|
75 |
<extension |
|
76 |
point="org.eclipse.ui.preferencePages"> |
|
77 |
<page |
|
78 |
category="org.txm.rcpapplication.preferences.UserPreferencePage" |
|
79 |
class="org.txm.partition.rcp.preferences.PartitionPreferencePage" |
|
80 |
id="org.txm.rcp.partition.preferences.PartitionPreferencePage" |
|
81 |
name="%page.name"> |
|
82 |
</page> |
|
83 |
</extension> |
|
84 |
<extension |
|
85 |
point="org.eclipse.ui.editors"> |
|
86 |
<editor |
|
87 |
class="org.txm.chartsengine.rcp.editors.ChartEditorPart" |
|
88 |
default="false" |
|
89 |
icon="icons/dimensions.png" |
|
90 |
id="org.txm.searchengine.cqp.corpus.Partition" |
|
91 |
name="%editor.name"> |
|
92 |
</editor> |
|
93 |
</extension> |
|
94 |
|
|
95 |
</plugin> |
|
0 | 96 |
tmp/org.txm.partition.rcp/.settings/org.eclipse.core.resources.prefs (revision 84) | ||
---|---|---|
1 |
eclipse.preferences.version=1 |
|
2 |
encoding//OSGI-INF/l10n/bundle_ru_utf-8.properties=UTF-8 |
|
0 | 3 |
tmp/org.txm.partition.rcp/.settings/org.eclipse.jdt.core.prefs (revision 84) | ||
---|---|---|
1 |
eclipse.preferences.version=1 |
|
2 |
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
|
3 |
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 |
|
4 |
org.eclipse.jdt.core.compiler.compliance=1.7 |
|
5 |
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error |
|
6 |
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
|
7 |
org.eclipse.jdt.core.compiler.source=1.7 |
|
0 | 8 |
tmp/org.txm.progression.rcp/OSGI-INF/l10n/bundle.properties (revision 84) | ||
---|---|---|
1 |
Bundle-Name = Progression |
|
2 |
page.name = Progression |
|
3 |
command.name = Progression |
|
4 |
command.tooltip = Process the progression graphic of a query |
|
5 |
ProgressionPreferencePage_2=Progression |
|
6 |
ProgressionPreferencePage_3=Default graph type is cumulative |
|
7 |
ProgressionPreferencePage_4=Grayscale |
|
8 |
ProgressionPreferencePage_5=Single line style |
|
9 |
ProgressionPreferencePage_6=Repeat the values of the structure properties |
|
10 |
ProgressionPreferencePage_7=Bande size multiplier |
|
0 | 11 |
tmp/org.txm.progression.rcp/OSGI-INF/l10n/___bundle_ru.properties (revision 84) | ||
---|---|---|
1 |
Bundle-Name=\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441\u0438\u044F |
|
2 |
page.name=\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441\u0438\u044F |
|
3 |
command.name=\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u044f |
|
4 |
command.tooltip=\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 |
|
5 |
ProgressionPreferencePage_2=\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u044f |
|
6 |
ProgressionPreferencePage_3=\u041a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0438 |
|
7 |
ProgressionPreferencePage_4=\u0427/\u0411 \u043b\u0438\u043d\u0438\u0438 |
|
8 |
ProgressionPreferencePage_5=\u041b\u0438\u043d\u0438\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435 |
|
9 |
ProgressionPreferencePage_6=\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 |
|
10 |
ProgressionPreferencePage_7=\u041c\u0430\u0441\u0448\u0442\u0430\u0431 \u0433\u0440\u0430\u043d\u0438\u0446 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 |
|
0 | 11 |
tmp/org.txm.progression.rcp/OSGI-INF/l10n/bundle_ru.properties (revision 84) | ||
---|---|---|
1 |
Bundle-Name=Прогрессия |
|
2 |
page.name=Прогрессия |
|
3 |
command.name=Прогрессия |
|
4 |
command.tooltip=Показывает график прогрессии ответов на запрос |
|
5 |
ProgressionPreferencePage_2=Прогрессия |
|
6 |
ProgressionPreferencePage_3=Кумулятивный граф прогрессии |
|
7 |
ProgressionPreferencePage_4=Ч/Б линии |
|
8 |
ProgressionPreferencePage_5=Линии в одном стиле |
|
9 |
ProgressionPreferencePage_6=Повторять значения с свойств структур |
|
10 |
ProgressionPreferencePage_7=Масштаб границ структур |
|
0 | 11 |
tmp/org.txm.progression.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 84) | ||
---|---|---|
1 |
Bundle-Name = Progression |
|
2 |
page.name = Progression |
|
3 |
command.name = Progression |
|
4 |
command.label = Progression |
|
5 |
command.tooltip=Calculer la progression d'une ou plusieurs requêtes |
|
6 |
ProgressionPreferencePage_2=Progression |
|
7 |
ProgressionPreferencePage_3=Graphe de progression cumulatif |
|
8 |
ProgressionPreferencePage_4=Niveaux de gris |
|
9 |
ProgressionPreferencePage_5=Style de ligne unique |
|
10 |
ProgressionPreferencePage_6=Répéter les valeurs de propriétés de structures |
|
11 |
ProgressionPreferencePage_7=Échelle des limites de structures |
|
0 | 12 |
tmp/org.txm.progression.rcp/plugin.xml (revision 84) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<?eclipse version="3.4"?> |
|
3 |
<plugin> |
|
4 |
<extension |
|
5 |
point="org.eclipse.ui.preferencePages"> |
|
6 |
<page |
|
7 |
category="org.txm.rcpapplication.preferences.UserPreferencePage" |
|
8 |
class="org.txm.progression.rcp.preferences.ProgressionPreferencePage" |
|
9 |
id="org.txm.progression.rcp.preferences.ProgressionPreferencePage" |
|
10 |
name="%page.name"> |
|
11 |
</page> |
|
12 |
</extension> |
|
13 |
<extension |
|
14 |
point="org.eclipse.ui.commands"> |
|
15 |
<command |
|
16 |
categoryId="org.txm.rcpapplication.category.txm" |
|
17 |
defaultHandler="org.txm.progression.rcp.handlers.ComputeProgression" |
|
18 |
id="ComputeProgression" |
|
19 |
name="%command.name"> |
|
20 |
</command> |
|
21 |
</extension> |
|
22 |
<extension |
|
23 |
point="org.eclipse.ui.menus"> |
|
24 |
<menuContribution |
|
25 |
allPopups="false" |
|
26 |
locationURI="toolbar:org.txm.rcpapplication.toolbartools"> |
|
27 |
<command |
|
28 |
commandId="ComputeProgression" |
|
29 |
icon="icons/functions/progression.png" |
|
30 |
style="push" |
|
31 |
tooltip="%command.tooltip"> |
|
32 |
<visibleWhen |
|
33 |
checkEnabled="false"> |
|
34 |
<or> |
|
35 |
<reference |
|
36 |
definitionId="OneCorpusSelected"> |
|
37 |
</reference> |
|
38 |
</or> |
|
39 |
</visibleWhen> |
|
40 |
</command> |
|
41 |
</menuContribution> |
|
42 |
<menuContribution |
|
43 |
allPopups="false" |
|
44 |
locationURI="popup:org.txm.rcpapplication.views.CorporaView"> |
|
45 |
<command |
|
46 |
commandId="ComputeProgression" |
|
47 |
icon="icons/functions/progression.png" |
|
48 |
style="push"> |
|
49 |
<visibleWhen |
|
50 |
checkEnabled="false"> |
|
51 |
<or> |
|
52 |
<reference |
|
53 |
definitionId="OneCorpusSelected"> |
|
54 |
</reference> |
|
55 |
</or> |
|
56 |
</visibleWhen> |
|
57 |
</command> |
|
58 |
</menuContribution> |
|
59 |
<menuContribution |
|
60 |
locationURI="menu:menu.tools"> |
|
61 |
<command |
|
62 |
commandId="ComputeProgression" |
|
63 |
icon="icons/functions/progression.png" |
|
64 |
style="push"> |
|
65 |
<visibleWhen |
|
66 |
checkEnabled="false"> |
|
67 |
<or> |
|
68 |
<reference |
|
69 |
definitionId="OneCorpusSelected"> |
|
70 |
</reference> |
|
71 |
</or> |
|
72 |
</visibleWhen> |
|
73 |
</command> |
|
74 |
</menuContribution> |
|
75 |
</extension> |
|
76 |
<extension |
|
77 |
point="org.txm.chartsengine.eventcallback"> |
|
78 |
<EventCallBack |
|
79 |
chartsEngineName="jfreechart_charts_engine" |
|
80 |
class="org.txm.progression.rcp.chartsengine.jfreechart.events.ProgressionEventCallBack" |
|
81 |
resultDataClass="org.txm.progression.core.functions.Progression2"> |
|
82 |
</EventCallBack> |
|
83 |
</extension> |
|
84 |
<extension |
|
85 |
point="org.eclipse.core.runtime.adapters"> |
|
86 |
<factory |
|
87 |
adaptableType="org.txm.progression.core.functions.Progression2" |
|
88 |
class="org.txm.progression.rcp.adapters.ProgressionAdapterFactory"> |
|
89 |
<adapter |
|
90 |
type="org.eclipse.ui.model.IWorkbenchAdapter"> |
|
91 |
</adapter> |
|
92 |
</factory> |
|
93 |
</extension> |
|
94 |
<extension |
|
95 |
point="org.eclipse.ui.editors"> |
|
96 |
<editor |
|
97 |
class="org.txm.chartsengine.rcp.editors.ChartEditorPart" |
|
98 |
default="false" |
|
99 |
icon="icons/functions/progression.png" |
|
100 |
id="org.txm.progression.core.functions.Progression2" |
|
101 |
name="Progression"> |
|
102 |
</editor> |
|
103 |
</extension> |
|
104 |
|
|
105 |
</plugin> |
|
0 | 106 |
tmp/org.txm.progression.rcp/.settings/org.eclipse.jdt.core.prefs (revision 84) | ||
---|---|---|
1 |
eclipse.preferences.version=1 |
|
2 |
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
|
3 |
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 |
|
4 |
org.eclipse.jdt.core.compiler.compliance=1.6 |
|
5 |
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error |
|
6 |
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
|
7 |
org.eclipse.jdt.core.compiler.source=1.6 |
|
0 | 8 |
tmp/org.txm.progression.rcp/.settings/org.eclipse.core.resources.prefs (revision 84) | ||
---|---|---|
1 |
eclipse.preferences.version=1 |
|
2 |
encoding//OSGI-INF/l10n/bundle.properties=UTF-8 |
|
3 |
encoding//OSGI-INF/l10n/bundle_fr.properties=UTF-8 |
|
4 |
encoding//OSGI-INF/l10n/bundle_ru.properties=UTF-8 |
|
0 | 5 |
tmp/org.txm.progression.rcp/.classpath (revision 84) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<classpath> |
|
3 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> |
|
4 |
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> |
|
5 |
<classpathentry kind="src" path="src"/> |
|
6 |
<classpathentry kind="src" path="OSGI-INF"/> |
|
7 |
<classpathentry kind="output" path="bin"/> |
|
8 |
</classpath> |
|
0 | 9 |
tmp/org.txm.progression.rcp/META-INF/MANIFEST.MF (revision 84) | ||
---|---|---|
1 |
Manifest-Version: 1.0 |
|
2 |
Bundle-ManifestVersion: 2 |
|
3 |
Bundle-Name: %Bundle-Name |
|
4 |
Bundle-SymbolicName: org.txm.progression.rcp;singleton:=true |
|
5 |
Bundle-Version: 1.0.0.qualifier |
|
6 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
|
7 |
Require-Bundle: org.txm.chartsengine.rcp;bundle-version="1.0.0", |
|
8 |
org.txm.chartsengine.core, |
|
9 |
org.eclipse.ui.workbench, |
|
10 |
org.eclipse.swt, |
|
11 |
org.txm.core;bundle-version="0.7.0", |
|
12 |
org.txm.chartsengine.jfreechart.core;bundle-version="1.0.0", |
|
13 |
org.txm.rcp, |
|
14 |
org.txm.chartsengine.r.core;bundle-version="1.0.0", |
|
15 |
org.eclipse.core.runtime;bundle-version="3.10.0", |
|
16 |
org.txm.chartsengine.svgbatik.rcp;bundle-version="1.0.0", |
|
17 |
org.txm.progression.core;bundle-version="1.0.0" |
|
18 |
Export-Package: org.txm.progression.rcp.adapters, |
|
19 |
org.txm.progression.rcp.dialogs |
|
0 | 20 |
tmp/org.txm.progression.rcp/.project (revision 84) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>org.txm.progression.rcp</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
</projects> |
|
7 |
<buildSpec> |
|
8 |
<buildCommand> |
|
9 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
10 |
<arguments> |
|
11 |
</arguments> |
|
12 |
</buildCommand> |
|
13 |
<buildCommand> |
|
14 |
<name>org.eclipse.pde.ManifestBuilder</name> |
|
15 |
<arguments> |
|
16 |
</arguments> |
|
17 |
</buildCommand> |
|
18 |
<buildCommand> |
|
19 |
<name>org.eclipse.pde.SchemaBuilder</name> |
|
20 |
<arguments> |
|
21 |
</arguments> |
|
22 |
</buildCommand> |
|
23 |
</buildSpec> |
|
24 |
<natures> |
|
25 |
<nature>org.eclipse.pde.PluginNature</nature> |
|
26 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
27 |
</natures> |
|
28 |
</projectDescription> |
|
0 | 29 |
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/preferences/ProgressionPreferencePage.java (revision 84) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.progression.rcp.preferences; |
|
29 |
|
|
30 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
|
31 |
import org.eclipse.swt.widgets.Composite; |
|
32 |
import org.eclipse.ui.IWorkbench; |
|
33 |
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider; |
|
34 |
import org.txm.progression.core.preferences.ProgressionPreferences; |
|
35 |
import org.txm.progression.rcp.adapters.ProgressionAdapterFactory; |
|
36 |
import org.txm.progression.rcp.messages.RCPProgressionMessages; |
|
37 |
import org.txm.rcp.preferences.TXMPreferencePage; |
|
38 |
import org.txm.rcp.preferences.TXMPreferenceStore; |
|
39 |
import org.txm.rcpapplication.TxmPreferences; |
|
40 |
import org.txm.rcpapplication.jface.DoubleFieldEditor; |
|
41 |
// TODO: Auto-generated Javadoc |
|
42 |
/** |
|
43 |
* This class represents a preference page that is contributed to the |
|
44 |
* Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we |
|
45 |
* can use the field support built into JFace that allows us to create a page |
|
46 |
* that is small and knows how to save, restore and apply itself. |
|
47 |
* <p> |
|
48 |
* This page is used to modif y preferences only. They are stored in the |
|
49 |
* preference store that belongs to the main plug-in class. That way, |
|
50 |
* preferences can be accessed directly via the preference store. |
|
51 |
*/ |
|
52 |
|
|
53 |
public class ProgressionPreferencePage extends TXMPreferencePage { |
|
54 |
|
|
55 |
|
|
56 |
/** |
|
57 |
* Instantiates a new progression preference page. |
|
58 |
*/ |
|
59 |
public ProgressionPreferencePage() { |
|
60 |
super(); |
|
61 |
} |
|
62 |
|
|
63 |
|
|
64 |
/** |
|
65 |
* |
|
66 |
* @return |
|
67 |
*/ |
|
68 |
public static TXMPreferenceStore getNewPreferenceStore() { |
|
69 |
return new TXMPreferenceStore(ProgressionPreferences.PREFERENCES_NODE); |
|
70 |
} |
|
71 |
|
|
72 |
|
|
73 |
/** |
|
74 |
* Creates the field editors. Field editors are abstractions of the common |
|
75 |
* GUI blocks needed to manipulate various types of preferences. Each field |
|
76 |
* editor knows how to save and restore itself. |
|
77 |
*/ |
|
78 |
@Override |
|
79 |
public void createFieldEditors() { |
|
80 |
|
|
81 |
|
|
82 |
// Charts rendering |
|
83 |
Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent()); |
|
84 |
|
|
85 |
this.addField(new BooleanFieldEditor(ProgressionPreferences.CHART_CUMULATIVE, RCPProgressionMessages.ProgressionPreferencePage_3, chartsTab)); |
|
86 |
this.addField(new BooleanFieldEditor(ProgressionPreferences.CHART_MONO_STYLE, RCPProgressionMessages.ProgressionPreferencePage_5, chartsTab)); |
|
87 |
this.addField(new BooleanFieldEditor(ProgressionPreferences.CHART_REPEAT_VALUES, RCPProgressionMessages.ProgressionPreferencePage_6, chartsTab)); |
|
88 |
|
|
89 |
float test = TxmPreferences.getFloat(ProgressionPreferences.CHART_BANDE_MULTIPLIER, 999f); |
|
90 |
if (test == 999f) { |
|
91 |
TxmPreferences.set(ProgressionPreferences.CHART_BANDE_MULTIPLIER, 1.0f); |
|
92 |
} |
|
93 |
|
|
94 |
DoubleFieldEditor bandemultiplierfield = new DoubleFieldEditor(ProgressionPreferences.CHART_BANDE_MULTIPLIER, RCPProgressionMessages.ProgressionPreferencePage_7, chartsTab); |
|
95 |
this.addField(bandemultiplierfield); |
|
96 |
// FIXME: valid range |
|
97 |
//if (bandemultiplierfield.getIntValue() == 0) |
|
98 |
// bandemultiplierfield.setStringValue("1"); |
|
99 |
//bandemultiplierfield.setValidRange(1, 10); |
|
100 |
|
|
101 |
// other shared preferences |
|
102 |
SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab); |
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
} |
|
109 |
|
|
110 |
@Override |
|
111 |
public void init(IWorkbench workbench) { |
|
112 |
this.setPreferenceStore(getNewPreferenceStore()); |
|
113 |
//setDescription("Progression"); |
|
114 |
this.setTitle(RCPProgressionMessages.ProgressionPreferencePage_2); |
|
115 |
this.setImageDescriptor(ProgressionAdapterFactory.ICON); |
|
116 |
} |
|
117 |
|
|
118 |
} |
|
0 | 119 |
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/dialogs/ProgressionDialog.java (revision 84) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.progression.rcp.dialogs; |
|
29 |
|
|
30 |
import java.util.ArrayList; |
|
31 |
import java.util.List; |
|
32 |
import java.util.regex.Pattern; |
|
33 |
import java.util.regex.PatternSyntaxException; |
|
34 |
|
|
35 |
import org.eclipse.jface.dialogs.Dialog; |
|
36 |
import org.eclipse.swt.SWT; |
|
37 |
import org.eclipse.swt.custom.ScrolledComposite; |
|
38 |
import org.eclipse.swt.events.SelectionEvent; |
|
39 |
import org.eclipse.swt.events.SelectionListener; |
|
40 |
import org.eclipse.swt.layout.FormAttachment; |
|
41 |
import org.eclipse.swt.layout.FormData; |
|
42 |
import org.eclipse.swt.layout.FormLayout; |
|
43 |
import org.eclipse.swt.layout.GridData; |
|
44 |
import org.eclipse.swt.layout.GridLayout; |
|
45 |
import org.eclipse.swt.widgets.Button; |
|
46 |
import org.eclipse.swt.widgets.Combo; |
|
47 |
import org.eclipse.swt.widgets.Composite; |
|
48 |
import org.eclipse.swt.widgets.Control; |
|
49 |
import org.eclipse.swt.widgets.Event; |
|
50 |
import org.eclipse.swt.widgets.Group; |
|
51 |
import org.eclipse.swt.widgets.Label; |
|
52 |
import org.eclipse.swt.widgets.Listener; |
|
53 |
import org.eclipse.swt.widgets.Shell; |
|
54 |
import org.eclipse.swt.widgets.Text; |
|
55 |
import org.txm.chartsengine.core.ChartsEngine; |
|
56 |
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences; |
|
57 |
import org.txm.chartsengine.rcp.messages.SWTComponentsProviderMessages; |
|
58 |
import org.txm.core.chartsengine.base.messages.ChartsEngineMessages; |
|
59 |
import org.txm.core.preferences.TXMPreferences; |
|
60 |
import org.txm.progression.core.functions.Progression2; |
|
61 |
import org.txm.progression.core.preferences.ProgressionPreferences; |
|
62 |
import org.txm.progression.rcp.preferences.ProgressionPreferencePage; |
|
63 |
import org.txm.rcp.preferences.TXMPreferenceStore; |
|
64 |
import org.txm.rcpapplication.Messages; |
|
65 |
import org.txm.rcpapplication.StatusLine; |
|
66 |
import org.txm.rcpapplication.swt.widget.AssistedQueryWidget; |
|
67 |
import org.txm.searchengine.cqp.corpus.Corpus; |
|
68 |
import org.txm.searchengine.cqp.corpus.StructuralUnit; |
|
69 |
import org.txm.searchengine.cqp.corpus.StructuralUnitProperty; |
|
70 |
import org.txm.searchengine.cqp.corpus.query.Query; |
|
71 |
import org.txm.utils.logger.Log; |
|
72 |
|
|
73 |
/** |
|
74 |
* Allow the user to choose : the type of the graphic the structural units, |
|
75 |
* property and values to be shown the queries of each curves. |
|
76 |
* |
|
77 |
* @author mdecorde |
|
78 |
* @author sjacquot |
|
79 |
*/ |
|
80 |
public class ProgressionDialog extends Dialog { |
|
81 |
|
|
82 |
/** The query widgets. */ |
|
83 |
protected List<AssistedQueryWidget> queryWidgets = new ArrayList<AssistedQueryWidget>(); |
|
84 |
|
|
85 |
/** The queries. */ |
|
86 |
List<Query> queries; |
|
87 |
|
|
88 |
/** The corpus. */ |
|
89 |
private Corpus corpus; |
|
90 |
|
|
91 |
/** The selected structural unit. */ |
|
92 |
private StructuralUnit selectedStructuralUnit; |
|
93 |
|
|
94 |
/** The selected structural unit property. */ |
|
95 |
private StructuralUnitProperty selectedStructuralUnitProperty; |
|
96 |
|
|
97 |
/** The regexproperty value. */ |
|
98 |
private String regexpropertyValue; |
|
99 |
|
|
100 |
/** The graphtype. */ |
|
101 |
private boolean cumulative = true; |
|
102 |
|
|
103 |
private boolean blackAndWhite = true; |
|
104 |
|
|
105 |
/** The monostyle. */ |
|
106 |
private boolean monostyle = true; |
|
107 |
|
|
108 |
/** The repeatvalues. */ |
|
109 |
private boolean repeatvalues = false; |
|
110 |
|
|
111 |
/** The linewidth. */ |
|
112 |
private int linewidth = 2; |
|
113 |
|
|
114 |
/** The bandemultiplier. */ |
|
115 |
private float bandemultiplier = 2; |
|
116 |
|
|
117 |
/** The structural units combo. */ |
|
118 |
Combo structuralUnitsCombo; |
|
119 |
|
|
120 |
/** The structural units. */ |
|
121 |
List<StructuralUnit> structuralUnits; |
|
122 |
|
|
123 |
/** The structural units properties. */ |
|
124 |
List<StructuralUnitProperty> structuralUnitsProperties; |
|
125 |
|
|
126 |
/** The property combo. */ |
|
127 |
private Combo propertyCombo; |
|
128 |
|
|
129 |
/** The regex value. */ |
|
130 |
private Text regexValue; |
|
131 |
|
|
132 |
/** The focus composite. */ |
|
133 |
Composite focusComposite; |
|
134 |
|
|
135 |
/** The main panel. */ |
|
136 |
Composite mainPanel; |
|
137 |
|
|
138 |
/** The bande field. */ |
|
139 |
Text bandeField; |
|
140 |
|
|
141 |
/** The cumu button. */ |
|
142 |
Button cumuButton; |
|
143 |
|
|
144 |
/** The repeat button. */ |
|
145 |
Button repeatButton; |
|
146 |
|
|
147 |
/** The color button. */ |
|
148 |
Button colorButton; |
|
149 |
|
|
150 |
/** The style button. */ |
|
151 |
Button styleButton; |
|
152 |
|
|
153 |
/** The colors. */ |
|
154 |
String[] colors = Progression2.colors; |
|
155 |
|
|
156 |
/** The self. */ |
|
157 |
ProgressionDialog self; |
|
158 |
|
|
159 |
/** The parent. */ |
|
160 |
private Composite parent; |
|
161 |
|
|
162 |
private ScrolledComposite sc1; |
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
/** |
|
167 |
* Instantiates a new progression dialog. |
|
168 |
* |
|
169 |
* @param parentShell the parent shell |
|
170 |
* @param corpus the corpus |
|
171 |
*/ |
|
172 |
public ProgressionDialog(Shell parentShell, Corpus corpus) { |
|
173 |
super(parentShell); |
|
174 |
this.corpus = corpus; |
|
175 |
this.setShellStyle(this.getShellStyle() | SWT.RESIZE); |
|
176 |
} |
|
177 |
|
|
178 |
/** |
|
179 |
* Instantiates a new progression dialog. |
|
180 |
* |
|
181 |
* @param parentShell the parent shell |
|
182 |
* @param corpus the corpus |
|
183 |
* @param queries the queries |
|
184 |
*/ |
|
185 |
public ProgressionDialog(Shell parentShell, Corpus corpus, |
|
186 |
List<Query> queries) { |
|
187 |
super(parentShell); |
|
188 |
this.corpus = corpus; |
|
189 |
this.queries = queries; |
|
190 |
this.setShellStyle(this.getShellStyle() | SWT.RESIZE); |
|
191 |
} |
|
192 |
|
|
193 |
/* (non-Javadoc) |
|
194 |
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) |
|
195 |
*/ |
|
196 |
@Override |
|
197 |
protected void configureShell(Shell newShell) { |
|
198 |
super.configureShell(newShell); |
|
199 |
newShell.setText(Messages.ProgressionDialog_0); |
|
200 |
newShell.setMinimumSize(300, 460); |
|
201 |
|
|
202 |
} |
|
203 |
|
|
204 |
/* (non-Javadoc) |
|
205 |
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) |
|
206 |
*/ |
|
207 |
@Override |
|
208 |
protected Control createDialogArea(Composite p) { |
|
209 |
try { |
|
210 |
this.self = this; |
|
211 |
this.parent = p; |
|
212 |
|
|
213 |
// get preferences values |
|
214 |
TXMPreferenceStore store = ProgressionPreferencePage.getNewPreferenceStore(); |
|
215 |
|
|
216 |
this.blackAndWhite = (TXMPreferences.getInt(ProgressionPreferences.PREFERENCES_NODE, ChartsEnginePreferences.RENDERING_COLORS_MODE) == ChartsEngine.RENDERING_MONOCHROME_MODE); |
|
217 |
|
|
218 |
this.monostyle = store.getBoolean(ProgressionPreferences.CHART_MONO_STYLE); |
|
219 |
this.cumulative = store.getBoolean(ProgressionPreferences.CHART_CUMULATIVE); |
|
220 |
this.repeatvalues = store.getBoolean(ProgressionPreferences.CHART_REPEAT_VALUES); |
|
221 |
this.bandemultiplier = store.getFloat(ProgressionPreferences.CHART_BANDE_MULTIPLIER); |
|
222 |
|
|
223 |
// System.out.println(parent.getLayout()); |
|
224 |
FormLayout mainlayout = new FormLayout(); |
|
225 |
mainPanel = new Composite(parent, SWT.NONE); |
|
226 |
mainPanel.setLayout(mainlayout); |
|
227 |
GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true); |
|
228 |
mainPanel.setLayoutData(gridData); |
|
229 |
|
|
230 |
Composite paramPanel = new Composite(mainPanel, SWT.NONE); |
|
231 |
// set the QueryWidget's tab |
|
232 |
|
|
233 |
sc1 = new ScrolledComposite(mainPanel, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); |
|
234 |
sc1.setLayout(new GridLayout(1, true)); |
|
235 |
sc1.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); |
|
236 |
sc1.setExpandHorizontal( true ); |
|
237 |
sc1.setExpandVertical( true ); |
|
238 |
sc1.setMinSize( 0, 250 ); |
|
239 |
|
|
240 |
focusComposite = new Composite(sc1, SWT.NONE); |
|
241 |
focusComposite.setLayout(new GridLayout(1, true)); |
|
242 |
sc1.setContent(focusComposite); |
|
243 |
|
|
244 |
FormData paramPanelData = new FormData(); |
|
245 |
paramPanelData.top = new FormAttachment(0); |
|
246 |
paramPanelData.left = new FormAttachment(0); |
|
247 |
paramPanelData.right = new FormAttachment(100); |
|
248 |
paramPanel.setLayoutData(paramPanelData); |
|
249 |
|
|
250 |
FormData queriesPanelData = new FormData(); |
|
251 |
queriesPanelData.top = new FormAttachment(paramPanel); |
|
252 |
queriesPanelData.left = new FormAttachment(0); |
|
253 |
queriesPanelData.right = new FormAttachment(100); |
|
254 |
queriesPanelData.bottom = new FormAttachment(100); |
|
255 |
sc1.setLayoutData(queriesPanelData); |
|
256 |
|
|
257 |
paramPanel.setLayout(new GridLayout(3, true)); |
|
258 |
|
|
259 |
// controls |
|
260 |
// graph param |
|
261 |
Label typeLabel = new Label(paramPanel, SWT.NONE); |
|
262 |
typeLabel.setText(Messages.ProgressionDialog_1); |
|
263 |
typeLabel.setAlignment(SWT.CENTER); |
|
264 |
|
|
265 |
cumuButton = new Button(paramPanel, SWT.RADIO); |
|
266 |
cumuButton.setText(Messages.ProgressionDialog_2); |
|
267 |
cumuButton.setSelection(cumulative); |
|
268 |
|
|
269 |
Button densityButton = new Button(paramPanel, SWT.RADIO); |
|
270 |
densityButton.setText(Messages.ProgressionDialog_3); |
|
271 |
densityButton.setSelection(!cumulative); |
|
272 |
|
|
273 |
//Bande size |
|
274 |
typeLabel = new Label(paramPanel, SWT.NONE); |
|
275 |
typeLabel.setText(Messages.ProgressionDialog_11); |
|
276 |
typeLabel.setAlignment(SWT.CENTER); |
|
277 |
|
|
278 |
bandeField = new Text(paramPanel, SWT.BORDER); |
|
279 |
bandeField.setText(""+bandemultiplier); //$NON-NLS-1$ |
|
280 |
bandeField.setLayoutData(new GridData(GridData.FILL, |
|
281 |
GridData.FILL, true, true, 2, 1)); |
|
282 |
// Structural units param |
|
283 |
Group displayParam = new Group(paramPanel, SWT.BORDER); |
|
284 |
displayParam.setText(Messages.ProgressionDialog_13); |
|
285 |
displayParam.setLayout(new GridLayout(3, true)); |
|
286 |
displayParam.setLayoutData(new GridData(GridData.FILL, |
|
287 |
GridData.FILL, true, true, 3, 1)); |
|
288 |
|
|
289 |
Label structLabel = new Label(displayParam, SWT.NONE); |
|
290 |
structLabel.setText(Messages.ProgressionDialog_4); |
|
291 |
structLabel.setAlignment(SWT.CENTER); |
|
292 |
|
|
293 |
structuralUnitsCombo = new Combo(displayParam, SWT.READ_ONLY); |
|
294 |
structuralUnitsCombo.setLayoutData(new GridData(GridData.FILL, |
|
295 |
GridData.FILL, true, true, 2, 1)); |
|
296 |
|
|
297 |
structuralUnitsCombo.addSelectionListener(new SelectionListener() { |
|
298 |
@Override |
|
299 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
300 |
} |
|
301 |
|
|
302 |
@Override |
|
303 |
public void widgetSelected(SelectionEvent event) { |
|
304 |
reloadProperties(); |
|
305 |
} |
|
306 |
}); |
|
307 |
|
|
308 |
try {// get |
|
309 |
structuralUnitsCombo.add(" "); //$NON-NLS-1$ |
|
310 |
structuralUnits = corpus.getOrderedStructuralUnits(); |
|
311 |
for (StructuralUnit unit : structuralUnits) { |
|
312 |
structuralUnitsCombo.add(unit.getName()); |
|
313 |
} |
|
314 |
} catch (Exception e) { |
|
315 |
Log.severe(Messages.ObjectExplorer_9 |
|
316 |
+ Log.toString(e)); |
|
317 |
return null; |
|
318 |
} |
|
319 |
structuralUnitsCombo.select(0); |
|
320 |
|
|
321 |
// if (structuralUnitsCombo.getItemCount() == 0) { |
|
322 |
// this.getButton(IDialogConstants.OK_ID).setEnabled(false); |
|
323 |
// } else { |
|
324 |
// selectedStructuralUnit = structuralUnits.get(0); |
|
325 |
// } |
|
326 |
|
|
327 |
// properties combo |
|
328 |
Label propLabel = new Label(displayParam, SWT.NONE); |
|
329 |
propLabel.setText(Messages.LexicalTable_1); |
|
330 |
propLabel.setAlignment(SWT.CENTER); |
|
331 |
|
|
332 |
propertyCombo = new Combo(displayParam, SWT.READ_ONLY); |
|
333 |
propertyCombo.setLayoutData(new GridData(GridData.FILL, |
|
334 |
GridData.FILL, true, true, 2, 1)); |
|
335 |
reloadProperties(); |
|
336 |
|
|
337 |
// property value field |
|
338 |
Label regexLabel = new Label(displayParam, SWT.NONE); |
|
339 |
regexLabel.setText(Messages.ProgressionDialog_7); |
|
340 |
regexLabel.setAlignment(SWT.CENTER); |
|
341 |
|
|
342 |
regexValue = new Text(displayParam, SWT.SINGLE | SWT.BORDER); |
|
343 |
regexValue.setLayoutData(new GridData(GridData.FILL, GridData.FILL, |
|
344 |
true, true, 2, 1)); |
|
345 |
|
|
346 |
//spacer |
|
347 |
styleButton = new Button(displayParam, SWT.CHECK); |
|
348 |
styleButton.setText(Messages.ProgressionDialog_14); |
|
349 |
styleButton.setSelection(monostyle); |
|
350 |
|
|
351 |
//Repeat options |
|
352 |
repeatButton = new Button(displayParam, SWT.CHECK); |
|
353 |
repeatButton.setText(Messages.ProgressionDialog_15); |
|
354 |
repeatButton.setSelection(repeatvalues); |
|
355 |
|
|
356 |
//Color options |
|
357 |
colorButton = new Button(displayParam, SWT.CHECK); |
|
358 |
colorButton.setText(SWTComponentsProviderMessages.ChartsEnginePreferencePage_RenderingModeBlackAndWhite); |
|
359 |
colorButton.setSelection(blackAndWhite); |
|
360 |
|
|
361 |
// queries param |
|
362 |
Label focusLabel = new Label(paramPanel, SWT.NONE); |
|
363 |
focusLabel.setText(Messages.ProgressionDialog_8); |
|
364 |
focusLabel.setAlignment(SWT.CENTER); |
|
365 |
|
|
366 |
Button plusButton = new Button(paramPanel, SWT.NONE); |
|
367 |
plusButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, |
|
368 |
true, true)); |
|
369 |
plusButton.setText(Messages.ProgressionDialog_9); |
|
370 |
plusButton.addListener(SWT.Selection, new Listener() { |
|
371 |
@Override |
|
372 |
public void handleEvent(Event event) { |
|
373 |
if (colors.length > queryWidgets.size()) { |
|
374 |
Log.info("add query field"); |
|
375 |
createTypeFocusField(); |
|
376 |
sc1.layout(true); |
|
377 |
focusComposite.layout(true); |
|
378 |
sc1.setMinSize(focusComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); |
|
379 |
} |
|
380 |
} |
|
381 |
}); |
|
382 |
|
|
383 |
Button minusButton = new Button(paramPanel, SWT.NONE); |
|
384 |
minusButton.setLayoutData(new GridData(GridData.FILL, |
|
385 |
GridData.FILL, true, true)); |
|
386 |
minusButton.setText(Messages.ProgressionDialog_5); |
|
387 |
minusButton.addListener(SWT.Selection, new Listener() { |
|
388 |
@Override |
|
389 |
public void handleEvent(Event event) { |
|
390 |
if (queryWidgets.size() > 0) { |
|
391 |
// System.out.println("remove field"); |
|
392 |
AssistedQueryWidget lastwidget = queryWidgets |
|
393 |
.get(queryWidgets.size() - 1); |
|
394 |
lastwidget.setSize(200, 30); |
|
395 |
queryWidgets.remove(queryWidgets.size() - 1); |
|
396 |
lastwidget.dispose(); |
|
397 |
sc1.layout(true); |
|
398 |
focusComposite.layout(true); |
|
399 |
sc1.setMinSize(focusComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); |
|
400 |
} |
|
401 |
} |
|
402 |
}); |
|
403 |
|
|
404 |
if (queries == null) { |
|
405 |
createTypeFocusField(); |
|
406 |
} else { |
|
407 |
for (Query q : queries) { |
|
408 |
createTypeFocusField().setText(q.getQueryString()); |
|
409 |
} |
|
410 |
} |
|
411 |
return mainPanel; |
|
412 |
} catch (Exception e) { |
|
413 |
Log.printStackTrace(e); |
|
414 |
} |
|
415 |
return null; |
|
416 |
} |
|
417 |
|
|
418 |
/** |
|
419 |
* Creates the type focus field. |
|
420 |
* |
|
421 |
* @return the assisted query widget |
|
422 |
*/ |
|
423 |
private AssistedQueryWidget createTypeFocusField() { |
|
424 |
AssistedQueryWidget focusTextBox = new AssistedQueryWidget( |
|
425 |
focusComposite, SWT.BORDER, this.corpus); |
Formats disponibles : Unified diff