Hi to all,<br>I&#39;d like to know if there&#39;s a way to preselect (in a &quot;clean way&quot;) which of the FlyrVect layers of my Project&#39;s Vista can be set as snapping layer for another layer?<br><br>I tried to use the LayerCollectionListener interface to capture when a 
layer is added and, when this occurs, and then add a LayerListener on 
that layer to capture editionChange event.<br>The problem is that the snapping layer must be set when the layer enters editing mode and AFTER that its VectorialLayerEdited (which embeds snap settings) is created.<br>The EditionManager, which creates the  VectorialLayerEdited,   is another  LayerListener at its own time but, unfortunately, it is added only when the edition starts so I&#39;m not able to get<br>

the layer&#39;s VectorialLayerEdited because my LayerListener is always called before the EditionManager.<br><br>I managed to preselect a snapping layer in a &quot;dirty&quot; way (using polling on the EditionManager) but I don&#39;t like it:<br>

<br>public void editionChanged(LayerEvent e) {<br>        System.out.println(&quot;------------------------------ EDIT STARTED&quot;);<br>        // STOP EDITING: do nothing<br>        if (!e.getSource().isEditing())<br>
            return;<br>
        source = e.getSource();<br>        EditionManager edManager = CADExtension.getEditionManager();<br>        VectorialLayerEdited lyrEd = (VectorialLayerEdited) edManager.getLayerEdited(source);<br>        <br>       <span style="background-color: rgb(255, 255, 102);"> // if the VectorialLayerEdited is not yet ready (editionChange of the EditionManager called)</span><br>

        if (lyrEd == null) {<br>            SwingUtilities.invokeLater(new Runnable() {<br>                <br>                public void run() {<br>                    EditionManager edManager = CADExtension.getEditionManager();<br>

                    VectorialLayerEdited lyrEd = null;<br>                    <span style="background-color: rgb(255, 255, 102);">// POLLING</span><br>                    while ((lyrEd = (VectorialLayerEdited) edManager.getLayerEdited(source)) == null) {<br>

                        try {<br>                            Thread.sleep(100);<br>                            System.out.println(&quot;Sleep...&quot;);<br>                        }<br>                        catch (InterruptedException e) {<br>

                            e.printStackTrace();<br>                        }<br>                    }<br>                  <span style="background-color: rgb(255, 255, 102);">  System.out.println(&quot;Found layer edited&quot;);</span><br>

                    ArrayList&lt;FLyrVect&gt; layersToSnap = lyrEd.getLayersToSnap();<br>                    .....<br>                    .....<br>               }<br>        }<br>}<br>Isn&#39;t it a limitation of gvSIG? Or is there a way to solve the problem in a better way?<br>

<br>Best regards,<br>Flavio<br>