You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(46) |
Jul
(37) |
Aug
(154) |
Sep
(140) |
Oct
(132) |
Nov
(104) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(113) |
Feb
(73) |
Mar
(102) |
Apr
(106) |
May
(114) |
Jun
(67) |
Jul
(116) |
Aug
(48) |
Sep
(108) |
Oct
(296) |
Nov
(56) |
Dec
(53) |
2010 |
Jan
(95) |
Feb
(31) |
Mar
(40) |
Apr
(12) |
May
(10) |
Jun
(27) |
Jul
(19) |
Aug
(81) |
Sep
(48) |
Oct
(45) |
Nov
(40) |
Dec
(7) |
2011 |
Jan
(16) |
Feb
(32) |
Mar
(55) |
Apr
(38) |
May
(24) |
Jun
(37) |
Jul
(12) |
Aug
(16) |
Sep
(97) |
Oct
(90) |
Nov
(101) |
Dec
(89) |
2012 |
Jan
(18) |
Feb
(2) |
Mar
(54) |
Apr
(69) |
May
(97) |
Jun
(131) |
Jul
(70) |
Aug
(48) |
Sep
(48) |
Oct
(119) |
Nov
(194) |
Dec
(60) |
2013 |
Jan
(73) |
Feb
(35) |
Mar
(42) |
Apr
(28) |
May
(7) |
Jun
(17) |
Jul
(27) |
Aug
(10) |
Sep
(38) |
Oct
(12) |
Nov
(4) |
Dec
(16) |
2014 |
Jan
(33) |
Feb
(37) |
Mar
(19) |
Apr
(3) |
May
(47) |
Jun
(26) |
Jul
(22) |
Aug
|
Sep
(10) |
Oct
(30) |
Nov
(24) |
Dec
(19) |
2015 |
Jan
(13) |
Feb
(16) |
Mar
(36) |
Apr
(19) |
May
(5) |
Jun
(5) |
Jul
(3) |
Aug
(11) |
Sep
(22) |
Oct
(7) |
Nov
(14) |
Dec
|
2016 |
Jan
|
Feb
(26) |
Mar
(13) |
Apr
(61) |
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
(27) |
Nov
(14) |
Dec
(21) |
2017 |
Jan
(30) |
Feb
(4) |
Mar
(3) |
Apr
(5) |
May
(69) |
Jun
(29) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <emm...@us...> - 2009-01-19 15:49:23
|
Revision: 4380 http://fudaa.svn.sourceforge.net/fudaa/?rev=4380&view=rev Author: emmanuel_martin Date: 2009-01-19 15:49:15 +0000 (Mon, 19 Jan 2009) Log Message: ----------- tache #147 : "Edition de bief : Ajouter la modification des lignes directrices". Il y a un bug ?\195?\160 corriger lors du d?\195?\169placement de deux lignes directrices se coupant au m?\195?\170me endroit. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainer.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/UtilsProfil1d.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2009-01-16 18:56:21 UTC (rev 4379) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2009-01-19 15:49:15 UTC (rev 4380) @@ -315,7 +315,7 @@ /** * Attribut contenant l'index des points correspondants aux l'intersections entre - * les lignes directrices et un profil. Ces index sont stock\xE9s dans une List<Integer>. + * les lignes directrices et un profil. Ces index sont stock\xE9s dans une {@link GISAttributeModelIntegerList}. */ public final static GISAttribute INTERSECTIONS_LIGNES_DIRECTRICES=new GISAttribute(null, CtuluLib .getS("Intersections lignes directrices"), false){ Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java 2009-01-16 18:56:21 UTC (rev 4379) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java 2009-01-19 15:49:15 UTC (rev 4380) @@ -7,10 +7,8 @@ */ package org.fudaa.fudaa.modeleur.modeleur1d.model; -import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; -import java.util.List; import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandComposite; @@ -19,6 +17,7 @@ import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeInterface; import org.fudaa.ctulu.gis.GISAttributeModel; +import org.fudaa.ctulu.gis.GISAttributeModelIntegerList; import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface; import org.fudaa.ctulu.gis.GISCoordinateSequenceFactory; import org.fudaa.ctulu.gis.GISPolyligne; @@ -159,7 +158,9 @@ profils_.getGeomData().setAttributValue(idxAttRiveDroite, i, null, null); profils_.getGeomData().setAttributValue(idxAttlsGauche, i, null, null); profils_.getGeomData().setAttributValue(idxAttlsDroite, i, null, null); - profils_.getGeomData().setAttributValue(idxAttLignesDirectrices, i, new ArrayList<Integer>(0), null); + GISAttributeModelIntegerList attrModel=new GISAttributeModelIntegerList(0, GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES); + attrModel.setListener(profils_.getGeomData()); + profils_.getGeomData().setAttributValue(idxAttLignesDirectrices, i, attrModel, null); } if (axeHydraulique_.getNombre()==1) { Geometry axeHydraulique=(Geometry)axeHydraulique_.getObject(0); @@ -286,11 +287,13 @@ * * @param _idxAttr l'index de l'attribut o\xF9 sera stock\xE9 les intersections */ - @SuppressWarnings("unchecked") private void valuateProfilIntersection(int _idxAttr) { // Cr\xE9ation des listes - for (int k=0; k<profils_.getNombre(); k++) - profils_.getGeomData().setAttributValue(_idxAttr, k, new ArrayList<Integer>(), null); + for (int k=0; k<profils_.getNombre(); k++) { + GISAttributeModelIntegerList attrModel=new GISAttributeModelIntegerList(0, GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES); + attrModel.setListener(profils_.getGeomData()); + profils_.getGeomData().setAttributValue(_idxAttr, k, attrModel, null); + } // Valuation de l'attribut int k=0; int[] lstIntersectionTmp=new int[profils_.getNombre()]; @@ -318,7 +321,7 @@ else { for (int l=0; l<profils_.getNombre(); l++) { // R\xE9cup\xE9ration de la liste contenant les index - List<Integer> lst=(List<Integer>)profils_.getGeomData().getValue(_idxAttr, l); + GISAttributeModelIntegerList lst=(GISAttributeModelIntegerList)profils_.getGeomData().getValue(_idxAttr, l); if (lstIntersectionTmp[l]!=-1) // Enregistrement de l'index lst.add(lstIntersectionTmp[l]); @@ -728,7 +731,6 @@ /** * R\xE9g\xE9n\xE8re toutes les g\xE9om\xE9tries volatiles. */ - @SuppressWarnings("unchecked") private void regenerateAll() { GISZoneCollection zone=profilsListen_.getGeomData(); // Cr\xE9ation des nouvelles g\xE9om\xE9tries \\ @@ -751,9 +753,9 @@ for(int i=0; i<ld.length; i++) ld[i]=new Coordinate[profilsListen_.getNombre()]; for(int i=0; i<profilsListen_.getNombre(); i++) { - List<Integer> lst=(List<Integer>) profilsListen_.getGeomData().getValue(idxAttlignesDirectrices_, i); + GISAttributeModelIntegerList lst=(GISAttributeModelIntegerList) profilsListen_.getGeomData().getValue(idxAttlignesDirectrices_, i); for(int j=0; j<lignesDirectricesModified_.getNombre(); j++) - ld[j][i]=profilsListen_.getGeomData().getCoordinateSequence(i).getCoordinate(lst.get(j)); + ld[j][i]=profilsListen_.getGeomData().getCoordinateSequence(i).getCoordinate(lst.getValue(j)); } // Ajout des nouvelles g\xE9o\xE9mtries \\ @@ -823,26 +825,22 @@ /** * Met \xE0 jours les lignes directrices. - * @param _idxPoint indique l'index du point ayant chang\xE9 + * @param _idxGeom indique la ligne directrice ayant chang\xE9. */ - @SuppressWarnings("unchecked") private void updateLd(int _idxGeom) { if(_idxGeom==-1) return; - List<Integer> lstIdx=(List<Integer>)profilsListen_.getGeomData().getValue(idxAttlignesDirectrices_, _idxGeom); - CoordinateSequence seqProfil=profilsListen_.getGeomData().getCoordinateSequence(_idxGeom); - boolean found=false; - int i=-1; - while(!found&&++i<lignesDirectricesModified_.getNombre()) { - CoordinateSequence seqLd= lignesDirectricesModified_.getGeomData().getCoordinateSequence(i); - Coordinate coodProfil=seqProfil.getCoordinate(lstIdx.get(i)); - // Test si c'est bien cette ligne directrice \xE0 mettre \xE0 jour - if(!UtilsProfil1d.egal(coodProfil, seqLd.getCoordinate(_idxGeom))) { - found=true; - seqLd.setOrdinate(_idxGeom, 0, coodProfil.x); - seqLd.setOrdinate(_idxGeom, 1, coodProfil.y); - seqLd.setOrdinate(_idxGeom, 2, coodProfil.z); - lignesDirectricesModified_.getGeomData().setCoordinateSequence(i, seqLd, null); + CoordinateSequence seqLd= lignesDirectricesModified_.getGeomData().getCoordinateSequence(_idxGeom); + for(int i=0;i<profilsListen_.getNombre();i++) { + GISAttributeModelIntegerList lstIdx=(GISAttributeModelIntegerList)profilsListen_.getGeomData().getValue(idxAttlignesDirectrices_, i); + CoordinateSequence seqProfil=profilsListen_.getGeomData().getCoordinateSequence(i); + Coordinate coodProfil=seqProfil.getCoordinate(lstIdx.getValue(_idxGeom)); + // Test si c'est bien un point \xE0 mettre \xE0 jour + if(!UtilsProfil1d.egal(coodProfil, seqLd.getCoordinate(i))) { + seqLd.setOrdinate(i, 0, coodProfil.x); + seqLd.setOrdinate(i, 1, coodProfil.y); + seqLd.setOrdinate(i, 2, coodProfil.z); + lignesDirectricesModified_.getGeomData().setCoordinateSequence(_idxGeom, seqLd, null); } } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainer.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainer.java 2009-01-16 18:56:21 UTC (rev 4379) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainer.java 2009-01-19 15:49:15 UTC (rev 4380) @@ -59,15 +59,6 @@ /** Retourne l'abscisse curviligne de l'axe sur le profil (ne pas confondre avec getAbsCurvProfilOnAxeHydraulique). -1 si inexistant. */ public double getAbsCurvAxeHydrauliqueOnProfil(); - /** Retourne les index des lignes directrices croisant le profil. null si aucun profil n'est selectionn\xE9. */ - public int[] getIdxLignesDirectrices(); - - /** Retourne les noms des lignes directrices. null si aucun profil n'est s\xE9lectionn\xE9 ou si il n'y a pas de noms.*/ - public String[] getNamesLignesDirectrices(); - - /** Retourneles noms des lignes directrices associ\xE9s \xE0 l'index pass\xE9 en param\xE8tre. null si aucun. */ - public String[] getNamesLignesDirectricesAt(int _idxPoint); - /** * Enregistre l'abcisse curviligne du point indiqu\xE9 en param\xE8tre. * Ce changement d'abscisse curviligne fonctionne sur tout les points. @@ -113,4 +104,27 @@ /** Place l'intersection du profil avec la rive droite \xE0 l'index _idx. */ public void setRiveDroite(int _idx, CtuluCommandContainer _cmd); + + + + /** Retourne le nombre de lignes directrices croisant le profil. */ + public int getNbLignesDirectrices(); + + /** Retourne les noms des lignes directrices. null si aucun profil n'est s\xE9lectionn\xE9 ou si il n'y a pas de noms.*/ + public String[] getNamesLignesDirectrices(); + + /** Retourne les index des lignes directrices associ\xE9s \xE0 l'index pass\xE9 en param\xE8tre. */ + public int[] getIdxLignesDirectricesAt(int _idxPoint); + + /** Retourne les noms des lignes directrices associ\xE9s \xE0 l'index pass\xE9 en param\xE8tre. */ + public String[] getNamesLignesDirectricesAt(int _idxPoint); + + /** Enregistre la ligne directrice _idxLd comme passant par le point _idxDestination. */ + public void setLigneDirectriceAt(int _idxLd, int _idxPoint, CtuluCommandContainer _cmd); + + /** Retourne le nom de la ligne directrice. */ + public String getLigneDirectriceName(int _idx); + + /** Retourne les index des lignes directrices pouvant \xEAtre d\xE9plac\xE9s au point indiqu\xE9.*/ + public int[] getAllowedMoveOfLignesDirectricesTo(int _idxPoint); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java 2009-01-16 18:56:21 UTC (rev 4379) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java 2009-01-19 15:49:15 UTC (rev 4380) @@ -19,6 +19,7 @@ import org.fudaa.ctulu.collection.CtuluCollection; import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeInterface; +import org.fudaa.ctulu.gis.GISAttributeModelIntegerList; import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface; import org.fudaa.ctulu.gis.GISGeometryFactory; import org.fudaa.ctulu.gis.GISPolyligne; @@ -371,34 +372,84 @@ .getGeometry(0)).getCoordinateSequence(), getCoordSeq()); } - @SuppressWarnings("unchecked") - public int[] getIdxLignesDirectrices() { + public int getNbLignesDirectrices() { if (idxProfilSelected_==-1) + return 0; + return biefContainer_.getZoneLignesDirectrices().getNbGeometries(); + } + + public void setLigneDirectriceAt(int _idxLd, int _idxDestination, CtuluCommandContainer _cmd) { + int[] allowed=getAllowedMoveOfLignesDirectricesTo(_idxDestination); + if(allowed==null||!UtilsProfil1d.in(_idxLd, allowed)) + throw new IllegalArgumentException(FudaaLib.getS("Ce d\xE9placement n'est pas permis")); + GISAttributeModelIntegerList lst=(GISAttributeModelIntegerList)getValueOf(GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES); + // Changement de la valeur + lst.set(_idxLd, _idxDestination, _cmd); + fireProfilContainerDataModified(); + } + + public String getLigneDirectriceName(int _idx) { + if (idxProfilSelected_==-1) return null; - List<Integer> lst=(List<Integer>)getValueOf(GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES); - int[] result=new int[lst.size()]; - for (int i=0; i<lst.size(); i++) - result[i]=lst.get(i); + GISZoneCollection zoneLd=biefContainer_.getZoneLignesDirectrices(); + if(_idx<0||_idx>=zoneLd.getNumGeometries()) + return null; + int idxTitre=zoneLd.getIndiceOf(GISAttributeConstants.TITRE); + if(idxTitre==-1) + return null; + return (String) zoneLd.getValue(idxTitre, _idx); + } + + public int[] getAllowedMoveOfLignesDirectricesTo(int _idxPoint) { + if(idxProfilSelected_==-1||_idxPoint<0||_idxPoint>=getNbPoint()) + return null; + // Recherche des lignes avants et apr\xE8s. + int[] namesLdPrevious=new int[0]; + int idx=_idxPoint; + while (namesLdPrevious.length==0&&--idx>=0) + namesLdPrevious=getIdxLignesDirectricesAt(idx); + int[] namesLdNext=new int[0]; + idx=_idxPoint; + while(namesLdNext.length==0&&++idx<getNbPoint()) + namesLdNext=getIdxLignesDirectricesAt(idx); + // Agr\xE9gation des r\xE9sultats + int[] result=new int[namesLdPrevious.length+namesLdNext.length]; + System.arraycopy(namesLdPrevious, 0, result, 0, namesLdPrevious.length); + System.arraycopy(namesLdNext, 0, result, namesLdPrevious.length, namesLdNext.length); return result; } + public int[] getIdxLignesDirectricesAt(int _idxPoint) { + if (idxProfilSelected_==-1||_idxPoint<0||_idxPoint>=getNbPoint()) + return new int[0]; + // R\xE9cup\xE9ration des croisements entre les lignes directrices et le profil + GISZoneCollection zone=biefContainer_.getZoneProfils(); + int idxAtt=zone.getIndiceOf(GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES); + GISAttributeModelIntegerList lst=(GISAttributeModelIntegerList) zone.getValue(idxAtt, idxProfilSelected_); + // S\xE9lection des index utils + int nbIdx=0; + for(int i=0;i<lst.getSize();i++) + if(lst.getValue(i)==_idxPoint) + nbIdx++; + int[] result=new int[nbIdx]; + int j=0; + for(int i=0;i<lst.getSize();i++) + if(lst.getValue(i)==_idxPoint) + result[j++]=i; + return result; + } + public String[] getNamesLignesDirectricesAt(int _idxPoint) { if (idxProfilSelected_==-1||_idxPoint<0||_idxPoint>=getNbPoint()) - return null; - // Nom des lignes directrices - int[] idx=getIdxLignesDirectrices(); - String[] names=getNamesLignesDirectrices(); - if(idx==null||names==null) - return null; - // Construction du label par agr\xE9gation des noms des lignes directrices croisant le point - ArrayList<String> labels=new ArrayList<String>(); - for(int i=0;i<idx.length;i++) - if(idx[i]==_idxPoint) - labels.add(names[i]); - if(labels.size()==0) - return null; - else - return labels.toArray(new String[0]); + return new String[0]; + int[] idx=getIdxLignesDirectricesAt(_idxPoint); + if(idx.length==0) + return new String[0]; + // R\xE9cup\xE9rationd des noms a partir des index + String[] result=new String[idx.length]; + for(int i=0;i<result.length;i++) + result[i]= getLigneDirectriceName(idx[i]); + return result; } public String[] getNamesLignesDirectrices() { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/UtilsProfil1d.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/UtilsProfil1d.java 2009-01-16 18:56:21 UTC (rev 4379) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/UtilsProfil1d.java 2009-01-19 15:49:15 UTC (rev 4380) @@ -411,4 +411,15 @@ else return 0; } + + /** + * Retourne vrai si _el is dans _coll. _coll n'est pas consid\xE9r\xE9 comme tri\xE9e. + */ + static public boolean in(int _in, int[] _coll) { + boolean found=false; + int i=-1; + while(!found&&++i<_coll.length) + found=_coll[i]==_in; + return found; + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java 2009-01-16 18:56:21 UTC (rev 4379) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java 2009-01-19 15:49:15 UTC (rev 4380) @@ -24,6 +24,7 @@ import org.fudaa.ctulu.CtuluCommandComposite; import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.CtuluListSelectionEvent; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluListSelectionListener; import org.fudaa.ctulu.CtuluNumberFormatDefault; @@ -48,6 +49,7 @@ import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuButton; +import com.memoire.bu.BuComboBox; import com.memoire.bu.BuPanel; import com.memoire.bu.BuSpecificBar; @@ -69,6 +71,24 @@ public class VueCourbe extends BuPanel { /** + * Petite classe utilie pour le combo box de choix de ligne directrice. + * Il permet de concerver l'index de la ligne directrice en plus de son nom. + * @author Emmanuel MARTIN + * @version $Id:$ + */ + private class PaireLd { + public int idx; + public String name; + public PaireLd(int _idx, String _name) { + idx=_idx; + name=_name; + } + public String toString() { + return name; + } + } + + /** * Ce nouveau model de courbe permet d'utiliser un model d\xE9j\xE0 existant sous la * forme d'une DataGeometry. */ @@ -139,6 +159,30 @@ } } + /** + * Place au point voulu le passage de la ligne directrice. + */ + public void setLigneDirectriceAt(int _idxPoint, int _idxLd) { + controller_.clearError(); + try { + data_.setLigneDirectriceAt(_idxLd, _idxPoint, controller_.getCommandManager()); + } + catch(IllegalArgumentException _e) { + controller_.showError(_e.getMessage()); + } + } + + /** + * Retourne les noms des lignes directrices d\xE9placable vers ce point. + */ + public PaireLd[] getAllowedLignesDirectricesAt(int _idxPoint) { + int[] idx=data_.getAllowedMoveOfLignesDirectricesTo(_idxPoint); + PaireLd[] lds=new PaireLd[idx.length]; + for(int i=0;i<lds.length;i++) + lds[i]=new PaireLd(idx[i], data_.getLigneDirectriceName(idx[i])); + return lds; + } + private void updateLabels() { courbe_.removeLabels(); // Rive gauche @@ -218,7 +262,7 @@ public String getPointLabel(int _i) { String[] names=data_.getNamesLignesDirectricesAt(_i); - if(names==null) + if(names.length==0) return null; // Construction du label par agr\xE9gation des noms String label=""; @@ -384,6 +428,7 @@ BuButton riveGauche_; BuButton riveDroite_; BuButton limiteDroite_; + BuComboBox lignesDirectrices_; public VueCourbe(Controller1d _controller, ProfilContainer _dataGeom){ controller_=_controller; @@ -471,7 +516,33 @@ courbeModel_.setLimiteDroite(idx[0]); } }); + actions.add(limiteDroite_); + lignesDirectrices_=new BuComboBox(); + lignesDirectrices_.addItem(new PaireLd(-1, FudaaLib.getS("LD"))); + lignesDirectrices_.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int[] idx=getSelection(); + if(idx!=null&&idx.length==1) { + PaireLd paireLd=(PaireLd) lignesDirectrices_.getSelectedItem(); + if(paireLd!=null&&paireLd.idx!=-1) + courbeModel_.setLigneDirectriceAt(idx[0], paireLd.idx); + } + } + }); + addSelectionListener(new CtuluListSelectionListener(){ + public void listeSelectionChanged(CtuluListSelectionEvent _e) { + int[] idx=getSelection(); + lignesDirectrices_.removeAllItems(); + lignesDirectrices_.addItem(new PaireLd(-1, FudaaLib.getS("LD"))); + if(idx!=null&&idx.length==1){ + PaireLd[] paireLd=courbeModel_.getAllowedLignesDirectricesAt(idx[0]); + for(int i=0;i<paireLd.length;i++) + lignesDirectrices_.addItem(paireLd[i]); + } + } + }); + actions.add(lignesDirectrices_); // Ajout des boutons \xE0 la barre speBar.addTools(actions.toArray(new JComponent[0])); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 18:56:27
|
Revision: 4379 http://fudaa.svn.sourceforge.net/fudaa/?rev=4379&view=rev Author: hadouxad Date: 2009-01-16 18:56:21 +0000 (Fri, 16 Jan 2009) Log Message: ----------- post Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGSpecificActions.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableGraphePanel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGActionAfficheOrigineCourbe.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -955,7 +955,7 @@ return (BCalqueLegende) getCqInfos().getCalqueParNom("cqLegende"); } - protected void removeCalqueLegend() { + public void removeCalqueLegend() { if (getCqLegend() != null) getCqInfos().remove(getCqLegend()); // getCqLegend().setVisible(false); } Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGActionAfficheOrigineCourbe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGActionAfficheOrigineCourbe.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGActionAfficheOrigineCourbe.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -0,0 +1,69 @@ +package org.fudaa.ebli.courbe; + +import java.awt.event.ActionEvent; +import java.util.HashMap; + +import javax.swing.Icon; + +import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.ressource.EbliResource; + +/** + * Action qui utilise les methodes viewGenerationSource() des modeles de courbes. + * Permet pour les modeles qui surcharge la methode d'afficher dans l'implementation fudaa voulue l'origine de la cr\xE9ation de la courbe. + * @author Adrien Hadoux + * + */ +public class EGActionAfficheOrigineCourbe extends EbliActionSimple{ + + /** + * Action utilis\xE9e uniquement pour les courbes unitaires (accessible via clic droit sur la courbe). + * @author genesis + * + */ + public static class CourbeOnly extends EGActionAfficheOrigineCourbe{ + EGModel model_; + public CourbeOnly(EGModel model,CtuluUI _impl){ + super(); + model_=model; + impl_=_impl; + } + public void actionPerformed(ActionEvent _e) { + if(model_!=null) + model_.viewGenerationSource(new HashMap(),impl_); + } + } + + EGFillePanel panelGraphe_; + CtuluUI impl_; + public EGActionAfficheOrigineCourbe(EGFillePanel _panel,CtuluUI _impl) { + this(); + panelGraphe_=_panel; + impl_=_impl; + } + public EGActionAfficheOrigineCourbe() { + super(EbliResource.EBLI.getString("Origine"),CtuluResource.CTULU.getIcon("crystal_visibilite"), "ORIGINE"); + } + @Override + public void actionPerformed(ActionEvent _e) { + + if(panelGraphe_.getGraphe().getSelectedComponent()==null || !(panelGraphe_.getGraphe().getSelectedComponent() instanceof EGCourbe)){ + impl_.error(EbliResource.EBLI.getString("Aucune courbe s\xE9lectionn\xE9e"),EbliResource.EBLI.getString("Aucune courbe s\xE9lectionn\xE9e"),true); + return; + }else if(panelGraphe_.getGraphe().getSelectedComponent().getModel()==null || !(panelGraphe_.getGraphe().getSelectedComponent().getModel() instanceof EGModel)){ + impl_.error(EbliResource.EBLI.getString("Aucune courbe s\xE9lectionn\xE9e"),EbliResource.EBLI.getString("Aucune courbe s\xE9lectionn\xE9e"),true); + return; + } + + //-- on recupere la courbe selectionnee dans le graphe --// + + EGModel modelSelectionne=panelGraphe_.getGraphe().getSelectedComponent().getModel(); + + modelSelectionne.viewGenerationSource(new HashMap(),impl_); + + + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -13,6 +13,7 @@ import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; /** @@ -221,6 +222,10 @@ return duplic; } + public void viewGenerationSource(Map infos, CtuluUI impl){ + + } + public Object getPersistSpecificDatas() { return null; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -15,6 +15,8 @@ import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ebli.commun.EbliActionInterface; +import java.util.List; + /** * @author Fred Deniger * @version $Id: EGGrapheModel.java,v 1.8 2007-02-01 16:12:04 deniger Exp $ @@ -177,5 +179,14 @@ */ public void setSpecificPersitDatas(Object sepcPersitData,Map Params); + + /** + * Methode qui retournes les actions sp\xE9cifiques AUX COURBES d'un graphe en fonction de son treemodel. + * Ces actions seront situ\xE9es dans le menu popup de la courbe (ie via clic droit sur la courbe dans l'arbre des courbes). + * Par exemple dans tr, le TrPostCourbeTreeModel retourne des actions d'ajout de variables pour les \xE9volutions temporelles. + * @return + */ + public List<EbliActionInterface> getSpecificsActionsCurvesOnly(EGGraphe _target); + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -284,6 +284,9 @@ in.close(); + + //-- on finalise les actions d'un graphe --// + model.finalizePersistance(); //-- Etape finale: creation du graphe --// graphe=new EGGraphe(model); graphe.transformer_.setXAxe(axeX); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheSimpleModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -810,4 +810,10 @@ } + +public List<EbliActionInterface> getSpecificsActionsCurvesOnly(EGGraphe _target) { + // TODO Auto-generated method stub + return null; +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -1132,4 +1132,18 @@ } + +public List<EbliActionInterface> getSpecificsActionsCurvesOnly(EGGraphe _target) { + // TODO Auto-generated method stub + return null; +} + + +/** + * Methode qui est appelee apres avoir charg\xE9 un model de graphe persistant. Doit etre surcharg\xE9 a plus haut niveau pour effectuer des actions de finalisation specifiques. + */ +public void finalizePersistance(){ + +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -162,6 +162,10 @@ return Collections.enumeration(comp_); } + public List getChildren() { + return comp_; + } + public boolean contains(final EGCourbe _i) { return comp_.contains(_i); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -11,6 +11,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.collection.CourbeInterface; import org.fudaa.ebli.palette.BPaletteInfo; @@ -191,11 +192,24 @@ */ EGModel duplicate(); + /** - * @return + * Methode qui une fois appel\xE9e se charge de creer un module ou interface qui affiche l'origine de la cr\xE9ation de la courbe. + * @param infos + * @param CtuluUI: l'implementation dans laquelle afficher les informations */ + void viewGenerationSource(Map infos, CtuluUI impl); + + /** + * retourner les infos persistantes de la courbe du mod\xE8le. + */ Object getPersistSpecificDatas(); + /** + *recuperer les infos persistantes de la courbe qui vont permettre de recr\xE9er le mod\xE8le. + * @param data + * @param infos + */ void setPersistSpecificDatas(Object data, Map infos); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGSpecificActions.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGSpecificActions.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGSpecificActions.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -16,8 +16,10 @@ import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.ctulu.gui.CtuluPopupMenu; +import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.ressource.EbliResource; @@ -50,6 +52,13 @@ target_ = _target; } + + CtuluUI ui_; + public EGSpecificActions(final EGGraphe _target,CtuluUI _ui) { + this(_target); + ui_=_ui; + } + private static String getActLast() { return "DERNIER"; } @@ -124,13 +133,21 @@ else menu_.addMenuItem(EbliResource.EBLI.getString("Courbe classique"), "NUAGE_POINTS", BuResource.BU .getIcon("crystal_oscilloscope"), true, this); + + //-- action origine de la courbe. --// + menu_.add(new EGActionAfficheOrigineCourbe.CourbeOnly(courbe.getModel(),ui_)); + + if(target_.getModel().getSpecificsActionsCurvesOnly(target_)!=null) + for(EbliActionInterface action:target_.getModel().getSpecificsActionsCurvesOnly(target_)) + menu_.add(action); + } } - + if(_evt!=null) menu_.show(_evt.getComponent(), _evt.getX(), _evt.getY()); } @@ -266,4 +283,12 @@ } +public CtuluPopupMenu getMenu() { + if(menu_==null) + buildPopupMenu(null); + return menu_; +} + + + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableGraphePanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableGraphePanel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGTableGraphePanel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -436,10 +436,15 @@ EvolTable t_; + + public EGTableGraphePanel() { + this(true); + } + boolean afficheNomCourbe_=true; /** * Initialise tous les composants n\xE9cessaires. */ - public EGTableGraphePanel() { + public EGTableGraphePanel(boolean afficheNomCourbe) { setLayout(new BuBorderLayout(5, 1, true, true)); setBorder(BorderFactory.createEmptyBorder(2, 5, 5, 2)); lb_ = new BuLabel(); @@ -447,7 +452,9 @@ lb_.setHorizontalTextPosition(SwingConstants.CENTER); lb_.setVerticalAlignment(SwingConstants.CENTER); lb_.setVerticalTextPosition(SwingConstants.CENTER); - add(lb_, BuBorderLayout.NORTH); + afficheNomCourbe_=afficheNomCourbe; + if(afficheNomCourbe) + add(lb_, BuBorderLayout.NORTH); t_ = new EvolTable() { public TableCellEditor getCellEditor(final int _row, final int _column) { @@ -624,7 +631,8 @@ updateButtons(); final BuPanel north = new BuPanel(); north.setLayout(new BuBorderLayout(2, 2, true, false)); - north.add(lb_, BuBorderLayout.NORTH); + if(afficheNomCourbe_) + north.add(lb_, BuBorderLayout.NORTH); final BuPanel pnBt = new BuPanel(); pnBt.setLayout(new BuButtonLayout(1, SwingConstants.LEFT)); pnBt.add(btAdd_); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -2,6 +2,7 @@ import java.awt.BorderLayout; import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -27,6 +28,7 @@ import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.commun.EbliComponentFactory; +import org.fudaa.ebli.courbe.EGActionAfficheOrigineCourbe; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; @@ -99,7 +101,9 @@ initTitlesOrigins(widgetGraphe_.panelGraphe_.getGraphe().getModel()); - + + + } @Override @@ -475,7 +479,7 @@ return menuGraphe_; } - + /** * Recupere les objets graphique tree et panel infos associe au calque. * @@ -485,19 +489,19 @@ public JComponent getOverviewComponent() { if (panelTreeGraphe_ == null) { - final EGTree tree = new EGTree(); - tree.setActions(new EGSpecificActions(getGraphe())); + final EGTree tree_ = new EGTree(); + tree_.setActions(new EGSpecificActions(getGraphe(),getWidget().getEbliScene().getCtuluUi() )); final EGGrapheTreeModel treeModel = (EGGrapheTreeModel) getGraphe().getModel(); - tree.setModel(treeModel); - tree.setSelectionModel(treeModel.getSelectionModel()); + tree_.setModel(treeModel); + tree_.setSelectionModel(treeModel.getSelectionModel()); - final EGTableGraphePanel tablePanel = new EGTableGraphePanel(); + final EGTableGraphePanel tablePanel = new EGTableGraphePanel(false); tablePanel.setGraphe(getGraphe()); tablePanel.addPanelAction(getGraphePanel()); final JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); - final JScrollPane compTop = new JScrollPane(tree); - compTop.setPreferredSize(new Dimension(150, 400)); + final JScrollPane compTop = new JScrollPane(tree_); + compTop.setPreferredSize(new Dimension(150, 200)); pane.setTopComponent(compTop); //-- panel global qui contient la paletet d'infos + tableau de valeurs --// @@ -505,12 +509,22 @@ final JSplitPane panelBottom = new JSplitPane(JSplitPane.VERTICAL_SPLIT); EGPaletteInfo paletteInfos=new EGPaletteInfo( getGraphePanel()); paletteInfos.setAvailable(true); - // final JScrollPane paletteInfos = new JScrollPane(paEg); - paletteInfos.setPreferredSize(new Dimension(150, 80)); - panelBottom.setTopComponent(paletteInfos); + paletteInfos.setPreferredSize(new Dimension(150, 120)); + //-- ajout des actions origine et replayData pour les graphes--// + BuPanel panelBoutons=new BuPanel(new FlowLayout(FlowLayout.LEFT)); + EGActionAfficheOrigineCourbe origine=new EGActionAfficheOrigineCourbe(getGraphePanel(),getWidget().getEbliScene().getCtuluUi()); + panelBoutons.add(origine.buildButton(EbliComponentFactory.INSTANCE)); + + + BuPanel miseEnPage=new BuPanel(new BorderLayout()); + miseEnPage.add(paletteInfos,BorderLayout.CENTER); + miseEnPage.add(panelBoutons,BorderLayout.SOUTH); + miseEnPage.setPreferredSize(new Dimension(150, 150)); + panelBottom.setTopComponent(miseEnPage); + final JScrollPane comp = new JScrollPane(tablePanel); - comp.setPreferredSize(new Dimension(150, 200)); + comp.setPreferredSize(new Dimension(150, 150)); panelBottom.setBottomComponent(comp); pane.setBottomComponent(panelBottom); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -13,6 +13,7 @@ import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; @@ -176,4 +177,7 @@ public void setPersistSpecificDatas(Object data, Map infos) { } + public void viewGenerationSource(Map infos, CtuluUI impl){ + + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -13,6 +13,7 @@ import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; @@ -219,5 +220,7 @@ public void setPersistSpecificDatas(Object data, Map infos) { } - + public void viewGenerationSource(Map infos, CtuluUI impl){ + + } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -5,6 +5,7 @@ import java.util.Map; import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.ebli.courbe.EGModel; @@ -97,5 +98,12 @@ return new ScopeCourbeModel((EvolutionReguliere)this.e_.getCopy(this.e_.getListener())); } - + public void viewGenerationSource(Map infos, CtuluUI impl){ + if(infos_.get(ScopeStructure.NOM_FICHIER)!=null){ + String msg="Cette courbe est issue du fichier "+infos_.get(ScopeStructure.NOM_FICHIER); + impl.message("Origine de la courbe scop", msg, false); + }else{ + impl.message("Origine de la courbe scop", "Impossible de trouver", false); + } + } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -18,6 +18,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.CtuluVariable; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.dodico.ef.EfGridData; @@ -28,9 +29,11 @@ import org.fudaa.ebli.palette.BPaletteInfo.InfoData; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; +import org.fudaa.fudaa.tr.post.TrReplayCurvesData; import org.fudaa.fudaa.tr.post.actions.TrPostProfileAction; import com.vividsolutions.jts.geom.LineString; @@ -390,6 +393,35 @@ //-- rejouer les donn\xE9es --// this.computeY(projet.impl_.getMainProgression()); } + public void viewGenerationSource(Map infos, CtuluUI impl){ + if(!(impl instanceof TrPostCommonImplementation)){ + impl.error(TrResource.getS("Impossible de r\xE9cup\xE9rer la bonne interface fudaa")); + return; + } + TrPostCommonImplementation implementation=(TrPostCommonImplementation)impl; + //-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --// + TrReplayCurvesData.getInstance().constructProfilSpatialOrigine(this, implementation); + + } + + public EfGridData getData() { + return data_; + } + + public void setData(EfGridData _data) { + this.data_ = _data; + } + + public EfLineIntersectionsResultsBuilder getBuilder() { + return builder_; + } + + public void setBuilder(EfLineIntersectionsResultsBuilder _builder) { + this.builder_ = _builder; + } + + + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -11,6 +11,7 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsBuilder; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; @@ -197,5 +198,7 @@ public void setPersistSpecificDatas(Object data, Map infos) { } - + public void viewGenerationSource(Map infos, CtuluUI impl){ + + } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -12,6 +12,7 @@ import java.awt.EventQueue; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -57,6 +58,7 @@ import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; import org.fudaa.fudaa.tr.post.ScopCourbeTreeModel; +import org.fudaa.fudaa.tr.post.TrPostCourbeModel; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.actions.TrPostProfileAction; @@ -708,6 +710,66 @@ } + + public void finalizePersistance(){ + + //-- recupere les groupes de la persistance qui doivent etre supprim\xE9 car ne sont pas des liens directs avec les variables H2dVariableType du projet--// + ArrayList<EGGroup> listeGroupeAsupprimer=new ArrayList<EGGroup>(); + + + for(int i=0;i<this.getNbEGObject();i++){ + EGObject eg=this.getEGObject(i); + if((this.getEGObject(i) instanceof EGGroup) && !(this.getEGObject(i) instanceof MvProfileCourbeGroup)){ + + EGGroup groupe=(EGGroup) this.getEGObject(i); + ArrayList<EGCourbeChild> listeCourbeToAdd=new ArrayList<EGCourbeChild>(); + MvProfileCourbeGroup nvGroupe=null; + for(int k=0;k<groupe.getChildCount();k++){ + if(groupe.getCourbeAt(k)!=null){ + EGCourbeChild courbe=groupe.getCourbeAt(k); + + if(courbe.getModel()!=null && (courbe.getModel() instanceof MVProfileCourbeModel)){ + // List childrens=groupe.getChildren(); + MVProfileCourbeModel model=(MVProfileCourbeModel) courbe.getModel(); + //-- recherche ou creation du bon groupe correspondant--// + nvGroupe=getGroup(model.variable_,true); + //nvGroupe.addEGComponent(courbe); + + listeCourbeToAdd.add(courbe); + + + }else{ + //-- on cree le groupe sans car la courbe n'est pas profil spatioal, elel peut etre socpgen--// + nvGroupe=getGroup(H2dVariableType.SANS,true); + //nvGroupe.addEGComponent(courbe); + //listeVar.put(groupe, MvProfileFillePanel.createGroupFor(H2dVariableType.SANS)); + listeCourbeToAdd.add(courbe); + } + + } + + } + + //-- ajout de la liste des children dans le bon groupe --// + nvGroupe.addEGComponent(listeCourbeToAdd); + + //-- ajout du groupe dans la liste a supprimer --// + listeGroupeAsupprimer.add(groupe); + } + } + + this.fireStructureChanged(); + //-- ensuite on vire tout les eggroup et on les remplies dans les goup --// + for(EGGroup groupe:listeGroupeAsupprimer){ + + super.remove(groupe); + + } + + + + } + @Override public EGGrapheModel duplicate(final EGGrapheDuplicator _duplicator) { final MvProfileTreeModel duplic = new MvProfileTreeModel(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -133,5 +133,9 @@ return duplic; } + + public String getSelectedSpecificCourbeInfos(){ + return null; + } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -26,7 +26,6 @@ import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGGraphe; -import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuBorders; @@ -77,22 +76,26 @@ @Override public void actionPerformed(final ActionEvent _e) { final TrPostCourbeTreeModel model = (TrPostCourbeTreeModel) model_.getModel(); - //final EGCourbe selectedComponent = model_.getSelectedComponent(); + final EGCourbe selectedComponent = model_.getSelectedComponent(); // final EGCourbe selectedComponent = model_.getModel().getCourbes()[0]; TrPostSource src = null; // if (selectedComponent != null && selectedComponent.getModel() instanceof TrPostCourbeModel) { // src = ((TrPostCourbeModel) selectedComponent.getModel()).getSource(); // } + if(selectedComponent==null || !(selectedComponent.getModel() instanceof TrPostCourbeModel)){ + impl_.error("Impossibe, on ne peut ajouter des variables que pour une \xE9volution temporelle. \n La courbe choisie n'est pas une \xE9volution temporelle."); + return; + } + final TrPostCourbeModel modelEvol=(TrPostCourbeModel)selectedComponent.getModel(); + //-- creation d'un lister de fichier source --// final String[] values = impl_.c_.formattageDonnees(false); final int selectedSource = selectSource(values, (String) getValue(Action.NAME), impl_.getFrame()); if(selectedSource !=-1) src=impl_.c_.getSource(selectedSource); - - if (src == null) return; final TrPostSource finalSrc = src; @@ -103,13 +106,13 @@ var.removeAll(model.varSupported_); - if(model.objIdx_==null){ - model.objIdx_=new int[src.getTime().getNbTimeStep()]; - for(int i=0;i<src.getTime().getNbTimeStep();i++) - model.objIdx_[i]=i; - } - if(model.intepolPt_==null) - model.intepolPt_ = new HashSet(); +// if(model.objIdx_==null){ +// model.objIdx_=new int[src.getTime().getNbTimeStep()]; +// for(int i=0;i<src.getTime().getNbTimeStep();i++) +// model.objIdx_[i]=i; +// } +// if(model.intepolPt_==null) +// model.intepolPt_ = new HashSet(); final H2dVariableType[] vars = (H2dVariableType[]) var.toArray(new H2dVariableType[var.size()]); final Object[] selected = select(vars, (String) getValue(Action.NAME), impl_.getFrame()); @@ -118,7 +121,7 @@ @Override public void act() { - model.addVariables(finalSrc, Arrays.asList(selected), new ProgressionBuAdapter(this), model_.getCmd()); + model.addVariables(modelEvol,finalSrc, Arrays.asList(selected), new ProgressionBuAdapter(this), model_.getCmd()); EventQueue.invokeLater(new Runnable() { public void run() { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -7,20 +7,30 @@ */ package org.fudaa.fudaa.tr.post; +import java.awt.Dimension; +import java.awt.Rectangle; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; +import javax.swing.JScrollPane; + import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.collection.CtuluArrayDouble; +import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.dodico.ef.EfData; import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.ebli.calque.BArbreCalque; +import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.courbe.EGCourbeChild; import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGModel; @@ -30,6 +40,10 @@ import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeModel; import org.fudaa.fudaa.tr.common.TrResource; +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuBorders; +import com.memoire.bu.BuLabel; +import com.memoire.bu.BuScrollPane; import com.memoire.fu.FuLog; import com.vividsolutions.jts.geom.Coordinate; @@ -51,22 +65,22 @@ */ public TrPostSource source_; - + public final static class Interpolated extends TrPostCourbeModel { - TrPostInterpolatePoint ptIdx_; + TrPostInterpolatePoint ptIdx_; - - /** - * ACHTUNG: constructeur utilis\xE9 uniquement pour la persistance des donn\xE9es!!! - */ - public Interpolated(){ - super(); - } - - + /** + * ACHTUNG: constructeur utilis\xE9 uniquement pour la persistance des donn\xE9es!!! + */ + public Interpolated(){ + super(); + } + + + /** * @param _ptIdx * @param _varIdx * @param _timeIdx @@ -124,47 +138,47 @@ if(point!=null && (point instanceof TrPostInterpolatePoint)) ptIdx_=(TrPostInterpolatePoint) point; } - + public String getInfosPoint() { - + return TrResource.getS("Point interpol\xE9:")+" ("+ptIdx_.x_+";"+ptIdx_.y_+")"; } - + @Override public boolean replayData(TrPostSource src, H2dVariableType var,EGGroup groupe,Map infos) { try{ - //-- creation d un nouveau node pour les donnees en entree --// - EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); - - //-- on remplace les anciennes valeurs par les nouvelles calculees --// - infos.put("MODELREPLAY", newCurve); - -// this.y_=((Node)newCurve.getModel()).y_; -// this.time_=((Node)newCurve.getModel()).time_; - + //-- creation d un nouveau node pour les donnees en entree --// + EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); + + //-- on remplace les anciennes valeurs par les nouvelles calculees --// + infos.put("MODELREPLAY", newCurve); + + // this.y_=((Node)newCurve.getModel()).y_; + // this.time_=((Node)newCurve.getModel()).time_; + }catch(Exception e){ e.printStackTrace(); return false; } return true; } - - - public EGModel duplicate() { - Interpolated duplic = new Interpolated(this.source_,new TrPostInterpolatePoint(this.ptIdx_),this.var_); - if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); - if (this.nom_ != null) duplic.nom_ = nom_; - if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); - return duplic; - } + public EGModel duplicate() { + Interpolated duplic = new Interpolated(this.source_,new TrPostInterpolatePoint(this.ptIdx_),this.var_); + if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); + if (this.nom_ != null) duplic.nom_ = nom_; + if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); + + return duplic; + } + } public final static class Node extends TrPostCourbeModel { - int ptIdx_; + int ptIdx_; /** * @param _ptIdx @@ -176,14 +190,14 @@ ptIdx_ = _ptIdx; } - + /** * ACHTUNG: constructeur utilis\xE9 uniquement pour la persistance des donn\xE9es!!! */ public Node(){ super(); } - + @Override protected void updateY() { createY(); @@ -197,7 +211,7 @@ FuLog.error(e); } // } - } + } // final EfData data = source_.getData(_var, _timeIdx); // if (data == null) { // FuLog.warning("TRP: data is null for " + _var); @@ -250,16 +264,16 @@ @Override public boolean replayData(TrPostSource src, H2dVariableType var,EGGroup groupe,Map infos) { try{ - //-- creation d un nouveau node pour les donnees en entree --// - EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); - - //-- on remplace les anciennes valeurs par les nouvelles calculees --// - infos.put("MODELREPLAY", newCurve); -// this.y_=((Node)newCurve.getModel()).y_; -// this.time_=((Node)newCurve.getModel()).time_; - - - + //-- creation d un nouveau node pour les donnees en entree --// + EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); + + //-- on remplace les anciennes valeurs par les nouvelles calculees --// + infos.put("MODELREPLAY", newCurve); + // this.y_=((Node)newCurve.getModel()).y_; + // this.time_=((Node)newCurve.getModel()).time_; + + + }catch(Exception e){ e.printStackTrace(); return false; @@ -268,18 +282,18 @@ } public EGModel duplicate() { - Node duplic = new Node(this.source_,this.ptIdx_,this.var_,CtuluLibArray.copy(time_)); - if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); - if (this.nom_ != null) duplic.nom_ = nom_; - if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); + Node duplic = new Node(this.source_,this.ptIdx_,this.var_,CtuluLibArray.copy(time_)); + if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); + if (this.nom_ != null) duplic.nom_ = nom_; + if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); - return duplic; - } - + return duplic; + } + @Override public String getInfosPoint() { - + return TrResource.getS("Point r\xE9el ")+ptIdx_+":("+this.source_.getGrid().getPtX(ptIdx_)+";"+this.source_.getGrid().getPtY(ptIdx_)+")"; } @@ -319,7 +333,7 @@ source_ = _src; var_ = _varIdx; } - + /** * ACTHUNG: constructeur utilis\xE9 uniquement pour la persistance des donn\xE9es!!! */ @@ -379,38 +393,38 @@ y_ = new double[source_.getNbTimeStep()]; } } - - - + + + public boolean addValue(double[] _x, double[] _y, CtuluCommandContainer _cmd) { - + time_ = CtuluLibArray.copy(_x); - y_ = CtuluLibArray.copy(_y); - -// for(int i=0;i<Math.min(_x.length,_y.lenght);i++){ -// -// } - + y_ = CtuluLibArray.copy(_y); + + // for(int i=0;i<Math.min(_x.length,_y.lenght);i++){ + // + // } + return true; } - - + + public void fillWithInfo(InfoData _table, CtuluListSelectionInterface _selectedPt) { if(EbliWidget.AMELIO_LOT_VISIBLE){ _table.put(TrResource.getS("Type"),"Evolution temporelle"); _table.put(TrResource.getS("Fichier r\xE9sultat"),this.source_.getFile().getName()); - _table.put(TrResource.getS("Chemin complet"),this.source_.getFile().getAbsolutePath()); - _table.put(TrResource.getS("Titre Fichier r\xE9sultat"),this.source_.getTitle()); - _table.put(TrResource.getS("Infos Point initial"),this.getInfosPoint()); - _table.put(TrResource.getS("Variable"),this.getVar().getName()+" en "+this.getVar().getCommonUnitString()); - - - + _table.put(TrResource.getS("Chemin complet"),this.source_.getFile().getAbsolutePath()); + _table.put(TrResource.getS("Titre Fichier r\xE9sultat"),this.source_.getTitle()); + _table.put(TrResource.getS("Infos Point initial"),this.getInfosPoint()); + _table.put(TrResource.getS("Variable"),this.getVar().getName()+" en "+this.getVar().getCommonUnitString()); + + + } } - - + + public Object getPersistSpecificDatas() { //-- retourne le quatuor point, pdt,variable et fichier source @@ -422,7 +436,7 @@ listeData.add(getSelectionPoint()); return listeData; } - + public abstract String getInfosPoint(); public abstract Object getSelectionPoint(); public abstract void setSelectionPoint(Object point); @@ -432,9 +446,9 @@ */ public abstract boolean replayData(TrPostSource src,H2dVariableType var,EGGroup groupe,Map infos); - + public void setPersistSpecificDatas(Object data, Map infos) { - if(data ==null || !(data instanceof ArrayList))return; + if(data ==null || !(data instanceof ArrayList))return; ArrayList<Object> liste=(ArrayList<Object>)data; String idSource=(String) liste.get(0); TrPostProjet projet = (TrPostProjet) infos.get("TrPostProjet"); @@ -446,13 +460,13 @@ this.source_=src; else{ ((List<String>) infos.get("errorMsg")) - .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); - return; + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); + return; } }else{ ((List<String>) infos.get("errorMsg")) - .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); - return; + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); + return; } // -- etape 2:times: ce sont les x donn\xE9es indirectement. --// @@ -460,18 +474,18 @@ // -- etape 3:variable --// String idVar=(String)liste.get(1); H2dVariableType var=null;//(H2dVariableType) liste.get(1); - + //-- recherche dans les sources de la variable par id --// for(int i=0;i<src.getAvailableVar().length;i++) if(src.getAvailableVar()[i].getID().equals(idVar)) var=src.getAvailableVar()[i]; - + if(var!=null) this.var_=var; else{ ((List<String>) infos.get("errorMsg")) - .add("Erreur, la frame graphe ne trouve pas la variable qui correspond \xE0 l'ID " + idVar); - return; + .add("Erreur, la frame graphe ne trouve pas la variable qui correspond \xE0 l'ID " + idVar); + return; } Object point=liste.get(2); if(point!=null) @@ -479,34 +493,45 @@ //-- FAUT il rejouer les donnees?? --// //final List<String> listeReloadSource=(List<String>) infos.get("RELOAD"); - + //if(listeReloadSource!=null && projet!=null && this.source_!=null && listeReloadSource.contains(idSource)){ - //-- on rejoue les donn\xE9es : methode specialisee replayData--// - this.updateY(); + //-- on rejoue les donn\xE9es : methode specialisee replayData--// + this.updateY(); //} + + + // if(listeReloadSource!=null && projet!=null && this.source_!=null && listeReloadSource.contains(idSource)){ + // //-- on rejoue les donn\xE9es : methode specialisee replayData--// + // EGGroup groupe =(EGGroup)infos.get("GROUPE"); + // if(groupe!=null){ + // + // + // if(replayData(this.source_, var,groupe,infos)){ + // + // }else{ + // //-- message d'erreur: rejoue des donnees foireux --// + // ((List<String>) infos.get("errorMsg")) + // .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); + // } + // }else{ + // //-- message d erreur: impossible de rejoeur les donnees --// + // ((List<String>) infos.get("errorMsg")) + // .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); + // } + // } + + + } + public void viewGenerationSource(Map infos, CtuluUI impl){ + + if(!(impl instanceof TrPostCommonImplementation)){ + impl.error(TrResource.getS("Impossible de r\xE9cup\xE9rer la bonne interface fudaa")); + return; + } + TrPostCommonImplementation implementation=(TrPostCommonImplementation)impl; + + //-- on cree une vue 2d a partir du fichier source fourni et on le centre sur le point interpol\xE9 ou non --// + TrReplayCurvesData.getInstance().constructEvolTemporelleOrigine(this, implementation); - -// if(listeReloadSource!=null && projet!=null && this.source_!=null && listeReloadSource.contains(idSource)){ -// //-- on rejoue les donn\xE9es : methode specialisee replayData--// -// EGGroup groupe =(EGGroup)infos.get("GROUPE"); -// if(groupe!=null){ -// -// -// if(replayData(this.source_, var,groupe,infos)){ -// -// }else{ -// //-- message d'erreur: rejoue des donnees foireux --// -// ((List<String>) infos.get("errorMsg")) -// .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); -// } -// }else{ -// //-- message d erreur: impossible de rejoeur les donnees --// -// ((List<String>) infos.get("errorMsg")) -// .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); -// } -// } - - } - } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -31,10 +31,12 @@ import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.mesure.EvolutionReguliereInterface; +import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheDuplicator; import org.fudaa.ebli.courbe.EGGrapheModel; import org.fudaa.ebli.courbe.EGGrapheTreeModel; @@ -331,7 +333,16 @@ } - protected void addVariables(final TrPostSource _src, final List _var, final ProgressionInterface _prog, + /** + * Ajoute une variable par rapport a une courbe evolution temporelle selectionnee. + * La variable a ete choisie ainsi que le fichier source. + * @param modelCourbe + * @param _src + * @param _var + * @param _prog + * @param _cmd + */ + protected void addVariables(TrPostCourbeModel modelCourbe,final TrPostSource _src, final List _var, final ProgressionInterface _prog, final CtuluCommandContainer _cmd) { // buildTimeSteps(); @@ -349,23 +360,29 @@ // fusion graphes _var.removeAll(varSupported_); - final int nbPt = objIdx_.length; + //final int nbPt = objIdx_.length; final double[] timesInSec = _src.getTime().getTimeListModel().getTimesInSec(); - final TrPostCourbeModel[] model = new TrPostCourbeModel[_var.size() * (nbPt + intepolPt_.size())]; + final TrPostCourbeModel[] model = new TrPostCourbeModel[_var.size()];//_var.size() * (nbPt + intepolPt_.size())]; int idx = 0; final List courbeToMem = _cmd == null ? null : new ArrayList(); final List groupToMem = _cmd == null ? null : new ArrayList(); for (int i = 0; i < _var.size(); i++) { final H2dVariableType var = (H2dVariableType) _var.get(i); final EGGroup g = getGroupFor(var); - for (int idxPt = 0; idxPt < nbPt; idxPt++) { - final EGCourbeChild c = TrPostCourbeModel.buildCourbeModel(var, objIdx_[idxPt], g, _src); + // for (int idxPt = 0; idxPt < nbPt; idxPt++) { + + //-- cas reel --// + if(modelCourbe instanceof TrPostCourbeModel.Node){ + final EGCourbeChild c = TrPostCourbeModel.buildCourbeModel(var, ((Integer)modelCourbe.getSelectionPoint()).intValue(), g, _src); courbeToMem.add(c); groupToMem.add(g); model[idx++] = (TrPostCourbeModel) c.getModel(); } - for (final Iterator iter = intepolPt_.iterator(); iter.hasNext();) { - final TrPostInterpolatePoint element = (TrPostInterpolatePoint) iter.next(); + else{ + //for (final Iterator iter = intepolPt_.iterator(); iter.hasNext();) { + //-- cas point interpol\xE9 --// + + final TrPostInterpolatePoint element = (TrPostInterpolatePoint)modelCourbe.getSelectionPoint(); final EGCourbeChild c = TrPostCourbeModel.buildCourbeModel(var, element, g, _src); courbeToMem.add(c); groupToMem.add(g); @@ -415,6 +432,9 @@ } + + + private void buildUpdating() { if (updating_ == null) { updating_ = new EGGroup(); @@ -980,6 +1000,30 @@ /** + * parcours la liste de ses courbes et range les fons groupes de variables correspondant + */ + public void finalizePersistance(){ + for(int i=0;i<this.getNbEGObject();i++){ + + if(this.getEGObject(i) instanceof EGGroup){ + + EGGroup groupe=(EGGroup) this.getEGObject(i); + for(int k=0;k<groupe.getChildCount();k++){ + if(groupe.getCourbeAt(k)!=null){ + EGCourbeChild courbe=groupe.getCourbeAt(k); + if(courbe.getModel()!=null && (courbe.getModel() instanceof TrPostCourbeModel)){ + TrPostCourbeModel model=(TrPostCourbeModel) courbe.getModel(); + varGroup_.put(model.var_, groupe); + } + } + } + } + } + + + } + + /** * Methode qui affiche les infos principales de la courbe choisie * @return */ @@ -1022,5 +1066,19 @@ this.impl_ = projet.impl_; } + + + /** + * Les actions des courbes specifiques: l'ajout de variable. + */ + public List<EbliActionInterface> getSpecificsActionsCurvesOnly(EGGraphe _target) { + List<EbliActionInterface> listeActions=new ArrayList<EbliActionInterface>(); + + //-- action d'ajout des variables --// + listeActions.add(new TrPostCourbeAddVariableAction(projet_.impl_, _target)); + + return listeActions; + + } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -46,6 +46,7 @@ import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorArrowEditor; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorTextEditor; +import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetControllerGraphe; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; @@ -327,14 +328,20 @@ // TrPostVisuPanel _calque = (TrPostVisuPanel) creator.getCalquepanelProvenance(); // TODO trop dangereux... // listeActions.add(new TrPostCourbeAddPointsAction(projet_.impl_, _graphe.getGraphe(), _calque)); - if (!(_graphe.getGraphe().getModel() instanceof MvProfileTreeModel)) listeActions - .add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); + // if (!(_graphe.getGraphe().getModel() instanceof MvProfileTreeModel)) listeActions +// .add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); + + //-- action ajout de variable --// +// if (_graphe.getGraphe().getModel() instanceof TrPostCourbeTreeModel){ +// ((EbliWidgetControllerGraphe)_controller).tree_.getActions().getMenu().add(new TrPostCourbeAddVariableAction(projet_.impl_, _graphe.getGraphe())); +// +// } if (_graphe.getGraphe().getModel() instanceof MvProfileTreeModel) { listeActions .add(new TrPostActionBilan(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_.getImpl())); - // listeActions.add(new TrPostActionCubature(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_ - // .getImpl())); +// listeActions.add(new TrPostActionCubature(((MvProfileTreeModel) _graphe.getGraphe().getModel()), projet_ +// .getImpl())); } // -- ajout de l'importation dans les courbes de l'action --// Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2009-01-16 13:36:14 UTC (rev 4378) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -179,7 +179,8 @@ projet_ = _controller; info_ = new TrPostInfoDelegate(source_, getEbliFormatter()); addCqInfos(source_.getGrid()); - addCqLegende(_leg); + if(_leg!=null) + addCqLegende(_leg); addCqMaillage(source_.getGrid(), info_); final MvGridLayerGroup gr = getGridGroup(); gr.getPointLayer().setVisible(false); Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-01-16 18:56:21 UTC (rev 4379) @@ -0,0 +1,233 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Rectangle; +import java.util.Vector; + +import javax.swing.JComponent; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; + +import org.fudaa.ctulu.gis.GISZoneCollectionPoint; +import org.fudaa.ctulu.gui.CtuluDialogPanel; +import org.fudaa.ebli.calque.BArbreCalque; +import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BCalqueLegende; +import org.fudaa.ebli.calque.ZCalquePoint; +import org.fudaa.ebli.calque.edition.ZModelePointEditable; +import org.fudaa.ebli.courbe.EGModel; +import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceIconModel; +import org.fudaa.ebli.trace.TraceLigneModel; +import org.fudaa.ebli.visuallibrary.calque.CalqueLegendeWidgetAdapter; +import org.fudaa.fudaa.meshviewer.profile.MVProfileCourbeModel; +import org.fudaa.fudaa.sig.layer.FSigEditor; +import org.fudaa.fudaa.sig.layer.FSigLayerPointEditable; +import org.fudaa.fudaa.tr.common.TrResource; + +import com.memoire.bu.BuBorderLayout; +import com.memoire.bu.BuBorders; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.LineString; + + + +/** + * Classe qui se charge d'afficher et rejouer les donn\xE9es d'origine des courbes TR. + * C'set a dire les courbes spatiales et evolutions temporelles. + * @author Adrien Hadoux + * + */ +public class TrReplayCurvesData { + + /** + * Classe singleton. + * Permet de stocker en memoire les constructions pour optimiser les calculs. + */ + private static TrReplayCurvesData instance_; + + /** + * Vue 2d gardee en memoire si on fait plusieurs appels cons\xE9cutifs \xE0 des courbes qui ont le meme fichier source. + */ + private TrPostVisuPanel memoire_; + private TrPostSource srcMemoire_; + + + public static TrReplayCurvesData getInstance(){ + + if(instance_==null) + instance_=new TrReplayCurvesData(); + return instance_; + + } + + /** + * Retourne une nouvelle vue 2d en fonction des parametres fournis. + * Dans le cas ou les parametres fournis ont deja constitu\xE9 le pr\xE9c\xE9dent appel, on retourne la construction graphique pr\xE9c\xE9dente. + * @param implementation + * @param src + * @return + */ + private TrPostVisuPanel createVue2d(TrPostCommonImplementation implementation,TrPostSource src){ + //-- petite optimisation --// + if(srcMemoire_!=null && memoire_!=null && srcMemoire_==src) + return memoire_; + + BCalqueLegende legende=new BCalqueLegende(); + TrPostVisuPanel vue2d=new TrPostVisuPanel(implementation,implementation.c_,legende,src); + vue2d.removeCalqueLegend(); + + vue2d.restaurer(); + Rectangle rec=new Rectangle(300,300); + vue2d.setPreferredSize(new Dimension(300,300)); + final BCalque[] tousCalques = vue2d.getVueCalque().getCalque().getTousCalques(); + vue2d.getVueCalque().setSize(rec.width, rec.height); + // calquePanel_.setPreferredSize(new Dimension(rec.width, rec.height)); + vue2d.getVueCalque().getCalque().setSize(rec.width, rec.height); + for (int i = 0; i < tousCalques.length; i++) { + tousCalques[i].setSize(rec.width, rec.height); + } + vue2d.restaurer(); + return vue2d; + } + + /** + * Cree la dialog qui affiche tout le contenu d'origine du graphe. + * @param vue2d + * @param implementation + * @param modele + */ + private void createDialogOrigine(TrPostVisuPanel vue2d, TrPostCommonImplementation implementation, EGModel modele,JComponent composantAdditionnel){ + //final JScrollPane arbreVue2d = new JScrollPane(new BArbreCalque(vue2d.getArbreCalqueModel())); + implementation.createTask(TrResource.getS("Origine ")+" "+modele.getTitle()); + final CtuluDialogPanel pn = new CtuluDialogPanel(false); + pn.setLayout(new BuBorderLayout()); + pn.setBorder(BuBorders.EMPTY3333); + //pn.add(new BuLabel(CtuluLib.getS("S\xE9lectionner le fichier r\xE9sultat")), BuBorderLayout.NORTH); + pn.add(vue2d,BuBorderLayout.CENTER); + if(composantAdditionnel!=null) + pn.add(composantAdditionnel,BuBorderLayout.EAST); + //pn.add(arbreVue2d,BuBorderLayout.EAST); + pn.add(vue2d.getLabelSuiviSouris(),BuBorderLayout.SOUTH); + pn.afficheModale(implementation.getParentComponent(), TrResource.getS("Origine ")+" "+modele.getTitle()); + + + implementation.clearMainProgression(); + } + + /** + * Constructeur d'une dialog qui affiche l... [truncated message content] |
From: <emm...@us...> - 2009-01-16 13:36:20
|
Revision: 4378 http://fudaa.svn.sourceforge.net/fudaa/?rev=4378&view=rev Author: emmanuel_martin Date: 2009-01-16 13:36:14 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Tache #146 : "Edition de bief : Ajouter la visualisation des lignes directrices" Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelProfile.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainer.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -312,4 +312,16 @@ return "ATTRIBUTE_INTERSECTION_LIMITE_STOCKAGE_DROITE"; } }; + + /** + * Attribut contenant l'index des points correspondants aux l'intersections entre + * les lignes directrices et un profil. Ces index sont stock\xE9s dans une List<Integer>. + */ + public final static GISAttribute INTERSECTIONS_LIGNES_DIRECTRICES=new GISAttribute(null, CtuluLib + .getS("Intersections lignes directrices"), false){ + @Override + public String getID() { + return "ATTRIBUTE_INTERSECTIONS_LIGNES_DIRECTRICES"; + } + }; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -413,15 +413,39 @@ xiVisible = _t.getXAxe().containsPoint(xi); yiVisible = getAxeY().containsPoint(yi); - if (model_.isPointDrawn(i) && xiVisible && yiVisible && iconeModel_.getType() != TraceIcon.RIEN) { - if (displayTitleOnCurve_) { - if (rangeDisplayed == null) { - rangeDisplayed = new Envelope(); + if(model_.isPointDrawn(i) && xiVisible && yiVisible) { + // Paint point label + String pLabel=model_.getPointLabel(i); + if(pLabel!=null) { + // Dessin de la boite et du label + // X + int xBox; + if(((int) xie)==_t.getMinEcranX()) + xBox=((int) xie); + else if(((int) xie)==_t.getMaxEcranX()) + xBox=((int) xie)-_g.getFontMetrics().stringWidth(pLabel)-3; + else + xBox=((int) xie)-_g.getFontMetrics().stringWidth(pLabel)/2-2; + // Y + int yBox; + if(((int) yie)==_t.getMaxEcranY()) + yBox=((int) yie)-10; + else + yBox=((int) yie)+10; + // Paint + tbox_.paintBox(_g, xBox, yBox, pLabel); + } + // Paint point + if(iconeModel_.getType() != TraceIcon.RIEN) { + if (displayTitleOnCurve_) { + if (rangeDisplayed == null) { + rangeDisplayed = new Envelope(); + } + rangeDisplayed.expandToInclude(xi, yi); } - rangeDisplayed.expandToInclude(xi, yi); + // icone_.couleur(getAspectContour()); + trIcon.paintIconCentre(_g, xie, yie); } - // icone_.couleur(getAspectContour()); - trIcon.paintIconCentre(_g, xie, yie); } if ((i > 0) && model_.isSegmentDrawn(i - 1) && (xpVisible || xiVisible || _t.getXAxe().isContained(xpe, xie))) { if (displayTitleOnCurve_) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelDefault.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -113,6 +113,10 @@ return 0; } + public String getPointLabel(int _i) { + return null; + } + public int getNbValues() { return x_.length; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelProfile.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelProfile.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGCourbeModelProfile.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -72,6 +72,10 @@ return name_; } + public String getPointLabel(int _i) { + return null; + } + /* (non-Javadoc) * @see org.fudaa.ebli.courbe.EGModel#getX(int) */ Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -47,6 +47,14 @@ boolean isPointDrawn(int _i); /** + * @param _i + * l'indice du point compris entre 0 et getNbPoint()-1 + * @return le text \xE0 afficher concernant le point correspondant \xE0 _i. Null si + * il n'y en a pas. + */ + String getPointLabel(int _i); + + /** * @param _idx l'indice voulu * @return la valeur de x en ce point */ Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -87,6 +87,10 @@ return false; } + public String getPointLabel(int _i) { + return null; + } + public int getNbValues() { return e_.getNbValues(); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -78,6 +78,10 @@ return false; } + public String getPointLabel(int _i) { + return null; + } + public int getNbValues() { if (y_ == null) { return 0; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -116,6 +116,10 @@ return 0; } + public String getPointLabel(int _i) { + return null; + } + public int getNbValues() { return res_.getNbIntersect(); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCoordinatesModel.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -81,6 +81,10 @@ return false; } + public String getPointLabel(int _i) { + return null; + } + public int getNbValues() { return res_.getNbIntersect(); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/Bief.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -127,6 +127,9 @@ int idxRg=zone.getIndiceOf(GISAttributeConstants.INTERSECTION_RIVE_GAUCHE); if (idxRg==-1) attToAdd++; + int idxLd=zone.getIndiceOf(GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES); + if(idxLd==-1) + attToAdd++; // Ajout des attributs manquant \\ if (attToAdd>0) { GISAttributeInterface[] atts=new GISAttributeInterface[zone.getNbAttributes()+attToAdd]; @@ -141,24 +144,28 @@ atts[k++]=GISAttributeConstants.INTERSECTION_RIVE_DROITE; if (idxRg==-1) atts[k++]=GISAttributeConstants.INTERSECTION_RIVE_GAUCHE; + if(idxLd==-1) + atts[k++]=GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES; zone.setAttributes(atts, null); } int idxAttRiveGauche=zone.getIndiceOf(GISAttributeConstants.INTERSECTION_RIVE_GAUCHE); int idxAttRiveDroite=zone.getIndiceOf(GISAttributeConstants.INTERSECTION_RIVE_DROITE); int idxAttlsGauche=zone.getIndiceOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_GAUCHE); int idxAttlsDroite=zone.getIndiceOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_DROITE); + int idxAttLignesDirectrices=zone.getIndiceOf(GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES); if (axeHydraulique_.getNombre()==0) for (int i=0; i<profils_.getNombre(); i++) { profils_.getGeomData().setAttributValue(idxAttRiveGauche, i, null, null); profils_.getGeomData().setAttributValue(idxAttRiveDroite, i, null, null); profils_.getGeomData().setAttributValue(idxAttlsGauche, i, null, null); profils_.getGeomData().setAttributValue(idxAttlsDroite, i, null, null); + profils_.getGeomData().setAttributValue(idxAttLignesDirectrices, i, new ArrayList<Integer>(0), null); } if (axeHydraulique_.getNombre()==1) { Geometry axeHydraulique=(Geometry)axeHydraulique_.getObject(0); CoordinateSequence seqAxeHydraulique=((GISCoordinateSequenceContainerInterface)axeHydraulique).getCoordinateSequence(); orderProfils(-1, null); - // Construction des rives et limites de stockages \\ + // Normalise le sens du profil \\ for (int k=0; k<profils_.getNombre(); k++) { Geometry profil=zone.getGeometry(k); CoordinateSequence seqProfil=((GISCoordinateSequenceContainerInterface)profil).getCoordinateSequence(); @@ -187,7 +194,9 @@ profil=(Geometry)profils_.getGeomData().getGeometry(k); seqProfil=((GISCoordinateSequenceContainerInterface)profil).getCoordinateSequence(); } - double abscisseCurvIntersectionAxe=UtilsProfil1d.abscisseCurviligne(seqProfil, interAxeProfil); + } + // Cr\xE9ation des nouveaux points sur les profils \\ + for (int k=0; k<profils_.getNombre(); k++) { // Ajout des points au profil si n\xE9c\xE9ssaire pour les intersections \\ // Rives for (int l=0; l<rives_.getNombre(); l++) @@ -195,8 +204,16 @@ // Limites de stockages for (int l=0; l<limitesStockages_.getNombre(); l++) createPointIfNeeded(k, (GISPolyligne) limitesStockages_.getObject(l)); - profil=(Geometry)profils_.getGeomData().getGeometry(k); - seqProfil=((GISCoordinateSequenceContainerInterface)profil).getCoordinateSequence(); + // Lignes directrices + for (int l=0; l<lignesDirectrices_.getNombre(); l++) + createPointIfNeeded(k, (GISPolyligne) lignesDirectrices_.getObject(l)); + } + // Valuation des attributs simple d'intersection (rives et limites) \\ + for(int k=0;k<profils_.getNombre();k++) { + Geometry profil=zone.getGeometry(k); + CoordinateSequence seqProfil=((GISCoordinateSequenceContainerInterface)profil).getCoordinateSequence(); + Coordinate interAxeProfil=profil.intersection(axeHydraulique).getCoordinate(); + double abscisseCurvIntersectionAxe=UtilsProfil1d.abscisseCurviligne(seqProfil, interAxeProfil); // Valuation des attributs avec les index des points des intersections \\ // Rives zone.setAttributValue(idxAttRiveGauche, k, 0, null); @@ -210,6 +227,9 @@ for (int l=0; l<limitesStockages_.getNombre(); l++) valuateProfilIntersection(k, (Geometry) limitesStockages_.getObject(l), idxAttlsGauche, idxAttlsDroite, abscisseCurvIntersectionAxe); } + // Valuation des attributs composites d'intersection (lignes directrices) \\ + // Lignes directrices \\ + valuateProfilIntersection(idxAttLignesDirectrices); } // Activation du synchroniser gisSynchroniser_.enable(); @@ -259,6 +279,79 @@ profils_.getGeomData().setAttributValue(_idxAttrGauche, _idxProfil, idxIntersection, null); } } + + /** + * Valuation des attributs composites des profils, c'est \xE0 dire des attributs contenant plusieurs + * informations d'intersection sous forme d'une liste. + * + * @param _idxAttr l'index de l'attribut o\xF9 sera stock\xE9 les intersections + */ + @SuppressWarnings("unchecked") + private void valuateProfilIntersection(int _idxAttr) { + // Cr\xE9ation des listes + for (int k=0; k<profils_.getNombre(); k++) + profils_.getGeomData().setAttributValue(_idxAttr, k, new ArrayList<Integer>(), null); + // Valuation de l'attribut + int k=0; + int[] lstIntersectionTmp=new int[profils_.getNombre()]; + while (k<lignesDirectrices_.getNombre()) { + Geometry ligneD=(Geometry)lignesDirectrices_.getObject(k); + // Recherche des croisements avec les profils + for (int l=0; l<profils_.getNombre(); l++) { + Geometry profil=profils_.getGeomData().getGeometry(l); + CoordinateSequence seqProfil=((GISCoordinateSequenceContainerInterface)profil).getCoordinateSequence(); + Geometry inter=((Geometry)profils_.getObject(l)).intersection(ligneD); + if (inter.getNumPoints()==0) + lstIntersectionTmp[l]=-1; + else + lstIntersectionTmp[l]=UtilsProfil1d.getIndex(seqProfil, inter.getCoordinate()); + } + // Test si au moins un croisement existe + boolean ok=false; + int m=-1; + while (!ok&&++m<lstIntersectionTmp.length) + ok=lstIntersectionTmp[m]!=-1; + if (!ok) + // Suppression de la ligne directrice qui est inutile et pas + // incr\xE9mentation de k + lignesDirectrices_.getGeomData().removeGeometries(new int[]{k}, null); + else { + for (int l=0; l<profils_.getNombre(); l++) { + // R\xE9cup\xE9ration de la liste contenant les index + List<Integer> lst=(List<Integer>)profils_.getGeomData().getValue(_idxAttr, l); + if (lstIntersectionTmp[l]!=-1) + // Enregistrement de l'index + lst.add(lstIntersectionTmp[l]); + else { + // Place le permier ou le dernier index \\ + // Recherche d'un point avant + int idxTest=l; + while (idxTest>=0&&lstIntersectionTmp[idxTest]==-1) + idxTest--; + if (idxTest<0) { + // Recherche d'un point apr\xE8s + idxTest=l; + while (idxTest<lstIntersectionTmp.length&&lstIntersectionTmp[idxTest]==-1) + idxTest++; + } + // Extraction d'informations sur le profils et l'axe hydraulique + Geometry profil=profils_.getGeomData().getGeometry(idxTest); + CoordinateSequence seqProfil=((GISCoordinateSequenceContainerInterface)profil).getCoordinateSequence(); + Coordinate intersection=profil.intersection((Geometry)axeHydraulique_.getObject(0)).getCoordinate(); + int idxAxe=UtilsProfil1d.getPreviousIndex(seqProfil, intersection); + if (idxAxe==-1) + idxAxe=0; + // Enregistrement de l'index + if (lstIntersectionTmp[idxTest]<=idxAxe) + lst.add(0); + else + lst.add(profils_.getGeomData().getCoordinateSequence(l).size()-1); + } + } + k++; + } + } + } /** * Cr\xE9e un point \xE0 l'intersection du profil indiqu\xE9 par _idxProfil et de @@ -456,12 +549,12 @@ private int idxRiveDroite_=-1; private int idxLimiteStockageGauche_=-1; private int idxLimiteStockageDroite_=-1; - private List<Integer> idxLignesDirectrices_=new ArrayList<Integer>(); // Les index des attributs \\ private int idxAttRiveGauche_=-1; private int idxAttRiveDroite_=-1; private int idxAttlsGauche_=-1; private int idxAttlsDroite_=-1; + private int idxAttlignesDirectrices_=-1; /** * Active/met \xE0 jour le synchroniser. @@ -479,6 +572,7 @@ idxAttRiveDroite_=profilsListen_.getGeomData().getIndiceOf(GISAttributeConstants.INTERSECTION_RIVE_DROITE); idxAttlsGauche_=profilsListen_.getGeomData().getIndiceOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_GAUCHE); idxAttlsDroite_=profilsListen_.getGeomData().getIndiceOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_DROITE); + idxAttlignesDirectrices_=profilsListen_.getGeomData().getIndiceOf(GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES); // D\xE9termination des index de g\xE9om\xE9tries // Rives if(rivesModified_.getNombre()>0) { @@ -557,11 +651,11 @@ idxRiveDroite_=-1; idxLimiteStockageGauche_=-1; idxLimiteStockageDroite_=-1; - idxLignesDirectrices_.clear(); idxAttRiveGauche_=-1; idxAttRiveDroite_=-1; idxAttlsGauche_=-1; idxAttlsDroite_=-1; + idxAttlignesDirectrices_=-1; } } @@ -593,13 +687,10 @@ idxLimiteStockageGauche_=-1; idxLimiteStockageDroite_=-1; // Lignes directrices - if (idxLignesDirectrices_.size()>0) { - int[] idxLD=new int[idxLignesDirectrices_.size()]; - for (int i=0; i<idxLignesDirectrices_.size(); i++) - idxLD[i]=idxLignesDirectrices_.get(i); - lignesDirectricesModified_.getGeomData().removeGeometries(idxLD, null); - idxLignesDirectrices_.clear(); - } + int[] idx=new int[lignesDirectricesModified_.getNombre()]; + for(int i=0;i<idx.length;i++) + idx[i]=i; + lignesDirectricesModified_.getGeomData().removeGeometries(idx, null); } /** @@ -620,6 +711,8 @@ updateGeom(_idxGeom, limitesStockagsesModified_, idxLimiteStockageGauche_, idxAttlsGauche_); else if(_att==GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_DROITE) updateGeom(_idxGeom, limitesStockagsesModified_, idxLimiteStockageDroite_, idxAttlsDroite_); + else if(_att==GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES) + updateLd(_idxGeom); } public void geometryAction(Object _source, int _idxGeom, Geometry _geom, int _action) { @@ -628,12 +721,14 @@ updateGeom(_idxGeom, rivesModified_, idxRiveDroite_, idxAttRiveDroite_); updateGeom(_idxGeom, limitesStockagsesModified_, idxLimiteStockageGauche_, idxAttlsGauche_); updateGeom(_idxGeom, limitesStockagsesModified_, idxLimiteStockageDroite_, idxAttlsDroite_); + updateLd(_idxGeom); } } /** * R\xE9g\xE9n\xE8re toutes les g\xE9om\xE9tries volatiles. */ + @SuppressWarnings("unchecked") private void regenerateAll() { GISZoneCollection zone=profilsListen_.getGeomData(); // Cr\xE9ation des nouvelles g\xE9om\xE9tries \\ @@ -651,19 +746,35 @@ lsGauche[i]=zone.getCoordinateSequence(i).getCoordinate((Integer)zone.getValue(idxAttlsGauche_, i)); lsDroite[i]=zone.getCoordinateSequence(i).getCoordinate((Integer)zone.getValue(idxAttlsDroite_, i)); } + // Lignes directrices + Coordinate[][] ld=new Coordinate[lignesDirectricesModified_.getNombre()][]; + for(int i=0; i<ld.length; i++) + ld[i]=new Coordinate[profilsListen_.getNombre()]; + for(int i=0; i<profilsListen_.getNombre(); i++) { + List<Integer> lst=(List<Integer>) profilsListen_.getGeomData().getValue(idxAttlignesDirectrices_, i); + for(int j=0; j<lignesDirectricesModified_.getNombre(); j++) + ld[j][i]=profilsListen_.getGeomData().getCoordinateSequence(i).getCoordinate(lst.get(j)); + } + // Ajout des nouvelles g\xE9o\xE9mtries \\ // Extraction des anciennes donn\xE9es Object[] dataRiveGauche=getData(idxRiveGauche_, rivesModified_.getGeomData()); Object[] dataRiveDroite=getData(idxRiveDroite_, rivesModified_.getGeomData()); Object[] dataLsGauche=getData(idxLimiteStockageGauche_, rivesModified_.getGeomData()); Object[] dataLsDroite=getData(idxLimiteStockageDroite_, rivesModified_.getGeomData()); + Object[][] dataLignesDirectrices=new Object[lignesDirectricesModified_.getNombre()][]; + for(int i=0;i<lignesDirectricesModified_.getNombre();i++) + dataLignesDirectrices[i]=getData(i, lignesDirectricesModified_.getGeomData()); // Destruction des g\xE9om\xE9tries destroyGeometries(); - // Ajout des geometries + // Ajout des geometries \\ + // Rives if (riveGauche.length>1&&riveGauche[0]!=null&&rivesModified_!=null) - idxRiveGauche_=rivesModified_.getGeomData().addGeometry(new GISPolyligne(new GISCoordinateSequenceFactory().create(riveGauche)), dataRiveGauche, null); + idxRiveGauche_=rivesModified_.getGeomData().addGeometry( + new GISPolyligne(new GISCoordinateSequenceFactory().create(riveGauche)), dataRiveGauche, null); if (riveDroite.length>1&&riveDroite[0]!=null&&rivesModified_!=null) - idxRiveDroite_=rivesModified_.getGeomData().addGeometry(new GISPolyligne(new GISCoordinateSequenceFactory().create(riveDroite)), dataRiveDroite, null); + idxRiveDroite_=rivesModified_.getGeomData().addGeometry( + new GISPolyligne(new GISCoordinateSequenceFactory().create(riveDroite)), dataRiveDroite, null); // Limites de stockages if (lsGauche.length>1&&lsGauche[0]!=null&&limitesStockagsesModified_!=null) idxLimiteStockageGauche_=limitesStockagsesModified_.getGeomData().addGeometry( @@ -671,6 +782,10 @@ if (lsDroite.length>1&&lsDroite[0]!=null&&limitesStockagsesModified_!=null) idxLimiteStockageDroite_=limitesStockagsesModified_.getGeomData().addGeometry( new GISPolyligne(new GISCoordinateSequenceFactory().create(lsDroite)), dataLsDroite, null); + // Lignes directrices + for (int i=0; i<ld.length; i++) + lignesDirectricesModified_.getGeomData().addGeometry(new GISPolyligne(new GISCoordinateSequenceFactory().create(ld[i])), + dataLignesDirectrices[i], null); } /** @@ -705,6 +820,32 @@ _model.getGeomData().setCoordinateSequence(_idxGeomVolatile, seqGeomV, null); } } + + /** + * Met \xE0 jours les lignes directrices. + * @param _idxPoint indique l'index du point ayant chang\xE9 + */ + @SuppressWarnings("unchecked") + private void updateLd(int _idxGeom) { + if(_idxGeom==-1) + return; + List<Integer> lstIdx=(List<Integer>)profilsListen_.getGeomData().getValue(idxAttlignesDirectrices_, _idxGeom); + CoordinateSequence seqProfil=profilsListen_.getGeomData().getCoordinateSequence(_idxGeom); + boolean found=false; + int i=-1; + while(!found&&++i<lignesDirectricesModified_.getNombre()) { + CoordinateSequence seqLd= lignesDirectricesModified_.getGeomData().getCoordinateSequence(i); + Coordinate coodProfil=seqProfil.getCoordinate(lstIdx.get(i)); + // Test si c'est bien cette ligne directrice \xE0 mettre \xE0 jour + if(!UtilsProfil1d.egal(coodProfil, seqLd.getCoordinate(_idxGeom))) { + found=true; + seqLd.setOrdinate(_idxGeom, 0, coodProfil.x); + seqLd.setOrdinate(_idxGeom, 1, coodProfil.y); + seqLd.setOrdinate(_idxGeom, 2, coodProfil.z); + lignesDirectricesModified_.getGeomData().setCoordinateSequence(i, seqLd, null); + } + } + } } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainer.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainer.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainer.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -59,6 +59,15 @@ /** Retourne l'abscisse curviligne de l'axe sur le profil (ne pas confondre avec getAbsCurvProfilOnAxeHydraulique). -1 si inexistant. */ public double getAbsCurvAxeHydrauliqueOnProfil(); + /** Retourne les index des lignes directrices croisant le profil. null si aucun profil n'est selectionn\xE9. */ + public int[] getIdxLignesDirectrices(); + + /** Retourne les noms des lignes directrices. null si aucun profil n'est s\xE9lectionn\xE9 ou si il n'y a pas de noms.*/ + public String[] getNamesLignesDirectrices(); + + /** Retourneles noms des lignes directrices associ\xE9s \xE0 l'index pass\xE9 en param\xE8tre. null si aucun. */ + public String[] getNamesLignesDirectricesAt(int _idxPoint); + /** * Enregistre l'abcisse curviligne du point indiqu\xE9 en param\xE8tre. * Ce changement d'abscisse curviligne fonctionne sur tout les points. Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/model/ProfilContainerAdapter.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -328,11 +328,11 @@ } /** - * Retourne la valeur de l'attribut d'intersection demand\xE9. C'est donc un index de point qui est renvoy\xE9. + * Retourne la valeur de l'attribut d'intersection demand\xE9. */ - private int getValueOf(GISAttributeInterface attr_) { + private Object getValueOf(GISAttributeInterface attr_) { int idxAtt=biefContainer_.getZoneProfils().getIndiceOf(attr_); - return (Integer) biefContainer_.getZoneProfils().getValue(idxAtt, idxProfilSelected_); + return biefContainer_.getZoneProfils().getValue(idxAtt, idxProfilSelected_); } private CoordinateSequence getCoordSeq() { @@ -341,36 +341,79 @@ } public double getAbsCurvRiveGauche() { - if(idxProfilSelected_==-1) + if (idxProfilSelected_==-1) return -1; - return getCurv(getValueOf(GISAttributeConstants.INTERSECTION_RIVE_GAUCHE)); + return getCurv((Integer)getValueOf(GISAttributeConstants.INTERSECTION_RIVE_GAUCHE)); } - + public double getAbsCurvRiveDroite() { - if(idxProfilSelected_==-1) + if (idxProfilSelected_==-1) return -1; - return getCurv(getValueOf(GISAttributeConstants.INTERSECTION_RIVE_DROITE)); + return getCurv((Integer)getValueOf(GISAttributeConstants.INTERSECTION_RIVE_DROITE)); } - + public double getAbsCurvLimiteStockageGauche() { - if(idxProfilSelected_==-1) + if (idxProfilSelected_==-1) return -1; - return getCurv(getValueOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_GAUCHE)); + return getCurv((Integer)getValueOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_GAUCHE)); } public double getAbsCurvLimiteStockageDroite() { - if(idxProfilSelected_==-1) + if (idxProfilSelected_==-1) return -1; - return getCurv(getValueOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_DROITE)); + return getCurv((Integer)getValueOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_DROITE)); } - + public double getAbsCurvProfilOnAxeHydraulique() { - if(idxProfilSelected_==-1||biefContainer_.getZoneAxeHydraulique().getNbGeometries()==0) + if (idxProfilSelected_==-1||biefContainer_.getZoneAxeHydraulique().getNbGeometries()==0) return -1; - return UtilsProfil1d.abscisseCurviligne(((GISCoordinateSequenceContainerInterface)biefContainer_.getZoneAxeHydraulique().getGeometry(0)) - .getCoordinateSequence(), getCoordSeq()); + return UtilsProfil1d.abscisseCurviligne(((GISCoordinateSequenceContainerInterface)biefContainer_.getZoneAxeHydraulique() + .getGeometry(0)).getCoordinateSequence(), getCoordSeq()); } + @SuppressWarnings("unchecked") + public int[] getIdxLignesDirectrices() { + if (idxProfilSelected_==-1) + return null; + List<Integer> lst=(List<Integer>)getValueOf(GISAttributeConstants.INTERSECTIONS_LIGNES_DIRECTRICES); + int[] result=new int[lst.size()]; + for (int i=0; i<lst.size(); i++) + result[i]=lst.get(i); + return result; + } + + public String[] getNamesLignesDirectricesAt(int _idxPoint) { + if (idxProfilSelected_==-1||_idxPoint<0||_idxPoint>=getNbPoint()) + return null; + // Nom des lignes directrices + int[] idx=getIdxLignesDirectrices(); + String[] names=getNamesLignesDirectrices(); + if(idx==null||names==null) + return null; + // Construction du label par agr\xE9gation des noms des lignes directrices croisant le point + ArrayList<String> labels=new ArrayList<String>(); + for(int i=0;i<idx.length;i++) + if(idx[i]==_idxPoint) + labels.add(names[i]); + if(labels.size()==0) + return null; + else + return labels.toArray(new String[0]); + } + + public String[] getNamesLignesDirectrices() { + if (idxProfilSelected_==-1) + return null; + GISZoneCollection zoneLd=biefContainer_.getZoneLignesDirectrices(); + int idxTitre=zoneLd.getIndiceOf(GISAttributeConstants.TITRE); + if(idxTitre==-1) + return null; + String[] result=new String[zoneLd.getNbGeometries()]; + for(int i=0; i<result.length;i++) + result[i]=(String) zoneLd.getValue(idxTitre, i); + return result; + } + public double getAbsCurvAxeHydrauliqueOnProfil() { if(idxProfilSelected_==-1||biefContainer_.getZoneAxeHydraulique().getNbGeometries()==0) return -1; @@ -382,7 +425,7 @@ } public void setLimiteGauche(int _idx, CtuluCommandContainer _cmd) { - int idxRiveGauche=getValueOf(GISAttributeConstants.INTERSECTION_RIVE_GAUCHE); + int idxRiveGauche=(Integer) getValueOf(GISAttributeConstants.INTERSECTION_RIVE_GAUCHE); if(_idx<=idxRiveGauche) setIndexIn(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_GAUCHE, _idx, _cmd); else @@ -390,7 +433,7 @@ } public void setLimiteDroite(int _idx, CtuluCommandContainer _cmd) { - int idxRiveDroite=getValueOf(GISAttributeConstants.INTERSECTION_RIVE_DROITE); + int idxRiveDroite=(Integer) getValueOf(GISAttributeConstants.INTERSECTION_RIVE_DROITE); if(_idx>=idxRiveDroite) setIndexIn(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_DROITE, _idx, _cmd); else @@ -398,8 +441,8 @@ } public void setRiveGauche(int _idx, CtuluCommandContainer _cmd) { - int idxLimiteGauche=getValueOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_GAUCHE); - int idxRiveDroite=getValueOf(GISAttributeConstants.INTERSECTION_RIVE_DROITE); + int idxLimiteGauche=(Integer) getValueOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_GAUCHE); + int idxRiveDroite=(Integer) getValueOf(GISAttributeConstants.INTERSECTION_RIVE_DROITE); if(_idx>=idxLimiteGauche&&_idx<idxRiveDroite) setIndexIn(GISAttributeConstants.INTERSECTION_RIVE_GAUCHE, _idx, _cmd); else @@ -407,8 +450,8 @@ } public void setRiveDroite(int _idx, CtuluCommandContainer _cmd) { - int idxLimiteDroite=getValueOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_DROITE); - int idxRiveGauche=getValueOf(GISAttributeConstants.INTERSECTION_RIVE_GAUCHE); + int idxLimiteDroite=(Integer) getValueOf(GISAttributeConstants.INTERSECTION_LIMITE_STOCKAGE_DROITE); + int idxRiveGauche=(Integer) getValueOf(GISAttributeConstants.INTERSECTION_RIVE_GAUCHE); if(_idx<=idxLimiteDroite&&_idx>idxRiveGauche) setIndexIn(GISAttributeConstants.INTERSECTION_RIVE_DROITE, _idx, _cmd); else Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/VueCourbe.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -216,6 +216,17 @@ public void fillWithInfo(InfoData _table, CtuluListSelectionInterface pt) { } + public String getPointLabel(int _i) { + String[] names=data_.getNamesLignesDirectricesAt(_i); + if(names==null) + return null; + // Construction du label par agr\xE9gation des noms + String label=""; + for(int i=0;i<names.length;i++) + label+=names[i]; + return label; + } + public int getNbValues() { return data_.getNbPoint(); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryCourbeModel.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -136,6 +136,10 @@ return 0; } + public String getPointLabel(int _i) { + return null; + } + public int getNbValues() { if (t_ == null) { return 0; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java 2009-01-16 08:31:00 UTC (rev 4377) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacWeirCourbeModel.java 2009-01-16 13:36:14 UTC (rev 4378) @@ -71,6 +71,10 @@ return 0; } + public String getPointLabel(int _i) { + return null; + } + public int getNbValues() { return s_.getNbPoint(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:31:05
|
Revision: 4377 http://fudaa.svn.sourceforge.net/fudaa/?rev=4377&view=rev Author: hadouxad Date: 2009-01-16 08:31:00 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-16 08:29:53 UTC (rev 4376) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-01-16 08:31:00 UTC (rev 4377) @@ -9,17 +9,26 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.collection.CtuluArrayDouble; import org.fudaa.dodico.ef.EfData; import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.ebli.courbe.EGCourbeChild; import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.courbe.EGModel; +import org.fudaa.ebli.palette.BPaletteInfo.InfoData; +import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTime; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeModel; +import org.fudaa.fudaa.tr.common.TrResource; import com.memoire.fu.FuLog; import com.vividsolutions.jts.geom.Coordinate; @@ -42,6 +51,8 @@ */ public TrPostSource source_; + + public final static class Interpolated extends TrPostCourbeModel { TrPostInterpolatePoint ptIdx_; @@ -113,7 +124,42 @@ if(point!=null && (point instanceof TrPostInterpolatePoint)) ptIdx_=(TrPostInterpolatePoint) point; } + + public String getInfosPoint() { + + return TrResource.getS("Point interpol\xE9:")+" ("+ptIdx_.x_+";"+ptIdx_.y_+")"; + } + + @Override + public boolean replayData(TrPostSource src, H2dVariableType var,EGGroup groupe,Map infos) { + try{ + //-- creation d un nouveau node pour les donnees en entree --// + EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); + + //-- on remplace les anciennes valeurs par les nouvelles calculees --// + infos.put("MODELREPLAY", newCurve); + +// this.y_=((Node)newCurve.getModel()).y_; +// this.time_=((Node)newCurve.getModel()).time_; + + }catch(Exception e){ + e.printStackTrace(); + return false; + } + return true; + } + + + public EGModel duplicate() { + Interpolated duplic = new Interpolated(this.source_,new TrPostInterpolatePoint(this.ptIdx_),this.var_); + if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); + if (this.nom_ != null) duplic.nom_ = nom_; + if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); + + return duplic; + } + } public final static class Node extends TrPostCourbeModel { @@ -200,6 +246,43 @@ ptIdx_=((Integer)point).intValue(); } + + @Override + public boolean replayData(TrPostSource src, H2dVariableType var,EGGroup groupe,Map infos) { + try{ + //-- creation d un nouveau node pour les donnees en entree --// + EGCourbeChild newCurve = TrPostCourbeModel.buildCourbeModel(var, this.ptIdx_,groupe, src); + + //-- on remplace les anciennes valeurs par les nouvelles calculees --// + infos.put("MODELREPLAY", newCurve); +// this.y_=((Node)newCurve.getModel()).y_; +// this.time_=((Node)newCurve.getModel()).time_; + + + + }catch(Exception e){ + e.printStackTrace(); + return false; + } + return true; + } + + public EGModel duplicate() { + Node duplic = new Node(this.source_,this.ptIdx_,this.var_,CtuluLibArray.copy(time_)); + if (this.yRange_ != null) duplic.yRange_ = new CtuluRange(this.yRange_); + if (this.nom_ != null) duplic.nom_ = nom_; + if (this.y_ != null) duplic.y_ = CtuluLibArray.copy(y_); + + return duplic; + } + + + @Override + public String getInfosPoint() { + + return TrResource.getS("Point r\xE9el ")+ptIdx_+":("+this.source_.getGrid().getPtX(ptIdx_)+";"+this.source_.getGrid().getPtY(ptIdx_)+")"; + } + } public static EGCourbeChild buildCourbeModel(final H2dVariableType _var, final int _idxPt, final EGGroup _group, @@ -296,55 +379,134 @@ y_ = new double[source_.getNbTimeStep()]; } } + + + + public boolean addValue(double[] _x, double[] _y, CtuluCommandContainer _cmd) { + + time_ = CtuluLibArray.copy(_x); + y_ = CtuluLibArray.copy(_y); + +// for(int i=0;i<Math.min(_x.length,_y.lenght);i++){ +// +// } + + return true; + } + + + public void fillWithInfo(InfoData _table, CtuluListSelectionInterface _selectedPt) { + if(EbliWidget.AMELIO_LOT_VISIBLE){ + _table.put(TrResource.getS("Type"),"Evolution temporelle"); + _table.put(TrResource.getS("Fichier r\xE9sultat"),this.source_.getFile().getName()); + _table.put(TrResource.getS("Chemin complet"),this.source_.getFile().getAbsolutePath()); + _table.put(TrResource.getS("Titre Fichier r\xE9sultat"),this.source_.getTitle()); + _table.put(TrResource.getS("Infos Point initial"),this.getInfosPoint()); + _table.put(TrResource.getS("Variable"),this.getVar().getName()+" en "+this.getVar().getCommonUnitString()); + + + + } + } + - @Override + public Object getPersistSpecificDatas() { //-- retourne le quatuor point, pdt,variable et fichier source ArrayList<Object> listeData=new ArrayList<Object>(); listeData.add(this.source_.getId()); - listeData.add(this.getTime()); - listeData.add(this.var_); + //listeData.add(this.getTime()); + listeData.add(this.var_.getID()); //-- recupere le noeud ou point interpol\xE9 --// listeData.add(getSelectionPoint()); return listeData; } - + + public abstract String getInfosPoint(); public abstract Object getSelectionPoint(); public abstract void setSelectionPoint(Object point); + /** + * Methode appelee pour rejouer les donnees d'une courbe en cas de rechargement avec d'autres donnees. + * Utilise le meme point (reel ou interpol\xE9) et les memes pas de temps si possible. + */ + public abstract boolean replayData(TrPostSource src,H2dVariableType var,EGGroup groupe,Map infos); - @Override + public void setPersistSpecificDatas(Object data, Map infos) { - - if(data ==null || !(data instanceof ArrayList))return; - + if(data ==null || !(data instanceof ArrayList))return; ArrayList<Object> liste=(ArrayList<Object>)data; - - String idSource=(String) liste.get(0); TrPostProjet projet = (TrPostProjet) infos.get("TrPostProjet"); - + TrPostSource src =null; if (projet != null){ // -- etape 1: recherche du source qui contient le path donn\xE9 --// - TrPostSource src = projet.findSourceById(idSource); + src = projet.findSourceById(idSource); if(src!=null) this.source_=src; - + else{ + ((List<String>) infos.get("errorMsg")) + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); + return; + } + }else{ + ((List<String>) infos.get("errorMsg")) + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idSource); + return; } - // -- etape 2:times --// - double[] times=(double[]) liste.get(1); - if(times!=null) - this.setTime(times); + // -- etape 2:times: ce sont les x donn\xE9es indirectement. --// + // -- etape 3:variable --// - H2dVariableType var=(H2dVariableType) liste.get(2); + String idVar=(String)liste.get(1); + H2dVariableType var=null;//(H2dVariableType) liste.get(1); + + //-- recherche dans les sources de la variable par id --// + for(int i=0;i<src.getAvailableVar().length;i++) + if(src.getAvailableVar()[i].getID().equals(idVar)) + var=src.getAvailableVar()[i]; + if(var!=null) this.var_=var; - - Object point=liste.get(3); + else{ + ((List<String>) infos.get("errorMsg")) + .add("Erreur, la frame graphe ne trouve pas la variable qui correspond \xE0 l'ID " + idVar); + return; + } + Object point=liste.get(2); if(point!=null) setSelectionPoint(point); + //-- FAUT il rejouer les donnees?? --// + //final List<String> listeReloadSource=(List<String>) infos.get("RELOAD"); + + //if(listeReloadSource!=null && projet!=null && this.source_!=null && listeReloadSource.contains(idSource)){ + //-- on rejoue les donn\xE9es : methode specialisee replayData--// + this.updateY(); + //} + + +// if(listeReloadSource!=null && projet!=null && this.source_!=null && listeReloadSource.contains(idSource)){ +// //-- on rejoue les donn\xE9es : methode specialisee replayData--// +// EGGroup groupe =(EGGroup)infos.get("GROUPE"); +// if(groupe!=null){ +// +// +// if(replayData(this.source_, var,groupe,infos)){ +// +// }else{ +// //-- message d'erreur: rejoue des donnees foireux --// +// ((List<String>) infos.get("errorMsg")) +// .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); +// } +// }else{ +// //-- message d erreur: impossible de rejoeur les donnees --// +// ((List<String>) infos.get("errorMsg")) +// .add("Erreur, Impossible de rejouer les donn\xE9es de la courbe "+this.nom_+" pour le fichier r\xE9sultat " + idSource+". Les donn\xE9es pr\xE9c\xE9dentes seront charg\xE9es."); +// } +// } + + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:29:57
|
Revision: 4376 http://fudaa.svn.sourceforge.net/fudaa/?rev=4376&view=rev Author: hadouxad Date: 2009-01-16 08:29:53 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeModel.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeModel.java 2009-01-16 08:28:57 UTC (rev 4375) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeModel.java 2009-01-16 08:29:53 UTC (rev 4376) @@ -25,6 +25,12 @@ public FudaaCourbeModel(final EvolutionReguliere _e) { super(_e); } + /** + * Achtung: utiliser uniqument pour la persistance des donnees. + */ + public FudaaCourbeModel() { + super(); + } public boolean addValue(final double _x, final double _y, final CtuluCommandContainer _cmd) { return getEvolution().add(_x, _y, _cmd); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:29:01
|
Revision: 4375 http://fudaa.svn.sourceforge.net/fudaa/?rev=4375&view=rev Author: hadouxad Date: 2009-01-16 08:28:57 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java 2009-01-16 08:25:37 UTC (rev 4374) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java 2009-01-16 08:28:57 UTC (rev 4375) @@ -1,12 +1,24 @@ package org.fudaa.fudaa.commun.courbe; +import java.awt.event.ActionEvent; import java.io.File; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGCourbeModelDefault; +import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.courbe.EGModel; +import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuWizardDialog; + /** * Gere l'importation de donn\xE9es scope s ou t et cr\xE9e un graphe temporel ou spatial selon le format * S'utilise avec le wizard FudaaCourbeWizardImportScope @@ -17,15 +29,15 @@ /** * Action qui genere un wizard pour le parametrage des structures import\xE9es. - * @param _fileChosen - * @param target - * @param _data - * @param _mng - * @param _prog - * @param nuagePoints + * @author Adrien Hadoux + * */ - public static void createGraphe(File _fileChosen,FudaaCourbeImporter.Target target,ScopeStructure _data, CtuluCommandManager _mng,ProgressionInterface _prog,boolean nuagePoints){ - createGraphe(target,_data.returnEvolReguliere(_fileChosen), _mng, _prog,nuagePoints); + + + public static void createGraphe(File fichier,FudaaCourbeImporter.Target target,ScopeStructure _data, CtuluCommandManager _mng,ProgressionInterface _prog,boolean nuagePoints){ + + + createGraphe(target,_data.returnEvolReguliere(fichier), _mng, _prog,nuagePoints); } public static void createGraphe(FudaaCourbeImporter.Target target,EvolutionReguliere[] _data, CtuluCommandManager _mng,ProgressionInterface _prog,boolean nuagePoints){ @@ -42,43 +54,43 @@ -// /** -// * genere un graphe spatial -// * @param data_ -// * @return -// */ -// public static void createGrapheSpatialGrapheOLD(FudaaCourbeImporter.Target target,ScopeStructure.SorT data_,ProgressionInterface prog){ -// -// EGGrapheTreeModel model=new EGGrapheTreeModel(); -// double[] tabX=new double[data_.getAllX().size()]; -// for(int i=0;i<data_.getAllX().size();i++) -// tabX[i]=data_.getX(i); -// -// -// for(int i=0;i<data_.getNbVariables();i++){ -// -// EGGroup varg=new EGGroup(); -// varg.setTitle(data_.getVariable(i)); -// model.add(varg); -// -// //--remplissage de valeurs --// -// //tableau des y -// double[] tabY=new double[tabX.length]; -// -// for(int j=0;j<tabX.length;j++) -// tabY[j]=data_.getValueOfvariable(i, j); -// EGCourbeModelDefault modelCourbe=new EGCourbeModelDefault(tabX,tabY); -// EGCourbeChild courbe=new EGCourbeChild(varg,modelCourbe); -// -// varg.addEGComponent(courbe); -// -// } -// -// -// EGGraphe graphe=new EGGraphe(model); -// -// -// -// } + /** + * genere un graphe spatial + * @param data_ + * @return + */ + public static void createGrapheSpatialGrapheOLD(FudaaCourbeImporter.Target target,ScopeStructure.SorT data_,ProgressionInterface prog){ + + EGGrapheTreeModel model=new EGGrapheTreeModel(); + double[] tabX=new double[data_.getAllX().size()]; + for(int i=0;i<data_.getAllX().size();i++) + tabX[i]=data_.getX(i); + + + for(int i=0;i<data_.getNbVariables();i++){ + + EGGroup varg=new EGGroup(); + varg.setTitle(data_.getVariable(i)); + model.add(varg); + + //--remplissage de valeurs --// + //tableau des y + double[] tabY=new double[tabX.length]; + + for(int j=0;j<tabX.length;j++) + tabY[j]=data_.getValueOfvariable(i, j); + EGCourbeModelDefault modelCourbe=new EGCourbeModelDefault(tabX,tabY); + EGCourbeChild courbe=new EGCourbeChild(varg,modelCourbe); + + varg.addEGComponent(courbe); + + } + + + EGGraphe graphe=new EGGraphe(model); + + + + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:25:40
|
Revision: 4374 http://fudaa.svn.sourceforge.net/fudaa/?rev=4374&view=rev Author: hadouxad Date: 2009-01-16 08:25:37 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2009-01-16 08:25:14 UTC (rev 4373) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeTimeModel.java 2009-01-16 08:25:37 UTC (rev 4374) @@ -22,13 +22,13 @@ */ public class FudaaCourbeTimeModel implements EGModel { - private double[] time_; + protected double[] time_; public double[] getTime() { return time_; } - CtuluRange yRange_; + protected CtuluRange yRange_; protected String nom_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:25:23
|
Revision: 4373 http://fudaa.svn.sourceforge.net/fudaa/?rev=4373&view=rev Author: hadouxad Date: 2009-01-16 08:25:14 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java 2009-01-16 08:23:33 UTC (rev 4372) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java 2009-01-16 08:25:14 UTC (rev 4373) @@ -35,6 +35,14 @@ y_ = _y; precision_ = _prec; } + + public TrPostInterpolatePoint(TrPostInterpolatePoint duplique) { + super(); + idxElt_ = duplique.idxElt_; + x_ = duplique.x_; + y_ = duplique.y_; + precision_ = duplique.precision_; + } protected double getInterpolateValue(final H2dVariableType _var, final int _tIdx, final TrPostSource _src) { try { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2009-01-16 08:23:33 UTC (rev 4372) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2009-01-16 08:25:14 UTC (rev 4373) @@ -104,8 +104,8 @@ public class TrPostProjet implements ActionListener { - public final static boolean AMELIO_LOT_VISIBLE=true; + /** * Manager de sauvegarder/charghement des donn\xE9es */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:23:37
|
Revision: 4372 http://fudaa.svn.sourceforge.net/fudaa/?rev=4372&view=rev Author: hadouxad Date: 2009-01-16 08:23:33 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2009-01-16 08:21:35 UTC (rev 4371) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2009-01-16 08:23:33 UTC (rev 4372) @@ -42,6 +42,7 @@ import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; +import org.fudaa.fudaa.commun.courbe.ScopeCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.tr.common.TrLib; @@ -66,7 +67,7 @@ TrPostProjet projet_; - private EGGroup updating_; + protected EGGroup updating_; final Map varGroup_; @@ -731,6 +732,7 @@ * @param anotherModel */ public void mergeWithAnotherTreeModel(final TrPostCourbeTreeModel anotherModel) { + // -- parcours de la liste des variables du graphe a fusionner --// for (final Iterator<Object> it = anotherModel.getVarSupported().iterator(); it.hasNext();) { final H2dVariableType var = (H2dVariableType) it.next(); @@ -756,7 +758,37 @@ } this.fireStructureChanged(); } + + /** + * Methode qui permet de fusionner le model courant avec un autre model de type SCOPE. + * Utilsier poru la fusion de courbes tempo et SCOPE + * ajout dans d autres courbes. + * + * @author Adrien Hadoux + * @param anotherModel + */ + public void mergeWithAScopeTreeModel(final ScopCourbeTreeModel anotherModel) { + + // -- parcours de la liste des variables SANS du graphe SCOPE a fusionner --// + final EGGroup group = this.getGroupFor(H2dVariableType.SANS); + // -- on recupere toutes les courbes associees a la var pour le graphe + // merges + final EGGroup g = anotherModel.getGroupFor(H2dVariableType.SANS); + for (int i = g.getChildCount() - 1; i >= 0; i--) { + if (g.getCourbeAt(i).getModel() instanceof ScopeCourbeModel) { + + + group.addEGComponent((EGCourbeChild) g.getCourbeAt(i).duplicate(group, new EGGrapheDuplicator())); + + } + + } + + this.fireStructureChanged(); + } + + /** * Redefinie pour la visibilit\xE9. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:21:38
|
Revision: 4371 http://fudaa.svn.sourceforge.net/fudaa/?rev=4371&view=rev Author: hadouxad Date: 2009-01-16 08:21:35 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2009-01-16 08:19:27 UTC (rev 4370) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2009-01-16 08:21:35 UTC (rev 4371) @@ -9,6 +9,7 @@ import java.io.File; import java.util.ArrayList; import java.util.Arrays; +import java.util.Map; import javax.swing.AbstractAction; import javax.swing.BorderFactory; @@ -383,6 +384,15 @@ } EvolutionReguliere evol=new EvolutionReguliere(tabX, tabY,_time); evol.setNom(nomVar+" "+nomSeparator); + + //-- ajout des infos specifiques --// + Map infos= evol.infos_; + infos.put("Type", "Profil spatial scopGene"); + infos.put("Fichier scopGENE", fileChoosen_.getName()); + infos.put(ScopeStructure.NOM_FICHIER, fileChoosen_.getAbsolutePath()); + infos.put("Variable", nomVar.replace(" ", "")); + infos.put("Plage de valeurs", nomSeparator.replace(" ", "")); + return evol; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:19:32
|
Revision: 4370 http://fudaa.svn.sourceforge.net/fudaa/?rev=4370&view=rev Author: hadouxad Date: 2009-01-16 08:19:27 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-16 08:16:33 UTC (rev 4369) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MVProfileCourbeModel.java 2009-01-16 08:19:27 UTC (rev 4370) @@ -1,252 +1,395 @@ -/* - * @creation 21 nov. 06 - * @modification $Date: 2007-06-13 12:58:09 $ - * @license GNU General Public License 2 - * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail de...@fu... - */ -package org.fudaa.fudaa.meshviewer.profile; - -import java.util.Map; - -import gnu.trove.TDoubleArrayList; - -import org.fudaa.ctulu.CtuluCommandContainer; -import org.fudaa.ctulu.CtuluListSelectionInterface; -import org.fudaa.ctulu.CtuluRange; -import org.fudaa.ctulu.CtuluVariable; -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.dodico.ef.EfGridData; -import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsBuilder; -import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; -import org.fudaa.ebli.palette.BPaletteInfo.InfoData; - -/** - * @author fred deniger - * @version $Id: MVProfileCourbeModel.java,v 1.10 2007-06-13 12:58:09 deniger Exp $ - */ -public class MVProfileCourbeModel implements MvProfileCourbeModelInterface { - - private int time_; - final EfGridData data_; - EfLineIntersectionsResultsI res_; - EfLineIntersectionsResultsBuilder builder_; - String title_; - - CtuluVariable variable_; - - final TDoubleArrayList y_; - - double yMax_; - - double yMin_; - - private MVProfileCourbeModel(final CtuluVariable _variable, final EfGridData _data, - final EfLineIntersectionsResultsI _res, final int _timeStep, final double[] _y, - final EfLineIntersectionsResultsBuilder _builder) { - super(); - variable_ = _variable; - data_ = _data; - res_ = _res; - title_ = _variable.toString(); - time_ = _timeStep; - builder_ = _builder; - y_ = new TDoubleArrayList(_y); - } - - public MVProfileCourbeModel(final CtuluVariable _variable, final EfGridData _data, final int _timeStep, - final EfLineIntersectionsResultsBuilder _builder, final ProgressionInterface _prog) { - super(); - variable_ = _variable; - data_ = _data; - title_ = _variable.toString(); - time_ = _timeStep; - builder_ = _builder; - if (builder_ != null) res_ = builder_.createResults(_timeStep, _prog); - y_ = new TDoubleArrayList(res_.getNbIntersect()); - computeY(_prog); - } - - public boolean addValue(final double _x, final double _y, final CtuluCommandContainer _cmd) { - return false; - } - - public boolean addValue(final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { - return false; - } - - public final void computeY(final ProgressionInterface _prog) { - final CtuluRange range = new CtuluRange(); - res_ = builder_.createResults(time_, _prog); - y_.ensureCapacity(res_.getNbIntersect()); - y_.resetQuick(); - for (int i = 0; i < res_.getNbIntersect(); i++) { - double val = 0; - if (res_.getIntersect(i).isRealIntersection()) { - val = res_.getIntersect(i).getValue(variable_, time_); - range.expandTo(val); - } - y_.add(val); - } - if (range.isNill()) { - yMax_ = 0; - yMin_ = 0; - } else { - yMax_ = range.getMax(); - yMin_ = range.getMin(); - } - } - - public boolean deplace(final int[] _selectIdx, final double _deltaX, final double _deltaY, - final CtuluCommandContainer _cmd) { - return false; - } - - public MVProfileCourbeModel duplicate() { - final MVProfileCourbeModel res = new MVProfileCourbeModel(variable_, data_, res_, time_, y_.toNativeArray(), - builder_); - res.yMax_ = yMax_; - res.yMin_ = yMin_; - return res; - } - - public void fillWithInfo(final InfoData _table, final CtuluListSelectionInterface _selectedPt) {} - - public int getActiveTimeIdx() { - return 0; - } - - public int getNbValues() { - return res_.getNbIntersect(); - } - - public EfLineIntersectionsResultsI getRes() { - return res_; - } - - public int getTime() { - return time_; - } - - public String getTitle() { - return title_; - } - - public CtuluVariable getVariable() { - return variable_; - } - - public double getX(final int _idx) { - return res_.getDistFromDeb(_idx); - } - - public double getXMax() { - return res_.getDistFromDeb(getNbValues() - 1); - } - - public double getXMin() { - return 0; - } - - public double getY(final int _idx) { - return y_.getQuick(_idx); - } - - public double getYMax() { - return yMax_; - } - - public double getYMin() { - return yMin_; - } - - public boolean isActiveTimeEnable() { - return false; - } - - public boolean isDuplicatable() { - return true; - } - - public boolean isModifiable() { - return false; - } - - public boolean isPointDrawn(final int _i) { - return res_.getIntersect(_i).isRealIntersection(); - } - - public boolean isRemovable() { - return false; - } - - public boolean isSegmentDrawn(final int _i) { - return res_.isSegmentIn(_i); - } - - public boolean isTitleModifiable() { - return true; - } - - public boolean isVisibleLong() { - return false; - } - - public boolean isXModifiable() { - return false; - } - - public boolean removeValue(final int _i, final CtuluCommandContainer _cmd) { - return false; - } - - public boolean removeValue(final int[] _i, final CtuluCommandContainer _cmd) { - return false; - } - - public void reupdateY() { - computeY(null); - - } - - public void setRes(final EfLineIntersectionsResultsBuilder _builder, final ProgressionInterface _prog) { - builder_ = _builder; - computeY(_prog); - } - - public void setTime(final int _time) { - if (time_ != _time && _time >= 0) { - time_ = _time; - computeY(null); - } - } - - public boolean setTitle(final String _newName) { - title_ = _newName; - return true; - } - - public boolean setValue(final int _i, final double _x, final double _y, final CtuluCommandContainer _cmd) { - return false; - } - - public boolean setValues(final int[] _idx, final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { - return false; - } - - public void setVariable(final CtuluVariable _variable, final boolean _contentChanged) { - variable_ = _variable; - if (_contentChanged && data_.isDefined(_variable)) { - computeY(null); - } - } - - public Object getPersistSpecificDatas() { - return null; - } - - public void setPersistSpecificDatas(Object data, Map infos) { - - } - -} +/* + * @creation 21 nov. 06 + * @modification $Date: 2007-06-13 12:58:09 $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.fudaa.meshviewer.profile; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.swing.JComboBox; + +import gnu.trove.TDoubleArrayList; + +import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.ctulu.CtuluRange; +import org.fudaa.ctulu.CtuluVariable; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.ef.EfGridData; +import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsBuilder; +import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; +import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.ebli.calque.BCalqueLegende; +import org.fudaa.ebli.palette.BPaletteInfo.InfoData; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.TrPostProjet; +import org.fudaa.fudaa.tr.post.TrPostSource; +import org.fudaa.fudaa.tr.post.TrPostVisuPanel; +import org.fudaa.fudaa.tr.post.actions.TrPostProfileAction; + +import com.vividsolutions.jts.geom.LineString; + +/** + * @author fred deniger + * @version $Id: MVProfileCourbeModel.java,v 1.10 2007-06-13 12:58:09 deniger Exp $ + */ +public class MVProfileCourbeModel implements MvProfileCourbeModelInterface { + + private int time_; + EfGridData data_; + EfLineIntersectionsResultsI res_; + EfLineIntersectionsResultsBuilder builder_; + String title_; + + CtuluVariable variable_; + + TDoubleArrayList y_; + + double yMax_; + + double yMin_; + + private MVProfileCourbeModel(final CtuluVariable _variable, final EfGridData _data, + final EfLineIntersectionsResultsI _res, final int _timeStep, final double[] _y, + final EfLineIntersectionsResultsBuilder _builder) { + super(); + variable_ = _variable; + data_ = _data; + res_ = _res; + title_ = _variable.toString(); + time_ = _timeStep; + builder_ = _builder; + y_ = new TDoubleArrayList(_y); + } + + public MVProfileCourbeModel(final CtuluVariable _variable, final EfGridData _data, final int _timeStep, + final EfLineIntersectionsResultsBuilder _builder, final ProgressionInterface _prog) { + super(); + variable_ = _variable; + data_ = _data; + title_ = _variable.toString(); + time_ = _timeStep; + builder_ = _builder; + if (builder_ != null) res_ = builder_.createResults(_timeStep, _prog); + y_ = new TDoubleArrayList(res_.getNbIntersect()); + computeY(_prog); + } + + /** + * ACHTUNG: Constructeur uniquement utilis\xE9 pour la persistance des donn\xE9es. + */ + public MVProfileCourbeModel(){ + super(); + } + + public boolean addValue(final double _x, final double _y, final CtuluCommandContainer _cmd) { + return false; + } + + public boolean addValue(final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { + return false; + } + + /** + * Recalcule les y en fonction des informations fournises. + * @param _prog + */ + public final void computeY(final ProgressionInterface _prog) { + final CtuluRange range = new CtuluRange(); + res_ = builder_.createResults(time_, _prog); + + if(y_==null) + y_=new TDoubleArrayList(); + + y_.ensureCapacity(res_.getNbIntersect()); + y_.resetQuick(); + for (int i = 0; i < res_.getNbIntersect(); i++) { + double val = 0; + if (res_.getIntersect(i).isRealIntersection()) { + val = res_.getIntersect(i).getValue(variable_, time_); + range.expandTo(val); + } + y_.add(val); + } + if (range.isNill()) { + yMax_ = 0; + yMin_ = 0; + } else { + yMax_ = range.getMax(); + yMin_ = range.getMin(); + } + } + + public boolean deplace(final int[] _selectIdx, final double _deltaX, final double _deltaY, + final CtuluCommandContainer _cmd) { + return false; + } + + public MVProfileCourbeModel duplicate() { + final MVProfileCourbeModel res = new MVProfileCourbeModel(variable_, data_, res_, time_, y_.toNativeArray(), + builder_); + res.yMax_ = yMax_; + res.yMin_ = yMin_; + return res; + } + + public void fillWithInfo(InfoData _table, CtuluListSelectionInterface _selectedPt) { + if(EbliWidget.AMELIO_LOT_VISIBLE){ + String pdt="N\xB0"+this.time_; + if(this.data_ instanceof TrPostSource){ + TrPostSource src=(TrPostSource)this.data_; + _table.put(TrResource.getS("Type"),"Profil spatial"); + _table.put(TrResource.getS("Fichier r\xE9sultat"),src.getFile().getName()); + _table.put(TrResource.getS("Chemin complet"),src.getFile().getAbsolutePath()); + _table.put(TrResource.getS("Titre Fichier r\xE9sultat"),src.getTitle()); + if(this.time_!=-1 && this.time_<src.getNbTimeStep()) + pdt+=": "+src.getTimeStep(this.time_); + } + if(this.variable_!=null) + _table.put(TrResource.getS("Variable"),this.variable_.getName()+" en "+this.variable_.getCommonUnit()); + _table.put(TrResource.getS("Pas de temps "),pdt); + + LineString polyligne=builder_.getInitLine_(); + if(polyligne!=null){ + _table.put(TrResource.getS("Polyligne, nb pts"),""+polyligne.getNumPoints()); + _table.put(TrResource.getS("Point d\xE9but"),"("+polyligne.getCoordinateN(0).x+";"+polyligne.getCoordinateN(0).y+")"); + _table.put(TrResource.getS("Point fin"),"("+polyligne.getCoordinateN(polyligne.getNumPoints()-1).x+";"+polyligne.getCoordinateN(polyligne.getNumPoints()-1).y+")"); + + } + + + } + } + + public int getActiveTimeIdx() { + return 0; + } + + public int getNbValues() { + return res_.getNbIntersect(); + } + + public EfLineIntersectionsResultsI getRes() { + return res_; + } + + public int getTime() { + return time_; + } + + public String getTitle() { + return title_; + } + + public CtuluVariable getVariable() { + return variable_; + } + + public double getX(final int _idx) { + return res_.getDistFromDeb(_idx); + } + + public double getXMax() { + return res_.getDistFromDeb(getNbValues() - 1); + } + + public double getXMin() { + return 0; + } + + public double getY(final int _idx) { + return y_.getQuick(_idx); + } + + public double getYMax() { + return yMax_; + } + + public double getYMin() { + return yMin_; + } + + public boolean isActiveTimeEnable() { + return false; + } + + public boolean isDuplicatable() { + return true; + } + + public boolean isModifiable() { + return false; + } + + public boolean isPointDrawn(final int _i) { + return res_.getIntersect(_i).isRealIntersection(); + } + + public boolean isRemovable() { + return false; + } + + public boolean isSegmentDrawn(final int _i) { + return res_.isSegmentIn(_i); + } + + public boolean isTitleModifiable() { + return true; + } + + public boolean isVisibleLong() { + return false; + } + + public boolean isXModifiable() { + return false; + } + + public boolean removeValue(final int _i, final CtuluCommandContainer _cmd) { + return false; + } + + public boolean removeValue(final int[] _i, final CtuluCommandContainer _cmd) { + return false; + } + + public void reupdateY() { + computeY(null); + + } + + public void setRes(final EfLineIntersectionsResultsBuilder _builder, final ProgressionInterface _prog) { + builder_ = _builder; + computeY(_prog); + } + + public void setTime(final int _time) { + if (time_ != _time && _time >= 0) { + time_ = _time; + computeY(null); + } + } + + public boolean setTitle(final String _newName) { + title_ = _newName; + return true; + } + + public boolean setValue(final int _i, final double _x, final double _y, final CtuluCommandContainer _cmd) { + return false; + } + + public boolean setValues(final int[] _idx, final double[] _x, final double[] _y, final CtuluCommandContainer _cmd) { + return false; + } + + public void setVariable(final CtuluVariable _variable, final boolean _contentChanged) { + variable_ = _variable; + if (_contentChanged && data_.isDefined(_variable)) { + computeY(null); + } + } + + + + + + public Object getPersistSpecificDatas() { + //-- retourne le quatuor point, pdt,variable et fichier source + ArrayList<Object> listeData=new ArrayList<Object>(); + //listeData.add(this.); + + //-- ajout du pas de temps --// + listeData.add(new Integer(time_)); + + //-- ajout de la variable --// + listeData.add(this.variable_.getID()); + + //-- ajout de la polyligne --// + listeData.add(builder_.getInitLine_()); + + //-- ajout des datas --// + if(data_ instanceof TrPostSource){ + listeData.add(((TrPostSource)data_).getId()); + } + + + return listeData; + } + + + public void setPersistSpecificDatas(Object data, Map infos) { + + if(data ==null || !(data instanceof ArrayList))return; + ArrayList<Object> liste=(ArrayList<Object>)data; + + TrPostProjet projet = (TrPostProjet) infos.get("TrPostProjet"); + TrPostSource src = null; + //-- etape 1: le pas de temps --// + this.time_=(Integer) liste.get(0); + + //-- etape 2 la variable --// + String idVar=(String)liste.get(1); + H2dVariableType var=null;//(H2dVariableType) liste.get(1); + + + + + + //-- etape 3: la polyligne --// + LineString polyligne=(LineString) liste.get(2); + + // -- etape 4: recherche du source qui contient le path donn\xE9 --// + if (projet != null && liste.size()>=4){ + String idSource=(String) liste.get(3); + src = projet.findSourceById(idSource); + if(src!=null) + this.data_=src; + else{ + ((List<String>) infos.get("errorMsg")) + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idVar); + return; + } + } + else{ + ((List<String>) infos.get("errorMsg")) + .add("Erreur, la frame graphe ne trouve pas le fichier r\xE9sultat qui correspond \xE0 l'ID " + idVar); + return; + } + //-- recherche dans les sources de la variable par id --// + for(int i=0;i<src.getAvailableVar().length;i++) + if(src.getAvailableVar()[i].getID().equals(idVar)) + var=src.getAvailableVar()[i]; + + if(var!=null) + this.variable_=var; + else{ + ((List<String>) infos.get("errorMsg")) + .add("Erreur, la frame graphe ne trouve pas la variable qui correspond \xE0 l'ID " + idVar); + return; + } + + //-- on rejoue les donn\xE9es: --// + //-- creation du resultBuilder: --// + TrPostVisuPanel panelUtilise=new TrPostVisuPanel(projet.impl_,projet,new BCalqueLegende(),src); + MvProfileTarget target=new TrPostProfileAction.ProfileAdapter(src,projet); + MvProfileBuilder builder=new MvProfileBuilderFromLine(target,projet.impl_,polyligne,panelUtilise,new MvProfileCoteTester()); + + //-- intersectionResultI --// + this.res_=builder.getDefaultRes(this.variable_, projet.impl_.getMainProgression()); + + //-- EfLineIntersectionsResultsBuilder --// + this.builder_=new EfLineIntersectionsResultsBuilder(polyligne,this.res_,new MvProfileCoteTester()); + + //-- rejouer les donn\xE9es --// + this.computeY(projet.impl_.getMainProgression()); + } + + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:16:43
|
Revision: 4369 http://fudaa.svn.sourceforge.net/fudaa/?rev=4369&view=rev Author: hadouxad Date: 2009-01-16 08:16:33 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2009-01-16 08:15:22 UTC (rev 4368) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2009-01-16 08:16:33 UTC (rev 4369) @@ -183,14 +183,19 @@ final String com = _evt.getActionCommand(); if ("CREER".equals(com)) { + + if(c_!=null){ final int reponse = JOptionPane.showConfirmDialog(this.getParentComponent(),TrResource.getS("Le projet courant va \xEAtre ferm\xE9. \n Voulez vous sauvegarder le projet courant avant sa fermeture?")); if (reponse == JOptionPane.CANCEL_OPTION) { return; } if (reponse == JOptionPane.OK_OPTION) { c_.getManager().saveProject(false); } //-- nettoyage du projet pr\xE9c\xE9dent --// + c_.getManager().clearProject(); - + } + else + c_=new TrPostProjet(this); //-- ouverture d'un fichier r\xE9sultat qui sera automatiquement ajout\xE9 dans la layout courante --// c_.createNewLayoutFrame(); //-- ouverture d'un fichier r\xE9sultat --// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:15:27
|
Revision: 4368 http://fudaa.svn.sourceforge.net/fudaa/?rev=4368&view=rev Author: hadouxad Date: 2009-01-16 08:15:22 +0000 (Fri, 16 Jan 2009) Log Message: ----------- corrections bug + persistance donn?\195?\169es enregistr?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCreateScope.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCreateScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCreateScope.java 2009-01-16 08:15:00 UTC (rev 4367) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCreateScope.java 2009-01-16 08:15:22 UTC (rev 4368) @@ -7,6 +7,7 @@ import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; +import org.fudaa.fudaa.tr.post.ScopCourbeTreeModel; import org.fudaa.fudaa.tr.post.TrPostCourbeTreeModel; import org.fudaa.fudaa.tr.post.TrPostProjet; @@ -40,7 +41,7 @@ public void actionPerformed(final ActionEvent _e) { // --Cr\xE9ation d'un nouveau target - final TrPostCourbeTreeModel model = new TrPostCourbeTreeModel(); + final ScopCourbeTreeModel model = new ScopCourbeTreeModel(); final TrPostWizardCreateScope wizard = new TrPostWizardCreateScope(projet_, model); final BuWizardDialog DialogWizard = new BuWizardDialog(ui_.getFrame(), wizard); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:15:03
|
Revision: 4367 http://fudaa.svn.sourceforge.net/fudaa/?rev=4367&view=rev Author: hadouxad Date: 2009-01-16 08:15:00 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java 2009-01-16 08:14:38 UTC (rev 4366) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java 2009-01-16 08:15:00 UTC (rev 4367) @@ -21,6 +21,7 @@ import org.fudaa.fudaa.tr.common.TrResource; import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; import org.fudaa.fudaa.tr.post.TrPostScene; +import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; import org.fudaa.fudaa.tr.post.actions.TrPostActionAddPointFromWidgetCalque; @@ -56,13 +57,13 @@ MvProfileBuilderFromTree builderParams_; TrPostActionAddPointFromWidgetCalque.Spatial actionChoixGraphes_; - +TrPostSource src_; public TrPostWizardProfilSpatial(final TrPostVisuPanel _calque, final MvProfileBuilderFromTree _chooserParam, final TrPostActionAddPointFromWidgetCalque.Spatial _actionChoixGraphes) { actionChoixGraphes_ = _actionChoixGraphes; builderParams_ = _chooserParam; // calque_ = _calque; - + src_=_calque.getSource(); } protected TrPostCommonImplementation getPostImpl() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:14:43
|
Revision: 4366 http://fudaa.svn.sourceforge.net/fudaa/?rev=4366&view=rev Author: hadouxad Date: 2009-01-16 08:14:38 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionGraphes.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostProfileAction.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionGraphes.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionGraphes.java 2009-01-16 08:14:16 UTC (rev 4365) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionGraphes.java 2009-01-16 08:14:38 UTC (rev 4366) @@ -30,6 +30,7 @@ import org.fudaa.ctulu.image.CtuluLibImage; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheDuplicator; +import org.fudaa.ebli.courbe.EGGrapheModel; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -41,6 +42,7 @@ import org.fudaa.ebli.visuallibrary.graphe.GrapheCellRenderer; import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.ScopCourbeTreeModel; import org.fudaa.fudaa.tr.post.TrPostCourbeTreeModel; import org.fudaa.fudaa.tr.post.TrPostProjet; @@ -55,248 +57,340 @@ */ public class TrPostActionFusionGraphes extends EbliWidgetActionSimple { - TrPostProjet projet_; - EbliWidgetGraphe widgetGraphe_; - EbliNode nodeGraphe_; - JList jListeGraphes_; - ArrayList<JLabel> listeObjetsCalques; - ArrayList<EbliNode> listeGraphesPossibles; - JComponent content_; - BuDialog dialog_; - DefaultListModel modelGraphesPossibles_; + TrPostProjet projet_; + EbliWidgetGraphe widgetGraphe_; + EbliNode nodeGraphe_; + JList jListeGraphes_; + ArrayList<JLabel> listeObjetsCalques; + ArrayList<EbliNode> listeGraphesPossibles; + JComponent content_; + BuDialog dialog_; + DefaultListModel modelGraphesPossibles_; - public TrPostActionFusionGraphes(final EbliWidgetGraphe widget, final EbliNode nodeGraphe, final TrPostProjet projet) { - super(widget.getEbliScene(), TrResource.getS("Fusion avec un autre graphe"), CtuluResource.CTULU.getIcon("cible"), - "ADDPOINTWIDGET"); + public TrPostActionFusionGraphes(final EbliWidgetGraphe widget, final EbliNode nodeGraphe, final TrPostProjet projet) { + super(widget.getEbliScene(), TrResource.getS("Fusion avec un autre graphe"), CtuluResource.CTULU.getIcon("cible"), + "ADDPOINTWIDGET"); - widgetGraphe_ = widget; - nodeGraphe_ = nodeGraphe; - projet_ = projet; + widgetGraphe_ = widget; + nodeGraphe_ = nodeGraphe; + projet_ = projet; - // -- ajout de la combo dans la toolbar de la widget --// - if (!((EbliWidgetControllerGraphe) widgetGraphe_.getController()).hasAlreadyFusion) { - widgetGraphe_.getController().getPopup().add(this); - ((EbliWidgetControllerGraphe) widgetGraphe_.getController()).hasAlreadyFusion = true; - } + // -- ajout de la combo dans la toolbar de la widget --// + if (!((EbliWidgetControllerGraphe) widgetGraphe_.getController()).hasAlreadyFusion) { + widgetGraphe_.getController().getPopup().add(this); + ((EbliWidgetControllerGraphe) widgetGraphe_.getController()).hasAlreadyFusion = true; + } - } + } - /** - * remplissage de la combo avec les graphes disponibles et compatibles - * - * @param scene - */ - private void remplirCombo() { - final Map params = new HashMap(); - CtuluLibImage.setCompatibleImageAsked(params); - listeGraphesPossibles = new ArrayList<EbliNode>(); - listeObjetsCalques = new ArrayList<JLabel>(); + /** + * remplissage de la combo avec les graphes disponibles et compatibles + * + * @param scene + */ + private void remplirCombo() { + final Map params = new HashMap(); + CtuluLibImage.setCompatibleImageAsked(params); + listeGraphesPossibles = new ArrayList<EbliNode>(); + listeObjetsCalques = new ArrayList<JLabel>(); - // -- remplissage de la liste a partir de l ecoute de la scene--// - final Set<EbliNode> listeNode = (Set<EbliNode>) scene_.getObjects(); - for (final Iterator<EbliNode> it = listeNode.iterator(); it.hasNext();) { - final EbliNode currentNode = it.next(); + // -- remplissage de la liste a partir de l ecoute de la scene--// + final Set<EbliNode> listeNode = (Set<EbliNode>) scene_.getObjects(); + for (final Iterator<EbliNode> it = listeNode.iterator(); it.hasNext();) { + final EbliNode currentNode = it.next(); - if (currentNode != nodeGraphe_ && currentNode.getCreator() instanceof EbliWidgetCreatorGraphe) { - final EbliWidgetCreatorGraphe new_name = (EbliWidgetCreatorGraphe) currentNode.getCreator(); + if (currentNode != nodeGraphe_ && currentNode.getCreator() instanceof EbliWidgetCreatorGraphe) { + final EbliWidgetCreatorGraphe new_name = (EbliWidgetCreatorGraphe) currentNode.getCreator(); - if (isCompatibleWithGraphe(new_name.getGraphe())) { + if (isCompatibleWithGraphe(new_name.getGraphe())) { - final JLabel label = new JLabel(); - final BufferedImage image = new_name.getGraphe().produceImage(70, 30, params); - final Icon icone = new ImageIcon(image); + final JLabel label = new JLabel(); + final BufferedImage image = new_name.getGraphe().produceImage(70, 30, params); + final Icon icone = new ImageIcon(image); - label.setIcon(icone); - label.setText("Fusionner avec " + currentNode.getTitle()); - listeObjetsCalques.add(label); - listeGraphesPossibles.add(currentNode); - } - } + label.setIcon(icone); + label.setText("Fusionner avec " + currentNode.getTitle()); + listeObjetsCalques.add(label); + listeGraphesPossibles.add(currentNode); + } + } - } + } - // -- creation graphique --// - if (jListeGraphes_ == null) jListeGraphes_ = new JList(); + // -- creation graphique --// + if (jListeGraphes_ == null) jListeGraphes_ = new JList(); - modelGraphesPossibles_ = new DefaultListModel(); + modelGraphesPossibles_ = new DefaultListModel(); - jListeGraphes_.setModel(modelGraphesPossibles_); + jListeGraphes_.setModel(modelGraphesPossibles_); - for (final Iterator<JLabel> it = listeObjetsCalques.iterator(); it.hasNext();) { + for (final Iterator<JLabel> it = listeObjetsCalques.iterator(); it.hasNext();) { - modelGraphesPossibles_.addElement(it.next()); + modelGraphesPossibles_.addElement(it.next()); - } - jListeGraphes_.setSize(250, 350); - jListeGraphes_.setBorder(BorderFactory.createTitledBorder(TrResource.TR.getString("Graphes possibles"))); - jListeGraphes_.setCellRenderer(new GrapheCellRenderer()); + } + jListeGraphes_.setSize(250, 350); + jListeGraphes_.setBorder(BorderFactory.createTitledBorder(TrResource.TR.getString("Graphes possibles"))); + jListeGraphes_.setCellRenderer(new GrapheCellRenderer()); - } + } - /** - * verifie si les graphes sont compatibles - * - * @param graphe - * @return - */ - public boolean isCompatibleWithGraphe(final EGGraphe graphe) { - return (this.widgetGraphe_.getGraphe().getModel() instanceof TrPostCourbeTreeModel && graphe.getModel() instanceof TrPostCourbeTreeModel) - || (this.widgetGraphe_.getGraphe().getModel() instanceof MvProfileTreeModel && graphe.getModel() instanceof MvProfileTreeModel); - } + /** + * verifie si les graphes sont compatibles + * + * @param graphe + * @return + */ + public boolean isCompatibleWithGraphe(final EGGraphe graphe) { - JComponent constructPanel() { - final JPanel content = new JPanel(new BorderLayout()); + //-- cas scop gene, compatible avec tout le monde --// + if(graphe.getModel() instanceof ScopCourbeTreeModel || this.widgetGraphe_.getGraphe().getModel() instanceof ScopCourbeTreeModel) + return true; - content.add(new JLabel(TrResource.getS("Fusion avec un autre graphe")), BorderLayout.NORTH); - content.add(new BuScrollPane(jListeGraphes_), BorderLayout.CENTER); - final JButton valide = new JButton(TrResource.getS("R\xE9aliser la fusion"), EbliResource.EBLI - .getIcon("crystal_valider")); - valide.addActionListener(new ActionListener() { + return (this.widgetGraphe_.getGraphe().getModel() instanceof TrPostCourbeTreeModel && graphe.getModel() instanceof TrPostCourbeTreeModel) + || (this.widgetGraphe_.getGraphe().getModel() instanceof MvProfileTreeModel && graphe.getModel() instanceof MvProfileTreeModel); + } - public void actionPerformed(final ActionEvent _e) { - if (jListeGraphes_.getSelectedIndex() != -1) { - mergeGraph(); - dialog_.dispose(); - } - } + JComponent constructPanel() { + final JPanel content = new JPanel(new BorderLayout()); - }); - jListeGraphes_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + content.add(new JLabel(TrResource.getS("Fusion avec un autre graphe")), BorderLayout.NORTH); + content.add(new BuScrollPane(jListeGraphes_), BorderLayout.CENTER); + final JButton valide = new JButton(TrResource.getS("R\xE9aliser la fusion"), EbliResource.EBLI + .getIcon("crystal_valider")); + valide.addActionListener(new ActionListener() { - final JPanel operations = new JPanel(new FlowLayout(FlowLayout.CENTER)); + public void actionPerformed(final ActionEvent _e) { + if (jListeGraphes_.getSelectedIndex() != -1) { + mergeGraph(); + dialog_.dispose(); + } + } - operations.add(valide); - content.add(operations, BorderLayout.SOUTH); + }); + jListeGraphes_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - return content; - } + final JPanel operations = new JPanel(new FlowLayout(FlowLayout.CENTER)); - /** - * Methode qui: merge le graphe choisi dans la combo avec el ndoe actuel degage le node choisi de la scene remet a - * jour al combo actuelle - */ - private void mergeGraph() { + operations.add(valide); + content.add(operations, BorderLayout.SOUTH); - final int selected = jListeGraphes_.getSelectedIndex(); - if (selected == -1) { return; } - final EbliNode nodeToMerge = listeGraphesPossibles.get(selected); + return content; + } - // --recuperation de son graphe --// - EbliWidgetGraphe grapheWidget = null; - if (nodeToMerge.getWidget() instanceof EbliWidgetBordureSingle) grapheWidget = (EbliWidgetGraphe) ((EbliWidgetBordureSingle) nodeToMerge - .getWidget()).getIntern(); - else grapheWidget = (EbliWidgetGraphe) nodeToMerge.getWidget(); + /** + * Methode qui: merge le graphe choisi dans la combo avec el ndoe actuel degage le node choisi de la scene remet a + * jour al combo actuelle + */ + private void mergeGraph() { - // -- cas des graphes temporels - if (widgetGraphe_.getGraphe().getModel() instanceof TrPostCourbeTreeModel) { - final TrPostCourbeTreeModel grapheToMerge = (TrPostCourbeTreeModel) grapheWidget.getGraphe().getModel(); - final TrPostCourbeTreeModel grapheModel = (TrPostCourbeTreeModel) widgetGraphe_.getGraphe().getModel(); - final EGGrapheTreeModel saveModel = (EGGrapheTreeModel) grapheModel.duplicate(new EGGrapheDuplicator()); - // --ajout de la courbe au widget de base --// - new CtuluTaskOperationGUI(projet_.impl_, TrResource.getS("Fusion avec un autre graphe")) { + final int selected = jListeGraphes_.getSelectedIndex(); + if (selected == -1) { return; } + final EbliNode nodeToMerge = listeGraphesPossibles.get(selected); - @Override - public void act() { - final ProgressionInterface prog = new ProgressionBuAdapter(this); + // --recuperation de son graphe --// + EbliWidgetGraphe grapheWidget = null; + if (nodeToMerge.getWidget() instanceof EbliWidgetBordureSingle) grapheWidget = (EbliWidgetGraphe) ((EbliWidgetBordureSingle) nodeToMerge + .getWidget()).getIntern(); + else grapheWidget = (EbliWidgetGraphe) nodeToMerge.getWidget(); - grapheModel.mergeWithAnotherTreeModel(grapheToMerge); - } - }.start();; - scene_.getCmdMng().addCmd(new CtuluCommand() { - public void redo() { - grapheModel.mergeWithAnotherTreeModel(grapheToMerge); - scene_.removeNodeWithEdges(nodeToMerge); - scene_.refresh(); - } + // -- cas des graphes temporels + if (widgetGraphe_.getGraphe().getModel() instanceof TrPostCourbeTreeModel && !(grapheWidget.getGraphe().getModel() instanceof MvProfileTreeModel)) { + final TrPostCourbeTreeModel grapheToMerge = (TrPostCourbeTreeModel) grapheWidget.getGraphe().getModel(); + final TrPostCourbeTreeModel grapheModel = (TrPostCourbeTreeModel) widgetGraphe_.getGraphe().getModel(); + final EGGrapheTreeModel saveModel = (EGGrapheTreeModel) grapheModel.duplicate(new EGGrapheDuplicator()); + // --ajout de la courbe au widget de base --// + new CtuluTaskOperationGUI(projet_.impl_, TrResource.getS("Fusion avec un autre graphe")) { - public void undo() { + @Override + public void act() { + final ProgressionInterface prog = new ProgressionBuAdapter(this); - widgetGraphe_.getGraphe().setModel(saveModel); - grapheModel.fireStructureChanged(); - scene_.addNode(nodeToMerge); - scene_.refresh(); - } + //-- cas merge avec un scope --// + if(grapheToMerge instanceof ScopCourbeTreeModel) + grapheModel.mergeWithAScopeTreeModel((ScopCourbeTreeModel)grapheToMerge); + else + grapheModel.mergeWithAnotherTreeModel(grapheToMerge); - }); + } + }.start();; - } else { - // -- cas des grapehs spatiaux --// - final MvProfileTreeModel grapheToMerge = (MvProfileTreeModel) grapheWidget.getGraphe().getModel(); - final MvProfileTreeModel grapheModel = (MvProfileTreeModel) widgetGraphe_.getGraphe().getModel(); - final EGGrapheTreeModel saveModel = (EGGrapheTreeModel) grapheModel.duplicate(new EGGrapheDuplicator()); - // --ajout de la courbe au widget de base --// - new CtuluTaskOperationGUI(projet_.impl_, TrResource.getS("Fusion avec un autre graphe")) { + scene_.getCmdMng().addCmd(new CtuluCommand() { - @Override - public void act() { - final ProgressionInterface prog = new ProgressionBuAdapter(this); + public void redo() { + grapheModel.mergeWithAnotherTreeModel(grapheToMerge); + scene_.removeNodeWithEdges(nodeToMerge); + scene_.refresh(); + } - grapheModel.mergeWithAnotherTreeModel(grapheToMerge); + public void undo() { - } - }.start(); + widgetGraphe_.getGraphe().setModel(saveModel); + grapheModel.fireStructureChanged(); + scene_.addNode(nodeToMerge); + scene_.refresh(); + } - scene_.getCmdMng().addCmd(new CtuluCommand() { + }); - public void redo() { - grapheModel.mergeWithAnotherTreeModel(grapheToMerge); - scene_.removeNodeWithEdges(nodeToMerge); - scene_.refresh(); - } + } else if(widgetGraphe_.getGraphe().getModel() instanceof MvProfileTreeModel){ + // -- cas des graphes spatiaux --// - public void undo() { + if(grapheWidget.getGraphe().getModel() instanceof MvProfileTreeModel){ + //-- cas de graphe spatial a graphe spatial --// + + final MvProfileTreeModel grapheToMerge = (MvProfileTreeModel) grapheWidget.getGraphe().getModel(); + final MvProfileTreeModel grapheModel = (MvProfileTreeModel) widgetGraphe_.getGraphe().getModel(); + final EGGrapheTreeModel saveModel = (EGGrapheTreeModel) grapheModel.duplicate(new EGGrapheDuplicator()); + // --ajout de la courbe au widget de base --// + new CtuluTaskOperationGUI(projet_.impl_, TrResource.getS("Fusion avec un autre graphe")) { - widgetGraphe_.getGraphe().setModel(saveModel); - grapheModel.fireStructureChanged(); - scene_.addNode(nodeToMerge); - scene_.refresh(); - } + @Override + public void act() { + final ProgressionInterface prog = new ProgressionBuAdapter(this); - }); + grapheModel.mergeWithAnotherTreeModel(grapheToMerge); - } + } + }.start(); - // -- v\xE9rification pour les l\xE9gendes --// - if (((EbliWidgetControllerGraphe) grapheWidget.getController()).hasLegende()) scene_.removeNode(grapheWidget - .getNodeLegende()); + scene_.getCmdMng().addCmd(new CtuluCommand() { - // --suppression du graphe merge --// - scene_.removeNodeWithEdges(nodeToMerge); + public void redo() { + grapheModel.mergeWithAnotherTreeModel(grapheToMerge); + scene_.removeNodeWithEdges(nodeToMerge); + scene_.refresh(); + } - scene_.refresh(); + public void undo() { - // -- maj de la combo --// - remplirCombo(); + widgetGraphe_.getGraphe().setModel(saveModel); + grapheModel.fireStructureChanged(); + scene_.addNode(nodeToMerge); + scene_.refresh(); + } - if (((EbliWidgetControllerGraphe) widgetGraphe_.getController()).hasLegende()) { - scene_.removeNode(widgetGraphe_.getNodeLegende()); - scene_.refresh(); - ((EbliWidgetControllerGraphe) widgetGraphe_.getController()).ajoutLegende(); - scene_.refresh(); - } + }); - } + } - @Override - public void actionPerformed(final ActionEvent _e) { + else if(grapheWidget.getGraphe().getModel() instanceof ScopCourbeTreeModel) { + //-- cas de fusion entre un spatial et un scop --// + final ScopCourbeTreeModel grapheToMerge = (ScopCourbeTreeModel) grapheWidget.getGraphe().getModel(); + final MvProfileTreeModel grapheModel = (MvProfileTreeModel) widgetGraphe_.getGraphe().getModel(); + final EGGrapheTreeModel saveModel = (EGGrapheTreeModel) grapheModel.duplicate(new EGGrapheDuplicator()); + // --ajout de la courbe au widget de base --// + new CtuluTaskOperationGUI(projet_.impl_, TrResource.getS("Fusion avec un autre graphe")) { - // -- remplisage combo --// - remplirCombo(); + @Override + public void act() { + final ProgressionInterface prog = new ProgressionBuAdapter(this); - dialog_ = new BuDialogConfirmation(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), TrResource - .getS("Fusion avec un autre graphe")); - if (content_ == null) content_ = constructPanel(); + grapheModel.mergeWithAnotherScopeTreeModel(grapheToMerge); - dialog_.setContentPane(content_); - dialog_.setSize(400, 250); + } + }.start(); - dialog_.setModal(true); + scene_.getCmdMng().addCmd(new CtuluCommand() { - // dialog_.setLocation(widgetGraphe_.getLocation()); - dialog_.activate(); - } + public void redo() { + grapheModel.mergeWithAnotherScopeTreeModel(grapheToMerge); + scene_.removeNodeWithEdges(nodeToMerge); + scene_.refresh(); + } -} + public void undo() { + + widgetGraphe_.getGraphe().setModel(saveModel); + grapheModel.fireStructureChanged(); + scene_.addNode(nodeToMerge); + scene_.refresh(); + } + + }); + + } + }else{ + + //-- dernier cas: un scope avec un mvprofil spatial: on inverse le cas precedent --// + //-- cas de fusion entre un spatial et un scop --// + final ScopCourbeTreeModel grapheToMerge =(ScopCourbeTreeModel) widgetGraphe_.getGraphe().getModel(); + final MvProfileTreeModel grapheModel = (MvProfileTreeModel) grapheWidget.getGraphe().getModel(); + final EGGrapheTreeModel saveModel = (EGGrapheTreeModel) grapheModel.duplicate(new EGGrapheDuplicator()); + // --ajout de la courbe au widget de base --// + new CtuluTaskOperationGUI(projet_.impl_, TrResource.getS("Fusion avec un autre graphe")) { + + @Override + public void act() { + final ProgressionInterface prog = new ProgressionBuAdapter(this); + + grapheToMerge.mergeWithAnotherMvProfileTreeModel(grapheModel); + + } + }.start(); + + scene_.getCmdMng().addCmd(new CtuluCommand() { + + public void redo() { + grapheToMerge.mergeWithAnotherMvProfileTreeModel(grapheModel); + scene_.removeNodeWithEdges(nodeToMerge); + scene_.refresh(); + } + + public void undo() { + + widgetGraphe_.getGraphe().setModel(saveModel); + grapheModel.fireStructureChanged(); + scene_.addNode(nodeToMerge); + scene_.refresh(); + } + + }); + + } + + + // -- v\xE9rification pour les l\xE9gendes --// + if (((EbliWidgetControllerGraphe) grapheWidget.getController()).hasLegende()) scene_.removeNode(grapheWidget + .getNodeLegende()); + + // --suppression du graphe merge --// + scene_.removeNodeWithEdges(nodeToMerge); + + scene_.refresh(); + + // -- maj de la combo --// + remplirCombo(); + + if (((EbliWidgetControllerGraphe) widgetGraphe_.getController()).hasLegende()) { + scene_.removeNode(widgetGraphe_.getNodeLegende()); + scene_.refresh(); + ((EbliWidgetControllerGraphe) widgetGraphe_.getController()).ajoutLegende(); + scene_.refresh(); + } + + } + + @Override + public void actionPerformed(final ActionEvent _e) { + + // -- remplisage combo --// + remplirCombo(); + + dialog_ = new BuDialogConfirmation(projet_.impl_.getApp(), projet_.impl_.getInformationsSoftware(), TrResource + .getS("Fusion avec un autre graphe")); + if (content_ == null) content_ = constructPanel(); + + dialog_.setContentPane(content_); + dialog_.setSize(400, 250); + + dialog_.setModal(true); + + // dialog_.setLocation(widgetGraphe_.getLocation()); + dialog_.activate(); + } + + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostProfileAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostProfileAction.java 2009-01-16 08:14:16 UTC (rev 4365) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostProfileAction.java 2009-01-16 08:14:38 UTC (rev 4366) @@ -33,7 +33,7 @@ /** * @author deniger */ - protected static class ProfileAdapter implements MvProfileTarget { + public static class ProfileAdapter implements MvProfileTarget { final TrPostProjet proj_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:14:21
|
Revision: 4365 http://fudaa.svn.sourceforge.net/fudaa/?rev=4365&view=rev Author: hadouxad Date: 2009-01-16 08:14:16 +0000 (Fri, 16 Jan 2009) Log Message: ----------- corrections bug + persistance donn?\195?\169es enregistr?\195?\169es Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/ScopCourbeTreeModel.java 2009-01-16 08:14:16 UTC (rev 4365) @@ -0,0 +1,137 @@ +package org.fudaa.fudaa.tr.post; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.dodico.mesure.EvolutionReguliere; +import org.fudaa.dodico.mesure.EvolutionReguliereInterface; +import org.fudaa.ebli.courbe.EGCourbe; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGGrapheDuplicator; +import org.fudaa.ebli.courbe.EGGrapheModel; +import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.courbe.EGGrapheTreeModel.GrapheTreeNode; + +import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; +import org.fudaa.fudaa.commun.courbe.ScopeCourbeModel; +import org.fudaa.fudaa.meshviewer.profile.MVProfileCourbeModel; +import org.fudaa.fudaa.meshviewer.profile.MvProfileCourbe; +import org.fudaa.fudaa.meshviewer.profile.MvProfileCourbeGroup; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; + + +/** + * Tree Model des formats scope + * @author genesis + * + */ +public class ScopCourbeTreeModel extends TrPostCourbeTreeModel{ + + + public void importCourbes(final EvolutionReguliereInterface[] _crb, final CtuluCommandManager _mng, + final ProgressionInterface _prog) { + if (_crb == null) return; + final EGGroup gr = getGroupFor(H2dVariableType.SANS); + final List<EGCourbeChild> childs = new ArrayList<EGCourbeChild>(_crb.length); + for (int i = 0; i < _crb.length; i++) { + + EvolutionReguliere evol=null; + if(_crb[i] instanceof EvolutionReguliere) + evol=(EvolutionReguliere) _crb[i]; + else + evol=new EvolutionReguliere(_crb[i]); + final EGCourbeChild child = new EGCourbeChild(gr, new ScopeCourbeModel(evol)); + childs.add(child); + + //-- on met a jour si la courbe est un nuage de points ou non --// + child.setNuagePoints_(_crb[i].isNuagePoints()); + + gr.addEGComponent(child); + } + + if (_mng != null) { + _mng.addCmd(new CommandAddCourbesMulti(childs.toArray(new EGCourbeChild[childs.size()]), new EGGroup[] { gr })); + } + fireStructureChanged(); + + } + + /** + * Methode qui permet de fusionner le model courant avec un autre model SPATIAL. Utilsier poru la fusion de courbes spatiales + * et l ajout dans d autres courbes. + * + * @author Adrien Hadoux + * @param anotherModel + */ + public void mergeWithAnotherMvProfileTreeModel(final MvProfileTreeModel anotherModel) { + // -- parcours de la liste des variables du graphe a fusionner --// + for (int i = 0; i < anotherModel.target_.getVars().length; i++) { + final H2dVariableType var = (H2dVariableType) anotherModel.target_.getVars()[i]; + + // -- on recupere toutes les courbes associees a la var pour le + // graphe merges + final MvProfileCourbeGroup g = anotherModel.getGroup(var, false); + if (g != null) { + // -- on recherche le group associe a la variale dans l autre graphe + // sinon on le cree --// + final EGGroup group = this.getGroupFor(var); + + for (int k = g.getChildCount() - 1; k >= 0; k--) { + if (g.getCourbeAt(k).getModel() instanceof MVProfileCourbeModel) { + if (((MVProfileCourbeModel) g.getCourbeAt(k).getModel()).getVariable() == var) { + + // -- duplication de la courbe dans le groupe --// + + + group.addEGComponent((EGCourbeChild) g.getCourbeAt(k).duplicate(group, new EGGrapheDuplicator())); + + + } + } + + } + } + + } + this.fireStructureChanged(); + + } + + +// public EGCourbe[] getCourbes() { +// +// List<EGCourbe> liste=new ArrayList<EGCourbe>(); +// +// for(int i=0;i<this.getNbEGObject();i++){ +// if(this.getEGObject(i) instanceof EGCourbe){ +// liste.add((EGCourbe) this.getEGObject(i)); +// } +// } +// return liste.toArray(new EGCourbe[liste.size()]); +// +// } + + public EGGrapheModel duplicate(final EGGrapheDuplicator _duplicator) { + final ScopCourbeTreeModel duplic = new ScopCourbeTreeModel(); + duplic.setAxeX(this.getAxeX().duplicate()); + + duplic.getSelectionModel().setSelectionMode(this.getSelectionModel().getSelectionMode()); + + final GrapheTreeNode root = this.getGrapheTreeNode(); + final GrapheTreeNode rootDuplique = duplic.getGrapheTreeNode(); + + for (int i = 0; i < root.components_.size(); i++) { + + // -- ajout du groupe duplique --// + duplic.add(root.getGroup(i).duplicate(_duplicator)); + + } + + return duplic; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:11:58
|
Revision: 4364 http://fudaa.svn.sourceforge.net/fudaa/?rev=4364&view=rev Author: hadouxad Date: 2009-01-16 08:11:47 +0000 (Fri, 16 Jan 2009) Log Message: ----------- corrections bug + persistance donn?\195?\169es enregistr?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/XmlCommentaire.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java 2009-01-16 08:09:59 UTC (rev 4363) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostSourcePersist.java 2009-01-16 08:11:47 UTC (rev 4364) @@ -20,9 +20,11 @@ @XStreamAlias("warning") String warning="ID unique"; String IdSource; + boolean rechargerLesLiens=false; + String pathRelatifSource; String pathSource; - String pathRelatifSource; - boolean rechargerLesLiens=false; + + public TrPostSourcePersist(){} /** Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/XmlCommentaire.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/XmlCommentaire.java 2009-01-16 08:09:59 UTC (rev 4363) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/XmlCommentaire.java 2009-01-16 08:11:47 UTC (rev 4364) @@ -20,9 +20,10 @@ } public static XmlCommentaire getCommentaireSources(){ - String buff=TrResource.getS("Fichier listant tous les fichiers r\xE9sultats. Pour modifier un fichier, modifier le chemin contenu dans balise pathSource (le contenu de pathRelatif n'a pas besoin d'etrre modifie).")+ + String buff=TrResource.getS("Fichier listant tous les fichiers r\xE9sultats. Pour modifier un fichier, modifier le chemin du path relatif et absolu contenu dans balise pathSource et mettre le booleen a TRUE pour indiquer qu'il faut rejouer les donnees.")+ TrResource.getS("Pour ajouter un fichier de r\xE9sultat dans le projet, copier/coller dans le fichier le contenu entre les balises SOURCE (balises incluses) et modifier le chemin absolu vers le fichier de r\xE9sultats d\xE9sir\xE9.Attention, il faut saisir un ID unique entre les balises idSource. Si on veut que les frames calques utilisent ce fichier de r\xE9sultat, il faut aller dans leur r\xE9pertoire Calques et inscrire dans leur fichier descriptor l'id de source correspondant.")+ - TrResource.getS("Pour supprimer un fichier de r\xE9sultat dans le projet, s\xE9lectionner dans le fichier le contenu entre les balises SOURCE (balises incluses) correspondant au fichier \xE0 enlever et supprimer le puis sauvegarder le fichier"); + TrResource.getS("Pour supprimer un fichier de r\xE9sultat dans le projet, s\xE9lectionner dans le fichier le contenu entre les balises SOURCE (balises incluses) correspondant au fichier \xE0 enlever et supprimer le puis sauvegarder le fichier") + ; return new XmlCommentaire(buff); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:10:08
|
Revision: 4363 http://fudaa.svn.sourceforge.net/fudaa/?rev=4363&view=rev Author: hadouxad Date: 2009-01-16 08:09:59 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/ScopeCourbeModel.java 2009-01-16 08:09:59 UTC (rev 4363) @@ -0,0 +1,101 @@ +package org.fudaa.fudaa.commun.courbe; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +import org.fudaa.ctulu.CtuluListSelectionInterface; +import org.fudaa.dodico.mesure.EvolutionReguliere; +import org.fudaa.dodico.telemac.io.ScopeStructure; +import org.fudaa.ebli.courbe.EGModel; +import org.fudaa.ebli.palette.BPaletteInfo.InfoData; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.TrPostSource; + +import com.vividsolutions.jts.geom.LineString; + + +/** + * Modele des courbes scop. + * @author Adrien Hadoux + * + */ +public class ScopeCourbeModel extends FudaaCourbeModel{ + + + + /** + * Map d'informations specifiques scop qui a permi de generer ce model de courbe. + */ + Map infos_; + + public ScopeCourbeModel(final EvolutionReguliere _e) { + super(_e); + infos_=new HashMap(_e.infos_); + } + /** + * Achtung: utiliser uniqument pour la persistance des donnees. + */ + public ScopeCourbeModel(){ + super(); + this.e_=new EvolutionReguliere(); + + } + + + public Object getPersistSpecificDatas() { + // TODO Auto-generated method stub + return infos_; + } + + + + + public void setPersistSpecificDatas(Object data, Map infos) { + if(data !=null && (data instanceof Map)) + infos_=(Map) data; + } + + + /** + * Retourne le fichier qui a permi de g\xE9n\xE9rer la courbe. + * Retourne null si le fichier n'a pa s \xE9t\xE9 enregistr\xE9. + * @return + */ + public File getFichierGenerateur(){ + if(infos_==null) + return null; + if(infos_.get(ScopeStructure.NOM_FICHIER) !=null){ + + String path=infos_.get(ScopeStructure.NOM_FICHIER).toString(); + + File res=new File(path); + + return res; + + }else return null; + + } + + + + + public void fillWithInfo(InfoData _table, CtuluListSelectionInterface _selectedPt) { + if(EbliWidget.AMELIO_LOT_VISIBLE){ + + for(Object key:infos_.keySet()){ + if(infos_.get(key)!=null) + _table.put(key.toString(),infos_.get(key).toString()); + } + } + + + } + + public EGModel duplicate(){ + + return new ScopeCourbeModel((EvolutionReguliere)this.e_.getCopy(this.e_.getListener())); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:08:07
|
Revision: 4362 http://fudaa.svn.sourceforge.net/fudaa/?rev=4362&view=rev Author: hadouxad Date: 2009-01-16 08:08:03 +0000 (Fri, 16 Jan 2009) Log Message: ----------- corrections bug + persistance donn?\195?\169es enregistr?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2009-01-16 08:07:39 UTC (rev 4361) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeDefautModel.java 2009-01-16 08:08:03 UTC (rev 4362) @@ -24,7 +24,7 @@ */ public class FudaaCourbeDefautModel implements EGModel { - EvolutionReguliereInterface e_; + protected EvolutionReguliereInterface e_; public final EvolutionReguliereInterface getEvolutionInterface() { return e_; @@ -37,6 +37,12 @@ super(); e_ = _e; } + /** + * Achtung: utiliser uniqument pour la persistance des donnees. + */ + public FudaaCourbeDefautModel(){ + super(); + } public int getActiveTimeIdx() { return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-16 08:07:42
|
Revision: 4361 http://fudaa.svn.sourceforge.net/fudaa/?rev=4361&view=rev Author: hadouxad Date: 2009-01-16 08:07:39 +0000 (Fri, 16 Jan 2009) Log Message: ----------- corrections bug + persistance donn?\195?\169es enregistr?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileAction.java 2009-01-15 22:22:54 UTC (rev 4360) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileAction.java 2009-01-16 08:07:39 UTC (rev 4361) @@ -13,6 +13,7 @@ import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.layer.MvVisuPanel; +import org.fudaa.fudaa.tr.post.TrPostSource; import com.vividsolutions.jts.geom.LineString; @@ -24,12 +25,13 @@ final MvProfileTarget src_; final MvVisuPanel panel_; final FudaaCommonImplementation ui_; - + public MvProfileAction(final MvProfileTarget _src, final FudaaCommonImplementation _ui, final MvVisuPanel _visu) { super(MvResource.getS("Profils spatiaux"), MvResource.MV.getIcon("profile"), "SPATIAL_PROFILE"); src_ = _src; ui_ = _ui; panel_ = _visu; + } protected LineString getSelectedLine() { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java 2009-01-15 22:22:54 UTC (rev 4360) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java 2009-01-16 08:07:39 UTC (rev 4361) @@ -37,6 +37,7 @@ import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; +import org.fudaa.fudaa.tr.post.TrPostSource; import com.memoire.bu.BuLib; import com.vividsolutions.jts.geom.LineString; @@ -111,7 +112,7 @@ * @param _prog * @param _selected */ - public void actBuildGroup(final ProgressionInterface _prog, final MvExportChooseVarAndTime _selected) { + public void actBuildGroup( final ProgressionInterface _prog, final MvExportChooseVarAndTime _selected) { int[] time = _selected.getSelectedTimeStepIdx(); final CtuluVariable[] vs = _selected.getSelectedVar(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java 2009-01-15 22:22:54 UTC (rev 4360) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromLine.java 2009-01-16 08:07:39 UTC (rev 4361) @@ -19,15 +19,19 @@ import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; +import org.fudaa.fudaa.tr.post.TrPostSource; import com.vividsolutions.jts.geom.LineString; public class MvProfileBuilderFromLine extends MvProfileBuilder { + + public MvProfileBuilderFromLine(final MvProfileTarget _data, final CtuluUI _ui, final LineString _line, final ZEbliCalquesPanel _panel, final EfLineIntersectionsCorrectionTester _tester) { super(_data, _panel, _tester, _line); selectedLine_ = _line; + } protected void actFirstTest(final ProgressionInterface _prog) { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java 2009-01-15 22:22:54 UTC (rev 4360) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilderFromTree.java 2009-01-16 08:07:39 UTC (rev 4361) @@ -30,6 +30,7 @@ import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; +import org.fudaa.fudaa.tr.post.TrPostSource; import com.memoire.bu.BuBorders; import com.memoire.bu.BuGlassPaneStop; @@ -41,6 +42,9 @@ final MvLineChooser lineChooser_; + + + /** * panel qui contient les calques des isolignes */ @@ -58,6 +62,7 @@ // initSelected_ = _selected; calque_ = _panel; lineChooser_ = new MvLineChooser(_selected, panel_); + } @Override Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-15 22:22:54 UTC (rev 4360) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-01-16 08:07:39 UTC (rev 4361) @@ -52,9 +52,11 @@ import org.fudaa.ebli.courbe.EGObject; import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; +import org.fudaa.fudaa.commun.courbe.ScopeCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; +import org.fudaa.fudaa.tr.post.ScopCourbeTreeModel; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostSource; import org.fudaa.fudaa.tr.post.actions.TrPostProfileAction; @@ -639,6 +641,41 @@ } + + /** + * Methode qui permet de fusionner le model courant avec un autre model. Utilsier poru la fusion de courbes spatiales + * et l ajout dans d autres courbes. + * + * @author Adrien Hadoux + * @param anotherModel + */ + public void mergeWithAnotherScopeTreeModel(final ScopCourbeTreeModel anotherModel) { + // -- parcours de la liste des variables du graphe a fusionner --// + + + + // -- on recherche le group associe a la variale dans l autre graphe + // sinon on le cree --// + final MvProfileCourbeGroup group = this.getGroup(H2dVariableType.SANS, true); + + + // -- on recupere toutes les courbes associees a la var pour le + // graphe merges + + final EGGroup g = anotherModel.getGroupFor(H2dVariableType.SANS); + for (int i = g.getChildCount() - 1; i >= 0; i--) { + if (g.getCourbeAt(i).getModel() instanceof ScopeCourbeModel) { + + + group.addEGComponent((EGCourbeChild) g.getCourbeAt(i).duplicate(group, new EGGrapheDuplicator())); + + } + + } + this.fireStructureChanged(); + + } + protected MvProfileGridPalette getPaletteGrid() { return paletteGrid_; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2009-01-15 22:56:35
|
Revision: 4360 http://fudaa.svn.sourceforge.net/fudaa/?rev=4360&view=rev Author: deniger Date: 2009-01-15 22:22:54 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BCalquePersistenceGroupe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BCalquePersistenceGroupe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BCalquePersistenceGroupe.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BCalquePersistenceGroupe.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -81,7 +81,8 @@ } target.initFrom(_saver.getUI()); // B.M. Les fils sont restitu\xE9s plus tard. A priori redondant, et provoque des pbs. -// restoreAndSordChild(target, _saver, _pn, _parent, _prog); + //Fred ils ne sont pas restitu\xE9s plus tard et c'est la seul methode qui permet de le retrier dans l'ordre sauvegard\xE9 + restoreAndSordChild(target, _saver, _pn, _parent, _prog); return target.getName(); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -305,20 +305,20 @@ * On force le mode visible dependant des sous calques, car les calques sont des components. * Les components fils ne sont affich\xE9s que si les components parents sont visibles. */ -// public boolean isVisible() { -// return getTousCalques().length==1 ? super.isVisible():isAllChildrenUnvisible() ? false:true; -// } + public boolean isVisible() { + return getTousCalques().length==1 ? super.isVisible():isAllChildrenUnvisible() ? false:true; + } /** * Met les sous calques en mode visible/invisible.<br> */ -// public void setVisible(boolean _b) { -// super.setVisible(_b); -// -// final BCalque[] c=getCalques(); -// for (int i=0; i<c.length; i++) { -// c[i].setVisible(_b); -// } -// } + public void setVisible(boolean _b) { + super.setVisible(_b); + + final BCalque[] c=getCalques(); + for (int i=0; i<c.length; i++) { + c[i].setVisible(_b); + } + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -6,6 +6,8 @@ import java.awt.Component; import java.awt.Point; +import java.util.HashMap; +import java.util.Map; import javax.swing.JLabel; import javax.swing.JList; @@ -13,8 +15,10 @@ import org.fudaa.ebli.calque.BArbreCalqueModel; import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BCalqueAffichage; import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.calque.BCalqueLegendePanel; +import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.palette.BPalettePlageInterface; import org.fudaa.ebli.palette.BPalettePlageLegende; import org.fudaa.ebli.ressource.EbliResource; @@ -41,196 +45,198 @@ @SuppressWarnings("serial") public class CalqueLegendeWidgetAdapter extends BCalqueLegende { - /** - * Mananger statique qui se charge de creer \xE9a widget associee au calque. - * - * @param _calqueLegende le panel legende qui sera recopie version widget - * @param _scene la scene - * @return la widfget de la legende. - */ - public static EbliWidgetCalqueLegende updateLegendeWidget(final EbliWidgetCalqueLegende _widgetLegende, - final BCalqueLegendePanel _calqueLegende, final EbliScene _scene) { + /** + * Mananger statique qui se charge de creer \xE9a widget associee au calque. + * + * @param _calqueLegende le panel legende qui sera recopie version widget + * @param _scene la scene + * @return la widfget de la legende. + */ + public static EbliWidgetCalqueLegende updateLegendeWidget(final EbliWidgetCalqueLegende _widgetLegende, + final BCalqueLegendePanel _calqueLegende, final EbliScene _scene) { - // --creation de la widget conteneur --// - BPalettePlageInterface listeplages = null; - // widgetLegende_ = new WidgetCalqueLegende(_scene, false, model, - // _calqueLegende); - _widgetLegende.setLayout(new FlowLayout(true, SerialAlignment.CENTER, 5)); - _widgetLegende.setBorder(BorderFactory.createEmptyBorder(10)); + // --creation de la widget conteneur --// + BPalettePlageInterface listeplages = null; + // widgetLegende_ = new WidgetCalqueLegende(_scene, false, model, + // _calqueLegende); + _widgetLegende.setLayout(new FlowLayout(true, SerialAlignment.CENTER, 5)); + _widgetLegende.setBorder(BorderFactory.createEmptyBorder(10)); - if (_calqueLegende != null) { - final Component[] listeC = _calqueLegende.getComponents(); + if (_calqueLegende != null) { + final Component[] listeC = _calqueLegende.getComponents(); - for (int i = 0; i < listeC.length; i++) { - final Component c = listeC[i]; - if (c instanceof JLabel && !((JLabel)c).getText().equals(EbliResource.EBLI.getString("R\xE9sultats"))) { + for (int i = 0; i < listeC.length; i++) { + final Component c = listeC[i]; + if (c instanceof JLabel && !((JLabel) c).getText().equals(EbliResource.EBLI.getString("R\xE9sultats"))) { - final LabelWidget titre = new LabelWidget(_scene); - titre.setAlignment(Alignment.CENTER); - titre.setVerticalAlignment(VerticalAlignment.CENTER); - titre.setLabel(((JLabel) c).getText()); - titre.setEnabled(true); - titre.setFont(c.getFont()); - _widgetLegende.addChild(titre); - } + final LabelWidget titre = new LabelWidget(_scene); + titre.setAlignment(Alignment.CENTER); + titre.setVerticalAlignment(VerticalAlignment.CENTER); + titre.setLabel(((JLabel) c).getText()); + titre.setEnabled(true); + titre.setFont(c.getFont()); + _widgetLegende.addChild(titre); + } - if (c instanceof BPalettePlageLegende) { + if (c instanceof BPalettePlageLegende) { - final BPalettePlageLegende pal = (BPalettePlageLegende) c; + final BPalettePlageLegende pal = (BPalettePlageLegende) c; - // --recuperation de la liste des plages --// - listeplages = pal.getModel(); - if(listeplages!=null){ - // --creation du titre --// - LabelWidget titre = new LabelWidget(_scene); - titre.setAlignment(Alignment.CENTER); - titre.setVerticalAlignment(VerticalAlignment.CENTER); - titre.setLabel(listeplages.getTitre()); - titre.setFont(pal.getFont()); - titre.setEnabled(true); - _widgetLegende.addChild(titre); - final LabelWidget sstitre = new LabelWidget(_scene); - sstitre.setAlignment(Alignment.CENTER); - titre.setFont(pal.getFont()); - sstitre.setVerticalAlignment(VerticalAlignment.CENTER); - sstitre.setLabel(listeplages.getSousTitre()); - sstitre.setEnabled(true); - _widgetLegende.addChild(sstitre); - final Widget ws = new Widget(_scene); - ws.setLayout(new FlowLayout(true, SerialAlignment.LEFT_TOP, 5)); - if (listeplages.getNbPlages() != 0) { - for (int j = listeplages.getNbPlages()-1; j >=0 ; j--) { + // --recuperation de la liste des plages --// + listeplages = pal.getModel(); + if (listeplages != null) { + // --creation du titre --// + LabelWidget titre = new LabelWidget(_scene); + titre.setAlignment(Alignment.CENTER); + titre.setVerticalAlignment(VerticalAlignment.CENTER); + titre.setLabel(listeplages.getTitre()); + titre.setFont(pal.getFont()); + titre.setEnabled(true); + _widgetLegende.addChild(titre); + final LabelWidget sstitre = new LabelWidget(_scene); + sstitre.setAlignment(Alignment.CENTER); + titre.setFont(pal.getFont()); + sstitre.setVerticalAlignment(VerticalAlignment.CENTER); + sstitre.setLabel(listeplages.getSousTitre()); + sstitre.setEnabled(true); + _widgetLegende.addChild(sstitre); + final Widget ws = new Widget(_scene); + ws.setLayout(new FlowLayout(true, SerialAlignment.LEFT_TOP, 5)); + if (listeplages.getNbPlages() != 0) { + for (int j = listeplages.getNbPlages() - 1; j >= 0; j--) { - final BPlageInterface plage = listeplages.getPlageInterface(j); + final BPlageInterface plage = listeplages.getPlageInterface(j); - // -- ajout d'une widget plage --// - final EbliWidgetPlage lw = new EbliWidgetPlage(_scene, plage, null); + // -- ajout d'une widget plage --// + final EbliWidgetPlage lw = new EbliWidgetPlage(_scene, plage, null); - lw.setUseBorder(false); - lw.setEnabled(true); + lw.setUseBorder(false); + lw.setEnabled(true); - ws.addChild(lw); + ws.addChild(lw); - } - } else { - // liste des plages est vide il s agit d une autre legende - final Component[] lcomp = pal.getComponents(); - for (int j = 0; j < lcomp.length; j++) { - final Component co = lcomp[j]; + } + } else { + // liste des plages est vide il s agit d une autre legende + final Component[] lcomp = pal.getComponents(); + for (int j = 0; j < lcomp.length; j++) { + final Component co = lcomp[j]; - if (co instanceof JPanel) { - final JPanel panel = (JPanel) co; + if (co instanceof JPanel) { + final JPanel panel = (JPanel) co; - for (int k = 0; k < panel.getComponents().length; k++) { + for (int k = 0; k < panel.getComponents().length; k++) { - if (panel.getComponents()[k] instanceof JLabel) { - titre = new LabelWidget(_scene); - titre.setAlignment(Alignment.CENTER); - titre.setVerticalAlignment(VerticalAlignment.CENTER); - titre.setLabel(((JLabel) panel.getComponents()[k]).getText()); - titre.setEnabled(true); - ws.addChild(titre); - } else if (panel.getComponents()[k] instanceof JList) { - final JList jlst = (JList) panel.getComponents()[k]; - for (int g = 0; g < jlst.getModel().getSize(); g++) { - titre = new LabelWidget(_scene); - titre.setAlignment(Alignment.CENTER); - titre.setVerticalAlignment(VerticalAlignment.CENTER); - titre.setLabel((String) jlst.getModel().getElementAt(g)); - titre.setEnabled(true); - ws.addChild(titre); - } + if (panel.getComponents()[k] instanceof JLabel) { + titre = new LabelWidget(_scene); + titre.setAlignment(Alignment.CENTER); + titre.setVerticalAlignment(VerticalAlignment.CENTER); + titre.setLabel(((JLabel) panel.getComponents()[k]).getText()); + titre.setEnabled(true); + ws.addChild(titre); + } else if (panel.getComponents()[k] instanceof JList) { + final JList jlst = (JList) panel.getComponents()[k]; + for (int g = 0; g < jlst.getModel().getSize(); g++) { + titre = new LabelWidget(_scene); + titre.setAlignment(Alignment.CENTER); + titre.setVerticalAlignment(VerticalAlignment.CENTER); + titre.setLabel((String) jlst.getModel().getElementAt(g)); + titre.setEnabled(true); + ws.addChild(titre); + } - } + } - } + } - } + } - } + } - } - _widgetLegende.addChild(ws); - _widgetLegende.setLegendsWidget(ws); - }//fin du if listeplage==null - } - } + } + _widgetLegende.addChild(ws); + _widgetLegende.setLegendsWidget(ws); + }// fin du if listeplage==null + } + } - _widgetLegende.setController(new EbliWidgetControllerLegendeCalque(_widgetLegende)); + _widgetLegende.setController(new EbliWidgetControllerLegendeCalque(_widgetLegende)); - // -- prendre en compte le resize automatique --// - _widgetLegende.getEbliScene().refresh(); - // _widgetLegende.setFormeFont(new Font("Helvetica", Font.PLAIN, 10)); + // -- prendre en compte le resize automatique --// + _widgetLegende.getEbliScene().refresh(); + // _widgetLegende.setFormeFont(new Font("Helvetica", Font.PLAIN, 10)); - return _widgetLegende; - } else { - FuLog.warning("createLegendeWidget retourne widget null"); - return null; - } - } + return _widgetLegende; + } else { + FuLog.warning("createLegendeWidget retourne widget null"); + return null; + } + } - // public static Dimension createSizeForWidget(int _nbLibelles) { - // return new Dimension(WIDTH_LEGENDE + MAX_BORDURE, _nbLibelles * (LENGHT_PER_LEGENDE + MAX_BORDURE / 2)); - // } + // public static Dimension createSizeForWidget(int _nbLibelles) { + // return new Dimension(WIDTH_LEGENDE + MAX_BORDURE, _nbLibelles * (LENGHT_PER_LEGENDE + MAX_BORDURE / 2)); + // } - public static void reconstructWidget(EbliWidgetCalqueLegende widgetLegende_, - final BCalqueLegendePanel _calqueLegende, final EbliScene _scene/* , BArbreCalqueModel model */) { + public static void reconstructWidget(EbliWidgetCalqueLegende widgetLegende_, + final BCalqueLegendePanel _calqueLegende, final EbliScene _scene/* , BArbreCalqueModel model */) { - final EbliWidgetWithBordure parent = (EbliWidgetWithBordure) widgetLegende_.getParentWidget(); + final EbliWidgetWithBordure parent = (EbliWidgetWithBordure) widgetLegende_.getParentWidget(); - widgetLegende_ = updateLegendeWidget(widgetLegende_, _calqueLegende, _scene); + widgetLegende_ = updateLegendeWidget(widgetLegende_, _calqueLegende, _scene); - parent.repaint(); + parent.repaint(); - } + } - BCalqueLegendePanel legendePanel_; + Map<BCalque, BCalqueLegendePanel> legendePanel_ = new HashMap<BCalque, BCalqueLegendePanel>(); - EbliScene scene_; + EbliScene scene_; - public EbliScene getScene() { - return scene_; - } + public EbliScene getScene() { + return scene_; + } - public void setScene(final EbliScene _scene) { - scene_ = _scene; - } + public void setScene(final EbliScene _scene) { + scene_ = _scene; + } - public CalqueLegendeWidgetAdapter(final EbliScene _scene, final BArbreCalqueModel model) { - super(); - scene_ = _scene; - // modelTreeCalque_ = model; + public CalqueLegendeWidgetAdapter(final EbliScene _scene, final BArbreCalqueModel model) { + super(); + scene_ = _scene; + // modelTreeCalque_ = model; - } + } - /** - * override de calqueLegende qui recupere le panel legende associe - */ - @Override - protected void addLegendToPanel(final BCalqueLegendePanel _pnLeg) { + /** + * override de calqueLegende qui recupere le panel legende associe + */ + @Override + protected void addLegendToPanel(final BCalqueLegendePanel _pnLeg) { + legendePanel_.put(_pnLeg.getCalque(), _pnLeg); + } - legendePanel_ = _pnLeg; + @Override + public void enleve(BCalqueAffichage _cq) { + legendePanel_.remove(_cq); + } - // createLegende(); - } + /** + * cree la legende en widget. + * + * @return EbliNode cree ajoute a la scene. + */ + public EbliNode createLegende(final Point _location, final EbliScene _scene, final String _id, BCalque _calqueCible) { + setScene(_scene); + final EbliNodeDefault def = new EbliNodeDefault(); + def.setPreferedLocation(_location); + // def.setPreferedSize(new Dimension(150, 250)); + def.setCreator(new EbliWidgetCreatorLegende(legendePanel_.get(_calqueCible), _id, _calqueCible)); + def.setTitle(EbliLib.getS("L\xE9gende calque") + " " + _calqueCible.getTitle()); + // TODO non stable + _scene.addNode(def); + _scene.refresh(); - /** - * cree la legende en widget. - * - * @return EbliNode cree ajoute a la scene. - */ - public EbliNode createLegende(final Point _location, final EbliScene _scene, final String id,BCalque calqueCible) { - setScene(_scene); - final EbliNodeDefault def = new EbliNodeDefault(); - def.setPreferedLocation(_location); - // def.setPreferedSize(new Dimension(150, 250)); - def.setCreator(new EbliWidgetCreatorLegende(legendePanel_, id,calqueCible)); - def.setTitle("L\xE9gende calque"); - // TODO non stable - _scene.addNode(def); - _scene.refresh(); + return def; + } - return def; - } - } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCalqueLegende.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -124,43 +124,8 @@ return null; } - // protected int getMaxTitle(final Font boldFt) { - // final FontMetrics ftmBold = this.getGraphics().getFontMetrics(boldFt); - // int maxWidth = 0; - // // -- mise a jour de la widget avec la nouvelle font - // final List<Widget> listePlage = getChildren(); - // for (final Iterator<Widget> it = listePlage.iterator(); it.hasNext();) { - // final Widget widget = it.next(); - // // -- test si il s agit d un widget plage --// - // if (widget instanceof LabelWidget && (((LabelWidget) widget).getLabel() != null)) { - // final LabelWidget lbWidget = (LabelWidget) widget; - // maxWidth = Math.max(maxWidth, ftmBold.stringWidth(lbWidget.getLabel()) + 5); - // // lbWidget.setPreferredBounds(boundsTitre); - // } - // } - // - // return maxWidth; - // - // } + - // protected int getMaxWidthLegende(final Font ft) { - // final FontMetrics ftm = this.getGraphics().getFontMetrics(ft); - // int maxWidth = 0; - // // -- mise a jour de la widget avec la nouvelle font - // final List<Widget> listePlage = getChildren(); - // for (final Iterator<Widget> it = listePlage.iterator(); it.hasNext();) { - // final Widget widget = it.next(); - // // -- test si il s agit d un widget plage --// - // if (widget instanceof EbliWidgetPlage) { - // final EbliWidgetPlage new_widget = (EbliWidgetPlage) widget; - // maxWidth = Math.max(maxWidth, ftm.stringWidth(new_widget.getInternWidget().getLabel())); - // } - // } - // - // return maxWidth; - // - // } - public void notifyClosing(final EditorController _controller, final Widget _widget, final JComponent _editor, final boolean _commit) { editingStop(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -178,7 +178,7 @@ // duplication du node en question final EbliNode duplique = n.duplicate(null); - duplique.setTitle("Calque "+(sceneDestination.getAllVue2d().size()+1)); + duplique.setTitle(EbliLib.getS("Calque")+" "+(sceneDestination.getAllVue2d().size()+1)); // -- redimensionnement du duplicata --// ((EbliWidgetCreatorVueCalque) duplique.getCreator()).initSize(getVisuPanel().getVueCalque().getCalque().getSize()); @@ -220,7 +220,7 @@ if (calqueActif != null && calqueActif instanceof BCalqueAffichage) { if (this.legendeWidget_.get(calqueActif) == null) { // legendeWidget_ = (CalqueLegendeWidgetAdapter) widgetCalque_.calquePanel_.getCqLegend(); - legendeWidget_.put(widgetCalque_.calquePanel_.getCalqueActif(), + legendeWidget_.put(calqueActif, (CalqueLegendeWidgetAdapter) widgetCalque_.calquePanel_.getCqLegend()); final CalqueLegendeWidgetAdapter legendeAdapter = this.legendeWidget_.get(calqueActif); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -110,7 +110,7 @@ else { CoupleData datas=(CoupleData) data; if(data !=null){ - String idCalque = (String) datas.idPosessor; + String idCalque = datas.idPosessor; int indexCalque=datas.indiceCalqueCible; if(idCalque!=null){ @@ -124,8 +124,7 @@ //-- recuperation du bon calque --// calqueCible_= (BCalque) calque.getArbreCalqueModel().getChild(calque.getArbreCalqueModel().getRoot(), indexCalque); IdPossessor_=idCalque; - //g=new BCalqueLegendePanel((BCalqueAffichage) calqueCible_,calqueCible_.getTitle()); - BCalqueLegendePanel legendePanel=((CalqueLegendeWidgetAdapter)calque.getCqLegend()).legendePanel_; + BCalqueLegendePanel legendePanel=((CalqueLegendeWidgetAdapter)calque.getCqLegend()).legendePanel_.get(calqueCible_); g=legendePanel; // -- mise a jour des sattelites --// ((EbliWidgetControllerCalque) widget.getController()).setNodeLegende((EbliNode) parameters.get("node")); @@ -145,7 +144,7 @@ calqueCible_= (BCalque) calque.getArbreCalqueModel().getChild(calque.getArbreCalqueModel().getRoot(), indexCalque); IdPossessor_=idCalque; //g=new BCalqueLegendePanel((BCalqueAffichage) calqueCible_,calqueCible_.getTitle()); - BCalqueLegendePanel legendePanel=((CalqueLegendeWidgetAdapter)calque.getCqLegend()).legendePanel_; + BCalqueLegendePanel legendePanel=((CalqueLegendeWidgetAdapter)calque.getCqLegend()).legendePanel_.get(calqueCible_);; g=legendePanel; // -- mise a jour des sattelites --// ((EbliWidgetControllerCalque) widget.getController()).setNodeLegende((EbliNode) parameters.get("node")); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetFusionCalques.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -55,58 +55,54 @@ // -- on met a jour le modele de zoom pour toutes les filles en prenant le // dernier widget (= la widget temoin) - GrBoite boite = null; - ZEbliCalquesPanel pn = null; + ZEbliCalquesPanel pn = listeWidgetCalque_.get(listeWidgetCalque_.size() - 1).calquePanel_; + changeAllZoomFrom(pn.getVueCalque()); for (int i = listeWidgetCalque_.size() - 1; i >= 0; i--) { EbliWidgetVueCalque vue = listeWidgetCalque_.get(i); - if (boite == null) { - boite = vue.getViewBoite(); + vue.calquePanel_.getVueCalque().addPropertyChangeListener("repere", this); - pn = vue.calquePanel_; - } - // } else if (vue.getViewBoite() != null) { - // boite.ajuste(vue.getViewBoite()); - // // vue.calquePanel_.getVueCalque().changeRepere(vue.calquePanel_, - // boite, - // // 0, 0); - // vue.image = null; - // vue.repaint(); - // } - // vue.calquePanel_.getVueCalque().addPropertyChangeListener("repere", this); - vue.calquePanel_.getVueCalque().addPropertyChangeListener("repereEvt", this); - vue.image = null; - vue.repaint(); - } - if (boite != null) { - // -- on force le redimensionnement de la widget calque initiale avec le - // meme zoom - // -- le fait de faire appel a ceci mettra a jour les zooms de toutes les - // autres widgets - pn.getVueCalque().changeRepere(pn, boite, 0, 0); - } getEbliScene().refresh(); } + private final Object sync = new Object(); + public void propertyChange(final PropertyChangeEvent _evt) { +// synchronized (sync) { - if (!noCyclePropertieChange) return; - noCyclePropertieChange = false; - // listeWidgetCalque_.get(0).calquePanel_.getVueCalque().changeViewBoite( - // _source, _boite, _rapide) - System.err.println("on recommence le tout"); - final BVueCalque vueCalque = (BVueCalque) _evt.getSource(); - RepereEvent newRepere = (RepereEvent) _evt.getNewValue(); + if (!noCyclePropertieChange) return; + noCyclePropertieChange = false; + // listeWidgetCalque_.get(0).calquePanel_.getVueCalque().changeViewBoite( + // _source, _boite, _rapide) + final BVueCalque vueCalque = (BVueCalque) _evt.getSource(); + if (getVueInEdition() != vueCalque) { + noCyclePropertieChange = true; + return; + } + // RepereEvent newRepere = (RepereEvent) _evt.getNewValue(); + changeAllZoomFrom(vueCalque); + noCyclePropertieChange = true; + getEbliScene().refresh(); +// } + } + + private BVueCalque getVueInEdition() { for (final Iterator<Widget> it = getChildren().iterator(); it.hasNext();) { final EbliWidgetVueCalque widget = (EbliWidgetVueCalque) ((EbliWidget) it.next()).getIntern(); + if (widget.isInEditMode()) return widget.calquePanel_.getVueCalque(); + } + return null; + } + + private void changeAllZoomFrom(final BVueCalque vueCalque) { + for (final Iterator<Widget> it = getChildren().iterator(); it.hasNext();) { + final EbliWidgetVueCalque widget = (EbliWidgetVueCalque) ((EbliWidget) it.next()).getIntern(); if (widget.calquePanel_.getVueCalque() != vueCalque) { - widget.repereModifie(newRepere); + widget.setZoom(vueCalque.getViewBoite()); } } - noCyclePropertieChange = true; - getEbliScene().refresh(); } /** @@ -117,7 +113,7 @@ EbliWidgetVueCalque widgetCalque; if (child instanceof EbliWidgetVueCalque) widgetCalque = (EbliWidgetVueCalque) child; else widgetCalque = (EbliWidgetVueCalque) ((EbliWidget) child.getChildren().get(0)).getIntern(); - widgetCalque.calquePanel_.getVueCalque().getAbstractCalque().removePropertyChangeListener("repereEvt", this); + widgetCalque.calquePanel_.getVueCalque().getAbstractCalque().removePropertyChangeListener("repere", this); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetVueCalque.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -14,15 +14,13 @@ import java.util.Observable; import java.util.Observer; -import javax.swing.BorderFactory; - +import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.image.CtuluLibImage; import org.fudaa.ebli.animation.EbliAnimatedInterface; import org.fudaa.ebli.animation.EbliAnimationAdapterInterface; import org.fudaa.ebli.calque.BCalque; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.geometrie.GrBoite; -import org.fudaa.ebli.repere.RepereEvent; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; @@ -48,9 +46,9 @@ Window frame_; - BufferedImage image; + BufferedImage image_; -// public GrBoite initZoom_; + // public GrBoite initZoom_; BuPanel conteneurEditor; @@ -71,7 +69,7 @@ public EbliWidgetVueCalque(final EbliScene _scene, final ZEbliCalquesPanel _vue, final GrBoite _initZoom) { super(_scene); calquePanel_ = _vue; -// initZoom_ = _initZoom; + // initZoom_ = _initZoom; zoom_ = _initZoom; calquePanel_.setBorder(null); @@ -81,8 +79,7 @@ public void update(final Observable _o, final Object _arg) { if (!isInEditMode() && "t".equals(_arg)) { - image = null; - // repaint(); + clearCacheImage(); } } @@ -105,12 +102,8 @@ public void notifyClosing(final org.netbeans.api.visual.action.InplaceEditorProvider.EditorController controller, final Widget widget, final BuPanel editor, final boolean commit) { editingStop(); - zoom_ = calquePanel_.getVueCalque().getViewBoite(); - image = null; - + setZoom(calquePanel_.getVueCalque().getViewBoite()); getEbliScene().refresh(); - // calquePanel_.setBorder(BuBorders.EMPTY1111); - this.repaint(); } /** @@ -145,7 +138,7 @@ return (EbliWidgetControllerCalque) getController(); } -// boolean first_ = true; + boolean zoomChanged_ = true; @Override protected void paintWidget() { @@ -159,34 +152,20 @@ final Graphics2D g = getGraphics(); initSize(rec); -// if (first_) { -// first_ = false; -// if (initZoom_ != null && initZoom_.getDeltaX() > 0 && initZoom_.getDeltaY() > 0) { -// calquePanel_.getVueCalque().changeRepere(this, initZoom_); -// -// // -- tres important!!: le zoom doit prendre la valeur initial du zoom pour conserver le bon angle si on fais -// // le cas suivant: -// // -- lros du chargement d un calque avec zoom specifique, suivi d'un agrandissement ou reduction: il faut que -// // le zoom!=null pour ne pas reinitialiser le repere (cf boucle suivante) -// zoom_ = initZoom_; -// initZoom_ = null; -// } else calquePanel_.restaurer(); -// -// // -- ACHTUNG!!! si on enleve la creation de l'image ici, elle se fera dans l'autre if et ecrasera le zoom -// // init!! --// -// final Map params = new HashMap(); -// CtuluLibImage.setCompatibleImageAsked(params); -// image = calquePanel_.produceImage(rec.width, rec.height, params); -// -// } - // mode edition - if (image == null || image.getWidth() != rec.width || image.getHeight() != rec.height) { + boolean sizeChanged = image_ != null && (image_.getWidth() != rec.width || image_.getHeight() != rec.height); + if (image_ == null || sizeChanged) { FuLog.debug("EWI: recreate image"); - if (zoom_ != null && zoom_.getDeltaX() > 0 && zoom_.getDeltaY() > 0) { - calquePanel_.getVueCalque().changeRepere(this, zoom_); + // on doit retailler la vue changement de taille. + if (sizeChanged || zoomChanged_) { + zoomChanged_ = false; + if (zoom_ != null && zoom_.getDeltaX() > 0 && zoom_.getDeltaY() > 0) { + // GrBoite zoomEnCours = calquePanel_.getVueCalque().getViewBoite(); + calquePanel_.getVueCalque().changeRepere(this, zoom_, 0, 0); - } else calquePanel_.restaurer(); + } else calquePanel_.restaurer(); + } + final Map params = new HashMap(); CtuluLibImage.setCompatibleImageAsked(params); // a ameliorer: il ne faudrait pas recreer l'image a chaque fois @@ -196,7 +175,7 @@ // GrBoite zoomMemoire=calquePanel_.getVueCalque().getViewBoite(); // -- on redessinne --// - image = calquePanel_.produceImage(rec.width, rec.height, params); + image_ = calquePanel_.produceImage(rec.width, rec.height, params); // -- on remet le repere au max de la clientArea de la widget --// // calquePanel_.getVueCalque().changeRepere(this, zoomMemoire); @@ -204,7 +183,7 @@ // calquePanel_.restaurer(); } - g.drawImage(image, rec.x, rec.y, rec.width, rec.height, null); + g.drawImage(image_, rec.x, rec.y, rec.width, rec.height, null); } } @@ -305,28 +284,24 @@ } - public BufferedImage getImage() { - return image; - } - - public void setImage(BufferedImage image) { - this.image = image; - } - protected GrBoite getZoom() { return zoom_; } - protected void setZoom(GrBoite zoom_) { - this.zoom_ = zoom_; + protected void setZoom(GrBoite _zoom) { + if (CtuluLib.isEquals(_zoom, zoom_)) return; + clearCacheImage(); + this.zoom_ = _zoom; + zoomChanged_=true; +// repaint(); + } - protected void repereModifie(RepereEvent _newRepere) { - image = null; - calquePanel_.getVueCalque().repereModifie(_newRepere); - - zoom_ = calquePanel_.getVueCalque().getViewBoite(); - repaint(); + /** + * Nettoie l'image utilise pour sauvegarder l'affichage + */ + public void clearCacheImage() { + image_ = null; } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporterScope.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -1,23 +1,12 @@ package org.fudaa.fudaa.commun.courbe; -import java.awt.event.ActionEvent; +import java.io.File; import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.dodico.mesure.EvolutionReguliere; import org.fudaa.dodico.telemac.io.ScopeStructure; -import org.fudaa.ebli.commun.EbliActionSimple; -import org.fudaa.ebli.courbe.EGCourbeChild; -import org.fudaa.ebli.courbe.EGCourbeModelDefault; -import org.fudaa.ebli.courbe.EGGraphe; -import org.fudaa.ebli.courbe.EGGrapheTreeModel; -import org.fudaa.ebli.courbe.EGGroup; -import org.fudaa.ebli.courbe.EGModel; -import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; -import com.memoire.bu.BuResource; -import com.memoire.bu.BuWizardDialog; - /** * Gere l'importation de donn\xE9es scope s ou t et cr\xE9e un graphe temporel ou spatial selon le format * S'utilise avec le wizard FudaaCourbeWizardImportScope @@ -28,15 +17,15 @@ /** * Action qui genere un wizard pour le parametrage des structures import\xE9es. - * @author Adrien Hadoux - * + * @param _fileChosen + * @param target + * @param _data + * @param _mng + * @param _prog + * @param nuagePoints */ - - - public static void createGraphe(FudaaCourbeImporter.Target target,ScopeStructure _data, CtuluCommandManager _mng,ProgressionInterface _prog,boolean nuagePoints){ - - - createGraphe(target,_data.returnEvolReguliere(), _mng, _prog,nuagePoints); + public static void createGraphe(File _fileChosen,FudaaCourbeImporter.Target target,ScopeStructure _data, CtuluCommandManager _mng,ProgressionInterface _prog,boolean nuagePoints){ + createGraphe(target,_data.returnEvolReguliere(_fileChosen), _mng, _prog,nuagePoints); } public static void createGraphe(FudaaCourbeImporter.Target target,EvolutionReguliere[] _data, CtuluCommandManager _mng,ProgressionInterface _prog,boolean nuagePoints){ @@ -53,43 +42,43 @@ - /** - * genere un graphe spatial - * @param data_ - * @return - */ - public static void createGrapheSpatialGrapheOLD(FudaaCourbeImporter.Target target,ScopeStructure.SorT data_,ProgressionInterface prog){ - - EGGrapheTreeModel model=new EGGrapheTreeModel(); - double[] tabX=new double[data_.getAllX().size()]; - for(int i=0;i<data_.getAllX().size();i++) - tabX[i]=data_.getX(i); - - - for(int i=0;i<data_.getNbVariables();i++){ - - EGGroup varg=new EGGroup(); - varg.setTitle(data_.getVariable(i)); - model.add(varg); - - //--remplissage de valeurs --// - //tableau des y - double[] tabY=new double[tabX.length]; - - for(int j=0;j<tabX.length;j++) - tabY[j]=data_.getValueOfvariable(i, j); - EGCourbeModelDefault modelCourbe=new EGCourbeModelDefault(tabX,tabY); - EGCourbeChild courbe=new EGCourbeChild(varg,modelCourbe); - - varg.addEGComponent(courbe); - - } - - - EGGraphe graphe=new EGGraphe(model); - - - - } +// /** +// * genere un graphe spatial +// * @param data_ +// * @return +// */ +// public static void createGrapheSpatialGrapheOLD(FudaaCourbeImporter.Target target,ScopeStructure.SorT data_,ProgressionInterface prog){ +// +// EGGrapheTreeModel model=new EGGrapheTreeModel(); +// double[] tabX=new double[data_.getAllX().size()]; +// for(int i=0;i<data_.getAllX().size();i++) +// tabX[i]=data_.getX(i); +// +// +// for(int i=0;i<data_.getNbVariables();i++){ +// +// EGGroup varg=new EGGroup(); +// varg.setTitle(data_.getVariable(i)); +// model.add(varg); +// +// //--remplissage de valeurs --// +// //tableau des y +// double[] tabY=new double[tabX.length]; +// +// for(int j=0;j<tabX.length;j++) +// tabY[j]=data_.getValueOfvariable(i, j); +// EGCourbeModelDefault modelCourbe=new EGCourbeModelDefault(tabX,tabY); +// EGCourbeChild courbe=new EGCourbeChild(varg,modelCourbe); +// +// varg.addEGComponent(courbe); +// +// } +// +// +// EGGraphe graphe=new EGGraphe(model); +// +// +// +// } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2009-01-15 19:48:24 UTC (rev 4359) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2009-01-15 22:22:54 UTC (rev 4360) @@ -663,7 +663,7 @@ dataST().restreindreStructure(listVariablesST_.getSelectedIndices(),Double.parseDouble(plageDeb_.getText()),Double.parseDouble(plageFin_.getText())); impl_.setMainProgression(30); impl_.setMainMessage(CtuluLib.getS("Cr\xE9ation du graphe")); - FudaaCourbeImporterScope.createGraphe(target_, data_, null, prog,false); + FudaaCourbeImporterScope.createGraphe(fileChoosen_,target_, data_, null, prog,false); } else{ //-- format scopeGen, selon le type de format g\xE9n\xE9r\xE9--// @@ -688,7 +688,7 @@ impl_.setMainProgression(30); impl_.setMainMessage(CtuluLib.getS("Cr\xE9ation du graphe")); //on cree les evol reguliere SPECIFIQUES pour ces courbes. - FudaaCourbeImporterScope.createGraphe(target_, dataG().returnEvolRegulierePourTemporelles(xchoosen), null, prog,false); + FudaaCourbeImporterScope.createGraphe(target_, dataG().returnEvolRegulierePourTemporelles(xchoosen,fileChoosen_), null, prog,false); }else{ //correlation @@ -704,7 +704,7 @@ //-- recuperation du choix nuage de points ou non boolean nuagePoints=choixNuagePoints_.isSelected(); - FudaaCourbeImporterScope.createGraphe(target_, dataG().returnEvolReguliereCorrelation(varX,varY,plageX,plageY), null, prog,nuagePoints); + FudaaCourbeImporterScope.createGraphe(target_, dataG().returnEvolReguliereCorrelation(varX,varY,plageX,plageY,fileChoosen_), null, prog,nuagePoints); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2009-01-15 19:48:32
|
Revision: 4359 http://fudaa.svn.sourceforge.net/fudaa/?rev=4359&view=rev Author: deniger Date: 2009-01-15 19:48:24 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Property Changed: ---------------- branches/Prepro-0.92-SNAPSHOT/ Property changes on: branches/Prepro-0.92-SNAPSHOT ___________________________________________________________________ Added: svn:mergeinfo + /trunk/fudaa_devel:3704-4350 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-15 17:49:40
|
Revision: 4358 http://fudaa.svn.sourceforge.net/fudaa/?rev=4358&view=rev Author: hadouxad Date: 2009-01-15 17:49:33 +0000 (Thu, 15 Jan 2009) Log Message: ----------- corrections bug + persistance donn?\195?\169es enregistr?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGPaletteInfo.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java 2009-01-15 17:48:55 UTC (rev 4357) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java 2009-01-15 17:49:33 UTC (rev 4358) @@ -1,7 +1,12 @@ package org.fudaa.ebli.courbe; +import java.util.Map; + +import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ebli.trace.TraceBox; import org.fudaa.ebli.trace.TraceLigneModel; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; /** * Classe persistante de la courbe @@ -27,6 +32,11 @@ TraceLigneModel lineModel_; TraceLigneModel tLigneMarqueur_; + //-- data specifiques --// + Object dataSpecifiques; + String classeModel; + + public EGCourbePersist(EGCourbeChild courbe, int IdGroup) { fillInfoWith(courbe,IdGroup); } @@ -55,17 +65,67 @@ tLigneMarqueur_=courbe.getMarkLigneModel(); + //-- donnees specifiques --// + + //-- exemple pour evol: pdt, point,variable, fichier source --// + dataSpecifiques=courbe.getModel().getPersistSpecificDatas(); + classeModel=courbe.getModel().getClass().toString(); } + public static EGModel forName(String className) { + + try{ + + if (className.startsWith("class ")) ; + className = className.substring("class ".length()); + final Class myclass = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); + final Object myModel = myclass.newInstance(); + + if (myModel instanceof EGModel) return (EGModel) myModel; + else return null; + }catch(Exception e){ + return null; + } +} + /** * Generate the proper curve in the appropriate group. * @param groupe * @return */ -public EGCourbeChild generateCourbe(EGGroup groupe){ - EGModel model=new EGCourbeModelDefault(abscisses,ordonnees); - EGCourbeChild courbe=new EGCourbeChild(groupe,model); +public EGCourbeChild generateCourbe(EGGroup groupe,Map infos){ + //EGModel model=new EGCourbeModelDefault(abscisses,ordonnees); + EGModel model=null; + if(classeModel!=null) + model=forName(classeModel); + + if(model==null) + model=new EGCourbeModelDefault(abscisses,ordonnees); + + //-- ajotu des coordonnees --// + model.addValue(abscisses, ordonnees, new CtuluCommandManager()); + + + + + //-- donnees specifiques --// + infos.put("GROUPE", groupe); + + model.setPersistSpecificDatas(dataSpecifiques, infos); + + EGCourbeChild courbe=null; + + //-- Verifie dans le cas de rejoue des donnees, il faut peut etre ne pas ajouter la courbe --// +// if(infos.get("MODELREPLAY")!=null && infos.get("MODELREPLAY") instanceof EGCourbeChild){ +// +// //-- on remplace le model par le model rejouee et deja ajout\xE9--// +// courbe=(EGCourbeChild) infos.get("MODELREPLAY"); +// infos.remove("MODELREPLAY"); +// }else{ + + courbe=new EGCourbeChild(groupe,model); +// } courbe.setTitle(title_); //graphiques @@ -77,6 +137,7 @@ courbe.setLigneMark(tLigneMarqueur_); courbe.setNuagePoints_(this.nuagePoints); + return courbe; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2009-01-15 17:48:55 UTC (rev 4357) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2009-01-15 17:49:33 UTC (rev 4358) @@ -278,7 +278,7 @@ List<EGCourbePersist> listeCourbesPersistantes = getPersitantCurvesList(false); for(EGCourbePersist cbPersist:listeCourbesPersistantes){ EGGroup container=model.getGroup(cbPersist.Idgroup); - EGCourbeChild newCurve=cbPersist.generateCourbe(container); + EGCourbeChild newCurve=cbPersist.generateCourbe(container,parameters); container.addEGComponent(newCurve); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2009-01-15 17:48:55 UTC (rev 4357) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGModel.java 2009-01-15 17:49:33 UTC (rev 4358) @@ -198,6 +198,6 @@ void setPersistSpecificDatas(Object data, Map infos); - //String getUnite(); + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGPaletteInfo.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGPaletteInfo.java 2009-01-15 17:48:55 UTC (rev 4357) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGPaletteInfo.java 2009-01-15 17:49:33 UTC (rev 4358) @@ -30,6 +30,7 @@ _p.getModel().addModelListener(this); _p.getModel().addSelectionListener(this); p_=_p; + } @@ -59,6 +60,9 @@ updateState(); } + + + public void updateState(){ if (!isAvailable()) { return; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java 2009-01-15 17:48:55 UTC (rev 4357) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/palette/BPaletteInfo.java 2009-01-15 17:49:33 UTC (rev 4358) @@ -110,7 +110,7 @@ } } - boolean isAvailable_; + protected boolean isAvailable_; protected Component parent_; protected JTable table_; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2009-01-15 17:48:55 UTC (rev 4357) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2009-01-15 17:49:33 UTC (rev 4358) @@ -35,6 +35,9 @@ */ public class EbliWidget extends Widget implements BSelecteurTargetInterface, EbliWidgetInterface<EbliWidgetController> { + + public final static boolean AMELIO_LOT_VISIBLE=true; + public final static String COLORCONTOUR = "ColorContour"; public final static String COLORFOND = "colorFond"; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2009-01-15 17:48:55 UTC (rev 4357) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2009-01-15 17:49:33 UTC (rev 4358) @@ -1,5 +1,6 @@ package org.fudaa.ebli.visuallibrary.graphe; +import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; @@ -14,6 +15,7 @@ import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; +import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JSplitPane; @@ -31,6 +33,7 @@ import org.fudaa.ebli.courbe.EGGrapheModel; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGModel; +import org.fudaa.ebli.courbe.EGPaletteInfo; import org.fudaa.ebli.courbe.EGSpecificActions; import org.fudaa.ebli.courbe.EGTableGraphePanel; import org.fudaa.ebli.courbe.EGTree; @@ -496,9 +499,27 @@ final JScrollPane compTop = new JScrollPane(tree); compTop.setPreferredSize(new Dimension(150, 400)); pane.setTopComponent(compTop); + + //-- panel global qui contient la paletet d'infos + tableau de valeurs --// + if(EbliWidget.AMELIO_LOT_VISIBLE){ + final JSplitPane panelBottom = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + EGPaletteInfo paletteInfos=new EGPaletteInfo( getGraphePanel()); + paletteInfos.setAvailable(true); + // final JScrollPane paletteInfos = new JScrollPane(paEg); + paletteInfos.setPreferredSize(new Dimension(150, 80)); + panelBottom.setTopComponent(paletteInfos); + final JScrollPane comp = new JScrollPane(tablePanel); comp.setPreferredSize(new Dimension(150, 200)); - pane.setBottomComponent(comp); + + panelBottom.setBottomComponent(comp); + pane.setBottomComponent(panelBottom); + }else{ + final JScrollPane comp = new JScrollPane(tablePanel); + comp.setPreferredSize(new Dimension(150, 200)); + pane.setBottomComponent(comp); + } + pane.setDividerLocation(0.5D); pane.resetToPreferredSizes(); getGraphePanel().majSelectionListener(tablePanel); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-15 17:49:05
|
Revision: 4357 http://fudaa.svn.sourceforge.net/fudaa/?rev=4357&view=rev Author: hadouxad Date: 2009-01-15 17:48:55 +0000 (Thu, 15 Jan 2009) Log Message: ----------- corrections bug + persistance donn?\195?\169es enregistr?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java 2009-01-15 17:47:53 UTC (rev 4356) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/BGroupeCalque.java 2009-01-15 17:48:55 UTC (rev 4357) @@ -305,20 +305,20 @@ * On force le mode visible dependant des sous calques, car les calques sont des components. * Les components fils ne sont affich\xE9s que si les components parents sont visibles. */ - public boolean isVisible() { - return getTousCalques().length==1 ? super.isVisible():isAllChildrenUnvisible() ? false:true; - } +// public boolean isVisible() { +// return getTousCalques().length==1 ? super.isVisible():isAllChildrenUnvisible() ? false:true; +// } /** * Met les sous calques en mode visible/invisible.<br> */ - public void setVisible(boolean _b) { - super.setVisible(_b); - - final BCalque[] c=getCalques(); - for (int i=0; i<c.length; i++) { - c[i].setVisible(_b); - } - } +// public void setVisible(boolean _b) { +// super.setVisible(_b); +// +// final BCalque[] c=getCalques(); +// for (int i=0; i<c.length; i++) { +// c[i].setVisible(_b); +// } +// } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-01-15 17:48:00
|
Revision: 4356 http://fudaa.svn.sourceforge.net/fudaa/?rev=4356&view=rev Author: hadouxad Date: 2009-01-15 17:47:53 +0000 (Thu, 15 Jan 2009) Log Message: ----------- corrections bug + persistance donn?\195?\169es enregistr?\195?\169es Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/interpolation/EfGridDataInterpolator.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/mesure/EvolutionReguliere.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/interpolation/EfGridDataInterpolator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/interpolation/EfGridDataInterpolator.java 2009-01-14 06:24:50 UTC (rev 4355) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/interpolation/EfGridDataInterpolator.java 2009-01-15 17:47:53 UTC (rev 4356) @@ -170,6 +170,9 @@ public double interpolate(int _idxElt, double _x, double _y, CtuluVariable _value, int _tIdx) throws IOException { EfData data = data_.getData(_value, _tIdx); + + if(data==null)return 0; + return interpolateFromValue(_idxElt, _x, _y, _value, data, _tIdx); } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java 2009-01-14 06:24:50 UTC (rev 4355) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java 2009-01-15 17:47:53 UTC (rev 4356) @@ -37,6 +37,7 @@ res_ = _res; tester_ = _tester; initLine_=initLine; + } public boolean isPresentInPool(int _tIdx) { Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/mesure/EvolutionReguliere.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/mesure/EvolutionReguliere.java 2009-01-14 06:24:50 UTC (rev 4355) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/mesure/EvolutionReguliere.java 2009-01-15 17:47:53 UTC (rev 4356) @@ -11,6 +11,7 @@ import gnu.trove.TDoubleHashSet; import gnu.trove.TIntArrayList; +import java.io.File; import java.text.DecimalFormat; import java.util.Arrays; import java.util.HashMap; @@ -36,6 +37,11 @@ private boolean nuagePoints_=false; + /** + * Infos supplementaires ajoutees aux courbes afin de transferer des infos specifiques. + */ + public Map infos_=new HashMap(); + public boolean isNuagePoints() { return nuagePoints_; } @@ -270,6 +276,7 @@ xVal_ = _evol.xVal_; yVal_ = _evol.yVal_; // used_ = _evol.used_; + infos_=new HashMap(_evol.infos_); } /** Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2009-01-14 06:24:50 UTC (rev 4355) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2009-01-15 17:47:53 UTC (rev 4356) @@ -1,5 +1,6 @@ package org.fudaa.dodico.telemac.io; +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -15,11 +16,13 @@ */ public abstract class ScopeStructure { + public final static String NOM_FICHIER="Chemin absolu"; + public final static ScopeKeyWord KEY = new ScopeKeyWord(); public abstract void printResults(); - public abstract EvolutionReguliere[] returnEvolReguliere(); + public abstract EvolutionReguliere[] returnEvolReguliere(File fichier); public abstract String getTitleFormFile(); @@ -175,7 +178,7 @@ * * @return */ - public EvolutionReguliere[] returnEvolReguliere() { + public EvolutionReguliere[] returnEvolReguliere(File fichier) { EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbVariables()]; // -- on parcours toutes les variables --// @@ -195,7 +198,15 @@ } evolReg[i] = new EvolutionReguliere(tabX, tabY, false); - evolReg[i].setNom("courbe de " + nomVar); + evolReg[i].setNom("courbe de " + nomVar.replace(" ", "")); + + //-- ajout des infos specifiques --// + Map infos= evolReg[i].infos_; + infos.put("Type", "Profil scop"); + infos.put("Fichier scop", fichier.getName()); + infos.put(NOM_FICHIER, fichier.getAbsolutePath()); + infos.put("Variable", nomVar.replace(" ", "")); + } return evolReg; } @@ -494,8 +505,10 @@ return titles_.get(i); } - - public EvolutionReguliere[] returnEvolReguliere() { + /** + * Retourne les evolutions regulieres des profils spatiaux. + */ + public EvolutionReguliere[] returnEvolReguliere(File fichier) { EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbSeparator() * (getNbVariables()-1)]; // -- on parcours tous les pas de temps --// @@ -522,6 +535,14 @@ evolReg[i] = new EvolutionReguliere(tabX, tabY, false); evolReg[i].setNom("courbe de " + nomVar.replace(" ", "")); evolReg[i].setUnite(nomVar); + + //-- ajout des infos specifiques --// +// Map infos= evolReg[i].infos_; +// infos.put("Type", "Profil spatial scopGene"); +// infos.put("Fichier scopGENE", fichier.getName()); +// infos.put(NOM_FICHIER, fichier.getAbsolutePath()); +// infos.put("Variable", nomVar.replace(" ", "")); +// infos.put("Plage de valeurs", pdt); } } @@ -561,7 +582,7 @@ * On cree une courbe par variables, et on prend les points de tous les separaor pou les former. * @return */ - public EvolutionReguliere[] returnEvolRegulierePourTemporelles(double xVoulu) { + public EvolutionReguliere[] returnEvolRegulierePourTemporelles(double xVoulu,File fichier) { EvolutionReguliere[] evolReg = new EvolutionReguliere[getNbVariables()-1]; @@ -615,6 +636,15 @@ evolReg[i].setNom(nomVar.replace(" ", "")+" sur ["+getSeparator(0).replace(" ", "")+";"+getSeparator(getNbSeparator()-1).replace(" ", "")+"] pour X choisi="+xVoulu); evolReg[i].setUnite(nomVar); + + //-- ajout des infos specifiques --// + Map infos= evolReg[i].infos_; + infos.put("Type", "Profil temporel scopGene"); + infos.put("Fichier scopGENE", fichier.getName()); + infos.put(NOM_FICHIER, fichier.getAbsolutePath()); + infos.put("Variable", nomVar.replace(" ", "")); + infos.put("X choisi", xVoulu); + infos.put("Intervalle", "["+getSeparator(0).replace(" ", "")+";"+getSeparator(getNbSeparator()-1).replace(" ", "")+"]"); } return evolReg; @@ -626,7 +656,7 @@ *les Y idem * @return */ - public EvolutionReguliere[] returnEvolReguliereCorrelation(int varX,int varY,int separatorX,int separatorY){ + public EvolutionReguliere[] returnEvolReguliereCorrelation(int varX,int varY,int separatorX,int separatorY,File fichier){ EvolutionReguliere[] evolReg = new EvolutionReguliere[1]; List<Double> listeX=getListValueForVariableForSeparator(getSeparator(separatorX), varX+1); @@ -642,9 +672,18 @@ } evolReg[0] = new EvolutionReguliere(tabX, tabY, false); - evolReg[0].setNom("cor\xE9lation:(X="+getVariable(varX+1).replace(" ", "")+"//Y="+getVariable(varY+1).replace(" ", "")+")"); + evolReg[0].setNom("Correlation:(X="+getVariable(varX+1).replace(" ", "")+"//Y="+getVariable(varY+1).replace(" ", "")+")"); evolReg[0].setUnite(getVariable(varX+1)); + //-- ajout des infos specifiques --// + Map infos= evolReg[0].infos_; + infos.put("Type", "Correlation scopGene"); + infos.put("Fichier scopGENE", fichier.getName()); + infos.put(NOM_FICHIER, fichier.getAbsolutePath()); + infos.put("Variable X", getVariable(varX+1).replace(" ", "")+" pour la plage "+getSeparator(separatorX)); + infos.put("Variable Y", getVariable(varY+1).replace(" ", "")+" pour la plage "+getSeparator(separatorY)); + + return evolReg; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |