Revision 30233
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/toolListeners/snapping/gui/SnapConfig.java | ||
---|---|---|
58 | 58 |
import org.gvsig.andami.PluginServices; |
59 | 59 |
import org.gvsig.fmap.mapcontrol.MapControl; |
60 | 60 |
import org.gvsig.fmap.mapcontrol.tools.snapping.snappers.ISnapper; |
61 |
import java.util.TreeMap; |
|
61 | 62 |
|
62 |
|
|
63 | 63 |
/** |
64 | 64 |
* @author fjp |
65 | 65 |
* |
... | ... | |
314 | 314 |
return getJChkBoxRefentActive().isSelected(); |
315 | 315 |
} |
316 | 316 |
|
317 |
public void selectSnappers(HashMap selected) {
|
|
317 |
public void selectSnappers(TreeMap selected) {
|
|
318 | 318 |
ArrayList snappers=mc.getMapContext().getSnappers(); |
319 | 319 |
for (int i=0;i<snappers.size();i++) { |
320 | 320 |
Boolean b=(Boolean)selected.get(snappers.get(i)); |
branches/v2_0_0_prep/libraries/libFMap_controls/src/org/gvsig/fmap/mapcontrol/MapControl.java | ||
---|---|---|
104 | 104 |
import org.gvsig.utils.exceptionHandling.ExceptionListener; |
105 | 105 |
import org.slf4j.Logger; |
106 | 106 |
import org.slf4j.LoggerFactory; |
107 |
import java.util.TreeMap; |
|
108 |
import java.util.Comparator; |
|
107 | 109 |
|
108 | 110 |
|
109 |
|
|
110 | 111 |
/** |
111 | 112 |
* <p>A component that includes a {@link MapContext MapContext} with support for use it as a particular {@link Behavior Behavior}.</p> |
112 | 113 |
* |
... | ... | |
439 | 440 |
*/ |
440 | 441 |
private double[] previousPoint = null; |
441 | 442 |
|
442 |
private static HashMap selected = new HashMap();
|
|
443 |
private static TreeMap selected = new TreeMap(new Comparator(){
|
|
443 | 444 |
|
445 |
public int compare(Object o1, Object o2) { |
|
446 |
if (o1.getClass().equals(o2.getClass())) |
|
447 |
return 0; |
|
448 |
if (((ISnapper)o1).getPriority()>((ISnapper)o2).getPriority()) |
|
449 |
return 1; |
|
450 |
else |
|
451 |
return -1; |
|
452 |
} |
|
453 |
|
|
454 |
}); |
|
455 |
|
|
444 | 456 |
public static int tolerance=4; |
445 | 457 |
/** |
446 | 458 |
* Represents the cursor's point selected in <i>map coordinates</i>. |
... | ... | |
2341 | 2353 |
return cadgrid; |
2342 | 2354 |
} |
2343 | 2355 |
|
2344 |
public static HashMap getSelectedSnapppers() {
|
|
2356 |
public static TreeMap getSelectedSnapppers() {
|
|
2345 | 2357 |
return selected; |
2346 | 2358 |
} |
2347 | 2359 |
|
branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/gui/preferences/SnapConfigPage.java | ||
---|---|---|
168 | 168 |
String nameClass=snp.getClass().getName(); |
169 | 169 |
nameClass=nameClass.substring(nameClass.lastIndexOf('.')); |
170 | 170 |
boolean select = prefs.getBoolean("snapper_activated" + nameClass, false); |
171 |
int priority = prefs.getInt("snapper_priority" + nameClass,3); |
|
172 |
snp.setPriority(priority); |
|
171 | 173 |
if (select) |
172 | 174 |
mc.getSelectedSnapppers().put(snp, new Boolean(select)); |
173 |
int priority = prefs.getInt("snapper_priority" + nameClass,3); |
|
174 |
snp.setPriority(priority); |
|
175 |
|
|
175 | 176 |
} |
176 | 177 |
applySnappers = prefs.getBoolean("apply-snappers",true); |
177 | 178 |
snapConfig.setApplySnappers(applySnappers); |
Also available in: Unified diff