Revision 2584 org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultStraightLine.java

View differences:

DefaultStraightLine.java
31 31
import java.awt.event.MouseEvent;
32 32
import java.awt.image.MemoryImageSource;
33 33
import java.util.ArrayList;
34
import java.util.List;
34 35

  
36
import org.gvsig.raster.swing.gcanvas.DrawableElement;
35 37
import org.gvsig.raster.swing.gcanvas.StraightLine;
36 38
import org.gvsig.raster.swing.impl.canvas.DefaultGCanvas;
37 39
import org.gvsig.raster.swing.impl.canvas.layer.DefaultInfoLayer;
......
39 41
 * Representa una linea recta con puntos de arrastre para la ecualizaci?n de
40 42
 * un histograma y realce lineales y dencity slicing.
41 43
 *
42
 * 14-oct-2007
43 44
 * @author Nacho Brodin (nachobrodin@gmail.com)
44 45
 */
45
@SuppressWarnings("unchecked")
46 46
public class DefaultStraightLine extends DefaultBaseFunction implements StraightLine {
47 47

  
48 48
	/**
49 49
	 * Representa un punto seleccionado sobre el canvas. Este es
50 50
	 * dibujado como un peque?o cuadrado.
51 51
	 *
52
	 * 14-oct-2007
53 52
	 * @author Nacho Brodin (nachobrodin@gmail.com)
54 53
	 */
55 54
	class Square {
......
172 171
	/**
173 172
	 * Lista de cuadrados que intersectan con la recta
174 173
	 */
175
	protected ArrayList listSquare        = new ArrayList();
176
	private int         pointDragged      = -1;
177
	private Cursor      transparentCursor = null;
178
	private boolean     showSquares       = true;
179
	private int         border            = 2;
174
	protected List<Square> listSquare        = new ArrayList<Square>();
175
	private int            pointDragged      = -1;
176
	private Cursor         transparentCursor = null;
177
	private boolean        showSquares       = true;
178
	private int            border            = 2;
180 179
	
181 180
	/**
182 181
	 * Constructor. Asigna el color
......
193 192
		addSquare(1.0D, 1.0D);
194 193
	}
195 194

  
196
	/*
197
	 * (non-Javadoc)
198
	 * @see org.gvsig.raster.swing.gcanvas.StraightLine#clearSquares()
199
	 */
200 195
	public void clearSquares() {
201 196
		listSquare.clear();
202 197
	}
203 198

  
204
	/*
205
	 * (non-Javadoc)
206
	 * @see org.gvsig.raster.swing.gcanvas.StraightLine#addSquare(double, double)
207
	 */
208 199
	public void addSquare(double x, double y) {
209 200
		listSquare.add(new Square(x, y));
210 201
	}
......
258 249
	 * @param square
259 250
	 */
260 251
	private void setInfoPoint(int point) {
261
		ArrayList list = canvas.getDrawableElements(DefaultInfoLayer.class);
252
		List<DrawableElement> list = canvas.getDrawableElements(DefaultInfoLayer.class);
262 253
		if (list.size() > 0) {
263 254
			DefaultInfoLayer infoLayer = (DefaultInfoLayer) list.get(0);
264 255
			if (point != -1) {
......
425 416
	 * Variable para saber si se ha visualizado alguna informacion
426 417
	 */
427 418
	boolean last = false;
428
	/*
429
	 * (non-Javadoc)
430
	 * @see org.gvsig.raster.beans.canvas.DrawableElement#mouseMoved(java.awt.event.MouseEvent)
431
	 */
419

  
432 420
	public boolean mouseMoved(MouseEvent e) {
433 421
		for (int i = 0; i < listSquare.size(); i++) {
434 422
			if (((Square)listSquare.get(i)).isInside(e.getPoint())) {
......
447 435
		return true;
448 436
	}
449 437

  
450
	/*
451
	 * (non-Javadoc)
452
	 * @see org.gvsig.raster.swing.gcanvas.StraightLine#getInValues(double, double)
453
	 */
454 438
	public double[] getInValues(double min, double max) {
455 439
		double[] in = getPercentInValues(); 
456 440
		for (int i = 0; i < in.length; i++)
......
458 442
		return in;
459 443
	}
460 444

  
461
	/*
462
	 * (non-Javadoc)
463
	 * @see org.gvsig.raster.swing.gcanvas.StraightLine#getOutValues()
464
	 */
465 445
	public int[] getOutValues() {
466 446
		double[] values = getPercentOutValues(); 
467 447
		int[] out = new int[values.length];
......
470 450
		return out;
471 451
	}
472 452

  
473
	/*
474
	 * (non-Javadoc)
475
	 * @see org.gvsig.raster.swing.gcanvas.StraightLine#getPercentInValues()
476
	 */
477 453
	public double[] getPercentInValues() {
478 454
		double[] in = new double[listSquare.size() + 2];
479 455
		for (int i = 0; i < listSquare.size(); i++) {
......
485 461
		return in;
486 462
	}
487 463

  
488
	/*
489
	 * (non-Javadoc)
490
	 * @see org.gvsig.raster.swing.gcanvas.StraightLine#getPercentOutValues()
491
	 */
492 464
	public double[] getPercentOutValues() {
493 465
		double[] out = new double[listSquare.size() + 2];
494 466
		for (int i = 0; i < listSquare.size(); i++) {
......
526 498
		return (1.0D - ((double) (pixel - canvas.getCanvasMinY() - border) / div));
527 499
	}
528 500
	
529
	/*
530
	 * (non-Javadoc)
531
	 * @see org.gvsig.raster.swing.gcanvas.StraightLine#getFunctionType()
532
	 */
533 501
	public int getFunctionType() {
534 502
		return 0;
535 503
	}

Also available in: Unified diff