Révision 1469

tmp/org.txm.specificities.core/src/org/txm/specificities/core/preferences/SpecificitiesPreferences.java (revision 1469)
50 50
		Preferences preferences = this.getDefaultPreferencesNode();
51 51
		
52 52
		preferences.put(FORMAT, "%,.1f"); //$NON-NLS-1$
53
		preferences.putInt(MAX_SCORE, 10000);
53
		preferences.putInt(MAX_SCORE, 1000);
54 54
		
55 55
		preferences.putBoolean(CHART_GROUP_BY_LINES, false);
56 56
		preferences.putBoolean(CHART_DRAW_BARS, true);
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java (revision 1469)
118 118
		final Font currentFont = ChartsEngine.createFont(chartEditor.getResult().getFont());
119 119
		
120 120
		final Combo fontCombo = new Combo(this, SWT.READ_ONLY);
121
		String fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
121
		String fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); //FIXME: SJ: maybe better here to get the fonts from SWT rather than from Java
122 122
		fontCombo.setItems(fonts);
123 123

  
124 124
		ToolItem fontsComboItem = new ToolItem(this, SWT.SEPARATOR);
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/preferences/ChartsEnginePreferences.java (revision 1469)
65 65
	public static final String MULTIPLE_LINE_STROKES = "multiple_line_strokes"; //$NON-NLS-1$
66 66
	
67 67

  
68
	
69
	
70
	
71 68
	// local result preferences
72 69
	public final static String CHART_TYPE = "chart_type"; //$NON-NLS-1$
73 70
	
74 71
	
75
	
76
	
77
	
78 72
	/**
79 73
	 * Default font string representation.
80 74
	 */
81 75
	public final static String DEFAULT_FONT = "1|Lucida Sans Unicode|11.0|0|WINDOWS|1|-16|0|0|0|400|0|0|0|0|3|2|1|34|Lucida Sans Unicode;"; //$NON-NLS-1$  
76
	//public final static String DEFAULT_FONT = "1|Tahoma|8.25|0|WINDOWS|1|-11|0|0|0|400|0|0|0|1|0|0|0|0|Tahoma;"; //$NON-NLS-1$
82 77
	
78
	
79
	
83 80
	public final static String DEFAULT_CHART_TYPE = "[Default]"; //$NON-NLS-1$
84 81
	
85 82

  
......
121 118
		
122 119
		// FIXME: maybe need to check here the target OS and set a default Unicode installed font
123 120
		preferences.put(FONT, DEFAULT_FONT);
124
		
125 121
	}
126 122
}
127 123

  
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java (revision 1469)
194 194

  
195 195
		Log.finest("*** ChartResult.renderChart(): rendering chart for result " + this.getClass() + " and chart type " + this.getChartType() + "..."); //$NON-NLS-1$
196 196

  
197
		
198
//		if(this.parametersHistory.size() > 2
199
//				
200
//				|| this.getLastParametersFromHistory().isEmpty()
201
//				)	{
202
//			this.clearLastComputingParameters();
203
//		}
204

  
205
		
206
		
197 207
		if (!this.chartDirty && !this.isChartDirtyFromHistory()) {
198 208
			Log.finest("--- ChartResult.renderChart(): chart rendering parameters have not changed since last rendering, rendering skipped."); //$NON-NLS-1$
199 209
			return true;
......
231 241
			// Solution 1: store two stacks, one for computing parameters and another for rendering parameters
232 242
			// Solution 2: stop to dissociate rendering parameters and computing parameters. Maybe the best way but need to check if this dissociation is very useless
233 243
			// clear the last computing parameters
234
			if(this.parametersHistory.size() > 2)	{
244
			if(this.parametersHistory.size() > 2
245
					
246
					//|| this.getLastParametersFromHistory().isEmpty()
247
					)	{
235 248
				this.clearLastComputingParameters();
236 249
			}
237 250

  
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java (revision 1469)
129 129

  
130 130
			// Extended parameters
131 131
			Composite extendedParametersArea = this.getExtendedParametersGroup();
132
			GridLayout gridLayout = new GridLayout();
133
			gridLayout.numColumns = 3;
134
			extendedParametersArea.setLayout(gridLayout);
132
			((GridLayout)extendedParametersArea.getLayout()).numColumns = 3;
135 133
			
134
//			GridLayout gridLayout = new GridLayout();
135
//			gridLayout.numColumns = 3;
136
//			extendedParametersArea.setLayout(gridLayout);
137
			
136 138
			// Computing listeners
137 139
			ComputeSelectionListener computeSelectionListener = new ComputeSelectionListener(this);
138 140
			ComputeKeyListener computeKeyListener = new ComputeKeyListener(this);
tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesEditor.java (revision 1469)
18 18
import org.eclipse.swt.widgets.Label;
19 19
import org.eclipse.swt.widgets.Spinner;
20 20
import org.eclipse.swt.widgets.Text;
21
import org.txm.core.messages.TXMCoreMessages;
21 22
import org.txm.core.results.Parameter;
22 23
import org.txm.properties.core.functions.Properties;
23 24
import org.txm.properties.core.preferences.PropertiesPreferences;
......
60 61
	@Override
61 62
	public void _createPartControl() {
62 63

  
63
		Composite parametersArea = this.getExtendedParametersGroup();
64
		// Extended parameters
65
		Composite extendedParametersArea = this.getExtendedParametersGroup();
66
		((GridLayout)extendedParametersArea.getLayout()).numColumns = 2;
64 67

  
65 68
		// label
66
		new Label(parametersArea, SWT.NONE).setText(PropertiesUIMessages.vMax);
69
		Label vMaxLabel = new Label(extendedParametersArea, SWT.NONE);
70
		vMaxLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
71
		vMaxLabel.setText(PropertiesUIMessages.vMax);
67 72

  
68 73
		// spinner
69
		this.maxPropertiesToDisplay = new Spinner(parametersArea, SWT.BORDER);
74
		this.maxPropertiesToDisplay = new Spinner(extendedParametersArea, SWT.BORDER);
70 75
		this.maxPropertiesToDisplay.setToolTipText(PropertiesUIMessages.theMaximumNumberOfWordPropertyValuesToShow);
71 76
		this.maxPropertiesToDisplay.setMinimum(0);
72 77
		this.maxPropertiesToDisplay.setMaximum(1000);
73
		RowData gdata = new RowData();
74
		gdata.width = 100;
75
		this.maxPropertiesToDisplay.setLayoutData(gdata);
78
		GridData data = new GridData(SWT.LEFT, SWT.CENTER, false, false);
79
		data.minimumWidth = 100;
80
		
81
//		RowData data = new RowData();
82
//		data.width = 100;
83
		this.maxPropertiesToDisplay.setLayoutData(data);
84
		
76 85
		this.maxPropertiesToDisplay.addSelectionListener(new ComputeSelectionListener(this));
77 86

  
78 87
		Group editComposite = this.getTopToolbar().installGroup(PropertiesUIMessages.corpusProperties, PropertiesUIMessages.corpusProperties, IImageKeys.PENCIL, null, false);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java (revision 1469)
9 9
import org.eclipse.swt.events.SelectionEvent;
10 10
import org.eclipse.swt.events.SelectionListener;
11 11
import org.eclipse.swt.layout.GridData;
12
import org.eclipse.swt.layout.GridLayout;
12 13
import org.eclipse.swt.layout.RowLayout;
13 14
import org.eclipse.swt.widgets.Composite;
14 15
import org.eclipse.swt.widgets.Control;
......
246 247
		final Group group = new Group(subWidgetComposite, SWT.NONE);
247 248
		group.setText(groupTitle);
248 249

  
249
		RowLayout layout = new RowLayout();
250
		layout.wrap = true;
251
		layout.center = true;
252
		layout.spacing = 8;
250
		// FIXME: SJ: new version to avoid to redefine the grid layout in each subclasses editors
251
		GridLayout layout = new GridLayout();
253 252
		layout.marginWidth = layout.marginBottom = layout.marginHeight = layout.marginTop = 0;
253

  
254
		// FIXME: SJ: old version
255
//		RowLayout layout = new RowLayout();
256
//		layout.wrap = true;
257
//		layout.center = true;
258
//		layout.spacing = 8;
259
//		layout.marginWidth = layout.marginBottom = layout.marginHeight = layout.marginTop = 0;
254 260
		group.setLayout(layout);
255 261

  
256 262
		GridData gd2 = new GridData(GridData.FILL_BOTH);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/ThresholdsGroup.java (revision 1469)
115 115
		gridLayout.makeColumnsEqualWidth = false;
116 116
		this.setLayout(gridLayout);
117 117

  
118
		
119
		GridData fieldsGridData = new GridData(SWT.LEFT, SWT.CENTER, false, false);
120
		fieldsGridData.minimumWidth = 100;
121
		
118 122
		// Fmin
119 123
		this.fMinLabel = new Label(this, SWT.NONE);
120 124
		this.fMinLabel.setText(TXMCoreMessages.common_fMin);
121
		this.fMinLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
125
		this.fMinLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
122 126

  
123
		GridData fieldsGridData = new GridData(GridData.VERTICAL_ALIGN_END);
124
		fieldsGridData.minimumWidth = 100;
125

  
126 127
		fMinSpinner = new Spinner(this, SWT.BORDER);
127 128
		fMinSpinner.setMinimum(0);
128 129
		fMinSpinner.setMaximum(9999999);
......
134 135
		if(displayFMax)	{
135 136
			this.fMaxLabel = new Label(this, SWT.NONE);
136 137
			this.fMaxLabel.setText(TXMCoreMessages.common_fMax);
137
			this.fMaxLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
138
			this.fMaxLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
138 139
	
139 140
			fMaxSpinner = new Spinner(this, SWT.BORDER);
140 141
			fMaxSpinner.setMinimum(0);
......
147 148
		// Vmax
148 149
		this.vMaxLabel = new Label(this, SWT.NONE);
149 150
		this.vMaxLabel.setText(TXMCoreMessages.common_vMax);
150
		this.vMaxLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
151
		this.vMaxLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
151 152

  
152 153
		vMaxSpinner = new Spinner(this, SWT.BORDER);
153 154
		vMaxSpinner.setMinimum(0);
tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 1469)
1453 1453
		// look in the global alternative preferences nodes
1454 1454
		else if(!keyExists("instance/" + nodePath, key))	{
1455 1455
			for(int i = 0; i < alternativeNodesQualifiers.size(); i++) {
1456
				if(keyExists(alternativeNodesQualifiers.get(i), key))	{
1457
					nodePath = alternativeNodesQualifiers.get(i);
1456
				if(keyExists("instance/" + alternativeNodesQualifiers.get(i), key))	{
1457
					nodePath = "instance/" + alternativeNodesQualifiers.get(i);
1458 1458
					break;
1459 1459
				}
1460 1460
			}
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 1469)
95 95
	protected boolean dirty = true;
96 96
	
97 97
	/**
98
	 * if frozen, the result is not updated when computed
98
	 * If locked, the result is not updated when computed.
99 99
	 */
100 100
	@Parameter(key=TXMPreferences.LOCK, type=Parameter.INTERNAL)
101 101
	protected boolean locked = false;
......
332 332
	}
333 333
	
334 334
	/**
335
	 * Freezes the result -> cannot be recomputed.
335
	 * Locks the result -> cannot be recomputed.
336 336
	 */
337 337
	public void lock() {
338 338
		this.locked = true;
339 339
	}
340 340
	
341 341
	/**
342
	 * Unfreezes the result -> can be recomputed.
342
	 * Unlocks the result -> can be recomputed.
343 343
	 */
344 344
	public void unLock() {
345 345
		this.locked = false;
346 346
	}
347 347

  
348 348
	/**
349
	 * Freezes/unfreezes the result.
349
	 * Locks/unlocks the result.
350 350
	 */
351 351
	public void setLocked(boolean state) {
352 352
		this.locked = state;
353 353
	}
354 354
	
355 355
	/**
356
	 * @return true if the resutl is frozen
356
	 * @return true if the result is locked
357 357
	 */
358 358
	public boolean isLocked() {
359 359
		return this.locked;
......
2023 2023
	protected boolean compute(IProgressMonitor monitor, boolean deepComputing) {
2024 2024

  
2025 2025
		// no changes to do
2026
		// FIXME: SJ: we need to do do some actions even if the object is frozen, eg. updating parameters, saving parameters, etc.
2026
		// FIXME: SJ: we need to do do some actions even if the object is locked, eg. updating parameters, saving parameters, etc.
2027 2027
		// FIXME MD: nope the parameters must not move and will be saved in the current state
2028 2028
		if (hasBeenComputedOnce && locked) {
2029 2029
			return true;
tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/handlers/ComputePartitionDimensionsBarChart.java (revision 1469)
27 27
//
28 28
package org.txm.partition.rcp.handlers;
29 29

  
30
import java.awt.Font;
31
import java.io.File;
32

  
30 33
import org.eclipse.core.commands.ExecutionEvent;
31 34
import org.eclipse.core.commands.ExecutionException;
35
import org.eclipse.swt.widgets.Display;
32 36
import org.txm.chartsengine.rcp.editors.ChartEditor;
33 37
import org.txm.partition.core.functions.PartitionDimensions;
34 38
import org.txm.rcp.handlers.BaseAbstractHandler;
35 39
import org.txm.searchengine.cqp.corpus.Partition;
40
import org.txm.utils.logger.Log;
36 41

  
37 42

  
38 43
/**
......
45 50
public class ComputePartitionDimensionsBarChart extends BaseAbstractHandler {
46 51

  
47 52

  
48
	/* (non-Javadoc)
49
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
50
	 */
51 53
	@Override
52 54
	public Object execute(ExecutionEvent event) throws ExecutionException {
53 55
		
......
75 77
		else	{
76 78
			return super.logCanNotExecuteCommand(selection);
77 79
		}
78
		
79
		// FIXME: Pie chart tests
80
//		partitionDimensions.setChartType("Partition Dimensions Pie Chart"); //$NON-NLS-1$
81
		
80

  
82 81
		ChartEditor.openEditor(partitionDimensions);
83 82

  
83
		// Load Java embedded fonts from JRE to SWT		
84
//		Display.getDefault().syncExec(new Runnable() {
85
//		    public void run() {
86
//
87
//				File javaFontsPath = new File(System.getProperty("java.home")
88
//						+ System.getProperty("file.separator") + "lib"
89
//						+ System.getProperty("file.separator") + "fonts"
90
//						+ System.getProperty("file.separator"));
91
//
92
//				String[] fontFiles = javaFontsPath.list(); 
93
//				
94
//				for (int i = 0; i < fontFiles.length; i++) {
95
//					
96
//					if(fontFiles[i].endsWith(".ttf"))	{ //$NON-NLS-1$
97
//						
98
//						File fontFile = new File(javaFontsPath, fontFiles[i]);
99
//						
100
//						Log.finest("Loading Java font to SWT Device from file " + fontFile + "...");
101
//					
102
//						// Load the font in SWT
103
//						Display.getDefault().loadFont(fontFile.getAbsolutePath());
104
//					}
105
//					
106
//				}
107
//		    }
108
//		});
109
		
84 110
		return null;
85 111
	}
86 112
	

Formats disponibles : Unified diff