Révision 134

tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/messages_ru.properties (revision 134)
1
CAHPreferencePage_0=\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0432 2D
2
CAHPreferencePage_1=\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f
3
CAHPreferencePage_2=\u0427\u0438\u0441\u043b\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432
4
CAHPreferencePage_3=\u041c\u0435\u0442\u043e\u0434
5
CAHPreferencePage_4=\u041c\u0435\u0442\u0440\u0438\u043a\u0430
0 6

  
tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/editors/CAHChartEditor.java (revision 134)
6 6
import org.eclipse.swt.widgets.Composite;
7 7
import org.eclipse.swt.widgets.Spinner;
8 8
import org.eclipse.swt.widgets.ToolItem;
9
import org.txm.cah.functions.CAH;
9
import org.txm.cah.core.functions.CAH;
10 10
import org.txm.cah.rcp.chartsengine.jfreechart.events.CAHSelectionListener;
11
import org.txm.cah.rcp.messages.RCPCAHMessages;
11 12
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
12 13
import org.txm.chartsengine.rcp.editors.ChartEditorInput;
13 14
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
......
92 93

  
93 94
		// Columns
94 95
		this.computeColumns = new ToolItem(this.toolBar, SWT.RADIO);
95
		this.computeColumns.setToolTipText(Messages.ComputeClassification_5);
96
		this.computeColumns.setToolTipText(RCPCAHMessages.ComputeClassification_5);
96 97
		this.computeColumns.setImage(IImageKeys.getImage(IImageKeys.CHARTS_CAH_COMPUTE_COLUMNS));
97 98
		// FIXME: keep this for offering an option "large icons" with text in buttons ?
98 99
		//this.computeColumns.setText(Messages.ComputeClassification_5);
......
101 102

  
102 103
		// Rows
103 104
		ToolItem computeRows = new ToolItem(this.toolBar, SWT.RADIO);
104
		computeRows.setToolTipText(Messages.ComputeClassification_6);
105
		computeRows.setToolTipText(RCPCAHMessages.ComputeClassification_6);
105 106
		computeRows.setImage(IImageKeys.getImage(IImageKeys.CHARTS_CAH_COMPUTE_ROWS));
106 107
		// FIXME: keep this for offering an option "large icons" with text in buttons ?
107 108
		//computeRows.setText(Messages.ComputeClassification_6);
tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/messages_fr.properties (revision 134)
1
CAHPreferencePage_0=Afficher les graphiques en 2D
2
CAHPreferencePage_1=Classification
3
CAHPreferencePage_2=Nombre de clusters
4
CAHPreferencePage_3=M?thode
5
CAHPreferencePage_4=M?trique
0 6

  
tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/chartsengine/jfreechart/events/CAHSelectionListener.java (revision 134)
3 3
import org.eclipse.swt.events.SelectionEvent;
4 4
import org.eclipse.swt.widgets.Spinner;
5 5
import org.eclipse.swt.widgets.ToolItem;
6
import org.txm.cah.functions.CAH;
6
import org.txm.cah.core.functions.CAH;
7
import org.txm.cah.core.preferences.CAHPreferences;
7 8
import org.txm.cah.rcp.commands.ComputeCAH;
8 9
import org.txm.cah.rcp.editors.CAHChartEditor;
9 10
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
10 11
import org.txm.chartsengine.rcp.events.BaseSelectionListener;
11 12
import org.txm.rcpapplication.TxmPreferences;
12
import org.txm.rcpapplication.preferences.CAHPreferencePage;
13 13
import org.txm.stat.engine.r.RWorkspaceException;
14 14

  
15 15
/**
......
49 49
			// Compute columns or rows
50 50
			else if(this.commandId == CAHSelectionListener.COMPUTE_COLUMNS)	{
51 51
				cah.setColumnsComputing(((ToolItem)e.getSource()).getSelection());
52
				cah.setNCluster(TxmPreferences.getInt(CAHPreferencePage.NCLUSTER));
52
				cah.setNCluster(TxmPreferences.getInt(CAHPreferences.NCLUSTER));
53 53
				((CAHChartEditor) chartEditor).updateNumbersOfClustersCurrentValue();
54 54
			}
55 55
			
tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/messages_ru_utf8.properties (revision 134)
1
CAHPreferencePage_0=Показывать графики в 2D
2
CAHPreferencePage_1=Классификация
3
CAHPreferencePage_2=Число кластеров
4
CAHPreferencePage_3=Метод
5
CAHPreferencePage_4=Метрика
0 6

  
tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/commands/ComputeCAH.java (revision 134)
53 53
import org.txm.chartsengine.rcp.editors.ChartEditorPart;
54 54
import org.txm.chartsengine.svgbatik.rcp.SVGSWTChartsComponentsProvider;
55 55
import org.txm.functions.ca.CA;
56
import org.txm.cah.functions.CAH;
56
import org.txm.cah.core.functions.CAH;
57
import org.txm.cah.core.preferences.CAHPreferences;
57 58
import org.txm.cah.rcp.editors.CAHChartEditor;
59
import org.txm.cah.rcp.messages.RCPCAHMessages;
58 60
import org.txm.rcpapplication.IImageKeys;
59 61
import org.txm.rcpapplication.JobsTimer;
60 62
import org.txm.rcpapplication.Messages;
61 63
import org.txm.rcpapplication.TxmPreferences;
62 64
import org.txm.rcpapplication.actions.LexicalTableDialog;
63
import org.txm.rcpapplication.preferences.CAHPreferencePage;
64 65
import org.txm.rcpapplication.preferences.CAPreferencePage;
65 66
import org.txm.rcpapplication.utils.JobHandler;
66 67
import org.txm.rcpapplication.views.CorporaView;
......
96 97

  
97 98

  
98 99
		if (!Toolbox.isStatEngineInitialized()) {
99
			System.out.println(Messages.ComputeCAH_4);
100
			System.out.println(RCPCAHMessages.ComputeCAH_4);
100 101
			return null;
101 102
		}
102 103

  
......
133 134
			//System.out.println("Compute CAH with Partition : "+((Partition)selection.getFirstElement()).getName());
134 135
			partition = (Partition)selection.getFirstElement();
135 136
			try {
136
				String title = Messages.bind(Messages.ComputeCAH_0, partition.getName());
137
				String title = RCPCAHMessages.bind(RCPCAHMessages.ComputeCAH_0, partition.getName());
137 138
				int vmax = TxmPreferences.getInt(CAPreferencePage.VMAX, 200);
138 139
				int fmin = TxmPreferences.getInt(CAPreferencePage.FMIN, 10);
139 140
				Shell shell = Display.getCurrent().getActiveShell();
......
163 164
			} 
164 165
		}
165 166

  
166
		final int ncluster = TxmPreferences.getInt(CAHPreferencePage.NCLUSTER, 2);
167
		final String metric = TxmPreferences.getString(CAHPreferencePage.METRIC, CAH.getDefaultMetric());
168
		final String method = TxmPreferences.getString(CAHPreferencePage.METHOD, CAH.getDefaultMethod());
169
		final Boolean display2D = "2D".equals(TxmPreferences.getString(CAHPreferencePage.DISPLAY, "3D")); //$NON-NLS-1$ //$NON-NLS-2$
167
		final int ncluster = TxmPreferences.getInt(CAHPreferences.NCLUSTER, 2);
168
		final String metric = TxmPreferences.getString(CAHPreferences.METRIC, CAH.getDefaultMetric());
169
		final String method = TxmPreferences.getString(CAHPreferences.METHOD, CAH.getDefaultMethod());
170
		final Boolean display2D = "2D".equals(TxmPreferences.getString(CAHPreferences.DISPLAY, "3D")); //$NON-NLS-1$ //$NON-NLS-2$
170 171
		final boolean computeColumns = true;
171 172

  
172 173
		// Use existent CAH (used when reopening an editor from a CAH result node)
......
198 199
	 */
199 200
	public static void compute(final CAH cah, final ChartEditorPart chartEditor) throws RWorkspaceException {
200 201

  
201
		JobHandler jobhandler = new JobHandler(Messages.CAHEditor_0) {
202
		JobHandler jobhandler = new JobHandler(RCPCAHMessages.CAHEditor_0) {
202 203
			@Override
203 204
			protected IStatus run(IProgressMonitor monitor) {
204 205
				this.runInit(monitor);
......
320 321
////
321 322
////		if (d.open() == Window.OK) {
322 323
////			final int ncluster = d.getNcluster();
323
////			final String metric = TxmPreferences.getString(CAHPreferencePage.METRIC, CAH.getDefaultMetric());
324
////			final String method = TxmPreferences.getString(CAHPreferencePage.METHOD, CAH.getDefaultMethod());
325
////			final Boolean displayMode = TxmPreferences.getBoolean(CAHPreferencePage.DISPLAY, false);
324
////			final String metric = TxmPreferences.getString(CAHPreferences.METRIC, CAH.getDefaultMetric());
325
////			final String method = TxmPreferences.getString(CAHPreferences.METHOD, CAH.getDefaultMethod());
326
////			final Boolean displayMode = TxmPreferences.getBoolean(CAHPreferences.DISPLAY, false);
326 327
////			final boolean docol = d.isDoculumns();
327 328
////
328
////			JobHandler jobhandler = new JobHandler(Messages.ComputeCAH_3+ca.getName()) {
329
////			JobHandler jobhandler = new JobHandler(RCPCAHMessages.ComputeCAH_3+ca.getName()) {
329 330
////				@Override
330 331
////				protected IStatus run(IProgressMonitor monitor) {
331 332
////					try {
332 333
////						JobsTimer.start();
333 334
////						monitor.beginTask("", 100); //$NON-NLS-1$
334 335
////
335
////						monitor.subTask(Messages.ComputeCAH_0);
336
////						monitor.subTask(RCPCAHMessages.ComputeCAH_0);
336 337
////
337 338
////						final CAH cah;
338 339
////						if (ca != null) {
......
349 350
////
350 351
////						monitor.worked(20);
351 352
////
352
////						monitor.subTask(Messages.ComputeCAH_1);
353
////						monitor.subTask(RCPCAHMessages.ComputeCAH_1);
353 354
////
354 355
////						syncExec(new Runnable() {
355 356
////							@Override
......
363 364
////								try {
364 365
////									outfile = File.createTempFile("cah", device.getExt(), resultDir); //$NON-NLS-1$
365 366
////									if (!outfile.canWrite()) {
366
////										System.out.println(NLS.bind(Messages.ComputeCAH_2, outfile));
367
////										System.out.println(NLS.bind(RCPCAHMessages.ComputeCAH_2, outfile));
367 368
////									}
368 369
////								} catch (IOException e1) {
369 370
////									// TODO Auto-generated catch block
......
435 436
		 */
436 437
		public CAHParamDialog(Shell parentShell) {
437 438
			super(parentShell);
438
			this.title = Messages.CAHEditorTitle;
439
			this.title = RCPCAHMessages.CAHEditorTitle;
439 440
		}
440 441

  
441 442
		/* (non-Javadoc)
......
448 449
			if (title != null)
449 450
				newShell.setText(title);
450 451
			else
451
				newShell.setText(Messages.CAHEditorTitle);
452
				newShell.setText(RCPCAHMessages.CAHEditorTitle);
452 453
		}
453 454

  
454 455
		/** The composite. */
......
477 478

  
478 479
			// N CLUSTERS
479 480
			Label label = new Label(composite, SWT.NONE);
480
			label.setText(Messages.CAHPreferencePage_2);
481
			label.setText(RCPCAHMessages.CAHPreferencePage_2);
481 482

  
482 483
			nclusterSpinner = new Spinner(composite, SWT.BORDER);
483 484
			nclusterSpinner.setMinimum(2);
484 485
			nclusterSpinner.setIncrement(1);
485
			nclusterSpinner.setSelection(TxmPreferences.getInt(CAHPreferencePage.NCLUSTER, 2));
486
			nclusterSpinner.setSelection(TxmPreferences.getInt(CAHPreferences.NCLUSTER, 2));
486 487
			nclusterSpinner.setMaximum(50);
487 488

  
488 489
			// ROWS OR COLS
489 490
			docolumnsButton = new Button(composite, SWT.RADIO);
490
			docolumnsButton.setText(Messages.ComputeClassification_5);
491
			docolumnsButton.setText(RCPCAHMessages.ComputeClassification_5);
491 492
			docolumnsButton.setSelection(true);
492 493

  
493 494
			Button dorowsButton = new Button(composite, SWT.RADIO);
494
			dorowsButton.setText(Messages.ComputeClassification_6);
495
			dorowsButton.setText(RCPCAHMessages.ComputeClassification_6);
495 496

  
496 497
			/*
497 498
			// METHODS
tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/preferences/CAHPreferencePage.java (revision 134)
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.cah.rcp.preferences;
29

  
30
import org.eclipse.jface.preference.BooleanFieldEditor;
31
import org.eclipse.jface.preference.ComboFieldEditor;
32
import org.eclipse.jface.preference.IntegerFieldEditor;
33
import org.eclipse.jface.preference.RadioGroupFieldEditor;
34
import org.eclipse.swt.widgets.Composite;
35
import org.eclipse.swt.widgets.Group;
36
import org.eclipse.ui.IWorkbench;
37
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
38
import org.txm.cah.core.functions.CAH;
39
import org.txm.cah.core.preferences.CAHPreferences;
40
import org.txm.cah.rcp.adapters.CAHAdapterFactory;
41
import org.txm.cah.rcp.messages.RCPCAHMessages;
42
import org.txm.rcp.preferences.TXMPreferencePage;
43
import org.txm.rcp.preferences.TXMPreferenceStore;
44
import org.txm.rcpapplication.Messages;
45
import org.txm.rcpapplication.TxmPreferences;
46
import org.txm.rcpapplication.jface.DoubleFieldEditor;
47
// TODO: Auto-generated Javadoc
48
/**
49
 * This class represents a preference page that is contributed to the
50
 * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we
51
 * can use the field support built into JFace that allows us to create a page
52
 * that is small and knows how to save, restore and apply itself.
53
 * <p>
54
 * This page is used to modif y preferences only. They are stored in the
55
 * preference store that belongs to the main plug-in class. That way,
56
 * preferences can be accessed directly via the preference store.
57
 */
58

  
59
public class CAHPreferencePage extends TXMPreferencePage {
60

  
61

  
62
	/**
63
	 * Instantiates a new cah preference page.
64
	 */
65
	public CAHPreferencePage() {
66
		super();
67
	}
68

  
69
	
70
	/**
71
	 * 
72
	 * @return
73
	 */
74
	public static TXMPreferenceStore getNewPreferenceStore()	{
75
		return new TXMPreferenceStore(CAHPreferences.PREFERENCES_NODE);
76
	}
77

  
78
	
79
	/**
80
	 * Creates the field editors. Field editors are abstractions of the common
81
	 * GUI blocks needed to manipulate various types of preferences. Each field
82
	 * editor knows how to save and restore itself.
83
	 */
84
	@Override
85
	public void createFieldEditors() {
86

  
87
		
88
		IntegerFieldEditor defaultncluster = new IntegerFieldEditor(CAHPreferences.NCLUSTER,
89
				RCPCAHMessages.CAHPreferencePage_2, getFieldEditorParent());
90
		addField(defaultncluster);
91

  
92
		String list[] = CAH.getMethods(); 
93
		String methods[][] = new String[list.length][2];
94
		for(int i = 0 ; i < list.length ; i++)
95
			methods[i][0] = methods[i][1] = list[i];
96
				
97
		ComboFieldEditor defaultmethod = new ComboFieldEditor(CAHPreferences.METHOD,
98
				RCPCAHMessages.CAHPreferencePage_3, methods, getFieldEditorParent());
99
		addField(defaultmethod);
100

  
101
		list = CAH.getMetrics(); 
102
		String metrics[][] = new String[list.length][2];
103
		for(int i = 0 ; i < list.length ; i++)
104
			metrics[i][0] = metrics[i][1] = list[i];
105
		
106
		ComboFieldEditor defaultmetric = new ComboFieldEditor(CAHPreferences.METRIC,
107
				RCPCAHMessages.CAHPreferencePage_4, metrics, getFieldEditorParent());
108
		addField(defaultmetric);
109
		
110
		
111
		// Charts
112
		Group chartsGroup = SWTChartsComponentsProvider.createChartsRenderingPreferencesGroup(getFieldEditorParent());
113

  
114
		// FIXME : these preferences should be renamed and moved to charts engine preference level (associated messages too)
115
		String[][] labelAndValues = {{"2D", "2D"}, {"3D", "3D"}}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
116
		RadioGroupFieldEditor default2D3Ddisplay = new RadioGroupFieldEditor(CAHPreferences.DISPLAY, RCPCAHMessages.CAHPreferencePage_0, 2, labelAndValues, chartsGroup);
117
		addField(default2D3Ddisplay);
118
		
119
		
120
		
121

  
122
	}
123

  
124
	@Override
125
	public void init(IWorkbench workbench) {
126
		this.setPreferenceStore(getNewPreferenceStore());
127
		//setDescription("CAH");
128
		this.setTitle(RCPCAHMessages.CAHPreferencePage_2);
129
		this.setImageDescriptor(CAHAdapterFactory.ICON);
130
	}
131

  
132
}
0 133

  
tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/messages.properties (revision 134)
1
CAHPreferencePage_0=Display graphics in
2
CAHPreferencePage_1=Classification
3
CAHPreferencePage_2=Number of clusters
4
CAHPreferencePage_3=Method
5
CAHPreferencePage_4=Metric
0 6

  
tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/adapters/CAHAdapterFactory.java (revision 134)
1
// Copyright © 2010-2013 ENS de Lyon.
2
package org.txm.cah.rcp.adapters;
3

  
4
import org.eclipse.jface.resource.ImageDescriptor;
5
import org.eclipse.ui.model.IWorkbenchAdapter;
6
import org.eclipse.ui.plugin.AbstractUIPlugin;
7
import org.osgi.framework.FrameworkUtil;
8
import org.txm.cah.core.functions.CAH;
9
import org.txm.rcp.adapters.BaseAdapterFactory;
10

  
11
/**
12
 * A factory for creating Adapter objects.
13
 *  
14
 * @author mdecorde
15
 * @author sjacquot
16
 */
17
public class CAHAdapterFactory extends BaseAdapterFactory {
18

  
19
	
20
	public static final ImageDescriptor ICON =
21
			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(CAHAdapterFactory.class).getSymbolicName(),
22
					"platform:/plugin/"+ FrameworkUtil.getBundle(CAHAdapterFactory.class).getSymbolicName() + "/icons/functions/cah.png"); //$NON-NLS-1$
23
	
24
	/**
25
	 * Gets the adapter.
26
	 *
27
	 * @param adaptableObject the adaptable object
28
	 * @param adapterType the adapter type
29
	 * @return the adapter
30
	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
31
	 */
32
	@Override
33
	public Object getAdapter(Object adaptableObject, Class adapterType) {
34
		
35
		if(adapterType == IWorkbenchAdapter.class)	{
36
			if(adaptableObject instanceof CAH)	{
37
				return new IWorkbenchAdapter() {
38
					@Override
39
					public Object[] getChildren(Object resultData) {
40
						return new Object[0];
41
					}
42
	
43
					@Override
44
					public ImageDescriptor getImageDescriptor(Object object) {
45
						return ICON;
46
					}
47
	
48
					@Override
49
					public String getLabel(Object resultData) {
50
						return ((CAH) resultData).getName(); 
51
					}
52
	
53
					@Override
54
					public Object getParent(Object resultData) {
55
						return ((CAH) resultData).getCorpus();
56
					}
57
				};
58
			}
59
		}
60
		return null;
61
	}
62

  
63

  
64
}
0 65

  
tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/messages/RCPCAHMessages.java (revision 134)
1
package org.txm.cah.rcp.messages;
2

  
3
import org.eclipse.osgi.util.NLS;
4
import org.txm.core.messages.TXMMessages;
5

  
6
public class RCPCAHMessages extends NLS {
7

  
8
	// FIXME: use the same properties file than the bundle
9
	private static final String BUNDLE_NAME = "l10n.bundle"; //$NON-NLS-1$
10
	public static String CAHPreferencePage_0;
11
	public static String CAHPreferencePage_2;
12
	public static String CAHPreferencePage_3;
13
	public static String CAHPreferencePage_4;
14
	
15
	public static String CAHEditor_0;
16
	
17
	public static String ComputeCAH_0;
18
	public static String ComputeCAH_1;
19
	public static String ComputeCAH_2;
20
	public static String ComputeCAH_3;
21

  
22
	public static String ComputeCAH_4;
23

  
24
	public static String ComputeCAH_5;
25

  
26
	public static String ComputeCAH_6;
27
	public static String ComputeClassification_5;
28
	public static String ComputeClassification_6;
29
	
30
	public static String CAHEditorTitle;
31
	
32
	static {
33
		// initializes resource bundle
34
		TXMMessages.initializeMessages(BUNDLE_NAME, RCPCAHMessages.class);
35
		//NLS.initializeMessages(BUNDLE_NAME, RCPProgressionMessages.class);
36
	}
37
	
38
	private RCPCAHMessages() {
39
	}
40
}
0 41

  
tmp/org.txm.cah.rcp/build.properties (revision 134)
1 1
source.. = src/
2 2
output.. = bin/
3 3
bin.includes = META-INF/,\
4
               .
4
               .,\
5
               plugin.xml
tmp/org.txm.cah.rcp/plugin.xml (revision 134)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.4"?>
3
<plugin>
4
   <extension
5
         point="org.txm.chartsengine.chartcreator">
6
      <ChartCreator
7
            class="org.txm.cah.core.chartsengine.r.RCAHChartCreator"
8
            fileNamePrefix="cah">
9
      </ChartCreator>
10
   </extension>
11
   <extension
12
         id="commands"
13
         name="commands"
14
         point="org.eclipse.ui.commands">
15
      <command
16
            categoryId="org.txm.rcpapplication.category.txm"
17
            defaultHandler="org.txm.rcpapplication.commands.function.ComputeCAH"
18
            id="org.txm.rcpapplication.commands.function.ComputeCAH"
19
            name="%command.name.54">
20
      </command>
21
   </extension>
22
   <extension
23
         point="org.eclipse.ui.menus">
24
      <menuContribution
25
            locationURI="menu:org.eclipse.ui.main.menu">
26
         <menu
27
               id="menu.tools"
28
               label="%menu.label.6">
29
            <command
30
                  commandId="org.txm.rcpapplication.commands.function.ComputeFrequencyList"
31
                  icon="icons/functions/IndexP.png"
32
                  label="%command.label.79"
33
                  style="push"
34
                  tooltip="%command.tooltip.61">
35
               <visibleWhen
36
                     checkEnabled="false">
37
                  <reference
38
                        definitionId="OneCorpusSelected">
39
                  </reference>
40
               </visibleWhen>
41
            </command>
42
            <command
43
                  commandId="org.txm.rcpapplication.commands.function.ComputeIndex"
44
                  icon="icons/functions/Index.png"
45
                  label="%command.label.66"
46
                  style="push"
47
                  tooltip="%command.tooltip.62">
48
               <visibleWhen
49
                     checkEnabled="false">
50
                  <or>
51
                     <reference
52
                           definitionId="OnePartitionSelected">
53
                     </reference>
54
                     <reference
55
                           definitionId="OneCorpusSelected">
56
                     </reference>
57
                  </or>
58
               </visibleWhen>
59
            </command>
60
            <command
61
                  commandId="org.txm.rcpapplication.commands.function.ComputeConcordance"
62
                  icon="icons/functions/Concordances.png"
63
                  label="%command.label.11"
64
                  style="push"
65
                  tooltip="%command.tooltip.7">
66
               <visibleWhen
67
                     checkEnabled="false">
68
                  <reference
69
                        definitionId="OneCorpusSelected">
70
                  </reference>
71
               </visibleWhen>
72
            </command>
73
            <command
74
                  commandId="org.txm.rcpapplication.commands.function.ComputeCooccurrences"
75
                  icon="icons/functions/Cooccurrences.png"
76
                  label="%command.label.91"
77
                  style="push"
78
                  tooltip="%command.tooltip.53">
79
               <visibleWhen
80
                     checkEnabled="false">
81
                  <or>
82
                     <reference
83
                           definitionId="OneCorpusSelected">
84
                     </reference>
85
                     <reference
86
                           definitionId="OneConcordanceSelected">
87
                     </reference>
88
                  </or>
89
               </visibleWhen>
90
            </command>
91
            <command
92
                  commandId="org.txm.rcpapplication.commands.function.ComputeReferencer"
93
                  icon="icons/functions/Referencer.png"
94
                  label="%command.label.108"
95
                  style="push"
96
                  tooltip="%command.tooltip.62">
97
               <visibleWhen
98
                     checkEnabled="false">
99
                  <reference
100
                        definitionId="OneCorpusSelected">
101
                  </reference>
102
               </visibleWhen>
103
            </command>
104
            <separator
105
                  name="menu.tools.stats"
106
                  visible="true">
107
            </separator>
108
            <command
109
                  commandId="org.txm.rcpapplication.commands.function.ComputeCorrespondanceAnalysis"
110
                  icon="icons/functions/CorrespondanceAnalysis.png"
111
                  label="%command.label.80"
112
                  style="push"
113
                  tooltip="%command.tooltip.46">
114
               <visibleWhen
115
                     checkEnabled="false">
116
                  <or>
117
                     <reference
118
                           definitionId="OnePartitionSelected">
119
                     </reference>
120
                     <reference
121
                           definitionId="OneLexicalTableSelected">
122
                     </reference>
123
                     <reference
124
                           definitionId="OneICAComputableSelected">
125
                     </reference>
126
                  </or>
127
               </visibleWhen>
128
            </command>
129
            <command
130
                  commandId="org.txm.rcpapplication.commands.function.ComputeCAH"
131
                  icon="icons/functions/CAH.png"
132
                  label="%command.label.116"
133
                  style="push"
134
                  tooltip="%command.tooltip.69">
135
               <visibleWhen
136
                     checkEnabled="false">
137
                  <or>
138
                     <reference
139
                           definitionId="OneCASelected">
140
                     </reference>
141
                     <reference
142
                           definitionId="OneLexicalTableSelected">
143
                     </reference>
144
                     <reference
145
                           definitionId="OnePartitionSelected">
146
                     </reference>
147
                  </or>
148
               </visibleWhen>
149
            </command>
150
            <separator
151
                  name="menu.tools.misc"
152
                  visible="true">
153
            </separator>
154
            <command
155
                  commandId="org.txm.rcpapplication.commands.base.SendToR"
156
                  icon="icons/functions/SendToR.png"
157
                  label="%command.label.117"
158
                  style="push"
159
                  tooltip="%command.tooltip.70">
160
               <visibleWhen
161
                     checkEnabled="false">
162
                  <or>
163
                     <reference
164
                           definitionId="OneConcordanceSelected">
165
                     </reference>
166
                     <reference
167
                           definitionId="OneLexiconSelected">
168
                     </reference>
169
                     <reference
170
                           definitionId="OneIndexSelected">
171
                     </reference>
172
                     <reference
173
                           definitionId="OneCooccurrenceSelected">
174
                     </reference>
175
                     <reference
176
                           definitionId="OneReferencerSelected">
177
                     </reference>
178
                     <reference
179
                           definitionId="OneCorpusSelected">
180
                     </reference>
181
                  </or>
182
               </visibleWhen>
183
            </command>
184
            <command
185
                  commandId="org.eclipse.ui.window.preferences"
186
                  icon="icons/functions/prefs.png"
187
                  label="%command.label.4"
188
                  style="push"
189
                  tooltip="%command.tooltip.0">
190
            </command>
191
         </menu>
192
      </menuContribution>
193
      <menuContribution
194
            allPopups="true"
195
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
196
         <toolbar
197
               id="org.txm.rcpapplication.toolbartools">
198
            <command
199
                  commandId="org.txm.rcpapplication.commands.function.ComputeFrequencyList"
200
                  icon="icons/functions/IndexP.png"
201
                  label="%command.label.79"
202
                  style="push"
203
                  tooltip="%command.tooltip.61">
204
               <visibleWhen
205
                     checkEnabled="false">
206
                  <reference
207
                        definitionId="OneCorpusSelected">
208
                  </reference>
209
               </visibleWhen>
210
            </command>
211
            <command
212
                  commandId="org.txm.rcpapplication.commands.function.ComputeIndex"
213
                  icon="icons/functions/Index.png"
214
                  label="%command.label.66"
215
                  style="push"
216
                  tooltip="%command.tooltip.62">
217
               <visibleWhen
218
                     checkEnabled="false">
219
                  <or>
220
                     <reference
221
                           definitionId="OnePartitionSelected">
222
                     </reference>
223
                     <reference
224
                           definitionId="OneCorpusSelected">
225
                     </reference>
226
                  </or>
227
               </visibleWhen>
228
            </command>
229
            <command
230
                  commandId="org.txm.rcpapplication.commands.function.ComputeConcordance"
231
                  icon="icons/functions/Concordances.png"
232
                  label="%command.label.11"
233
                  style="push"
234
                  tooltip="%command.tooltip.7">
235
               <visibleWhen
236
                     checkEnabled="false">
237
                  <reference
238
                        definitionId="OneCorpusSelected">
239
                  </reference>
240
               </visibleWhen>
241
            </command>
242
            <command
243
                  commandId="org.txm.rcpapplication.commands.function.ComputeCooccurrences"
244
                  icon="icons/functions/Cooccurrences.png"
245
                  label="%command.label.96"
246
                  style="push"
247
                  tooltip="%command.tooltip.57">
248
               <visibleWhen
249
                     checkEnabled="false">
250
                  <or>
251
                     <reference
252
                           definitionId="OneCorpusSelected">
253
                     </reference>
254
                     <reference
255
                           definitionId="OneConcordanceSelected">
256
                     </reference>
257
                  </or>
258
               </visibleWhen>
259
            </command>
260
            <command
261
                  commandId="org.txm.rcpapplication.commands.function.ComputeReferencer"
262
                  icon="icons/functions/Referencer.png"
263
                  label="%command.label.108"
264
                  style="push"
265
                  tooltip="%command.tooltip.63">
266
               <visibleWhen
267
                     checkEnabled="false">
268
                  <reference
269
                        definitionId="OneCorpusSelected">
270
                  </reference>
271
               </visibleWhen>
272
            </command>
273
            <separator
274
                  name="org.txm.rcp.separator4"
275
                  visible="true">
276
            </separator>
277
            <command
278
                  commandId="org.txm.rcpapplication.commands.function.ComputeCorrespondanceAnalysis"
279
                  icon="icons/functions/CorrespondanceAnalysis.png"
280
                  label="%command.label.80"
281
                  style="push"
282
                  tooltip="%command.tooltip.46">
283
               <visibleWhen
284
                     checkEnabled="false">
285
                  <or>
286
                     <reference
287
                           definitionId="OnePartitionSelected">
288
                     </reference>
289
                     <reference
290
                           definitionId="OneLexicalTableSelected">
291
                     </reference>
292
                     <reference
293
                           definitionId="OneICAComputableSelected">
294
                     </reference>
295
                  </or>
296
               </visibleWhen>
297
            </command>
298
            <command
299
                  commandId="org.txm.rcpapplication.commands.function.ComputeCAH"
300
                  icon="icons/functions/CAH.png"
301
                  label="%command.label.120"
302
                  style="push"
303
                  tooltip="%command.tooltip.73">
304
               <visibleWhen
305
                     checkEnabled="false">
306
                  <or>
307
                     <reference
308
                           definitionId="OneCASelected">
309
                     </reference>
310
                     <reference
311
                           definitionId="OneLexicalTableSelected">
312
                     </reference>
313
                     <reference
314
                           definitionId="OnePartitionSelected">
315
                     </reference>
316
                  </or>
317
               </visibleWhen>
318
            </command>
319
            <separator
320
                  name="org.txm.rcpapplication.separator1">
321
            </separator>
322
            <command
323
                  commandId="org.txm.rcpapplication.commands.base.SendToR"
324
                  icon="icons/functions/SendToR.png"
325
                  label="%command.label.121"
326
                  style="push"
327
                  tooltip="%command.tooltip.74">
328
               <visibleWhen
329
                     checkEnabled="false">
330
                  <or>
331
                     <reference
332
                           definitionId="OneConcordanceSelected">
333
                     </reference>
334
                     <reference
335
                           definitionId="OneLexiconSelected">
336
                     </reference>
337
                     <reference
338
                           definitionId="OneIndexSelected">
339
                     </reference>
340
                     <reference
341
                           definitionId="OneCooccurrenceSelected">
342
                     </reference>
343
                     <reference
344
                           definitionId="OneReferencerSelected">
345
                     </reference>
346
                     <reference
347
                           definitionId="OneCorpusSelected">
348
                     </reference>
349
                  </or>
350
               </visibleWhen>
351
            </command>
352
            <command
353
                  commandId="org.eclipse.ui.window.preferences"
354
                  icon="icons/functions/prefs.png"
355
                  label="%command.label.4"
356
                  style="push"
357
                  tooltip="%command.tooltip.0">
358
            </command>
359
         </toolbar>
360
      </menuContribution>
361
      <menuContribution
362
            locationURI="popup:org.txm.rcpapplication.views.CorporaView">
363
         <command
364
               commandId="org.txm.rcpapplication.commands.function.ComputeCAH"
365
               icon="icons/functions/CAH.png"
366
               label="%command.label.126"
367
               style="push"
368
               tooltip="%command.tooltip.79">
369
            <visibleWhen
370
                  checkEnabled="false">
371
               <or>
372
                  <reference
373
                        definitionId="OneCASelected">
374
                  </reference>
375
                  <reference
376
                        definitionId="OneLexicalTableSelected">
377
                  </reference>
378
                  <reference
379
                        definitionId="OnePartitionSelected">
380
                  </reference>
381
               </or>
382
            </visibleWhen>
383
         </command>
384
      </menuContribution>
385
   </extension>
386

  
387
</plugin>
0 388

  
tmp/org.txm.cah.rcp/.settings/org.eclipse.core.resources.prefs (revision 134)
1
eclipse.preferences.version=1
2
encoding//src/org/txm/cah/rcp/messages_ru_utf8.properties=UTF-8
0 3

  
tmp/org.txm.cah.rcp/META-INF/MANIFEST.MF (revision 134)
1 1
Manifest-Version: 1.0
2 2
Bundle-ManifestVersion: 2
3 3
Bundle-Name: CAH RCP
4
Bundle-SymbolicName: org.txm.cah.rcp
4
Bundle-SymbolicName: org.txm.cah.rcp;singleton:=true
5 5
Bundle-Version: 1.0.0.qualifier
6 6
Bundle-Activator: org.txm.cah.rcp.Activator
7 7
Require-Bundle: org.txm.chartsengine.rcp;bundle-version="1.0.0",
......
19 19
 org.txm.chartsengine.svgbatik.rcp;bundle-version="1.0.0"
20 20
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
21 21
Bundle-ActivationPolicy: lazy
22
Export-Package: org.txm.cah.rcp.chartsengine.jfreechart.events,
23
 org.txm.cah.rcp.editors
22
Export-Package: org.txm.cah.rcp,
23
 org.txm.cah.rcp.adapters,
24
 org.txm.cah.rcp.chartsengine.jfreechart.events,
25
 org.txm.cah.rcp.commands,
26
 org.txm.cah.rcp.editors,
27
 org.txm.cah.rcp.messages,
28
 org.txm.cah.rcp.preferences
tmp/org.txm.cah.core/src/org/txm/cah/core/chartsengine/r/RCAHChartCreator.java (revision 134)
1
package org.txm.cah.core.chartsengine.r;
2

  
3
import java.io.File;
4

  
5
import org.txm.cah.core.functions.CAH;
6
import org.txm.chartsengine.r.core.RChartCreator;
7
import org.txm.chartsengine.r.core.RChartsEngine;
8

  
9
public class RCAHChartCreator extends RChartCreator {
10

  
11
	public RCAHChartCreator() {
12
		// TODO Auto-generated constructor stub
13
	}
14

  
15
	@Override
16
	public Object createChart(Object resultData, String preferencesNode) {
17
		// TODO Auto-generated method stub
18
		return null;
19
	}
20
	
21

  
22
	public String createCAH2dChartFile(CAH cah) {
23
		return "plot.HCPC(" + cah.getSymbol() + ", new.plot=FALSE, choice=\"tree\")";
24
	}
25

  
26
	public String createCAH3dChartFile(CAH cah) {
27
		return "plot.HCPC("+ cah.getSymbol() +", new.plot=FALSE)";
28
	}
29

  
30
	@Override
31
	public File createChartFile(Object resultData, File file, String preferencesNode) {
32

  
33
		try {
34
			CAH cah = (CAH) resultData;
35
			
36
			// parameters
37
//			int maxWords = TXMPreferences.getInt(preferencesNode, resultData, WordCloudPreferences.MAX_WORDS);
38
//			int minFreq = TXMPreferences.getInt(preferencesNode, resultData, WordCloudPreferences.FMIN);
39
//			float rotPer = TXMPreferences.getFloat(preferencesNode, resultData, WordCloudPreferences.ROT);
40
//			boolean randomOrder = TXMPreferences.getBoolean(preferencesNode, resultData, WordCloudPreferences.RANDOM_POSITION);
41
			
42
			String cmd = null;
43
			if (cah.isDisplay2D()) {
44
				cmd = createCAH2dChartFile(cah);
45
			} else {
46
				cmd = createCAH3dChartFile(cah);
47
			}
48
			
49
			((RChartsEngine) this.chartsEngine).plot(file, cmd);
50
		}
51
		catch(Exception e) {
52
			// TODO Auto-generated catch block
53
			e.printStackTrace();
54
		}
55
		
56
		return file;
57
	}
58

  
59
	
60
	@Override
61
	// FIXME: to not load the chart creator, to remove when implemented 
62
	public Class getChartsEngineClass() {
63
		return null;
64
	}
65
	
66
	@Override
67
	public Class getResultDataClass() {
68
		return CAH.class;
69
	}
70

  
71

  
72

  
73
}
0 74

  
tmp/org.txm.cah.core/src/org/txm/cah/core/chartsengine/jfreechart/JFCCAHChartCreator.java (revision 134)
1
package org.txm.cah.core.chartsengine.jfreechart;
2

  
3
import org.jfree.chart.JFreeChart;
4
import org.txm.cah.core.functions.CAH;
5
import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
6

  
7
/**
8
 * 
9
 * @author mdecorde
10
 * 
11
 * TODO: not done
12
 *
13
 */
14
public class JFCCAHChartCreator extends JFCChartCreator {
15

  
16
	public JFCCAHChartCreator() {
17
		// TODO Auto-generated constructor stub
18
	}
19

  
20
	@Override
21
	public JFreeChart createChart(Object resultData, String preferencesNode) {
22

  
23
		final CAH cah = (CAH) resultData;
24
		
25
		
26
		return null;
27
		
28
	}
29

  
30

  
31
	@Override
32
	public Class getResultDataClass() {
33
		return CAH.class;
34
	}
35

  
36

  
37

  
38

  
39

  
40
	
41

  
42
}
0 43

  
tmp/org.txm.cah.core/src/org/txm/cah/core/preferences/CAHPreferences.java (revision 134)
1
package org.txm.cah.core.preferences;
2

  
3

  
4
import org.eclipse.core.runtime.preferences.DefaultScope;
5
import org.osgi.framework.FrameworkUtil;
6
import org.osgi.service.prefs.Preferences;
7
import org.txm.cah.core.functions.CAH;
8
import org.txm.core.preferences.TXMPreferences;
9

  
10
/**
11
 * Default preferences initializer.
12
 * 
13
 * @author mdecorde
14
 * @author sjacquot
15
 *
16
 */
17
public class CAHPreferences extends TXMPreferences {
18

  
19
	// auto populate the preference node qualifier from the current bundle id
20
	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(CAHPreferences.class).getSymbolicName();
21
	public static final String PREFERENCES_PREFIX = "cah_"; //$NON-NLS-1$
22
	
23
	/** The Constant DISPLAY. */
24
	public static final String DISPLAY = "cah_display_2d"; //$NON-NLS-1$
25
	
26
	/** The Constant METHOD. */
27
	public static final String METHOD = "cah_default_method"; //$NON-NLS-1$
28
	
29
	/** The Constant METRIC. */
30
	public static final String METRIC = "cah_default_metric"; //$NON-NLS-1$
31
	
32
	/** The Constant NCLUSTER. */
33
	public static final String NCLUSTER = "cah_default_ncluster"; //$NON-NLS-1$
34
	
35
	/** The Constant ID. */
36
	public static final String ID = "org.txm.rcpapplication.preferences.CAHPreferencePage"; //$NON-NLS-1$
37

  
38
	public CAHPreferences() {
39
		// TODO Auto-generated constructor stub
40
	}
41

  
42
	@Override
43
	public void initializeDefaultPreferences() {
44
		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
45
		preferences.putBoolean(DISPLAY, false);
46
		preferences.putInt(NCLUSTER, 2);
47
		preferences.put(METHOD, CAH.getDefaultMethod());
48
		preferences.put(METRIC, CAH.getDefaultMetric());
49
		
50
		// shared charts rendering preferences
51
		super.initializeChartsEngineSharedPreferences(preferences);
52
	}
53
	
54
}
0 55

  
tmp/org.txm.cah.core/src/org/txm/cah/core/messages/TBXCAHMessages.java (revision 134)
1
package org.txm.cah.core.messages;
2

  
3
import org.eclipse.osgi.util.NLS;
4

  
5
public class TBXCAHMessages extends NLS {
6

  
7
	private static final String BUNDLE_NAME = "org.txm.cah.core.messages.messages"; //$NON-NLS-1$
8

  
9
	public static String CAH_0;
10

  
11
	public static String CAHEditor_PART_NAME_PREFIX;
12
	public static String CAHEditorTitle;
13
	
14
	static {
15
		// initialize resource bundle
16
		NLS.initializeMessages(BUNDLE_NAME, TBXCAHMessages.class);
17
	}
18

  
19
	private TBXCAHMessages() {
20
	}
21
}
0 22

  
tmp/org.txm.cah.core/src/org/txm/cah/core/messages/messages.properties (revision 134)
1
CAH_0=Error while exporting CAH result : 
0 2

  
tmp/org.txm.cah.core/src/org/txm/cah/core/messages/messages_ru.properties (revision 134)
1
CAH_0=Error while exporting CAH result : 
0 2

  
tmp/org.txm.cah.core/src/org/txm/cah/core/messages/messages_fr.properties (revision 134)
1
CAH_0=Erreur durant l'export du r?sultat CAH : 
0 2

  
tmp/org.txm.cah.core/src/org/txm/cah/core/functions/CAH.java (revision 134)
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.cah.core.functions;
29

  
30
import java.io.File;
31

  
32
import org.rosuda.REngine.REXP;
33
import org.rosuda.REngine.REXPMismatchException;
34
import org.txm.HasResults;
35
import org.txm.cah.core.messages.TBXCAHMessages;
36
import org.txm.functions.Function;
37
import org.txm.functions.TXMResult;
38
import org.txm.functions.ca.CA;
39
import org.txm.searchengine.cqp.corpus.Corpus;
40
import org.txm.searchengine.cqp.corpus.Partition;
41
import org.txm.stat.data.LexicalTable;
42
import org.txm.stat.engine.r.RWorkspace;
43
import org.txm.stat.engine.r.RWorkspaceException;
44

  
45
// TODO: Auto-generated Javadoc
46
/**
47
 * The Class CAH.
48
 * 
49
 * @author mdecorde
50
 *
51
 */
52
public class CAH extends Function implements TXMResult
53
{
54
	/** The metric. */
55
	String metric = "euclidean"; // euclidean, manhattan //$NON-NLS-1$
56

  
57
	/** The method. */
58
	String method = "ward"; // METHODS <- c("average", "single", "complete", "ward", "weighted", "flexible") //$NON-NLS-1$
59

  
60
	/** The N cluster. */
61
	int NCluster = 3;
62

  
63
	/** The columns. */
64
	boolean columns = true;
65

  
66
	/** The symbol. */
67
	String symbol = null;
68

  
69
	/** The target. */
70
	String target;
71

  
72
	/** The partition. */
73
	Partition partition;
74
	Corpus corpus;
75

  
76
	/** The source. */
77
	Object source;
78

  
79
	/** The name. */
80
	String name;
81

  
82
	/** The display2 d. */
83
	// FIXME : to remove when charts engine will be validated
84
	@Deprecated
85
	boolean display2D;
86

  
87
	// FIXME : to remove when charts engine will be validated
88
	@Deprecated
89
	private File svgFile;
90

  
91

  
92
	/**
93
	 * The coordinates of the clusters.
94
	 */
95
	protected double[][] clusterCoords = null;
96

  
97
	/**
98
	 * The numbers of the clusters.
99
	 */
100
	protected int[] clusterNumbers = null;
101

  
102
	/**
103
	 * The names of the cluster rows.
104
	 */
105
	protected String[] clusterRowNames = null;
106

  
107
	/**
108
	 * The ordered names of the cluster rows.
109
	 */
110
	protected String[] clusterOrderedRowNames = null;
111

  
112
	/**
113
	 * The cluster tree heights.
114
	 */
115
	protected double[] clusterHeights = null;
116

  
117
	/**
118
	 * The cluster tree merges.
119
	 */
120
	protected double[][] clusterMerges = null;
121

  
122
	/**
123
	 * The inertia gains.
124
	 */
125
	protected double[] inertiaGains = null;
126

  
127
	protected CA ca;
128
	protected LexicalTable table;
129

  
130

  
131
	/**
132
	 * Instantiates a new cAH.
133
	 *
134
	 * @param ca the ca
135
	 * @param col the col
136
	 * @param method the method
137
	 * @param metric the metric
138
	 * @param NCluster the n cluster
139
	 * @param display2D the display mode
140
	 */
141
	public CAH(CA ca, boolean col, String method, String metric, int NCluster, Boolean display2D)
142
	{
143
		this.ca = ca;
144
		this.table = ca.getLexicalTable();
145
		this.columns = col;
146
		this.metric = metric;
147
		this.NCluster = NCluster;
148
		this.method = method;
149
		this.display2D = display2D;
150

  
151
		this.source = ca;
152
		this.partition = ca.getPartition();
153
		this.corpus = ca.getCorpus();
154
		this.target = ca.getSymbol();
155
		this.name = ca.getName();
156
	}
157

  
158
	/**
159
	 * Instantiates a new cAH.
160
	 *
161
	 * @param table the table
162
	 * @param col the col
163
	 * @param method the method
164
	 * @param metric the metric
165
	 * @param NCluster the n cluster
166
	 * @param displayMode the display mode
167
	 */
168
	public CAH(LexicalTable table, boolean col, String method, String metric, int NCluster, Boolean display2D)
169
	{
170
		this.columns = col;
171
		this.metric = metric;
172
		this.NCluster = NCluster;
173
		this.method = method;
174
		this.display2D = display2D;
175

  
176
		this.source = table;
177
		this.partition = table.getPartition();
178
		this.corpus = table.getCorpus();
179
		this.target = table.getSymbol();
180
		this.name = table.getName();
181
		this.table = table;
182
	}
183

  
184

  
185
	/**
186
	 * Resets the cached data so the next getter calls will request the values from R.
187
	 */
188
	public void resetCache()	{
189
		this.clusterCoords = null;
190
		this.clusterNumbers = null;
191
		this.clusterRowNames = null;
192
		this.clusterOrderedRowNames = null;
193
		this.clusterHeights = null;
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff