Revision 2587 org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedListener.java
EnhancedListener.java | ||
---|---|---|
53 | 53 |
import org.gvsig.raster.swing.gcanvas.GraphicHistogram; |
54 | 54 |
import org.gvsig.raster.swing.gcanvas.IGCanvasListener; |
55 | 55 |
import org.gvsig.raster.swing.gcanvas.LogaritmicExponentialLine; |
56 |
import org.gvsig.raster.swing.gcanvas.MinMaxLines; |
|
57 | 56 |
import org.gvsig.raster.swing.gcanvas.SquareRootPowLine; |
58 | 57 |
import org.gvsig.raster.swing.gcanvas.StraightLine; |
59 | 58 |
import org.gvsig.raster.tools.app.basic.RasterToolsUtil; |
... | ... | |
333 | 332 |
* Removes the first and the last point if the coordinate X don't change. |
334 | 333 |
* @param pointList |
335 | 334 |
*/ |
336 |
private void simplifyPointList(List<Point2D> pointList) {
|
|
335 |
private double[] simplifyPointList(List<Point2D> pointList) {
|
|
337 | 336 |
int lastPoint = pointList.size() - 1; |
337 |
double[] removed = new double[2]; |
|
338 | 338 |
if(pointList.size() > 1) { |
339 | 339 |
if(pointList.get(lastPoint).getX() == 1 && |
340 | 340 |
pointList.get(lastPoint).getY() == 1 && |
341 | 341 |
pointList.get(lastPoint - 1).getY() == 1) { |
342 |
pointList.remove(lastPoint);
|
|
342 |
removed[0] = pointList.remove(lastPoint).getX();
|
|
343 | 343 |
} |
344 | 344 |
} |
345 | 345 |
|
... | ... | |
347 | 347 |
if(pointList.get(0).getX() == 0 && |
348 | 348 |
pointList.get(0).getY() == 0 && |
349 | 349 |
pointList.get(1).getY() == 0) { |
350 |
pointList.remove(0);
|
|
350 |
removed[1] = pointList.remove(0).getX();
|
|
351 | 351 |
} |
352 | 352 |
} |
353 |
return removed; |
|
353 | 354 |
} |
354 | 355 |
|
355 | 356 |
/** |
... | ... | |
383 | 384 |
((DrawableElement)status.getBaseFunction()).getColor()); |
384 | 385 |
((StraightLine) baseFunction).clearSquares(); |
385 | 386 |
List<Point2D> pointList = getPointListFromStretches(stretch); |
387 |
//linesLayer.setMinimum(pointList.get(0).getX()); |
|
388 |
//linesLayer.setMaximum(pointList.get(pointList.size() - 1).getX()); |
|
386 | 389 |
|
387 | 390 |
StraightLine func = ((StraightLine) baseFunction); |
391 |
//((DefaultBaseFunction)func).setMinX(prueba[0]); |
|
392 |
//((DefaultBaseFunction)func).setMaxX(prueba[1]); |
|
393 |
|
|
388 | 394 |
for (int i = 0; i < pointList.size(); i++) { |
389 | 395 |
func.addSquare(pointList.get(i).getX(), pointList.get(i).getY()); |
390 | 396 |
} |
Also available in: Unified diff