Revision 2712

tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java (revision 2712)
269 269
			this.fMinSpinner = thresholdsGroup.getFMinSpinner();
270 270
			this.fMaxSpinner = thresholdsGroup.getFMaxSpinner();
271 271
			this.vMaxSpinner = thresholdsGroup.getVMaxSpinner();
272
			this.vMaxSpinner.setMinimum(1);
272
			this.vMaxSpinner.setMinimum(2);
273 273
		}
274 274
		
275 275
		this.chartToolBar.pack();
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java (revision 2712)
208 208
				this.fMinSpinner = thresholdsGroup.getFMinSpinner();
209 209
				this.fMaxSpinner = thresholdsGroup.getFMaxSpinner();
210 210
				this.vMaxSpinner = thresholdsGroup.getVMaxSpinner();
211
				this.vMaxSpinner.setMinimum(1);
211
				this.vMaxSpinner.setMinimum(2);
212 212
			}
213 213
			
214 214
		}
tmp/org.txm.ahc.rcp/src/org/txm/ahc/rcp/editors/AHCEditor.java (revision 2712)
156 156
			ThresholdsGroup thresholdsGroup = new ThresholdsGroup(this.getExtendedParametersGroup(), SWT.NONE, this, true, false);
157 157
			this.fMinSpinner = thresholdsGroup.getFMinSpinner();
158 158
			this.vMaxSpinner = thresholdsGroup.getVMaxSpinner();
159
			this.vMaxSpinner.setMinimum(1);
159
			this.vMaxSpinner.setMinimum(2);
160 160
		}
161 161
	}
162 162
	
tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/PartitionIndexEditor.java (revision 2712)
167 167
	public void _createPartControl() {
168 168
		
169 169
		
170
		this.index = (PartitionIndex) this.getResult();
170
		this.index = this.getResult();
171 171
		
172 172
		// Computing listeners
173 173
		ComputeSelectionListener computeSelectionListener = new ComputeSelectionListener(this);
......
216 216
		
217 217
		
218 218
		// Word properties selector
219
		propertiesSelector = new PropertiesSelector<WordProperty>(this.getMainParametersComposite(), SWT.NONE);
219
		propertiesSelector = new PropertiesSelector<>(this.getMainParametersComposite(), SWT.NONE);
220 220
		propertiesSelector.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
221 221
		propertiesSelector.setLayout(new GridLayout(3, false));
222 222
		try {
......
301 301
		this.fMaxSpinner = thresholdsGroup.getFMaxSpinner();
302 302
		this.vMaxSpinner = thresholdsGroup.getVMaxSpinner();
303 303
		
304
		
305
		
306
		
307 304
		Label lNLigneppage = new Label(this.getExtendedParametersGroup(), SWT.NONE);
308 305
		lNLigneppage.setText(IndexUIMessages.pageSize);
309 306
		
......
600 597
			lines = index.getLines(from, to);
601 598
		}
602 599
		else {
603
			lines = new ArrayList<Line>();
600
			lines = new ArrayList<>();
604 601
		}
605 602
		
606 603
		navigationArea.setInfoLineText("" + (from + 1), //$NON-NLS-1$
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/MatrixImpl.java (revision 2712)
359 359
			}
360 360
		}
361 361
		
362
		ifmin = Math.max(1, Math.min(nlines, ifmin));
362
		ifmin = Math.max(1, ifmin);
363 363
		ifmax = Math.max(1, ifmax);
364
		
365
		if ((ifmin - ifmax) >= nlines) { // too much lines, cutting fmin lines
366
			ifmin = ifmax + nlines - 1;
367
		}
364 368
		// cut
365 369
		
366
		cut(ifmax, ifmin); // ifmax is always < to fmin, because of the decreasing loop index
367
		
370
		if (ifmax <= ifmin) {
371
			cut(ifmax, ifmin); // ifmax is always < to fmin, because of the decreasing loop index
372
		}
368 373
	}
369 374
	
370 375
	/**
......
382 387
		if (before < 1) before = 1;
383 388
		
384 389
		try {
385
			// cut nlines
386
			REXP r = rw.eval(symbol + "<- " + symbol + "[" + before + ":" + (after) + ", ];"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
390
			// // cut nlines
391
			if (before != after) {
392
				REXP r = rw.eval(symbol + "<- " + symbol + "[" + before + ":" + (after) + ", ];"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
393
			}
394
			else {
395
				REXP r = rw.eval(symbol + "<- " + "as.matrix(" + symbol + "[" + before + ", ]);"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
396
			}
387 397
			// getRowNames().cut(before, after);
388 398
			// this.nrow = nlines;
389 399
		}
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 2712)
261 261
			throw new IllegalArgumentException("Index is not computed with a partition. Aborting."); //$NON-NLS-1$
262 262
		}
263 263
		
264
		if (!this.property.getFullName().equals(partIndex.getProperties().get(0).getFullName())) {
265
			Log.info(NLS.bind("The Lexical table @{0} word property has been ignored. The index {1} properties are used.", this.property, WordProperty.asString(partIndex.getProperties())));
266
		}
267
		
268
		if (partIndex.size() <= 1 && !this.useAllOccurrences) { // cant buid LT of one line. If the #REST line is added, we'll have 2 lines \o/
269
			Log.warning("Error: cannot build a lexical table with less than 2 lines");
270
			return null;
271
		}
272
		
264 273
		this.property = partIndex.getProperties().get(0);
265 274
		
266 275
		HashMap<String, Line> alllines = new HashMap<>();
tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java (revision 2712)
621 621
		return getLines(0, lines.size());
622 622
	}
623 623
	
624
	public int size() {
625
		return lines.size();
626
	}
627
	
624 628
	/**
625 629
	 * update the lines counts.
626 630
	 */
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java (revision 2712)
131 131
			}
132 132
			
133 133
			final PartitionIndex firstIndex = partitionIndexes.get(0);
134
			
135
			if (!useAllOccurrences && firstIndex.size() <= 1) {
136
				Log.warning("Error: cannot build a lexical table with less than 2 lines");
137
				return false;
138
			}
139
			
134 140
			Partition firstPartition = firstIndex.getPartition();
135 141
			for (PartitionIndex partitionIndex : partitionIndexes) {
136 142
				if (!firstPartition.equals(partitionIndex.getPartition())) {
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java (revision 2712)
233 233
			this.fMinSpinner = thresholdsGroup.getFMinSpinner();
234 234
			this.fMaxSpinner = thresholdsGroup.getFMaxSpinner();
235 235
			this.vMaxSpinner = thresholdsGroup.getVMaxSpinner();
236
			this.vMaxSpinner.setMinimum(1);
236
			this.vMaxSpinner.setMinimum(2); // LT won't work with 1 line only
237 237
			
238 238
			// Merge or delete columns button
239 239
			mergeDeleteColumnsButton = new Button(extendedParametersArea, SWT.PUSH);

Also available in: Unified diff