Revision 27314
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/VectorialUniqueValue.java | ||
---|---|---|
256 | 256 |
|
257 | 257 |
FeatureSet set = elRs.getFeatureSet(); |
258 | 258 |
|
259 |
if (set.getSize() > 100) { |
|
260 |
int resp = JOptionPane.showConfirmDialog(this, PluginServices |
|
261 |
.getText(this, "mas_de_100_simbolos"), PluginServices |
|
262 |
.getText(this, "quiere_continuar"), |
|
263 |
JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); |
|
264 | 259 |
|
265 |
if ((resp == JOptionPane.NO_OPTION) |
|
266 |
|| (resp == JOptionPane.DEFAULT_OPTION)) { |
|
267 |
set.dispose(); |
|
268 |
return; |
|
269 |
} |
|
270 |
} |
|
260 |
int count = 0; |
|
271 | 261 |
|
272 | 262 |
Iterator iterator = set.iterator(); |
273 | 263 |
while (iterator.hasNext()) { |
... | ... | |
283 | 273 |
|
284 | 274 |
////Comprobar que no esta repetido y no hace falta introducir en el hashtable el campo junto con el simbolo. |
285 | 275 |
if (auxLegend.getSymbolByValue(clave) == null) { |
276 |
|
|
277 |
if (count == 100) { |
|
278 |
int resp = JOptionPane.showConfirmDialog(this, |
|
279 |
PluginServices.getText(this, |
|
280 |
"mas_de_100_simbolos"), PluginServices |
|
281 |
.getText(this, "quiere_continuar"), |
|
282 |
JOptionPane.YES_NO_OPTION, |
|
283 |
JOptionPane.WARNING_MESSAGE); |
|
284 |
|
|
285 |
if ((resp == JOptionPane.NO_OPTION) |
|
286 |
|| (resp == JOptionPane.DEFAULT_OPTION)) { |
|
287 |
break; |
|
288 |
} |
|
289 |
} |
|
290 |
|
|
291 |
|
|
286 | 292 |
//si no esta creado el simbolo se crea |
287 | 293 |
// jaume (moved to ISymbol); theSymbol = new FSymbol(layer.getShapeType()); |
288 | 294 |
theSymbol = SymbologyFactory. |
... | ... | |
290 | 296 |
colorScheme[rand.nextInt(colorScheme.length)].getColor()); |
291 | 297 |
theSymbol.setDescription(clave.toString()); |
292 | 298 |
auxLegend.addSymbol(clave, theSymbol); |
299 |
count++; |
|
300 |
} |
|
293 | 301 |
|
294 |
|
|
295 |
} |
|
296 | 302 |
} // for |
297 | 303 |
|
298 | 304 |
symbolTable.fillTableFromSymbolList(auxLegend.getSymbols(), |
... | ... | |
310 | 316 |
} |
311 | 317 |
|
312 | 318 |
private boolean compareClassifyingFieldNames(String[] a, String[] b){ |
313 |
if (a==b) return true; |
|
314 |
if (a == null || b == null) return false; |
|
315 |
if (a.length != b.length) return false; |
|
319 |
if (a==b) { |
|
320 |
return true; |
|
321 |
} |
|
322 |
if (a == null || b == null) { |
|
323 |
return false; |
|
324 |
} |
|
325 |
if (a.length != b.length) { |
|
326 |
return false; |
|
327 |
} |
|
316 | 328 |
for (int i=0; i<a.length; i++){ |
317 |
if (!a[i].equals(b[i])) return false; |
|
329 |
if (!a[i].equals(b[i])) { |
|
330 |
return false; |
|
331 |
} |
|
318 | 332 |
} |
319 | 333 |
return true; |
320 | 334 |
} |
321 | 335 |
|
322 | 336 |
private boolean compareClassifyingFieldTypes(int[] a, int[] b){ |
323 |
if (a==b) return true; |
|
324 |
if (a == null || b == null) return false; |
|
325 |
if (a.length != b.length) return false; |
|
337 |
if (a==b) { |
|
338 |
return true; |
|
339 |
} |
|
340 |
if (a == null || b == null) { |
|
341 |
return false; |
|
342 |
} |
|
343 |
if (a.length != b.length) { |
|
344 |
return false; |
|
345 |
} |
|
326 | 346 |
for (int i=0; i<a.length; i++){ |
327 |
if (a[i]!=b[i]) return false; |
|
347 |
if (a[i]!=b[i]) { |
|
348 |
return false; |
|
349 |
} |
|
328 | 350 |
} |
329 | 351 |
return true; |
330 | 352 |
} |
Also available in: Unified diff