Revision 7568

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/actions/LayersUngroupTocMenuEntry.java
52 52
 *
53 53
 * $Id$
54 54
 * $Log$
55
 * Revision 1.3  2006-09-20 12:01:24  jaume
55
 * Revision 1.4  2006-09-25 15:24:26  jmvivo
56
 * * Modificada la implementacion.
57
 *
58
 * Revision 1.3  2006/09/20 12:01:24  jaume
56 59
 * *** empty log message ***
57 60
 *
58 61
 * Revision 1.2  2006/09/20 11:41:20  jaume
......
103 106

  
104 107

  
105 108
	public void execute(ITocItem item, FLayer[] selectedItems) {
106
		if (isTocItemBranch(item)){
109
		if (isTocItemBranch(item)){			
107 110
			FLayers agrupa = (FLayers)getNodeLayer(item);
108 111
			FLayers parent=agrupa.getParentLayer();
112
			
109 113
			if (parent!=null){
110
				FLayers allLayers=getMapContext().getLayers();
111
				for (int i=0;i<allLayers.getLayersCount();i++) {
112
					FLayer layer=allLayers.getLayer(i);
113
					if (layer.equals(agrupa)) {
114
						for (int j=0;j<agrupa.getLayersCount();j++){
115
							parent.addLayer(i+j,agrupa.getLayer(j));
116
						}
117
						parent.removeLayer(agrupa);
118
					}
114
				getMapContext().beginAtomicEvent();
115
				while (agrupa.getLayersCount() > 0){
116
					FLayer layer = agrupa.getLayer(0);
117
					parent.addLayer(layer);
118
					agrupa.removeLayer(layer);
119 119
				}
120
			}
120
				parent.removeLayer(agrupa);
121
				getMapContext().endAtomicEvent();
122
				
123
				// TRUCO PARA REFRESCAR.
124
				getMapContext().invalidate();
125

  
126
			}		
121 127
		}
122
		// TRUCO PARA REFRESCAR.
123
		getMapContext().invalidate();
124 128
	}
125 129
}

Also available in: Unified diff