From: <emm...@us...> - 2008-10-20 09:52:21
|
Revision: 4082 http://fudaa.svn.sourceforge.net/fudaa/?rev=4082&view=rev Author: emmanuel_martin Date: 2008-10-20 09:47:19 +0000 (Mon, 20 Oct 2008) Log Message: ----------- am?\195?\169lioration mineur et correction de bugs dans le wizard d'import du modeleur Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/collection/CtuluListObject.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadBERReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadPROReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadSEMReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImportStepDestination.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigExportImportAttributesMapper.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/collection/CtuluListObject.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/collection/CtuluListObject.java 2008-10-17 17:12:25 UTC (rev 4081) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/collection/CtuluListObject.java 2008-10-20 09:47:19 UTC (rev 4082) @@ -386,19 +386,20 @@ public final boolean addAll(final Object[] _obj, final List _o, final CtuluCommandContainer _cmd) { if (canAdd(_obj)) { - final int idx = list_.size(); - list_.addAll(Arrays.asList(_obj)); - CtuluCommandCompositeInverse cmd = null; - if (_cmd != null) { - cmd = new CtuluCommandCompositeInverse(); + if (_obj.length>0) { + final int idx=list_.size(); + list_.addAll(Arrays.asList(_obj)); + CtuluCommandCompositeInverse cmd=null; + if (_cmd!=null) { + cmd=new CtuluCommandCompositeInverse(); + } + internActionPointAdded(_o, cmd, _obj.length); + if (_cmd!=null&&cmd!=null) { + cmd.addCmd(new CommandAddAll(idx, _obj)); + _cmd.addCmd(cmd.getSimplify()); + } + fireObjectAdded(); } - internActionPointAdded(_o, cmd, _obj.length); - if (_cmd != null && cmd != null) { - cmd.addCmd(new CommandAddAll(idx, _obj)); - _cmd.addCmd(cmd.getSimplify()); - } - - fireObjectAdded(); return true; } return false; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadBERReader.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadBERReader.java 2008-10-17 17:12:25 UTC (rev 4081) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadBERReader.java 2008-10-20 09:47:19 UTC (rev 4082) @@ -70,7 +70,7 @@ private synchronized GISZoneCollectionLigneBrisee readBerges() { GISZoneCollectionLigneBrisee polys = new GISZoneCollectionLigneBrisee(); polys.setAttributes(new GISAttribute[]{GISAttributeConstants.BATHY}, null); - if(polys.getAttributeIsZ()!=null) + if(polys.getAttributeIsZ()==null) polys.setAttributeIsZ(GISAttributeConstants.BATHY); polys.setTitle(name_, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadPROReader.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadPROReader.java 2008-10-17 17:12:25 UTC (rev 4081) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadPROReader.java 2008-10-20 09:47:19 UTC (rev 4082) @@ -73,7 +73,7 @@ private synchronized GISZoneCollectionLigneBrisee readProfils() { GISZoneCollectionLigneBrisee polys = new GISZoneCollectionLigneBrisee(); polys.setAttributes(new GISAttribute[]{GISAttributeConstants.BATHY, GISAttributeConstants.TITRE}, null); - if(polys.getAttributeIsZ()!=null) + if(polys.getAttributeIsZ()==null) polys.setAttributeIsZ(GISAttributeConstants.BATHY); polys.setTitle(name_, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadSEMReader.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadSEMReader.java 2008-10-17 17:12:25 UTC (rev 4081) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/ReflucadSEMReader.java 2008-10-20 09:47:19 UTC (rev 4082) @@ -68,7 +68,7 @@ private synchronized GISZoneCollectionPoint readSemis() { GISZoneCollectionPoint pts = new GISZoneCollectionPoint(); pts.setAttributes(new GISAttribute[]{GISAttributeConstants.BATHY}, null); - if(pts.getAttributeIsZ()!=null) + if(pts.getAttributeIsZ()==null) pts.setAttributeIsZ(GISAttributeConstants.BATHY); pts.setTitle(name_, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java 2008-10-17 17:12:25 UTC (rev 4081) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java 2008-10-20 09:47:19 UTC (rev 4082) @@ -148,7 +148,7 @@ final GISZoneCollectionLigneBrisee zligs = new GISZoneCollectionLigneBrisee(null); zligs.addAllLineStringClosedOrNode((LineString[]) lignes.toArray(new LineString[lignes.size()]), null); zligs.setAttributes(new GISAttributeInterface[] { GISAttributeConstants.BATHY, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE}, null); - if(zligs.getAttributeIsZ()!=null) + if(zligs.getAttributeIsZ()==null) zligs.setAttributeIsZ(GISAttributeConstants.BATHY); zligs.postImport(0); @@ -177,7 +177,7 @@ zdirs.addAllLineStringClosedOrNode(ldirs, null); zdirs.setAttributes(new GISAttributeInterface[] { GISAttributeConstants.BATHY, GISAttributeConstants.TITRE, GISAttributeConstants.NATURE}, null); - if(zdirs.getAttributeIsZ()!=null) + if(zdirs.getAttributeIsZ()==null) zdirs.setAttributeIsZ(GISAttributeConstants.BATHY); zdirs.postImport(0); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxReader.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxReader.java 2008-10-17 17:12:25 UTC (rev 4081) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SinusxReader.java 2008-10-20 09:47:19 UTC (rev 4082) @@ -216,7 +216,7 @@ analyze_.addWarn(H2dResource.getS("Profils non g\xE9r\xE9s"), in_.getLineNumber()); pt = defZone.createPointContainer(); pt.setAttributes(attPts, null); - if(pt.getAttributeIsZ()!=null) + if(pt.getAttributeIsZ()==null) pt.setAttributeIsZ(GISAttributeConstants.BATHY); idx++; // pt.setTitle("profil", null); @@ -226,13 +226,13 @@ ptDefZone = defZone.createPointContainer(); pt = ptDefZone; pt.setAttributes(attPts, null); - if(pt.getAttributeIsZ()!=null) + if(pt.getAttributeIsZ()==null) pt.setAttributeIsZ(GISAttributeConstants.BATHY); idx++; } else { pt = defZone.createPointContainer(); pt.setAttributes(attPts, null); - if(pt.getAttributeIsZ()!=null) + if(pt.getAttributeIsZ()==null) pt.setAttributeIsZ(GISAttributeConstants.BATHY); idx++; // pt.setTitle(name_ + " " + (idx++), null); @@ -242,7 +242,7 @@ analyze_.addWarn(H2dResource.getS("TYPE inconnu : assimil\xE9 a un semis"), in_.getLineNumber()); pt = defZone.createPointContainer(); pt.setAttributes(attPts, null); - if(pt.getAttributeIsZ()!=null) + if(pt.getAttributeIsZ()==null) pt.setAttributeIsZ(GISAttributeConstants.BATHY); idx++; // pt.setTitle(H2dResource.getS("type inconnu"), null); @@ -254,14 +254,14 @@ ptDefZone = defZone.createPointContainer(); pt = ptDefZone; pt.setAttributes(attPts, null); - if(pt.getAttributeIsZ()!=null) + if(pt.getAttributeIsZ()==null) pt.setAttributeIsZ(GISAttributeConstants.BATHY); idx++; name=name_+" "+(idx); } else { pt = defZone.createPointContainer(); pt.setAttributes(attPts, null); - if(pt.getAttributeIsZ()!=null) + if(pt.getAttributeIsZ()==null) pt.setAttributeIsZ(GISAttributeConstants.BATHY); idx++; name=name_+" "+(idx); @@ -355,7 +355,7 @@ if (_polygones == null) { _polygones = _defZone.createPolygoneContainer(); _polygones.setAttributes(atts, null); - if(_polygones.getAttributeIsZ()!=null) + if(_polygones.getAttributeIsZ()==null) _polygones.setAttributeIsZ(GISAttributeConstants.BATHY); } _polyligneXyz.add(_polyligneXyz.getQuick(0)); @@ -370,7 +370,7 @@ if (_polylignes == null) { _polylignes = _defZone.createPolyligneContainer(); _polylignes.setAttributes(atts, null); - if(_polylignes.getAttributeIsZ()!=null) + if(_polylignes.getAttributeIsZ()==null) _polylignes.setAttributeIsZ(GISAttributeConstants.BATHY); } if (_niveau) Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java 2008-10-17 17:12:25 UTC (rev 4081) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java 2008-10-20 09:47:19 UTC (rev 4082) @@ -52,7 +52,6 @@ import org.fudaa.fudaa.sig.FSigGeomSrcData; import org.fudaa.fudaa.sig.FSigLib; import org.fudaa.fudaa.sig.wizard.FSigFileLoaderPanel; -import org.fudaa.fudaa.sig.wizard.FSigWizardImportHelper; import com.memoire.bu.BuButtonPanel; import com.memoire.bu.BuGlassPaneStop; @@ -283,14 +282,17 @@ } public String getStepText() { - if (super.current_ == 0) { - final StringBuffer r = new StringBuffer(); - r.append(CtuluLibString.LINE_SEP + FSigLib.getS("Les formats des fichiers sont choisis en fonction des extensions.")); - r.append(CtuluLibString.LINE_SEP + FSigLib.getS("Il est possible de les modifier dans la colonne 'Format'.")); - r.append(CtuluLibString.LINE_SEP + FSigLib.getS("La derni\xE8re colonne permet de sp\xE9cifier la tra\xE7abilit\xE9 des fichiers.")); - return r.toString(); + final StringBuffer r=new StringBuffer(); + if (super.current_==0) { + r.append(FSigLib.getS("Les formats des fichiers sont choisis en fonction des extensions.")); + r.append(CtuluLibString.LINE_SEP+FSigLib.getS("Il est possible de les modifier dans la colonne 'Format'.")); + r.append(CtuluLibString.LINE_SEP+FSigLib.getS("La derni\xE8re colonne permet de sp\xE9cifier la tra\xE7abilit\xE9 des fichiers.")); } - return FSigLib.getS("Pr\xE9ciser les calques et les attributs \xE0 modifier"); + else if (super.current_==1) { + r.append(FSigLib.getS("Pr\xE9ciser les calques et les attributs \xE0 modifier")); + r.append(CtuluLibString.LINE_SEP+FSigLib.getS("Le cadre 'Attributs' permet de mapper les attributs lus avec les attributs permis par le calque choisi dans le tableau.")); + } + return r.toString(); } public String getStepTitle() { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImportStepDestination.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImportStepDestination.java 2008-10-17 17:12:25 UTC (rev 4081) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImportStepDestination.java 2008-10-20 09:47:19 UTC (rev 4082) @@ -22,6 +22,7 @@ import javax.swing.AbstractCellEditor; import javax.swing.JPanel; import javax.swing.JTable; +import javax.swing.UIManager; import javax.swing.event.CellEditorListener; import javax.swing.event.ChangeEvent; import javax.swing.event.ListSelectionEvent; @@ -195,12 +196,20 @@ public class ImportTableRenderer implements TableCellRenderer { public Component getTableCellRendererComponent(JTable _table, Object _value, boolean _isSelected, boolean _hasFocus, int _row, int _column) { + Color selectionBackground = UIManager.getColor("Table.selectionBackground"); + JPanel pn=new JPanel(); + pn.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); + if(_isSelected) + pn.setBackground(selectionBackground); + else + pn.setBackground(Color.WHITE); + if (_column==2) { - JPanel pn=new JPanel(); - pn.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); - pn.setBackground(Color.WHITE); BuCheckBox cb=new BuCheckBox("", (Boolean)_value); - cb.setBackground(Color.WHITE); + if(_isSelected) + cb.setBackground(selectionBackground); + else + cb.setBackground(Color.WHITE); pn.add(cb); return pn; } @@ -210,20 +219,26 @@ value=FSigLib.getS(value); BuLabel lbl =new BuLabel(value); lbl.setHorizontalAlignment(BuLabel.CENTER); - return lbl; + if(_isSelected) + lbl.setBackground(selectionBackground); + pn.add(lbl); + return pn; } else if (_column==1){ BuLabel lbl =new BuLabel(_value.toString()); lbl.setHorizontalAlignment(BuLabel.CENTER); - return lbl; + if(_isSelected) + lbl.setBackground(selectionBackground); + pn.add(lbl); + return pn; } else { BuLabel lbl =new BuLabel(_value.toString()); lbl.setHorizontalAlignment(BuLabel.CENTER); - if(_isSelected){ - lbl.setText("<html><b>"+lbl.getText()+"</b></html>"); - } - return lbl; + if(_isSelected) + lbl.setBackground(selectionBackground); + pn.add(lbl); + return pn; } } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigExportImportAttributesMapper.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigExportImportAttributesMapper.java 2008-10-17 17:12:25 UTC (rev 4081) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigExportImportAttributesMapper.java 2008-10-20 09:47:19 UTC (rev 4082) @@ -169,7 +169,7 @@ t_.getColumnModel().getColumn(1).setCellEditor(new ComboCellEditor(renderer)); } - final String ignoreObject_ = FSigLib.getS("Ignorer"); + final String ignoreObject_ = FSigLib.getS("< Ignorer >"); /** * @return la table utilisee pour editer les correspondance source->destination @@ -207,10 +207,10 @@ final GISAttributeInterface[] attributes = (GISAttributeInterface[]) srcClassDestValid_.get(src_[_row] .getDataClass()); cbModel_.removeAllElements(); + cbModel_.addElement(ignoreObject_); if (_value != null && !_value.equals(ignoreObject_)) { cbModel_.addElement(_value); } - cbModel_.addElement(ignoreObject_); if (attributes != null) { for (int i = 0; i < attributes.length; i++) { if (CtuluLibArray.findObjectEgalEgal(FSigExportImportAttributesMapper.this.model_.selectedAttributes_, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |