Revision 19361 trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/beans/canvas/layers/MinMaxLines.java
MinMaxLines.java | ||
---|---|---|
35 | 35 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
36 | 36 |
*/ |
37 | 37 |
public class MinMaxLines extends DrawableElement { |
38 |
private int smallLine = 5; |
|
39 |
|
|
40 | 38 |
/** |
41 |
* Representa el borde de separacion para los limites
|
|
39 |
* Representa el borde de separacion para los limites |
|
42 | 40 |
*/ |
43 |
private int border = 2; |
|
44 |
|
|
45 |
private double minPos = 0.0D; |
|
46 |
private double maxPos = 1.0D; |
|
41 |
private int border = 2; |
|
47 | 42 |
|
43 |
private double minPos = 0.0D; |
|
44 |
private double maxPos = 1.0D; |
|
45 |
|
|
48 | 46 |
private boolean minSelected = false; |
49 | 47 |
private boolean maxSelected = false; |
50 | 48 |
/** |
... | ... | |
120 | 118 |
* Inicializamos el punto arrastrado a un valor fuera del array |
121 | 119 |
*/ |
122 | 120 |
public boolean mouseReleased(MouseEvent e) { |
123 |
if (actionsManager != null && (minSelected != false || maxSelected != false ))
|
|
124 |
actionsManager.end(new double[] { getMinDistance(), getMaxDistance() });
|
|
121 |
if (canvas != null && (minSelected != false || maxSelected != false ))
|
|
122 |
canvas.callDataChanged("minmax", this);
|
|
125 | 123 |
minSelected = false; |
126 | 124 |
maxSelected = false; |
127 | 125 |
return true; |
... | ... | |
131 | 129 |
* Cuando se ha pinchado un punto y se arrastra se define aqu? su comportamiento. |
132 | 130 |
*/ |
133 | 131 |
public boolean mouseDragged(MouseEvent e) { |
132 |
if (canvas == null) |
|
133 |
return true; |
|
134 |
|
|
134 | 135 |
if (minSelected) { |
135 | 136 |
minPos = pixelToValue(e.getX()); |
136 | 137 |
if (minPos < 0) |
... | ... | |
140 | 141 |
if (minPos > maxPos) |
141 | 142 |
maxPos = minPos; |
142 | 143 |
canvas.repaint(); |
144 |
canvas.callDataDragged("minmax", this); |
|
143 | 145 |
return false; |
144 | 146 |
} |
145 | 147 |
if (maxSelected) { |
... | ... | |
151 | 153 |
if (maxPos < minPos) |
152 | 154 |
minPos = maxPos; |
153 | 155 |
canvas.repaint(); |
156 |
canvas.callDataDragged("minmax", this); |
|
154 | 157 |
return false; |
155 | 158 |
} |
156 | 159 |
return true; |
... | ... | |
195 | 198 |
public double getMaxDistance() { |
196 | 199 |
return maxPos * 100.0D; |
197 | 200 |
} |
198 |
|
|
199 |
public void setMax(double max) { |
|
200 |
//maxDistance = max |
|
201 |
} |
|
202 |
|
|
203 |
public void setMin(double min) { |
|
204 |
double value = (min * canvas.getCanvasWidth()) / 100; |
|
205 |
|
|
206 |
} |
|
207 |
} |
|
201 |
} |
Also available in: Unified diff