Revision 40611 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/rendering/symbols/impl/DefaultSymbolManager.java
DefaultSymbolManager.java | ||
---|---|---|
111 | 111 |
status.setRangeOfValues(0, symbolFiles.length); |
112 | 112 |
status.setAutoremove(true); |
113 | 113 |
status.add(); |
114 |
|
|
115 |
/* |
|
116 |
* Sorting by file name before loading. |
|
117 |
* The problem here is that some |
|
118 |
* descriptions can be empty, so sorting using description |
|
119 |
* can have strange behavior. Sorting by file name is not |
|
120 |
* very elegant, though. |
|
121 |
*/ |
|
122 |
status.message("sorting symbols"); |
|
123 |
Arrays.sort(symbolFiles, new Comparator() { |
|
124 |
public int compare( Object o1, Object o2) { |
|
125 |
File f1 = (File) o1; |
|
126 |
File f2 = (File) o2; |
|
127 |
return f1.getName().compareTo(f2.getName()); |
|
128 |
} |
|
129 |
}); |
|
114 | 130 |
|
115 | 131 |
ISymbol[] symbols = null; |
116 | 132 |
try { |
... | ... | |
120 | 136 |
symbols[i] = loadSymbol(symbolFiles[i]); |
121 | 137 |
|
122 | 138 |
} |
123 |
status.message("sorting symbols"); |
|
124 |
Arrays.sort(symbols, new Comparator() { |
|
125 |
public int compare( Object o1, Object o2) { |
|
126 |
ISymbol s1 = (ISymbol)o1; |
|
127 |
ISymbol s2 = (ISymbol)o2; |
|
128 |
return s1.getDescription().compareTo(s2.getDescription()); |
|
129 |
} |
|
130 |
}); |
|
131 | 139 |
|
132 | 140 |
} finally { |
133 | 141 |
status.terminate(); |
Also available in: Unified diff