Revision 17158 trunk/libraries/libRaster/src/org/gvsig/raster/grid/filter/bands/NoDataListManager.java
NoDataListManager.java | ||
---|---|---|
59 | 59 |
/** |
60 | 60 |
* A?ade un filtro de NoData a la pila de filtros. |
61 | 61 |
* @param ladoVentana |
62 |
* @throws FilterTypeException
|
|
62 |
* @throws FilterTypeException |
|
63 | 63 |
*/ |
64 | 64 |
public void addNoDataFilter(Double noDataValue) throws FilterTypeException { |
65 | 65 |
RasterFilter filter = new NoDataByteFilter(); |
... | ... | |
68 | 68 |
|
69 | 69 |
if (filter != null) { |
70 | 70 |
filter.addParam("noDataValue", noDataValue); |
71 |
filter.addParam("Transparency", filterListManager.getFilterList().getEnvParam("Transparency")); |
|
72 | 71 |
filterList.add(filter); |
73 | 72 |
} |
74 | 73 |
} |
... | ... | |
99 | 98 |
* @see org.gvsig.raster.grid.filter.IRasterFilterListManager#createFilterListFromStrings(java.util.ArrayList, java.lang.String, int) |
100 | 99 |
*/ |
101 | 100 |
public int createFilterListFromStrings(ArrayList filters, String fil, int filteri) { |
102 |
/* |
|
103 |
String pkgBase = "filter.colortable."; |
|
104 |
if (fil.startsWith(pkgBase + "active")) { |
|
105 |
boolean exec = true; |
|
106 |
if ((RasterFilterListManager.getValue(fil).equals("false"))) |
|
107 |
exec = false; |
|
108 |
filters.remove(0); |
|
109 |
|
|
110 |
ColorTable colorTable = createColorTableFromArray(filters); |
|
111 |
|
|
112 |
filterList.remove(NoDataFilter.class); |
|
113 |
addColorTableFilter(new GridPalette(colorTable)); |
|
114 |
|
|
115 |
NoDataFilter ct = (NoDataFilter) filterList.getFilterByBaseClass(NoDataFilter.class); |
|
116 |
ct.setExec(exec); |
|
117 |
} |
|
118 |
*/ |
|
119 | 101 |
return filteri; |
120 | 102 |
} |
121 | 103 |
|
... | ... | |
124 | 106 |
* @see org.gvsig.raster.grid.filter.IRasterFilterListManager#getStringsFromFilterList(java.util.ArrayList, org.gvsig.raster.grid.filter.RasterFilter) |
125 | 107 |
*/ |
126 | 108 |
public ArrayList getStringsFromFilterList(ArrayList filterList, RasterFilter rf) { |
127 |
/* |
|
128 |
if (rf instanceof NoDataFilter) { |
|
129 |
String pkgBase = "filter.colortable."; |
|
130 |
NoDataFilter colorTableFilter = (NoDataFilter) rf; |
|
131 |
ColorTable colorTable = (ColorTable) colorTableFilter.getParam("colorTable"); |
|
132 |
if (colorTable != null) { |
|
133 |
if (colorTableFilter.isExec()) |
|
134 |
filterList.add(pkgBase + "active=true"); |
|
135 |
else |
|
136 |
filterList.add(pkgBase + "active=false"); |
|
137 |
|
|
138 |
filterList.add(pkgBase + "name=" + colorTable.getName()); |
|
139 |
filterList.add(pkgBase + "interpolated=" + colorTable.isInterpolated()); |
|
140 |
|
|
141 |
for (int i = 0; i < colorTable.getColorItems().size(); i++) { |
|
142 |
ColorItem colorItem = (ColorItem) colorTable.getColorItems().get(i); |
|
143 |
filterList.add(pkgBase + "color" + i + ".value=" + colorItem.getValue()); |
|
144 |
filterList.add(pkgBase + "color" + i + ".name=" + colorItem.getNameClass()); |
|
145 |
Color c = colorItem.getColor(); |
|
146 |
filterList.add(pkgBase + "color" + i + ".rgb=" + c.getRed() + "," + c.getGreen() + "," + c.getBlue()); |
|
147 |
filterList.add(pkgBase + "color" + i + ".interpolated=" + colorItem.getInterpolated()); |
|
148 |
} |
|
149 |
|
|
150 |
for (int i = 0; i < colorTable.getColorItems().size(); i++) { |
|
151 |
ColorItem colorItem = (ColorItem) colorTable.getColorItems().get(i); |
|
152 |
filterList.add(pkgBase + "alpha" + i + ".value=" + colorItem.getValue()); |
|
153 |
Color c = colorItem.getColor(); |
|
154 |
filterList.add(pkgBase + "alpha" + i + ".a=" + c.getAlpha()); |
|
155 |
filterList.add(pkgBase + "alpha" + i + ".interpolated=" + colorItem.getInterpolated()); |
|
156 |
} |
|
157 |
} |
|
158 |
} |
|
159 |
*/ |
|
160 | 109 |
return filterList; |
161 | 110 |
} |
162 | 111 |
} |
Also available in: Unified diff