Revision 2147
trunk/extensions/extWCS/src/com/iver/cit/gvsig/gui/Panels/PropertiesWCSDialog.java | ||
---|---|---|
425 | 425 |
|
426 | 426 |
//Filtro lineal seleccionado |
427 | 427 |
if( this.getEnhancedPanel().getLinealDirectoRadioButton().isSelected()){ |
428 |
stackManager.addEnhancedFilter(); |
|
428 |
if(contentPane.getEnhancedPanel().getRemoveCheck().isSelected()) |
|
429 |
stackManager.addEnhancedFilter(true); |
|
430 |
else |
|
431 |
stackManager.addEnhancedFilter(false); |
|
429 | 432 |
|
430 | 433 |
//Recorte de colas seleccionado |
431 | 434 |
if(this.getEnhancedPanel().getTailCheck().isSelected()){ |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/Rasterizer.java | ||
---|---|---|
51 | 51 |
Extent ext = null; |
52 | 52 |
|
53 | 53 |
if(viewPortBlock == null)//Primer bloque |
54 |
ext = new Extent( vp.getExtent().minX(),
|
|
55 |
vp.getExtent().maxY(),
|
|
56 |
vp.getExtent().maxX(),
|
|
57 |
vp.getExtent().maxY()-wcIntervalo);
|
|
54 |
ext = new Extent( Math.round(vp.getExtent().minX()),
|
|
55 |
Math.round(vp.getExtent().maxY()),
|
|
56 |
Math.round(vp.getExtent().maxX()),
|
|
57 |
Math.round(vp.getExtent().maxY()-wcIntervalo));
|
|
58 | 58 |
else //Bloques siguientes |
59 |
ext = new Extent( vp.getExtent().minX(),
|
|
60 |
vp.getExtent().minY(),
|
|
61 |
vp.getExtent().maxX(),
|
|
62 |
vp.getExtent().minY()-wcIntervalo);
|
|
59 |
ext = new Extent( Math.round(vp.getExtent().minX()),
|
|
60 |
Math.round(vp.getExtent().minY()),
|
|
61 |
Math.round(vp.getExtent().maxX()),
|
|
62 |
Math.round(vp.getExtent().minY()-wcIntervalo));
|
|
63 | 63 |
|
64 | 64 |
viewPortBlock = new ViewPortData( vp.getProjection(), |
65 | 65 |
ext, |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/EcwFile.java | ||
---|---|---|
706 | 706 |
boolean order = true; |
707 | 707 |
|
708 | 708 |
if(img==null){ //Caso en el que se crea un Image |
709 |
System.out.println("SE CREA UN NUEVO IMAGE"); |
|
709 | 710 |
Image ecwImage = null; |
710 | 711 |
for (int nChunk=0; nChunk<frames.length; nChunk++) { |
711 | 712 |
ChunkFrame f = frames[nChunk]; |
... | ... | |
733 | 734 |
System.out.println("Leido al "+lastRefreshPercent+" %."); |
734 | 735 |
return ecwImage; |
735 | 736 |
}else{ //Caso en el que se actualiza una banda del Image |
737 |
System.out.println("SE ACTUALIZA UNA BANDA DEL IMAGE"); |
|
736 | 738 |
for (int nChunk=0; nChunk<frames.length; nChunk++) { |
737 | 739 |
ChunkFrame f = frames[nChunk]; |
738 | 740 |
if(bandCount!=3) |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/LinearEnhancementShortFilter.java | ||
---|---|---|
20 | 20 |
|
21 | 21 |
this.raster = (RasterBuf)params.get("raster"); |
22 | 22 |
this.stats = (RasterStats)params.get("stats"); |
23 |
this.removeExtrema = ((Boolean)params.get("remove")).booleanValue(); |
|
23 | 24 |
height = raster.getHeight(); |
24 | 25 |
width = raster.getWidth(); |
25 | 26 |
super.pre(); |
... | ... | |
29 | 30 |
raster.getElemInt(x, y, px); |
30 | 31 |
int bandsCnt = 3; // Esto hay que sacarlo de fuera, l?gicamente. |
31 | 32 |
for (int i=0; i<bandsCnt; i++) { |
32 |
if ( px[i] > stats.maxBandValue[i] )
|
|
33 |
px[i] = stats.maxBandValue[i];
|
|
34 |
else if (px[i] < stats.minBandValue[i] )
|
|
35 |
px[i] = stats.minBandValue[i];
|
|
33 |
if ( px[i] > maxBandValue[i] ) |
|
34 |
px[i] = maxBandValue[i]; |
|
35 |
else if (px[i] < minBandValue[i] ) |
|
36 |
px[i] = minBandValue[i]; |
|
36 | 37 |
|
37 | 38 |
px[i] = (((int) (((double)px[i])*scale[i] + offset[i])) & 0xff); |
38 | 39 |
} |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/ComputeMinMaxShortFilter.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
public void process(int x, int y) { |
29 | 29 |
raster.getElemInt(x, y, px); |
30 |
for (int i=0; i<3; i++) { |
|
30 |
/*for (int i=0; i<3; i++) {
|
|
31 | 31 |
min[i] = Math.min(min[i], px[i]); |
32 | 32 |
max[i] = Math.max(max[i], px[i]); |
33 |
} |
|
33 |
}*/ |
|
34 |
int pxBand = px[2]; |
|
35 |
if(pxBand<min[0]){ |
|
36 |
secondMin[0] = min[0]; |
|
37 |
min[0] = pxBand; |
|
38 |
}else if(pxBand < secondMin[0] && pxBand!=min[0]) |
|
39 |
secondMin[0] = pxBand; |
|
40 |
|
|
41 |
if(pxBand>max[0]){ |
|
42 |
secondMax[0] = max[0]; |
|
43 |
max[0] = pxBand; |
|
44 |
}else if(pxBand > secondMax[0] && pxBand!=max[0]) |
|
45 |
secondMax[0] = pxBand; |
|
46 |
|
|
47 |
pxBand = px[1]; |
|
48 |
if(pxBand<min[1]){ |
|
49 |
secondMin[1] = min[1]; |
|
50 |
min[1] = pxBand; |
|
51 |
}else if(pxBand < secondMin[1] && pxBand!=min[1]) |
|
52 |
secondMin[1] = pxBand; |
|
53 |
|
|
54 |
if(pxBand>max[1]){ |
|
55 |
secondMax[1] = max[1]; |
|
56 |
max[1] = pxBand; |
|
57 |
}else if(pxBand > secondMax[1] && pxBand!=max[1]) |
|
58 |
secondMax[1] = pxBand; |
|
59 |
|
|
60 |
pxBand = px[0]; |
|
61 |
if(pxBand<min[2]){ |
|
62 |
secondMin[2] = min[2]; |
|
63 |
min[2] = pxBand; |
|
64 |
}else if(pxBand < secondMin[2] && pxBand!=min[2]) |
|
65 |
secondMin[2] = pxBand; |
|
66 |
|
|
67 |
if(pxBand>max[2]){ |
|
68 |
secondMax[2] = max[2]; |
|
69 |
max[2] = pxBand; |
|
70 |
}else if(pxBand > secondMax[2] && pxBand!=max[2]) |
|
71 |
secondMax[2] = pxBand; |
|
34 | 72 |
} |
35 | 73 |
|
36 | 74 |
public int getInRasterDataType(){ |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/PercentTailTrimFilter.java | ||
---|---|---|
115 | 115 |
q.quicksort(sample[i]); |
116 | 116 |
|
117 | 117 |
//Si est? marcada la opci?n removeMaxValue se calcula la posici?n en la que el m?ximo valor |
118 |
//y el m?nimo ya no estan teniendo as? un subconjunto del vector que elimina estos valores |
|
118 |
//y el m?nimo ya no estan, teniendo as? un subconjunto del vector que elimina estos valores
|
|
119 | 119 |
|
120 | 120 |
if(removeMaxValue){ |
121 | 121 |
for(int i=0; i<sample[0].length;i++){ |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/RasterStats.java | ||
---|---|---|
9 | 9 |
public class RasterStats { |
10 | 10 |
public int [] minBandValue = {Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE}; |
11 | 11 |
public int [] maxBandValue = {Integer.MIN_VALUE,Integer.MIN_VALUE,Integer.MIN_VALUE}; |
12 |
public int [] secondMinBandValue = {Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE}; |
|
13 |
public int [] secondMaxBandValue = {Integer.MIN_VALUE,Integer.MIN_VALUE,Integer.MIN_VALUE}; |
|
12 | 14 |
|
13 | 15 |
public double tailPercent = 0D; //porcentaje de recorte de colas |
14 | 16 |
|
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/LinearEnhancementFilter.java | ||
---|---|---|
12 | 12 |
public abstract class LinearEnhancementFilter extends RasterFilter { |
13 | 13 |
protected double [] scale = new double[3]; |
14 | 14 |
protected double [] offset = new double[3]; |
15 |
protected int [] minBandValue = null; |
|
16 |
protected int [] maxBandValue = null; |
|
17 |
protected boolean removeExtrema = false; |
|
15 | 18 |
|
16 | 19 |
public LinearEnhancementFilter(){ |
17 | 20 |
super(); |
18 | 21 |
} |
19 |
|
|
22 |
|
|
20 | 23 |
public void pre(){ |
24 |
if(removeExtrema){ |
|
25 |
this.minBandValue = stats.secondMinBandValue; |
|
26 |
this.maxBandValue = stats.secondMaxBandValue; |
|
27 |
System.out.println("L27 LINEARENHANCEMENTFILTER ELIMINAR EXTREMOS ACTIVO="+minBandValue[0]+" "+maxBandValue[0]+" "+minBandValue[1]+" "+maxBandValue[1]+" "+minBandValue[2]+" "+maxBandValue[2]); |
|
28 |
}else{ |
|
29 |
this.minBandValue = stats.minBandValue; |
|
30 |
this.maxBandValue = stats.maxBandValue; |
|
31 |
System.out.println("L31 LINEARENHANCEMENTFILTER ELIMINAR EXTREMOS NO ACTIVO="+minBandValue[0]+" "+maxBandValue[0]+" "+minBandValue[1]+" "+maxBandValue[1]+" "+minBandValue[2]+" "+maxBandValue[2]); |
|
32 |
} |
|
21 | 33 |
for (int i=0; i<3; i++) { |
22 |
scale[i] = 255D/(stats.maxBandValue[i]-stats.minBandValue[i]);
|
|
23 |
offset[i] = (255D*stats.minBandValue[i])/(stats.minBandValue[i]-stats.maxBandValue[i]);
|
|
34 |
scale[i] = 255D/(maxBandValue[i]-minBandValue[i]);
|
|
35 |
offset[i] = (255D*minBandValue[i])/(minBandValue[i]-maxBandValue[i]);
|
|
24 | 36 |
} |
25 | 37 |
} |
26 | 38 |
|
... | ... | |
42 | 54 |
} |
43 | 55 |
execute(); |
44 | 56 |
}*/ |
57 |
|
|
58 |
/** |
|
59 |
* Obtiene true si est? activado el flag de eliminar extremos y false si no lo est? |
|
60 |
*/ |
|
61 |
public Boolean getRemoveExtrema(){ |
|
62 |
return new Boolean(removeExtrema); |
|
63 |
} |
|
45 | 64 |
} |
46 | 65 |
|
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/RasterFilterStackManager.java | ||
---|---|---|
248 | 248 |
/** |
249 | 249 |
* A?ade un filtro de realce |
250 | 250 |
*/ |
251 |
public void addEnhancedFilter(){ |
|
251 |
public void addEnhancedFilter(boolean remove){
|
|
252 | 252 |
if(filterStack.isActive(((Integer)typeFilters.get("enhanced")).intValue())) |
253 | 253 |
filterStack.removeFilter(((Integer)typeFilters.get("enhanced")).intValue()); |
254 | 254 |
|
... | ... | |
260 | 260 |
case RasterBuf.TYPE_INT:filtro = new LinearEnhancementShortFilter();break; |
261 | 261 |
} |
262 | 262 |
filtro.addParam("stats", filterStack.getStats()); |
263 |
if(remove) |
|
264 |
filtro.addParam("remove", new Boolean(true)); |
|
265 |
else |
|
266 |
filtro.addParam("remove", new Boolean(false)); |
|
263 | 267 |
filterStack.addFilter(((Integer)typeFilters.get("enhanced")).intValue(), filtro); |
264 | 268 |
this.controlTypes(); |
265 | 269 |
} |
... | ... | |
422 | 426 |
|
423 | 427 |
}else if(rf instanceof LinearEnhancementFilter){ |
424 | 428 |
lista.add("filter.enhanced.active=true"); |
429 |
lista.add("filter.enhanced.remove="+((LinearEnhancementFilter)rf).getRemoveExtrema().toString()); |
|
425 | 430 |
|
426 | 431 |
}else if(rf instanceof ComputeMinMaxFilter){ |
427 | 432 |
lista.add("filter.computeminmax.active=true"); |
428 |
|
|
433 |
|
|
429 | 434 |
}else if(rf instanceof PercentTailTrimFilter){ |
430 | 435 |
lista.add("filter.tail.active=true"); |
431 | 436 |
lista.add("filter.tail.value="+this.getStackStats().tailPercent); |
... | ... | |
478 | 483 |
|
479 | 484 |
if(fil.startsWith("filter.enhanced.active") && getValue(fil).equals("true")){ |
480 | 485 |
filters.remove(filteri); |
481 |
this.addEnhancedFilter(); |
|
486 |
boolean remove = false; |
|
487 |
for(int propFilter=0;propFilter<filters.size();propFilter++){ |
|
488 |
String elem = (String)filters.get(propFilter); |
|
489 |
if(elem.startsWith("filter.enhanced.remove")){ |
|
490 |
this.addEnhancedFilter(Boolean.valueOf(getValue(elem)).booleanValue()); |
|
491 |
filters.remove(propFilter); |
|
492 |
propFilter--; |
|
493 |
} |
|
494 |
} |
|
495 |
|
|
482 | 496 |
this.addComputeMinMaxFilter(); |
483 | 497 |
filteri = -1; |
484 | 498 |
} |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/LinearEnhancementImageFilter.java | ||
---|---|---|
19 | 19 |
//Obtenci?n de par?metros |
20 | 20 |
this.image = (Image)params.get("raster"); |
21 | 21 |
this.stats = (RasterStats)params.get("stats"); |
22 |
this.removeExtrema = ((Boolean)params.get("remove")).booleanValue(); |
|
22 | 23 |
height = image.getHeight(null); |
23 | 24 |
width = image.getWidth(null); |
24 | 25 |
super.pre(); |
... | ... | |
31 | 32 |
((pt & 0xff00) >> 8) & 0xff, pt & 0xff}; |
32 | 33 |
|
33 | 34 |
for (int i=0; i<3; i++) { |
34 |
if (px4[i+1] > stats.maxBandValue[i])
|
|
35 |
px4[i+1] = stats.maxBandValue[i];
|
|
36 |
else if (px4[i+1] < stats.minBandValue[i] )
|
|
37 |
px4[i+1] = stats.minBandValue[i];
|
|
35 |
if (px4[i+1] > maxBandValue[i]) |
|
36 |
px4[i+1] = maxBandValue[i]; |
|
37 |
else if (px4[i+1] < minBandValue[i] ) |
|
38 |
px4[i+1] = minBandValue[i]; |
|
38 | 39 |
px4[i+1] = (((int) (((double)px4[i+1])*scale[i] + offset[i])) & 0xff); |
39 | 40 |
} |
40 | 41 |
((BufferedImage) image).setRGB(x,y, ( |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/ComputeMinMaxFilter.java | ||
---|---|---|
12 | 12 |
public abstract class ComputeMinMaxFilter extends RasterFilter { |
13 | 13 |
protected int [] min = {Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE}; |
14 | 14 |
protected int [] max = {Integer.MIN_VALUE,Integer.MIN_VALUE,Integer.MIN_VALUE}; |
15 |
protected int [] secondMin = {Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE}; |
|
16 |
protected int [] secondMax = {Integer.MIN_VALUE,Integer.MIN_VALUE,Integer.MIN_VALUE}; |
|
17 |
protected int [] tmpMin = {Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE}; |
|
18 |
protected int [] tmpMax = {Integer.MIN_VALUE,Integer.MIN_VALUE,Integer.MIN_VALUE}; |
|
15 | 19 |
|
16 | 20 |
public ComputeMinMaxFilter(){ |
17 | 21 |
super(); |
... | ... | |
28 | 32 |
//Operaciones del filtro concreto |
29 | 33 |
this.min = new int[stats.minBandValue.length]; |
30 | 34 |
this.max = new int[stats.maxBandValue.length]; |
35 |
this.secondMin = new int[stats.minBandValue.length]; |
|
36 |
this.secondMax = new int[stats.maxBandValue.length]; |
|
37 |
this.tmpMin = new int[stats.minBandValue.length]; |
|
38 |
this.tmpMax = new int[stats.maxBandValue.length]; |
|
31 | 39 |
for (int i=0; i<min.length; i++) { |
32 |
min[i] = stats.minBandValue[i];
|
|
33 |
max[i] = stats.maxBandValue[i];
|
|
34 |
} |
|
40 |
secondMin[i] = tmpMin[i] = min[i] = Integer.MAX_VALUE;
|
|
41 |
secondMax[i] = tmpMax[i] = max[i] = Integer.MIN_VALUE;
|
|
42 |
}
|
|
35 | 43 |
} |
36 | 44 |
|
37 | 45 |
/** |
38 | 46 |
* Operaciones que se realizan despu?s de la ejecuci?n del filtro |
39 | 47 |
*/ |
40 | 48 |
public void post(){ |
49 |
|
|
41 | 50 |
for (int i=0; i<3; i++) { |
42 | 51 |
stats.minBandValue[i] = min[i]; |
43 | 52 |
stats.maxBandValue[i] = max[i]; |
53 |
stats.secondMinBandValue[i] = secondMin[i]; |
|
54 |
stats.secondMaxBandValue[i] = secondMax[i]; |
|
55 |
System.out.println("L60 ComputeMinMaxFilter "+min[i]+" "+secondMin[i]); |
|
56 |
System.out.println("L61 ComputeMinMaxFilter "+max[i]+" "+secondMax[i]); |
|
44 | 57 |
} |
45 | 58 |
} |
46 | 59 |
|
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/ComputeMinMaxImageFilter.java | ||
---|---|---|
26 | 26 |
super.pre(); |
27 | 27 |
} |
28 | 28 |
|
29 |
public void process(int x, int y) {
|
|
29 |
public void process(int x, int y){ |
|
30 | 30 |
int px = ((BufferedImage) image).getRGB(x,y); |
31 |
min[0] = Math.min(min[0], (px & 0xff0000) >> 16); |
|
32 |
max[0] = Math.max(max[0], (px & 0xff0000) >> 16); |
|
33 |
min[1] = Math.min(min[1], (px & 0x00ff00) >> 8); |
|
34 |
max[1] = Math.max(max[1], (px & 0x00ff00) >> 8); |
|
35 |
min[2] = Math.min(min[2], (px & 0x0000ff)); |
|
36 |
max[2] = Math.max(max[2], (px & 0x0000ff)); |
|
31 |
|
|
32 |
int pxBand = ((px & 0xff0000) >> 16); |
|
33 |
if(pxBand<min[0]){ |
|
34 |
secondMin[0] = min[0]; |
|
35 |
min[0] = pxBand; |
|
36 |
}else if(pxBand < secondMin[0] && pxBand!=min[0]) |
|
37 |
secondMin[0] = pxBand; |
|
38 |
|
|
39 |
if(pxBand>max[0]){ |
|
40 |
secondMax[0] = max[0]; |
|
41 |
max[0] = pxBand; |
|
42 |
}else if(pxBand > secondMax[0] && pxBand!=max[0]) |
|
43 |
secondMax[0] = pxBand; |
|
44 |
|
|
45 |
pxBand = ((px & 0x00ff00) >> 8); |
|
46 |
if(pxBand<min[1]){ |
|
47 |
secondMin[1] = min[1]; |
|
48 |
min[1] = pxBand; |
|
49 |
}else if(pxBand < secondMin[1] && pxBand!=min[1]) |
|
50 |
secondMin[1] = pxBand; |
|
51 |
|
|
52 |
if(pxBand>max[1]){ |
|
53 |
secondMax[1] = max[1]; |
|
54 |
max[1] = pxBand; |
|
55 |
}else if(pxBand > secondMax[1] && pxBand!=max[1]) |
|
56 |
secondMax[1] = pxBand; |
|
57 |
|
|
58 |
pxBand = (px & 0x0000ff); |
|
59 |
if(pxBand<min[2]){ |
|
60 |
secondMin[2] = min[2]; |
|
61 |
min[2] = pxBand; |
|
62 |
}else if(pxBand < secondMin[2] && pxBand!=min[2]) |
|
63 |
secondMin[2] = pxBand; |
|
64 |
|
|
65 |
if(pxBand>max[2]){ |
|
66 |
secondMax[2] = max[2]; |
|
67 |
max[2] = pxBand; |
|
68 |
}else if(pxBand > secondMax[2] && pxBand!=max[2]) |
|
69 |
secondMax[2] = pxBand; |
|
37 | 70 |
} |
38 | 71 |
|
39 | 72 |
public int getInRasterDataType(){ |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/px/PxRaster.java | ||
---|---|---|
782 | 782 |
//filterStack.setDataTypeInFilter(RasterBuf.TYPE_SHORT); |
783 | 783 |
filterStack.setInitRasterBuf(raster); |
784 | 784 |
|
785 |
//Si la imagen es de 16 bits lleva un filtro de realce por defecto |
|
785 | 786 |
if(stackManager == null){ |
786 | 787 |
stackManager = new RasterFilterStackManager(filterStack); |
787 |
stackManager.addEnhancedFilter(); |
|
788 |
stackManager.addEnhancedFilter(false);
|
|
788 | 789 |
stackManager.removeFilter(stackManager.getTypeFilter("computeminmax")); |
789 | 790 |
stackManager.addTailFilter( this.percentFilterInit, 0D, false); |
790 | 791 |
} |
... | ... | |
795 | 796 |
t2 = new Date().getTime(); |
796 | 797 |
System.out.println("Dibujando PxRaster: "+(t2-t1)/1000D+", secs. Dibujando"); |
797 | 798 |
} else if (geoFile != null && geoFile.length > 1) { // multiFiles |
798 |
//System.out.println("Dibujando PxRaster (Multifile) ... Bands "+geoFile.length);
|
|
799 |
System.out.println("Dibujando PxRaster (Multifile) ... Bands "+geoFile.length); |
|
799 | 800 |
|
800 | 801 |
geoImage = bandSwitch.getBandR().getGeoRasterFile().updateImage |
801 | 802 |
(wImg, hImg, rp, null, 0, 0); |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/FilterRasterDialogPanel.java | ||
---|---|---|
432 | 432 |
pEnhan.getTailText().setText(op); |
433 | 433 |
}catch(NumberFormatException exc){ |
434 | 434 |
System.err.println("Formato no numerico"); |
435 |
pEnhan.getTailText().setText("0"); |
|
435 |
pEnhan.getTailText().setText("0.0");
|
|
436 | 436 |
pEnhan.getTailSlider().setValue(0); |
437 | 437 |
} |
438 | 438 |
} |
... | ... | |
476 | 476 |
pTrans.getOpacityText().setText(String.valueOf(pTrans.getOpacitySlider().getValue())); |
477 | 477 |
|
478 | 478 |
if(e.getSource().equals(pEnhan.getTailSlider())) |
479 |
pEnhan.getTailText().setText(String.valueOf((pEnhan.getTailSlider().getValue()>>1))); |
|
479 |
pEnhan.getTailText().setText(String.valueOf((pEnhan.getTailSlider().getValue()>>1))+".0");
|
|
480 | 480 |
} |
481 | 481 |
|
482 | 482 |
public void focusGained(FocusEvent e) { |
... | ... | |
504 | 504 |
pEnhan.getTailCheck().setEnabled(false); |
505 | 505 |
pEnhan.setActiveTailControl(false); |
506 | 506 |
pEnhan.getSinRealceRadioButton().setSelected(true); |
507 |
pEnhan.getRemoveCheck().setEnabled(false); |
|
507 | 508 |
} |
508 | 509 |
} |
509 | 510 |
|
510 | 511 |
if(e.getSource().equals(pEnhan.getLinealDirectoRadioButton())){ |
511 | 512 |
pEnhan.getTailCheck().setEnabled(true); |
513 |
pEnhan.getRemoveCheck().setEnabled(true); |
|
512 | 514 |
if(pEnhan.getTailCheck().isSelected()){ |
513 | 515 |
pEnhan.setActiveTailControl(true); |
514 | 516 |
} |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/EnhancedPanel.java | ||
---|---|---|
95 | 95 |
|
96 | 96 |
private JPanel jPanel5 = null; |
97 | 97 |
private JSlider jSlider = null; |
98 |
private JLabel jLabel3 = null; |
|
99 | 98 |
private JTextField jTextField = null; |
100 | 99 |
|
101 | 100 |
|
... | ... | |
104 | 103 |
private JLabel jLabel4 = null; |
105 | 104 |
private JPanel jPanel7 = null; |
106 | 105 |
private JLabel jLabel1 = null; |
106 |
private JPanel jPanel8 = null; |
|
107 |
private JPanel jPanel9 = null; |
|
108 |
private JLabel jLabel5 = null; |
|
107 | 109 |
public EnhancedPanel(FilterRasterDialogPanel parent){ |
108 | 110 |
this.parent = parent; |
109 | 111 |
|
... | ... | |
118 | 120 |
private void initialize() { |
119 | 121 |
this.setLayout(new BorderLayout()); |
120 | 122 |
this.setSize(445, 239); |
121 |
this.add(getJPanel(), java.awt.BorderLayout.WEST); |
|
123 |
this.setPreferredSize(new java.awt.Dimension(445,239)); |
|
124 |
this.add(getJPanel(), java.awt.BorderLayout.CENTER); |
|
122 | 125 |
|
123 | 126 |
initControls(); |
124 | 127 |
} |
... | ... | |
128 | 131 |
*/ |
129 | 132 |
public void initControls(){ |
130 | 133 |
jRadioButton1.setSelected(true); |
131 |
this.getTailText().setText("0"); |
|
134 |
this.getTailText().setText("0.0");
|
|
132 | 135 |
this.getTailSlider().setValue(0); |
133 | 136 |
this.setActiveTailControl(false); |
134 | 137 |
this.getTailCheck().setEnabled(false); |
135 |
|
|
136 |
|
|
138 |
this.getRemoveCheck().setEnabled(false); |
|
137 | 139 |
} |
138 | 140 |
|
139 | 141 |
|
... | ... | |
144 | 146 |
*/ |
145 | 147 |
private JPanel getJPanel() { |
146 | 148 |
if (jPanel == null) { |
147 |
GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); |
|
148 |
GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); |
|
149 |
FlowLayout flowLayout2 = new FlowLayout(); |
|
149 | 150 |
GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); |
150 | 151 |
jPanel = new JPanel(); |
151 |
jPanel.setLayout(new GridBagLayout());
|
|
152 |
jPanel.setLayout(flowLayout2);
|
|
152 | 153 |
gridBagConstraints4.gridx = 0; |
153 | 154 |
gridBagConstraints4.gridy = 0; |
154 |
gridBagConstraints7.gridx = 0; |
|
155 |
gridBagConstraints7.gridy = 0; |
|
156 |
gridBagConstraints7.gridwidth = 3; |
|
157 |
gridBagConstraints7.insets = new java.awt.Insets(5,5,5,5); |
|
158 |
gridBagConstraints7.anchor = java.awt.GridBagConstraints.WEST; |
|
159 |
gridBagConstraints8.gridx = 0; |
|
160 |
gridBagConstraints8.insets = new java.awt.Insets(25,5,5,5); |
|
161 |
gridBagConstraints8.anchor = java.awt.GridBagConstraints.WEST; |
|
162 | 155 |
jPanel.setPreferredSize(new java.awt.Dimension(445,239)); |
163 |
jPanel.add(getJPanel4(), gridBagConstraints7); |
|
164 |
jPanel.add(getJPanel2(), gridBagConstraints8); |
|
156 |
flowLayout2.setAlignment(java.awt.FlowLayout.CENTER); |
|
157 |
jPanel.add(getJPanel4(), null); |
|
158 |
jPanel.add(getJPanel8(), null); |
|
165 | 159 |
} |
166 | 160 |
return jPanel; |
167 | 161 |
} |
... | ... | |
190 | 184 |
jPanel2 = new JPanel(); |
191 | 185 |
jPanel2.setLayout(new BorderLayout()); |
192 | 186 |
jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1)); |
193 |
jPanel2.setPreferredSize(new java.awt.Dimension(420,52));
|
|
194 |
jPanel2.add(getJPanel5(), java.awt.BorderLayout.SOUTH);
|
|
195 |
jPanel2.add(getJPanel6(), java.awt.BorderLayout.EAST);
|
|
196 |
jPanel2.add(getJPanel7(), null);
|
|
187 |
jPanel2.setPreferredSize(new java.awt.Dimension(220,95));
|
|
188 |
jPanel2.add(getJPanel5(), java.awt.BorderLayout.CENTER);
|
|
189 |
jPanel2.add(getJPanel6(), java.awt.BorderLayout.SOUTH);
|
|
190 |
jPanel2.add(getJPanel7(), java.awt.BorderLayout.NORTH);
|
|
197 | 191 |
} |
198 | 192 |
return jPanel2; |
199 | 193 |
} |
... | ... | |
267 | 261 |
gridBagConstraints10.gridy = 1; |
268 | 262 |
gridBagConstraints10.insets = new java.awt.Insets(5,0,5,5); |
269 | 263 |
jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0)); |
264 |
jPanel4.setPreferredSize(new java.awt.Dimension(175,200)); |
|
270 | 265 |
jPanel4.add(getJPanel3(), gridBagConstraints9); |
271 | 266 |
jPanel4.add(getJPanel1(), gridBagConstraints10); |
272 | 267 |
} |
... | ... | |
281 | 276 |
*/ |
282 | 277 |
private JPanel getJPanel5() { |
283 | 278 |
if (jPanel5 == null) { |
284 |
jLabel3 = new JLabel(); |
|
285 | 279 |
jPanel5 = new JPanel(); |
286 |
jLabel3.setText("% recorte"); |
|
287 | 280 |
jPanel5.add(getTailSlider(), null); |
288 |
jPanel5.add(jLabel3, null); |
|
289 |
jPanel5.add(getTailText(), null); |
|
290 | 281 |
} |
291 | 282 |
return jPanel5; |
292 | 283 |
} |
... | ... | |
298 | 289 |
public JSlider getTailSlider() { |
299 | 290 |
if (jSlider == null) { |
300 | 291 |
jSlider = new JSlider(); |
301 |
jSlider.setPreferredSize(new java.awt.Dimension(310,16));
|
|
292 |
jSlider.setPreferredSize(new java.awt.Dimension(240,16));
|
|
302 | 293 |
} |
303 | 294 |
return jSlider; |
304 | 295 |
} |
... | ... | |
310 | 301 |
public JTextField getTailText() { |
311 | 302 |
if (jTextField == null) { |
312 | 303 |
jTextField = new JTextField(); |
313 |
jTextField.setPreferredSize(new java.awt.Dimension(30,19)); |
|
304 |
jTextField.setPreferredSize(new java.awt.Dimension(40,19)); |
|
305 |
jTextField.setText("0.0"); |
|
314 | 306 |
} |
315 | 307 |
return jTextField; |
316 | 308 |
} |
... | ... | |
322 | 314 |
public void setActiveTailControl(boolean active){ |
323 | 315 |
this.getTailSlider().setEnabled(active); |
324 | 316 |
this.getTailText().setEnabled(active); |
325 |
this.getRemoveCheck().setEnabled(active); |
|
326 | 317 |
} |
327 | 318 |
|
328 | 319 |
/** |
... | ... | |
343 | 334 |
case 0: jRadioButton1.setSelected(true); //Sin realce |
344 | 335 |
jCheckBox.setEnabled(false); |
345 | 336 |
setActiveTailControl(false); |
337 |
this.getRemoveCheck().setEnabled(false); |
|
346 | 338 |
break; |
347 | 339 |
case 1: |
348 |
this.getRemoveCheck().setEnabled(true); |
|
349 | 340 |
this.getRemoveCheck().setSelected(true); |
350 | 341 |
|
351 | 342 |
case 2: jRadioButton.setSelected(true); //Realce lineal |
352 | 343 |
this.getTailCheck().setEnabled(true); |
353 |
if(!this.getTailText().getText().equals("") && !this.getTailText().getText().equals("0")){ |
|
344 |
this.getRemoveCheck().setEnabled(true); |
|
345 |
if(!this.getTailText().getText().equals("") && !this.getTailText().getText().equals("0.0")){ |
|
354 | 346 |
this.getTailCheck().setSelected(true); |
355 | 347 |
this.setActiveTailControl(true); |
356 | 348 |
} |
... | ... | |
365 | 357 |
*/ |
366 | 358 |
private JPanel getJPanel6() { |
367 | 359 |
if (jPanel6 == null) { |
360 |
FlowLayout flowLayout3 = new FlowLayout(); |
|
368 | 361 |
jLabel4 = new JLabel(); |
369 | 362 |
jPanel6 = new JPanel(); |
370 |
jLabel4.setText("Eliminar extremos"); |
|
371 |
jPanel6.add(getRemoveCheck(), null); |
|
363 |
jPanel6.setLayout(flowLayout3); |
|
364 |
jLabel4.setText("% recorte"); |
|
365 |
flowLayout3.setAlignment(java.awt.FlowLayout.LEFT); |
|
366 |
jPanel6.add(getTailText(), null); |
|
372 | 367 |
jPanel6.add(jLabel4, null); |
373 | 368 |
} |
374 | 369 |
return jPanel6; |
... | ... | |
402 | 397 |
} |
403 | 398 |
return jPanel7; |
404 | 399 |
} |
405 |
} // @jve:decl-index=0:visual-constraint="36,15" |
|
400 |
/** |
|
401 |
* This method initializes jPanel8 |
|
402 |
* |
|
403 |
* @return javax.swing.JPanel |
|
404 |
*/ |
|
405 |
private JPanel getJPanel8() { |
|
406 |
if (jPanel8 == null) { |
|
407 |
jPanel8 = new JPanel(); |
|
408 |
jPanel8.setLayout(new BorderLayout()); |
|
409 |
jPanel8.setPreferredSize(new java.awt.Dimension(250,130)); |
|
410 |
jPanel8.add(getJPanel2(), java.awt.BorderLayout.SOUTH); |
|
411 |
jPanel8.add(getJPanel9(), java.awt.BorderLayout.NORTH); |
|
412 |
} |
|
413 |
return jPanel8; |
|
414 |
} |
|
415 |
/** |
|
416 |
* This method initializes jPanel9 |
|
417 |
* |
|
418 |
* @return javax.swing.JPanel |
|
419 |
*/ |
|
420 |
private JPanel getJPanel9() { |
|
421 |
if (jPanel9 == null) { |
|
422 |
jLabel5 = new JLabel(); |
|
423 |
FlowLayout flowLayout11 = new FlowLayout(); |
|
424 |
jPanel9 = new JPanel(); |
|
425 |
jPanel9.setLayout(flowLayout11); |
|
426 |
jLabel5.setText("Eliminar Extremos"); |
|
427 |
flowLayout11.setAlignment(java.awt.FlowLayout.LEFT); |
|
428 |
jPanel9.add(getRemoveCheck(), null); |
|
429 |
jPanel9.add(jLabel5, null); |
|
430 |
} |
|
431 |
return jPanel9; |
|
432 |
} |
|
433 |
} // @jve:decl-index=0:visual-constraint="36,15" |
branches/gvSIG_GisPlanet/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Panels/PropertiesRasterDialog.java | ||
---|---|---|
48 | 48 |
|
49 | 49 |
import java.awt.Container; |
50 | 50 |
import java.awt.event.ActionEvent; |
51 |
import java.awt.event.KeyEvent; |
|
52 |
import java.awt.event.KeyListener; |
|
51 | 53 |
import java.awt.geom.Rectangle2D; |
52 | 54 |
import java.io.File; |
53 | 55 |
import java.util.ArrayList; |
... | ... | |
91 | 93 |
* @author Nacho Brodin <brodin_ign@gva.es> |
92 | 94 |
*/ |
93 | 95 |
public class PropertiesRasterDialog extends FilterRasterDialogPanel implements View { |
94 |
|
|
95 |
private FilterRasterDialogPanel contentPane = null; |
|
96 |
|
|
96 | 97 |
private JPanel propPanel = null; |
97 | 98 |
private IProjection currentProjection = null; |
98 | 99 |
private FLyrRaster fLayer = null; |
... | ... | |
399 | 400 |
delFileBand(evt); |
400 | 401 |
} |
401 | 402 |
}); |
402 |
|
|
403 |
|
|
403 | 404 |
|
404 | 405 |
} |
405 | 406 |
|
... | ... | |
530 | 531 |
if(this.getTab().getSelectedComponent() == this.getEnhancedPanel()){ |
531 | 532 |
|
532 | 533 |
//Filtro lineal seleccionado |
533 |
if( this.getEnhancedPanel().getLinealDirectoRadioButton().isSelected()){ |
|
534 |
stackManager.addEnhancedFilter(); |
|
534 |
if( this.getEnhancedPanel().getLinealDirectoRadioButton().isSelected()){ |
|
535 |
if( this.getEnhancedPanel().getRemoveCheck().isSelected() && |
|
536 |
!this.getEnhancedPanel().getTailCheck().isSelected()) |
|
537 |
stackManager.addEnhancedFilter(true); |
|
538 |
else |
|
539 |
stackManager.addEnhancedFilter(false); |
|
535 | 540 |
|
536 | 541 |
//Recorte de colas seleccionado |
537 | 542 |
if(this.getEnhancedPanel().getTailCheck().isSelected()){ |
... | ... | |
714 | 719 |
fLayer.getFMap().invalidate(); |
715 | 720 |
} |
716 | 721 |
|
722 |
|
|
717 | 723 |
/** |
718 | 724 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo() |
719 | 725 |
*/ |
branches/gvSIG_GisPlanet/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/FPopupMenu.java | ||
---|---|---|
401 | 401 |
} |
402 | 402 |
if(((String)stackList.get(i)).startsWith("filter.tail.remove")) |
403 | 403 |
remove = Boolean.valueOf(stackManager.getValue((String)stackList.get(i))).booleanValue(); |
404 |
|
|
405 |
if(((String)stackList.get(i)).startsWith("filter.enhanced.remove")) |
|
406 |
remove = Boolean.valueOf(stackManager.getValue((String)stackList.get(i))).booleanValue(); |
|
404 | 407 |
} |
405 | 408 |
|
406 | 409 |
if(stackManager.isActive(stackManager.getTypeFilter("enhanced"))){ |
407 |
//System.out.println("*=>"+remove); |
|
408 | 410 |
if(remove) |
409 | 411 |
pEnhan.setSelectedFilter(1); |
410 | 412 |
else |
Also available in: Unified diff