From: <emm...@us...> - 2008-11-06 14:22:23
|
Revision: 4183 http://fudaa.svn.sourceforge.net/fudaa/?rev=4183&view=rev Author: emmanuel_martin Date: 2008-11-06 14:22:09 +0000 (Thu, 06 Nov 2008) Log Message: ----------- bugfix : sur la palette de visibilit?\195?\169 : changement de visibilit?\195?\169 infonctionnelle, probl?\195?\168me de d?\195?\169placement des g?\195?\169om?\195?\169tries, undo/redo en deux temps. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISCollection.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEditVisibility.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISCollection.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISCollection.java 2008-11-06 14:11:44 UTC (rev 4182) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISCollection.java 2008-11-06 14:22:09 UTC (rev 4183) @@ -403,9 +403,12 @@ if(_index1!=_index2){ CtuluCommandComposite cmd=new CtuluCommandComposite(); // Permutation de la g\xE9om\xE9trie - Object tmp=geometry_.getValueAt(_index1); - geometry_.set(_index1, geometry_.getValueAt(_index2), cmd); - geometry_.set(_index2, tmp, cmd); + Object idx1=geometry_.getValueAt(_index1); + Object idx2=geometry_.getValueAt(_index2); + geometry_.set(_index1, idx2, cmd); + geometry_.set(_index2, idx1, cmd); + fireGeometryModified(_index1, (Geometry) idx1); + fireGeometryModified(_index2, (Geometry) idx2); if(_cmd!=null) _cmd.addCmd(cmd.getSimplify()); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java 2008-11-06 14:11:44 UTC (rev 4182) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java 2008-11-06 14:22:09 UTC (rev 4183) @@ -794,8 +794,10 @@ for(int i=0;i<attr_.length;i++){ Object tmp=attr_[i].getObjectValueAt(_index1); attr_[i].setObject(_index1, attr_[i].getObjectValueAt(_index2), cmd); - attr_[i].setObject(_index2, tmp, _cmd); + attr_[i].setObject(_index2, tmp, cmd); } + fireAttributeValueChanged(-1, null, _index1, null); + fireAttributeValueChanged(-1, null, _index2, null); if(_cmd!=null) _cmd.addCmd(cmd.getSimplify()); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEditVisibility.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEditVisibility.java 2008-11-06 14:11:44 UTC (rev 4182) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEditVisibility.java 2008-11-06 14:22:09 UTC (rev 4183) @@ -419,7 +419,7 @@ GISZoneCollection zone=_model.getGeomData(); int indexVisibility=zone.getIndiceOf(GISAttributeConstants.VISIBILITE); if (indexVisibility!=-1) - zone.getModel(indexVisibility).setObject(_numGeom, _visibility==true ? GISAttributeConstants.ATT_VAL_TRUE:GISAttributeConstants.ATT_VAL_FALSE, cmd_); + zone.getModel(indexVisibility).setObject(scene_.sceneId2LayerId(_numGeom), _visibility==true ? GISAttributeConstants.ATT_VAL_TRUE:GISAttributeConstants.ATT_VAL_FALSE, cmd_); listenVisibility=true; } @@ -632,30 +632,48 @@ } public void attributeValueChangeAction(Object _source, int att, GISAttributeInterface _att, int _geom, Object _value) { - if(listenVisibility&&(_att==GISAttributeConstants.TITRE||_att==GISAttributeConstants.VISIBILITE)){ - if(_geom>=0){ - // Mise \xE0 jour seulement de la g\xE9om\xE9trie. - boolean found=false; - int i=-1; - while(!found&&++i<table_.getModel().getRowCount()){ - ZModeleEditable model=(ZModeleEditable) table_.getModel().getValueAt(i, 2); - Integer indexGeom=(Integer) table_.getModel().getValueAt(i, 3); - found=(model==_source)&&(indexGeom==_geom); + if(listenVisibility&&(_att==GISAttributeConstants.TITRE||_att==GISAttributeConstants.VISIBILITE||_att==null)){ + // Recherche le calque contenant le model + boolean foundCalque=false; + int j=-1; + ZCalqueEditable[] calques=scene_.getEditableLayers(); + while (!foundCalque&&++j<calques.length) + foundCalque=calques[j].getModelEditable()==_source; + if (foundCalque) { + if (_geom>=0) { + int idxGeom=scene_.layerId2SceneId(calques[j], _geom); + // Mise \xE0 jour seulement de la g\xE9om\xE9trie. + boolean found=false; + int i=-1; + while (!found&&++i<table_.getModel().getRowCount()) { + ZModeleEditable model=(ZModeleEditable)table_.getModel().getValueAt(i, 2); + Integer indexGeom=(Integer)table_.getModel().getValueAt(i, 3); + found=(model==_source)&&(indexGeom==idxGeom); + } + if (found) + if (_att==GISAttributeConstants.TITRE) + table_.getModel().setValueAt(_value, i, 0); + else if (_att==GISAttributeConstants.VISIBILITE) + table_.getModel().setValueAt(_value.equals(GISAttributeConstants.ATT_VAL_TRUE) ? true:false, i, 1); + else { + GISZoneCollection zone=((ZModeleEditable)_source).getGeomData(); + table_.getModel().setValueAt( + ((ZModeleEditable)_source).getGeomData().getValue(zone.getIndiceOf(GISAttributeConstants.TITRE), _geom), i, 0); + table_.getModel().setValueAt( + ((ZModeleEditable)_source).getGeomData().getValue(zone.getIndiceOf(GISAttributeConstants.VISIBILITE), _geom) + .equals(GISAttributeConstants.ATT_VAL_TRUE) ? true:false, i, 1); + } } - if(found) - if(_att==GISAttributeConstants.TITRE) - table_.getModel().setValueAt(_value, i, 0); - else - table_.getModel().setValueAt(_value.equals(GISAttributeConstants.ATT_VAL_TRUE) ? true : false, i, 1); + else + // Mise \xE0 jour de toutes les g\xE9om\xE9tries. + fillTableGeometry(); } - else - // Mise \xE0 jour de toutes les g\xE9om\xE9tries. - fillTableGeometry(); } } public void geometryAction(Object _source, int geom, Geometry _geom, int _action) { - fillTableGeometry(); + if(_action!=GEOMETRY_ACTION_MODIFY) + fillTableGeometry(); } // La selection dans un calque \xE0 chang\xE9e \\ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |