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: <had...@us...> - 2009-03-12 19:46:47
|
Revision: 4530 http://fudaa.svn.sourceforge.net/fudaa/?rev=4530&view=rev Author: hadouxad Date: 2009-03-12 19:46:45 +0000 (Thu, 12 Mar 2009) Log Message: ----------- - Refonte DRSO - Debut DPTG Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactoryCommom.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactoryDCSP.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactoryDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactoryDPTG.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactoryDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactoryDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoPersistDCSP.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoPersistDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoPersistDPTG.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoPersistDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoPersistDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoPersistOPTG.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoStructuresFormatDCSP.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoStructuresFormatDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoStructuresFormatDPTG.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoStructuresFormatDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoStructuresFormatDRSO.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDSCP.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactory.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoOPTG.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueRessource.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDSCP.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/TransformCrue9to10.java Deleted: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java 2009-03-12 19:45:15 UTC (rev 4529) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java 2009-03-12 19:46:45 UTC (rev 4530) @@ -1,50 +0,0 @@ -package main.java.org.fudaa.dodico.crue.dao; - -import java.util.List; - -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.io.xml.DomDriver; - -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDFRT.StriRefPersist; -import main.java.org.fudaa.dodico.crue.metier.emh.DonFrt; -import main.java.org.fudaa.dodico.crue.metier.emh.EMH; - -/** - * Classe persistante qui reprend la meme structure que le fichier xml - *DFRT - Fichier des donn\xE9es de frottement (xml) - * A persister telle qu'elle. - * @author Adrien Hadoux - * - */ -public class CrueDaoDFRT extends CrueDaoParsing<List<DonFrt>>{ - //-- variables qui correspondent \xE0 celle du fichier xml --// -// public String VersionCrue="10"; -// public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; - - /** - * Il faut ajouter un parametre dans xstream pour lui indiquer de degager les balises 'collections' - * car il n'y en a pas dans ce fichier. - */ - List<StriRefPersist> listeFrottement; - - - public void fillInfosWith(List<DonFrt> data,List<String> listeMessageError) { - listeFrottement=CrueDaoFactory.remplirPersistanceAvecFrottemetnsDFRT(data,listeMessageError); - - } - - - public List<DonFrt> fillInfosWithPersistant(Object data,List<String> listeMessageError) { - return CrueDaoFactory.remplirFrottemetnsAvecPersistanceDFRT(listeFrottement,listeMessageError); - } - - - public XStream initXmlParser() { - XStream xstream = new XStream(new DomDriver()); - //-- initialisation du format de la structure des documents --// - (new DaoStructuresFormatDFRT()).initXmlParserForDFRT(xstream); - return xstream; - } - - -} Deleted: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java 2009-03-12 19:45:15 UTC (rev 4529) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java 2009-03-12 19:46:45 UTC (rev 4530) @@ -1,99 +0,0 @@ -package main.java.org.fudaa.dodico.crue.dao; - -import java.util.ArrayList; -import java.util.List; - -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.io.xml.DomDriver; - -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract; -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract; -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu; -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.SectionAbstract; -import main.java.org.fudaa.dodico.crue.metier.emh.EMH; - -/** - * Classe persistante qui reprend la meme structure que le fichier xml - * A persister telle qu'elle. - * Le fichier DPTI d\xE9crit les conditions initiales - * (dont les manoeuvres d'ouvrages) d'un mod\xE8le CrueX. Son p\xE9rim\xE8tre est le mod\xE8le - * @author Adrien Hadoux - * - */ -public class CrueDaoDPTI extends CrueDaoParsing<List<EMH>>{ - - - /** - * la liste des noeuds - */ - private List<NoeudNiveauContinu> Noeuds; - - /** - * la liste des branches - */ - private List<BrancheAbstract> Branches; - - /** - * la liste des casiers - */ - private List<CasierAbstract> Casiers; - - - /** - * la liste des sections - */ - private List<SectionAbstract> Sections; - - @Override - public void fillInfosWith(List<EMH> data, List<String> listeMessageError) { - // TODO Auto-generated method stub - //-- etape 1: on remplit les infso des noeuds --// - Noeuds=CrueDaoFactory.remplirPersistanceAvecNoeudDPTI(data,listeMessageError); - - //-- etape 2: on remplit les infso des branches --// - Branches=CrueDaoFactory.remplirPersistanceAvecBrancheDPTI(data,listeMessageError); - - - //-- etape 3: on remplit les infso des casiers --// - Casiers=CrueDaoFactory.remplirPersistanceAvecCasierDPTI(data,listeMessageError); - - - //-- etape 4: on remplit les infso des sections --// - Sections=new ArrayList<SectionAbstract>(); - } - - @Override - List<EMH> fillInfosWithPersistant(Object data,List<String> listeMessageError) { - - if(data==null || ! (data instanceof List)){ - listeMessageError.add(CrueRessource.getS("Impossible de r\xE9cup\xE9rer les donn\xE9es r\xE9saux (DRSO). Les r\xE9f\xE9rences du fichier DPTI ne pourront etre utilis\xE9es.")); - return null; - } - List<EMH> listeEMHDRSO=(List<EMH> )data; - - //-- remplissage des noeuds --// - CrueDaoFactory.remplirNoeudAvecPersistanceDPTI(Noeuds,listeEMHDRSO,listeMessageError); - - //-- remplissage des branches --// - CrueDaoFactory.remplirBrancheAvecPersistanceDPTI(Branches, listeEMHDRSO,listeMessageError); - - - //-- remplissage des casiers --// - CrueDaoFactory.remplirCasierAvecPersistanceDPTI(Casiers, listeEMHDRSO, listeMessageError); - - //-- remplissage des sections --// - - //TODO pour le moment rien mais il faudrait demander des pr\xE9cisions --// - - return listeEMHDRSO; - } - - @Override - public XStream initXmlParser() { - XStream xstream = new XStream(new DomDriver()); - //-- init du parser --// - (new DaoStructuresFormatDPTI()).initXmlParserForDPTI(xstream); - return xstream; - } - -} Deleted: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-03-12 19:45:15 UTC (rev 4529) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-03-12 19:46:45 UTC (rev 4530) @@ -1,116 +0,0 @@ -package main.java.org.fudaa.dodico.crue.dao; - -import java.awt.font.MultipleMaster; -import java.util.ArrayList; -import java.util.List; -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.converters.SingleValueConverter; -import com.thoughtworks.xstream.io.xml.DomDriver; -import main.java.org.fudaa.dodico.crue.metier.emh.EMH; - -/** - * Classe persistante qui reprend la meme structure que le fichier xml - * DRSO - Fichier des donn\xE9es du r\xE9seau (xml) - * A persister telle qu'elle. - * @author Adrien Hadoux - * - */ -public class CrueDaoDRSO extends CrueDaoParsing<List<EMH>>{ - - /** - * Suffixe ajout\xE9 aux r\xE9f\xE9rences des objets emh du fichier dpti pour indiquer qu'ils r\xE9f\xE8rent aux objets d\xE9finis dans DRSO. - */ - public static final String SUFFIXE_REF_DRSO="DRSO#"; - - //-- variables qui correspondent \xE0 celle du fichier xml --// -// public String VersionCrue="10"; -// public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; - - /** - * la liste des noeuds - */ - private List Noeuds; - /** - * la liste des branches - */ - private List Branches; - - /** - * la liste des casiers - */ - private List Casiers; - - - /** - * la liste des sections - */ - private List Sections; - - @Override - public XStream initXmlParser(){ - XStream xstream = new XStream(new DomDriver()); - //-- initialisation du format de la structure des documents --// - (new DaoStructuresFormatDRSO()).initXmlParserForDRSO(xstream); - return xstream; - } - - @Override - public void fillInfosWith(List<EMH> data,List<String> listeMessageError) { - - //-- etape 1: on remplit les infso des noeuds --// - Noeuds=CrueDaoFactory.remplirPersistanceAvecNoeudDRSO(data,listeMessageError); - - //-- etape 2: on remplit les infso des branches --// - Branches=CrueDaoFactory.remplirPersistanceAvecBrancheDRSO(data,listeMessageError); - - - //-- etape 3: on remplit les infso des casiers --// - Casiers=CrueDaoFactory.remplirPersistanceAvecCasierDRSO(data,listeMessageError); - - - //-- etape 4: on remplit les infso des sections --// - Sections=CrueDaoFactory.remplirPersistanceAvecSectionsDRSO(data,listeMessageError); - - - - - } - - @Override - public List<EMH> fillInfosWithPersistant(Object data,List<String> listeMessageError) { - - List<EMH> listeCompleteEMH=new ArrayList<EMH>(); - - //-- etape 1: on remplit les infso des noeuds --// - List<EMH> listeNoeuds=CrueDaoFactory.remplirNoeudAvecPersistanceDRSO(Noeuds,listeMessageError); - - //-- etape 2: les casiers --// - List<EMH> listeCasiers=CrueDaoFactory.remplirCasierAvecPersistanceDRSO(Casiers, listeNoeuds,listeMessageError); - - - //-- etape 3: les branches et les sections de bransche --// - List<EMH> listeBranches=CrueDaoFactory.remplirBrancheAvecPersistanceDRSO(Branches, listeNoeuds,listeMessageError); - - //-- etape 3: les sections a partir des sections cr\xE9es lors du remplissage des branches --// - - List<EMH> listeSections= CrueDaoFactory.remplirSectionsAvecPersistanceDRSO(Sections, listeBranches,listeMessageError); - - - - - - //-- on ajoute tout dans la liste compl\xE8te --// - listeCompleteEMH.addAll(listeNoeuds); - listeCompleteEMH.addAll(listeCasiers); - listeCompleteEMH.addAll(listeBranches); - listeCompleteEMH.addAll(listeSections); - return listeCompleteEMH; - } - - - - - - - -} Deleted: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDSCP.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDSCP.java 2009-03-12 19:45:15 UTC (rev 4529) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDSCP.java 2009-03-12 19:46:45 UTC (rev 4530) @@ -1,64 +0,0 @@ -package main.java.org.fudaa.dodico.crue.dao; - -import java.util.ArrayList; -import java.util.List; - - -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract; -import main.java.org.fudaa.dodico.crue.metier.emh.EMH; - -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.io.xml.DomDriver; - -/** - * Classe persistante qui reprend la meme structure que le fichier xml - * DSCP - Fichier des donn\xE9es de calcul (xml) - * A persister telle qu'elle. - * @author Adrien Hadoux - * - */ -public class CrueDaoDSCP extends CrueDaoParsing<List<EMH>>{ - - - - - /** - * la liste des branches - */ - private List<BrancheAbstract> Branches; - - - - @Override - public void fillInfosWith(List<EMH> data, List<String> listeMessageError) { - // TODO Auto-generated method stub - //-- etape 1: on remplit les infso des branches --// - Branches=CrueDaoFactory.remplirPersistanceAvecBrancheDSCP(data,listeMessageError); - - } - - @Override - List<EMH> fillInfosWithPersistant(Object data,List<String> listeMessageError) { - - if(data==null || ! (data instanceof List)){ - listeMessageError.add(CrueRessource.getS("Impossible de r\xE9cup\xE9rer les donn\xE9es r\xE9saux (DRSO). Les r\xE9f\xE9rences du fichier DSCP ne pourront etre utilis\xE9es.")); - return null; - } - List<EMH> listeEMHDRSO=(List<EMH> )data; - - - //-- remplissage des branches --// - CrueDaoFactory.remplirBrancheAvecPersistanceDSCP(Branches, listeEMHDRSO,listeMessageError); - - return listeEMHDRSO; - } - - @Override - public XStream initXmlParser() { - XStream xstream = new XStream(new DomDriver()); - //-- init du parser --// - (new DaoStructuresFormatDSCP()).initXmlParserForDSCP(xstream); - return xstream; - } - -} \ No newline at end of file Deleted: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactory.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactory.java 2009-03-12 19:45:15 UTC (rev 4529) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactory.java 2009-03-12 19:46:45 UTC (rev 4530) @@ -1,1350 +0,0 @@ -package main.java.org.fudaa.dodico.crue.dao; - - -import java.util.ArrayList; -import java.util.List; -import org.fudaa.ebli.geometrie.GrPoint; -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDRSO.*; -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.ElemSeuil; -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.ElemSeuilPdc; -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.ElemSeuilOrifice; -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDFRT.*; -import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHBranche; -import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHCasier; -import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHNoeud; -import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHSection; -import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrt; -import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBarrageFilEau; -import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheOrifice; -import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBranchePDC; -import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSaintVenant; -import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSeuilLateral; -import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSeuilTransversal; -import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtSection; -import main.java.org.fudaa.dodico.crue.metier.emh.DonFrt; -import main.java.org.fudaa.dodico.crue.metier.emh.EMH; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageFilEau; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageGenerique; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageRhone; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheEnchainement; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheNiveauxAssocies; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheOrifice; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBranchePdc; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSaintVenant; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilLongitudinale; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilTransversal; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheStrickler; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHCasierMNT; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHCasierProfil; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionIdem; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionInterpolee; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionProfil; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionSansGeometrie; -import main.java.org.fudaa.dodico.crue.metier.emh.ElemSeuilAvecPdc; -import main.java.org.fudaa.dodico.crue.metier.emh.Loi; -import main.java.org.fudaa.dodico.crue.metier.emh.StriRefC; -import main.java.org.fudaa.dodico.crue.metier.emh.StriRefH; -import main.java.org.fudaa.dodico.crue.metier.emh.StriRefZ; - -/** - * Factory qui se charge de remplir les structures DAO avec les donn\xE9es m\xE9tier et inversement. - * @author Adrien Hadoux - * - */ -public class CrueDaoFactory { - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la premiere partie du fichier DRSO: les Noeuds. - * @param data - * @return - */ - public static List remplirPersistanceAvecNoeudDRSO(List<EMH> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - if(data==null || data.size()==0){ - listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); - }else - for(EMH emh:data ){ - if(emh instanceof CatEMHNoeud){ - CatEMHNoeud noeud=(CatEMHNoeud) emh; - NoeudNiveauContinu noeudPersist=new NoeudNiveauContinu(); - noeudPersist.Nom=noeud.getNom(); - listePersistante.add(noeudPersist); - } - } - return listePersistante; - } - - - /** - * Methode qui remplit une arrayList d'objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes qui constituent la premiere partie du fichier DRSO: les Noeuds. - * @param data - * @return - */ - public static List<EMH> remplirNoeudAvecPersistanceDRSO(List listePersistants,List<String> listeMessageError ){ - List<EMH> listeEMH=new ArrayList(); - - if(listePersistants==null || listePersistants.size()==0){ - listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); - }else - for(Object persist:listePersistants ){ - if(persist instanceof NoeudNiveauContinu){ - NoeudNiveauContinu noeudPersist=(NoeudNiveauContinu) persist; - CatEMHNoeud noeud=new CatEMHNoeud(noeudPersist.Nom); - listeEMH.add(noeud); - } - } - return listeEMH; - } - - - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la deuxieme partie du fichier DRSO: les Branches. - * @param data - * @return - */ - public static List remplirPersistanceAvecBrancheDRSO(List<EMH> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - if(data==null || data.size()==0){ - listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); - }else - for(EMH emh:data ){ - if(emh instanceof CatEMHBranche){ - CatEMHBranche branche=(CatEMHBranche) emh; - BrancheAbstract branchePersist=null; - if (branche instanceof EMHBrancheBarrageFilEau) { - EMHBrancheBarrageFilEau new_name = (EMHBrancheBarrageFilEau) branche; - branchePersist=new BrancheBarrageFilEau(); - }else if (branche instanceof EMHBrancheBarrageGenerique) { - EMHBrancheBarrageGenerique new_name = (EMHBrancheBarrageGenerique) branche; - branchePersist=new BrancheBarrageGenerique(); - }else if (branche instanceof EMHBrancheBarrageRhone) { - EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; - branchePersist=new BrancheBarrageRhone(); - }else if (branche instanceof EMHBrancheEnchainement) { - EMHBrancheEnchainement new_name = (EMHBrancheEnchainement) branche; - branchePersist=new BrancheEnchainement(); - }else if (branche instanceof EMHBrancheNiveauxAssocies) { - EMHBrancheNiveauxAssocies new_name = (EMHBrancheNiveauxAssocies) branche; - branchePersist=new BrancheNiveauxAssocies(); - }else if (branche instanceof EMHBrancheOrifice) { - EMHBrancheOrifice new_name = (EMHBrancheOrifice) branche; - branchePersist=new BrancheOrifice(); - }else if (branche instanceof EMHBranchePdc) { - EMHBranchePdc new_name = (EMHBranchePdc) branche; - branchePersist=new BranchePdc(); - }else if (branche instanceof EMHBrancheSaintVenant) { - EMHBrancheSaintVenant new_name = (EMHBrancheSaintVenant) branche; - branchePersist=new BrancheSaintVenant(); - }else if (branche instanceof EMHBrancheSeuilLongitudinale) { - EMHBrancheSeuilLongitudinale new_name = (EMHBrancheSeuilLongitudinale) branche; - branchePersist=new BrancheSeuilLateral(); - }else if (branche instanceof EMHBrancheSeuilTransversal) { - EMHBrancheSeuilTransversal new_name = (EMHBrancheSeuilTransversal) branche; - branchePersist=new BrancheSeuilTransversal(); - }else if (branche instanceof EMHBrancheStrickler) { - EMHBrancheStrickler new_name = (EMHBrancheStrickler) branche; - branchePersist=new BrancheStrickler(); - } - - if(branchePersist!=null){ - //-- commun --// - BrancheAbstract br=(BrancheAbstract) branchePersist; - br.Active=branche.isActive(); - br.Nom=branche.getNom(); - if(branche.getNoeudAmont()!=null) - br.NdAm=new NdAm(branche.getNoeudAmont().getNom()); - if(branche.getNoeudAval()!=null) - br.NdAv=new NdAv(branche.getNoeudAval().getNom()); - //-- on remplit les sections persistantes avec celle de la branche --// - br.Sections=CrueDaoFactory.remplirPersistanceAvecSectionsBrancheDRSO(branche.getListeSections(),listeMessageError); - listePersistante.add(br); - } - } - } - return listePersistante; - } - - - public static List<EMH> remplirBrancheAvecPersistanceDRSO(List listePersistante,List<EMH> listeNoeuds,List<String> listeMessageError){ - List<EMH> data=new ArrayList(); - if(listePersistante==null || listePersistante.size()==0){ - listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); - }else - for(Object objet:listePersistante ){ - if(objet instanceof BrancheAbstract){ - CatEMHBranche branche=null; - BrancheAbstract branchePersist=(BrancheAbstract) objet; - String nom=branchePersist.Nom; - if (branchePersist instanceof BrancheBarrageFilEau) { - branche = new EMHBrancheBarrageFilEau(nom); - - }else if (branchePersist instanceof BrancheBarrageGenerique) { - branche = new EMHBrancheBarrageGenerique(nom); - - }else if (branchePersist instanceof BrancheBarrageRhone) { - branche = new EMHBrancheBarrageRhone(nom); - - }else if (branchePersist instanceof BrancheEnchainement) { - branche = new EMHBrancheEnchainement(nom); - - }else if (branchePersist instanceof BrancheNiveauxAssocies) { - branche = new EMHBrancheNiveauxAssocies(nom); - - }else if (branchePersist instanceof BrancheOrifice) { - branche = new EMHBrancheOrifice(nom); - - }else if (branchePersist instanceof BranchePdc) { - branche = new EMHBranchePdc(nom); - - }else if (branchePersist instanceof BrancheSaintVenant) { - branche = new EMHBrancheSaintVenant(nom); - - }else if (branchePersist instanceof BrancheSeuilLateral) { - branche = new EMHBrancheSeuilLongitudinale(nom); - - }else if (branchePersist instanceof BrancheSeuilTransversal) { - branche = new EMHBrancheSeuilTransversal(nom); - - }else if (branchePersist instanceof BrancheStrickler) { - branche = new EMHBrancheStrickler(nom); - - } - - if(branche!=null){ - //-- commun --// - - branche.setActive(branchePersist.Active); - //branche.setNom(branchePersist.Nom); - if(branchePersist.NdAm!=null){ - CatEMHNoeud noeudAmont=CatEMHNoeud.findByReference(branchePersist.NdAm.NomRef, listeNoeuds); - if(noeudAmont!=null) - branche.setNoeudAmont(noeudAmont); - else - listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAm.NomRef)); - }else - listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud amont pour la branche "+branche.getNom())); - if(branchePersist.NdAv!=null){ - CatEMHNoeud noeudAval=CatEMHNoeud.findByReference(branchePersist.NdAv.NomRef, listeNoeuds); - if(noeudAval!=null) - branche.setNoeudAval(noeudAval); - else - listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAv.NomRef)); - }else - listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud aval pour la branche "+branche.getNom())); - - //-- on remplit les sections persistantes avec celle de la branche --// - if(branchePersist.Sections!=null) - branche.setListeSections(CrueDaoFactory.remplirSectionsBrancheAvecPersistanceDRSO(branchePersist.Sections,listeMessageError)); - - - data.add(branche); - } - } - } - return data; - } - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la troisi\xE8me partie du fichier DRSO: les Casier. - * @param data - * @return - */ - public static List remplirPersistanceAvecCasierDRSO(List<EMH> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - for(EMH emh:data ){ - if(emh instanceof CatEMHCasier){ - CatEMHCasier casier=(CatEMHCasier)emh; - CasierAbstract casierPersist=null; - if(casier instanceof EMHCasierMNT){ - casierPersist=new CasierMNT(); - }else if(casier instanceof EMHCasierProfil){ - casierPersist= new CasierProfil(); - EMHCasierProfil casierProfil=(EMHCasierProfil) casier; - - ((CasierProfil)casierPersist).Profil= new ReferenceProfil(); - ((CasierProfil)casierPersist).Profil.NomRef=casierProfil.getNomProfil(); - } - //-- commun --// - if(casierPersist!=null){ - casierPersist.Active=casier.isActive(); - if(casier.getNoeud()!=null) - casierPersist.Noeud=new ReferenceNoeud(casier.getNoeud().getNom()); - casierPersist.Nom=casier.getNom(); - listePersistante.add(casierPersist); - } - - - } - } - - return listePersistante; - } - - - /** - * Methode qui remplit une arrayList d'objets m\xE9tier EMH casier a partir des donn\xE9es persistantes qui constituent a troisi\xE8me partie du fichier DRSO: les Casier. - * @param data - * @return - */ - public static List<EMH> remplirCasierAvecPersistanceDRSO(List listePersistants,List<EMH> listeNoeuds ,List<String> listeMessageError){ - List<EMH> listeEMH=new ArrayList(); - if(listePersistants==null || listePersistants.size()==0){ - listeMessageError.add(CrueRessource.getS("Casiers: la liste est vide.")); - }else - for(Object persist:listePersistants ){ - if(persist instanceof CasierAbstract){ - CasierAbstract casierPersist=(CasierAbstract) persist; - String nom=casierPersist.Nom; - //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// - CatEMHCasier casier=null; - - //-- on recherche sa sp\xE9cialisation --// - if(casierPersist instanceof CasierProfil){ - casier=new EMHCasierProfil(nom); - if(((CasierProfil)casierPersist).Profil!=null) - ((EMHCasierProfil)casier).setNomProfil(((CasierProfil)casierPersist).Profil.NomRef); - }else if(casierPersist instanceof CasierMNT){ - casier=new EMHCasierMNT(nom); - } - - //-- commun aux objets --// - if(casier!=null){ - casier.setActive(casierPersist.Active); - if(casierPersist.Noeud!=null){ - String reference=casierPersist.Noeud.NomRef; - - - CatEMHNoeud noeudRef=CatEMHNoeud.findByReference(reference, listeNoeuds); - if(noeudRef!=null) - casier.setNoeud(noeudRef); - else - listeMessageError.add(CrueRessource.getS("Casier: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+reference)); - } else - listeMessageError.add(CrueRessource.getS("Casier: Il n'y a pas de noeud pour le casier "+casier.getNom())); - - listeEMH.add(casier); - } - } - } - return listeEMH; - } - - - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la quatri\xE8me partie du fichier DRSO: les Sections-references. - * @param data - * @return - */ - public static List remplirPersistanceAvecSectionsDRSO(List<EMH> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - for(EMH emh:data ){ - if(emh instanceof CatEMHSection){ - CatEMHSection section=(CatEMHSection)emh; - SectionAbstract sectionPersist=null; - if(section instanceof EMHSectionIdem){ - sectionPersist=new SectionRefIdem(); - }else - if(section instanceof EMHSectionInterpolee){ - sectionPersist=new SectionRefInterpolee(); - }else - if(section instanceof EMHSectionProfil){ - sectionPersist=new SectionRefProfil(); - }else - if(section instanceof EMHSectionSansGeometrie){ - sectionPersist=new SectionRefSansGeometrie(); - } - - //-- commun --// - if(sectionPersist!=null){ - sectionPersist.Nom=section.getNom(); - listePersistante.add(sectionPersist); - } - } - } - return listePersistante; - } - - /** - * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections de branches a partir des donn\xE9es persistantes qui constituent la partie interne d'une partie Branche du fichier DRSO: les Sections. - * @param data - * @return - */ - public static List<CatEMHSection> remplirSectionsBrancheAvecPersistanceDRSO(List listePersistantsBranches,List<String> listeMessageError){ - List<CatEMHSection> listeEMH=new ArrayList<CatEMHSection>(); - if(listePersistantsBranches==null || listePersistantsBranches.size()==0){ - listeMessageError.add(CrueRessource.getS("Sections Branches: la liste est vide.")); - }else - for(Object persist:listePersistantsBranches ){ - if(persist instanceof SectionBrancheAbstract){ - SectionBrancheAbstract sectionPersist=(SectionBrancheAbstract) persist; - - //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// - CatEMHSection section=null; - String nom=sectionPersist.NomRef; - //-- on recherche sa sp\xE9cialisation --// - if(sectionPersist instanceof SectionIdem){ - section=new EMHSectionIdem(nom); - - }else if(sectionPersist instanceof SectionInterpolee){ - section=new EMHSectionInterpolee(nom); - }else if(sectionPersist instanceof SectionProfil){ - section=new EMHSectionProfil(nom); - }else if(sectionPersist instanceof SectionSansGeometrie){ - section=new EMHSectionSansGeometrie(nom); - } - - //-- commun aux objets --// - if(section!=null){ - - if(sectionPersist.Pos!=null) - section.setPosition(sectionPersist.Pos); - section.setXp(sectionPersist.Xp); - listeEMH.add(section); - } - } - } - return listeEMH; - } - - /** - * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections a partir des donn\xE9es persistantes qui constituent a quatrieme partie du fichier DRSO: les Sections. - * @param data - * @return - */ - public static List<EMH> remplirSectionsAvecPersistanceDRSO(List listePersistantsSection,List<EMH> listeBranches,List<String> listeMessageError){ - List<EMH> listeEMH=new ArrayList<EMH>(); - if(listePersistantsSection==null || listePersistantsSection.size()==0){ - listeMessageError.add(CrueRessource.getS("Sections : la liste est vide.")); - }else - for(Object persist:listePersistantsSection ){ - if(persist instanceof SectionAbstract){ - SectionAbstract sectionPersist=(SectionAbstract) persist; - - //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// - CatEMHSection section=null; - String reference=sectionPersist.Nom; - section=CatEMHSection.findByReferenceFromBrancheOrSectionEMH(reference, listeBranches); - - - - if(section!=null) - listeEMH.add(section); - else - listeMessageError.add(CrueRessource.getS("Sections : Impossible de trouver la section de r\xE9f\xE9rence "+reference)); - } - } - return listeEMH; - } - - - /** - * Remplit les don\xE9nes persistantes avec la liste des sections d'une branche. - * Remplit toutes les donn\xE9es associ\xE9es aux sections - * @param data - * @return - */ - public static List remplirPersistanceAvecSectionsBrancheDRSO(List<CatEMHSection> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - for(EMH emh:data ){ - if(emh instanceof CatEMHSection){ - CatEMHSection section=(CatEMHSection)emh; - SectionBrancheAbstract sectionPersist=null; - if(section instanceof EMHSectionIdem){ - sectionPersist=new SectionIdem(); - }else - if(section instanceof EMHSectionInterpolee){ - sectionPersist=new SectionInterpolee(); - }else - if(section instanceof EMHSectionProfil){ - sectionPersist=new SectionProfil(); - }else - if(section instanceof EMHSectionSansGeometrie){ - sectionPersist=new SectionSansGeometrie(); - } - - //-- commun --// - if(sectionPersist!=null){ - sectionPersist.NomRef=section.getNom(); - - sectionPersist.Pos=section.getPosition(); - sectionPersist.Xp=section.getXp(); - - - listePersistante.add(sectionPersist); - } - } - } - return listePersistante; - } - - /** - * remplir le fichier DFRT avec les frottemetns - * @param data - * @return - */ - public static List<StriRefPersist> remplirPersistanceAvecFrottemetnsDFRT(List<DonFrt> data,List<String> listeMessageError){ - List<StriRefPersist> listeFrottement=new ArrayList<StriRefPersist>(); - for(DonFrt frt:data){ - StriRefPersist persist=null; - if(frt instanceof StriRefC) - persist=new StriRefCPersist(frt.getNom()); - else - if(frt instanceof StriRefH) - persist=new StriRefHPersist(frt.getNom()); - else - if(frt instanceof StriRefZ) - persist=new StriRefZPersist(frt.getNom()); - - //-- commun --// - if(persist!=null){ - if(frt.getListePoints()!=null && frt.getListePoints().size()>0){ - persist.listePoints=new ArrayList<StringBuffer>(); - for(GrPoint pt:frt.getListePoints()){ - StringBuffer buff=new StringBuffer(""+pt.x_+" "+pt.y_); - persist.listePoints.add(buff); - } - } - listeFrottement.add(persist); - } - - } - return listeFrottement; - } - - /** - * remplir le fichier DFRT avec les frottemetns - * @param data - * @return - */ - public static List<DonFrt> remplirFrottemetnsAvecPersistanceDFRT(List<StriRefPersist> persistListe,List<String> listeMessageError){ - List<DonFrt> data=new ArrayList<DonFrt>(); - if(persistListe==null || persistListe.size()==0){ - listeMessageError.add(CrueRessource.getS("Frottements : la liste est vide.")); - }else - for(StriRefPersist persist:persistListe){ - DonFrt frt=null; - if(persist instanceof StriRefCPersist) - frt=new StriRefC(persist.Nom); - else - if(persist instanceof StriRefHPersist) - frt=new StriRefH(persist.Nom); - else - if(persist instanceof StriRefZPersist) - frt=new StriRefZ(persist.Nom); - - //-- commun --// - if(persist!=null){ - if(persist.listePoints!=null){ - - List<GrPoint> listePoints=new ArrayList<GrPoint>(); - for(StringBuffer buff:persist.listePoints){ - - int indiceCesure=buff.lastIndexOf(" "); - String val1=buff.substring(0, indiceCesure); - String val2=buff.substring(indiceCesure+1, buff.length()); - double x=0; - try{ - x=Double.parseDouble(val1); - - }catch(NumberFormatException e){ - listeMessageError.add(CrueRessource.getS("Frottement: "+frt.getNom()+": impossible de r\xE9cup\xE9rer le r\xE9el du contenu: "+buff)); - } - double y=0; - try{ - y=Double.parseDouble(val2); - }catch(NumberFormatException e){ - listeMessageError.add(CrueRessource.getS("Frottement: "+frt.getNom()+": impossible de r\xE9cup\xE9rer le r\xE9el du contenu: "+buff)); - } - listePoints.add(new GrPoint(x,y,0)); - - } - - - frt.setListePoints(listePoints); - } - data.add(frt); - } - - } - return data; - } - - - /** - * Remplit les donn\xE9es persistante avec les conditions initiales des noeuds - * @param data - * @param listeMessageError - * @return - */ - public static List remplirPersistanceAvecNoeudDPTI(List<EMH> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - if(data==null || data.size()==0){ - listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); - }else - for(EMH emh:data ){ - if(emh instanceof CatEMHNoeud){ - CatEMHNoeud noeud=(CatEMHNoeud) emh; - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu noeudPersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu(); - noeudPersist.NomRef=CrueDaoDRSO.SUFFIXE_REF_DRSO+noeud.getNom(); - noeudPersist.Zini=noeud.getZini(); - listePersistante.add(noeudPersist); - } - } - return listePersistante; - } - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la deuxieme partie du fichier DRSO: les Branches. - * @param data - * @return - */ - public static List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract> remplirPersistanceAvecBrancheDPTI(List<EMH> data,List<String> listeMessageError){ - String suffixe=CrueDaoDRSO.SUFFIXE_REF_DRSO; - List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract> listePersistante=new ArrayList<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract>(); - if(data==null || data.size()==0){ - listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); - }else - for(EMH emh:data ){ - if(emh instanceof CatEMHBranche){ - CatEMHBranche branche=(CatEMHBranche) emh; - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract branchePersist=null; - if (branche instanceof EMHBrancheBarrageFilEau) { - EMHBrancheBarrageFilEau new_name = (EMHBrancheBarrageFilEau) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheBarrageFilEau(); - }else if (branche instanceof EMHBrancheBarrageGenerique) { - EMHBrancheBarrageGenerique new_name = (EMHBrancheBarrageGenerique) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheBarrageGenerique(); - }else if (branche instanceof EMHBrancheBarrageRhone) { - EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheBarrageRhone(); - }else if (branche instanceof EMHBrancheEnchainement) { - EMHBrancheEnchainement new_name = (EMHBrancheEnchainement) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheEnchainement(); - }else if (branche instanceof EMHBrancheNiveauxAssocies) { - EMHBrancheNiveauxAssocies new_name = (EMHBrancheNiveauxAssocies) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheNiveauxAssocies(); - }else if (branche instanceof EMHBrancheOrifice) { - EMHBrancheOrifice new_name = (EMHBrancheOrifice) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice(); - - (( main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice)branchePersist).OuvPasseDessous=new_name.getOuvPasseDessous(); - - }else if (branche instanceof EMHBranchePdc) { - EMHBranchePdc new_name = (EMHBranchePdc) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BranchePdc(); - }else if (branche instanceof EMHBrancheSaintVenant) { - EMHBrancheSaintVenant new_name = (EMHBrancheSaintVenant) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheSaintVenant(); - }else if (branche instanceof EMHBrancheSeuilLongitudinale) { - EMHBrancheSeuilLongitudinale new_name = (EMHBrancheSeuilLongitudinale) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheSeuilLateral(); - }else if (branche instanceof EMHBrancheSeuilTransversal) { - EMHBrancheSeuilTransversal new_name = (EMHBrancheSeuilTransversal) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheSeuilTransversal(); - }else if (branche instanceof EMHBrancheStrickler) { - EMHBrancheStrickler new_name = (EMHBrancheStrickler) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheStrickler(); - } - - if(branchePersist!=null){ - //-- commun --// - - branchePersist.NomRef=suffixe+branche.getNom(); - - branchePersist.Qini=new Double(branche.getQini()); - branchePersist.Qruis=new Double(branche.getQruis()); - - - listePersistante.add(branchePersist); - } - } - } - return listePersistante; - } - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la troisi\xE8me partie du fichier DRSO: les Casier. - * @param data - * @return - */ - public static List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract> remplirPersistanceAvecCasierDPTI(List<EMH> data,List<String> listeMessageError){ - List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract> listePersistante=new ArrayList<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract>(); - for(EMH emh:data ){ - if(emh instanceof CatEMHCasier){ - CatEMHCasier casier=(CatEMHCasier)emh; - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract casierPersist=null; - if(casier instanceof EMHCasierMNT){ - casierPersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierMNT(); - }else if(casier instanceof EMHCasierProfil){ - casierPersist= new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierProfil(); - } - //-- commun --// - if(casierPersist!=null){ - casierPersist.NomRef=CrueDaoDRSO.SUFFIXE_REF_DRSO+casier.getNom(); - casierPersist.Qruis=casier.getQruis(); - listePersistante.add(casierPersist); - } - } - } - return listePersistante; - } - - /** - * Methode qui met a jour les objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes de DPTI et les pr\xE9chargements de DRSO - * @param data - * @return - */ - public static void remplirNoeudAvecPersistanceDPTI(List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu> listePersistants,List<EMH> data,List<String> listeMessageError ){ - if(listePersistants==null || listePersistants.size()==0){ - listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); - }else - for(Object persist:listePersistants ){ - if(persist instanceof main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu noeudPersist=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu) persist; - String reference=noeudPersist.NomRef; - if(reference.contains(CrueDaoDRSO.SUFFIXE_REF_DRSO)){ - reference=reference.replace(CrueDaoDRSO.SUFFIXE_REF_DRSO,""); - } - CatEMHNoeud noeud=CatEMHNoeud.findByReference(reference, data); - if(noeud==null){ - listeMessageError.add(CrueRessource.getS("Noeuds : Impossible de trouver le noeud de r\xE9f\xE9rence "+reference)); - }else{ - noeud.setZini(noeudPersist.Zini); - } - } - } - - } - /** - * Methode qui met a jour les objets m\xE9tier EMH branches a partir des donn\xE9es persistantes de DPTI et les pr\xE9chargements de DRSO - * @param data - * @return - */ - public static void remplirBrancheAvecPersistanceDPTI(List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract> listePersistants,List<EMH> data,List<String> listeMessageError ){ - if(listePersistants==null || listePersistants.size()==0){ - listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); - }else - for(Object persist:listePersistants ){ - if(persist instanceof main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract branchePersist=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract) persist; - String reference=branchePersist.NomRef; - if(reference.contains(CrueDaoDRSO.SUFFIXE_REF_DRSO)){ - reference=reference.replace(CrueDaoDRSO.SUFFIXE_REF_DRSO,""); - } - CatEMHBranche branche=CatEMHBranche.findByReference(reference, data); - if(branche==null){ - listeMessageError.add(CrueRessource.getS("Branche : Impossible de trouver la branche de r\xE9f\xE9rence "+reference)); - }else{ - if(branchePersist.Qini!=null) - branche.setQini(branchePersist.Qini); - if(branchePersist.Qruis!=null) - branche.setQruis(branchePersist.Qruis); - - //-- cas particuliers --// - if(branchePersist instanceof main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice){ - EMHBrancheOrifice br=(EMHBrancheOrifice)branche; - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice orif=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice) branchePersist; - if(orif.OuvPasseDessous!=null) - br.setOuvPasseDessous(orif.OuvPasseDessous); - } - } - } - } - } - - - /** - * Methode qui met a jour les objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes de DPTI et les pr\xE9chargements de DRSO - * @param data - * @return - */ - public static void remplirCasierAvecPersistanceDPTI(List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract> listePersistants,List<EMH> data,List<String> listeMessageError ){ - if(listePersistants==null || listePersistants.size()==0){ - listeMessageError.add(CrueRessource.getS("Casiers: la liste est vide.")); - }else - for(Object persist:listePersistants ){ - if(persist instanceof main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract casierPersist=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract) persist; - String reference=casierPersist.NomRef; - if(reference.contains(CrueDaoDRSO.SUFFIXE_REF_DRSO)){ - reference=reference.replace(CrueDaoDRSO.SUFFIXE_REF_DRSO,""); - } - CatEMHCasier casier=CatEMHCasier.findByReference(reference, data); - if(casier==null){ - listeMessageError.add(CrueRessource.getS("Casiers : Impossible de trouver le casier de r\xE9f\xE9rence "+reference)); - }else{ - if(casierPersist.Qruis!=null) - casier.setQruis(casierPersist.Qruis); - } - } - } - - } - - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent le fichier fichier DSCP: les Branches. - * @param data - * @return - */ - public static List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract> remplirPersistanceAvecBrancheDSCP(List<EMH> data,List<String> listeMessageError){ - String suffixe=CrueDaoDRSO.SUFFIXE_REF_DRSO; - List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract> listePersistante=new ArrayList<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract>(); - if(data==null || data.size()==0){ - listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); - }else - for(EMH emh:data ){ - if(emh instanceof CatEMHBranche){ - CatEMHBranche branche=(CatEMHBranche) emh; - DonCalcSansPrt dataCalc=null; - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract branchePersist=null; - if (branche instanceof EMHBrancheBarrageFilEau) { - EMHBrancheBarrageFilEau new_name = (EMHBrancheBarrageFilEau) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageFilEau(); - - //-- recuperation de la donnee de calcul de la branche --// - dataCalc=branche.getDSCP(); - if(dataCalc!=null ){ - - if( dataCalc instanceof DonCalcSansPrtBarrageFilEau){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageFilEau br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageFilEau)branchePersist; - - //-- recuperation de la formule --// - if(((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam()!=null) - br.Loi=((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam().getNom(); - br.QLimInf=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimInf(); - br.QLimSup=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimSup(); - //-- on remplit la liste des elements seuils --// - - br.ElemSeuils=remplirPersistanceAvecSeuilsBarragesDSCP(((DonCalcSansPrtBarrageFilEau)dataCalc).getListElt()); - - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche barrage Fil d'eau) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - - }else if (branche instanceof EMHBrancheBarrageGenerique) { - EMHBrancheBarrageGenerique new_name = (EMHBrancheBarrageGenerique) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageGenerique(); - //-- recuperation de la donnee de calcul de la branche --// - dataCalc=branche.getDSCP(); - if(dataCalc!=null ){ - - if( dataCalc instanceof DonCalcSansPrtBarrageFilEau){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageGenerique br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageGenerique)branchePersist; - - //-- recuperation de la formule --// - if(((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam()!=null) - br.Loi=((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam().getNom(); - br.QLimInf=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimInf(); - br.QLimSup=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimSup(); - //-- on remplit la liste des elements seuils --// - - br.ElemSeuils=remplirPersistanceAvecSeuilsBarragesDSCP(((DonCalcSansPrtBarrageFilEau)dataCalc).getListElt()); - - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche barrage Generique) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - - }else if (branche instanceof EMHBrancheBarrageRhone) { - EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageRhone(); - //-- recuperation de la donnee de calcul de la branche --// - dataCalc=branche.getDSCP(); - if(dataCalc!=null ){ - - if( dataCalc instanceof DonCalcSansPrtBarrageFilEau){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageRhone br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageRhone)branchePersist; - - //-- recuperation de la formule --// - if(((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam()!=null) - br.Loi=((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam().getNom(); - br.QLimInf=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimInf(); - br.QLimSup=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimSup(); - //-- on remplit la liste des elements seuils --// - - br.ElemSeuils=remplirPersistanceAvecSeuilsBarragesDSCP(((DonCalcSansPrtBarrageFilEau)dataCalc).getListElt()); - - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche barrage Rhone) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - - } -// else if (branche instanceof EMHBrancheBarrageRhone) { -// EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; -// branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageRhone(); -// } -// else if (branche instanceof EMHBrancheEnchainement) { -// EMHBrancheEnchainement new_name = (EMHBrancheEnchainement) branche; -// branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheEnchainement(); -// }else if (branche instanceof EMHBrancheNiveauxAssocies) { -// EMHBrancheNiveauxAssocies new_name = (EMHBrancheNiveauxAssocies) branche; -// branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheNiveauxAssocies(); -// } - else if (branche instanceof EMHBrancheOrifice) { - - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheOrifice(); - - //-- recuperation de la donnee de calcul de la branche --// - dataCalc=branche.getDSCP(); - if(dataCalc!=null ){ - - if( dataCalc instanceof DonCalcSansPrtBrancheOrifice){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheOrifice br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheOrifice)branchePersist; - - //-- recuperation de la formule --// - br.FormulePdc=((DonCalcSansPrtBrancheOrifice)dataCalc).getFormulePdc(); - //-- on remplit la liste des elements seuils --// - br.ElemOrifices =remplirPersistanceAvecOrificesSeuilsDSCP(((DonCalcSansPrtBrancheOrifice)dataCalc).getElement()); - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche Orifice) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - - }else if (branche instanceof EMHBranchePdc) { - EMHBranchePdc new_name = (EMHBranchePdc) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BranchePdc(); - - //-- recuperation de la donnee de calcul de la branche --// - dataCalc=branche.getDSCP(); - if(dataCalc!=null ){ - - if( dataCalc instanceof DonCalcSansPrtBranchePDC){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BranchePdc br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BranchePdc)branchePersist; - - //-- recuperation de la formule --// - if(((DonCalcSansPrtBranchePDC)dataCalc).getPdc_DZ()!=null) - br.Loi=((DonCalcSansPrtBranchePDC)dataCalc).getPdc_DZ().getNom(); - - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche seuil Longitudinal) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - - - }else if (branche instanceof EMHBrancheSaintVenant) { - EMHBrancheSaintVenant new_name = (EMHBrancheSaintVenant) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheSaintVenant(); - //-- recuperation de la donnee de calcul de la branche --// - dataCalc=branche.getDSCP(); - if(dataCalc!=null ){ - - if( dataCalc instanceof DonCalcSansPrtBrancheSaintVenant){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheClassiqueAbstract br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheClassiqueAbstract)branchePersist; - - br.CoefBeta=((DonCalcSansPrtBrancheSaintVenant)dataCalc).getCoeffBeta(); - br.CoefRuis=((DonCalcSansPrtBrancheSaintVenant)dataCalc).getCoefRuis(); - br.CoefRuisQdm=((DonCalcSansPrtBrancheSaintVenant)dataCalc).getCoeffRuisQdm(); - - //-- remplissage des sections de branches --// - br.Sections=remplirPersistanceAvecSectionsBrancheDSCP( branche.getListeSections(), listeMessageError); - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche SaintVenant) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - }else{ - listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); - } - - - - }else if (branche instanceof EMHBrancheSeuilLongitudinale) { - EMHBrancheSeuilLongitudinale new_name = (EMHBrancheSeuilLongitudinale) branche; - branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheSeuilLateral(); - - //-- recuperation de la donnee de calcul de la branche --// - dataCalc=branche.getDSCP(); - if(dataCalc!=null ){ - - if( dataCalc instanceof DonCalcSansPrtBrancheSeuilLateral){ - main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheSeuilLateral br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheSeuilLateral)branchePersist; - - //-- recuperation de la formule --// - br.FormulePdc=((DonCalcSansPrtBranche... [truncated message content] |
From: <had...@us...> - 2009-03-12 19:45:29
|
Revision: 4529 http://fudaa.svn.sourceforge.net/fudaa/?rev=4529&view=rev Author: hadouxad Date: 2009-03-12 19:45:15 +0000 (Thu, 12 Mar 2009) Log Message: ----------- - Refonte DRSO - Debut DPTG Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDRSO.xsd Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDCSP.xsd branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDPTG.xsd branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideOPTG.xsd Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDSCP.xsd Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java 2009-03-12 19:44:37 UTC (rev 4528) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java 2009-03-12 19:45:15 UTC (rev 4529) @@ -33,7 +33,10 @@ public static final String xsdDFRT="valideDFRT.xsd"; public static final String xsdDRSO="valideDRSO.xsd"; public static final String xsdDPTI="valideDPTI.xsd"; - public static final String xsdDSCP="valideDSCP.xsd"; + public static final String xsdDCSP="valideDCSP.xsd"; + public static final String xsdOPTG="valideOPTG.xsd"; + + public static final String xsdTEST="valideTest.xsd"; /** Copied: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDCSP.xsd (from rev 4525, branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDSCP.xsd) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDCSP.xsd (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDCSP.xsd 2009-03-12 19:45:15 UTC (rev 4529) @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + + + + <xs:complexType name="BrancheClassique"> + <xs:sequence> + <xs:element name="CoefBeta" type="xs:double"/> + <xs:element name="CoefRuisQdm" type="xs:double"/> + <xs:element name="CoefRuis" type="xs:double"/> + <xs:element name="Sections" type="Sections"/> + </xs:sequence> + <xs:attribute name="NomRef" type="xs:string"/> + </xs:complexType> + + <xs:complexType name="BranchePDC"> + <xs:sequence> + <xs:element name="Loi" type="xs:string"/> + </xs:sequence> + <xs:attribute name="NomRef" type="xs:string"/> + </xs:complexType> + + <xs:complexType name="BrancheOrifice"> + <xs:sequence> + <xs:choice minOccurs="0" maxOccurs="1"> + <xs:element name="FormulePdc" type="xs:string"/> + </xs:choice> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="ElemOrifice" type="ElemOrifice"/> + </xs:choice> + </xs:sequence> + <xs:attribute name="NomRef" type="xs:string"/> + </xs:complexType> + + + <xs:complexType name="BrancheSeuil"> + <xs:sequence> + <xs:choice minOccurs="0" maxOccurs="1"> + <xs:element name="FormulePdc" type="xs:string"/> + </xs:choice> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="ElemSeuilPdc" type="ElemSeuilPDC"/> + </xs:choice> + </xs:sequence> + <xs:attribute name="NomRef" type="xs:string"/> + </xs:complexType> + + <xs:complexType name="BrancheBarrageFilEau"> + <xs:sequence> + <xs:element name="Loi" type="xs:string"/> + <xs:element name="QLimInf" type="xs:double"/> + <xs:element name="QLimSup" type="xs:double"/> + + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="ElemSeuil" type="ElemSeuil"/> + </xs:choice> + </xs:sequence> + <xs:attribute name="NomRef" type="xs:string"/> + </xs:complexType> + + + <xs:complexType name="Branches"> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="BrancheSaintVenant" type="BrancheClassique"/> + <xs:element name="BrancheSeuilTransversal" type="BrancheSeuil"/> + <xs:element name="BrancheSeuilLateral" type="BrancheSeuil"/> + <!--<xs:element name="BrancheStrickler" type="BrancheClassique"/>--> + <xs:element name="BrancheOrifice" type="BrancheOrifice"/> + <xs:element name="BrancheBarrageFilEau" type="BrancheBarrageFilEau"/> + <xs:element name="BranchePdc" type="BranchePDC"/> + <xs:element name="BrancheBarrageGenerique" type="BrancheBarrageFilEau"/> + <!--<xs:element name="BrancheBarrageRhone" type="BrancheClassique"/>--> + <!--<xs:element name="BrancheEnchainement" type="BrancheClassique"/>--> + <!--<xs:element name="BrancheNiveauxAssocies" type="BrancheClassique"/>--> + + </xs:choice> + </xs:complexType> + + + <!-- ELEMENT ORIFICE --> + <xs:complexType name="ElemOrifice"> + <xs:sequence> + <xs:element name="CoefCtrLim" type="xs:double"/> + <xs:element name="Larg" type="xs:double"/> + <xs:element name="Zseuil" type="xs:double"/> + <xs:element name="Haut" type="xs:double"/> + <xs:element name="CoefD" type="xs:double"/> + <xs:element name="Sens" type="xs:string"/> + </xs:sequence> + + </xs:complexType> + + <!-- ELEMENT SEUILS --> + <xs:complexType name="ElemSeuilPDC"> + <xs:sequence> + <xs:element name="Larg" type="xs:double"/> + <xs:element name="Zseuil" type="xs:double"/> + <xs:element name="CoefD" type="xs:double"/> + <xs:element name="CoefPdc" type="xs:double"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="ElemSeuil"> + <xs:sequence> + <xs:element name="Larg" type="xs:double"/> + <xs:element name="Zseuil" type="xs:double"/> + <xs:element name="CoefD" type="xs:double"/> + </xs:sequence> + </xs:complexType> + + + <!-- section --> + <xs:complexType name="Section"> + <xs:sequence> + <xs:element name="CoefPond" type="xs:double"/> + <xs:element name="CoefConv" type="xs:double"/> + <xs:element name="CoefDiv" type="xs:double"/> + </xs:sequence> + <xs:attribute name="NomRef" type="xs:string"/> + </xs:complexType> + + <xs:complexType name="Sections"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="SectionIdem" type="Section"/> + <xs:element name="SectionInterpolee" type="Section"/> + <xs:element name="SectionProfil" type="Section"/> + <xs:element name="SectionSansGeometrie" type="Section"/> + <xs:element name="SectionPilote" type="Section"/> + </xs:choice> + </xs:complexType> + + + <xs:element name="DCSP" > + <xs:complexType> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="VersionCrue" type="xs:string"/> + <xs:element name="Commentaire" type="xs:string"/> + <xs:element name="Branches" type="Branches"/> + </xs:choice> + </xs:complexType> + </xs:element> + + + </xs:schema> Property changes on: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDCSP.xsd ___________________________________________________________________ Added: svn:mergeinfo + Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDPTG.xsd =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDPTG.xsd (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDPTG.xsd 2009-03-12 19:45:15 UTC (rev 4529) @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + + <!-- PROFILS SECTIONS --> + <xs:complexType name="Serie"> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="PointFF" type="xs:string"/> + </xs:choice> + <xs:attribute name="Nom" type="xs:string"/> + </xs:complexType> + + + <xs:complexType name="Frottement"> + <xs:attribute name="NomRef" type="xs:string"/> + </xs:complexType> + + + <xs:complexType name="Lit"> + <xs:sequence > + <xs:element name="LimDeb" type="xs:double"/> + <xs:element name="IsActif" type="xs:boolean"/> + <xs:element name="IsMineur" type="xs:boolean"/> + <xs:element name="Frot" type="Frottement"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="Lits"> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="Lit" type="Lit"/> + </xs:choice> + <xs:attribute name="Nom" type="xs:string"/> + </xs:complexType> + + <xs:complexType name="ProfilSection"> + <xs:sequence > + <xs:element name="Serie" type="Serie"/> + <xs:element name="Lits" type="Lits"/> + </xs:sequence> + <xs:attribute name="Nom" type="xs:string"/> + </xs:complexType> + + + <!-- PROFILS CASIERS --> + <xs:complexType name="ProfilCasier"> + <xs:sequence > + <xs:element name="Long" type="xs:double"/> + <xs:element name="Serie" type="Serie"/> + <xs:element name="Lits" type="Lits"/> + </xs:sequence> + <xs:attribute name="Nom" type="xs:string"/> + </xs:complexType> + + + + <!-- CONTENEUR PROFILS --> + <xs:complexType name="Profils"> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="ProfilSection" type="ProfilSection"/> + <xs:element name="ProfilCasier" type="ProfilCasier"/> + + </xs:choice> + <xs:attribute name="Nom" type="xs:string"/> + </xs:complexType> + + + + <!-- SECTIONS --> + <xs:complexType name="SectionIdem"> + <xs:sequence > + <xs:element name="Dz" type="xs:double"/> + </xs:sequence> + <xs:attribute name="NomRef" type="xs:string"/> + </xs:complexType> + + <xs:complexType name="Sections"> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="SectionIdem" type="SectionIdem"/> + </xs:choice> + </xs:complexType> + + + + + <!-- BRANCHES --> + <xs:complexType name="BrancheSaintVenant"> + <xs:sequence > + <xs:element name="CoefSinuo" type="xs:double"/> + <xs:element name="LongMineur" type="xs:double"/> + <xs:element name="LongMajeur" type="xs:double"/> + </xs:sequence> + <xs:attribute name="NomRef" type="xs:string"/> + </xs:complexType> + + <xs:complexType name="Branches"> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="BrancheSaintVenant" type="BrancheSaintVenant"/> + </xs:choice> + </xs:complexType> + + + + + <!-- GENERAL --> + <xs:element name="DPTG" > + <xs:complexType> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="VersionCrue" type="xs:string"/> + <xs:element name="Commentaire" type="xs:string"/> + <xs:element name="Profils" type="Profils"/> + <xs:element name="Sections" type="Sections"/> + <xs:element name="Branches" type="Branches"/> + </xs:choice> + </xs:complexType> + </xs:element> + + + </xs:schema> \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDRSO.xsd =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDRSO.xsd 2009-03-12 19:44:37 UTC (rev 4528) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDRSO.xsd 2009-03-12 19:45:15 UTC (rev 4529) @@ -20,20 +20,22 @@ <!-- Gestion des BRANCHES --> <xs:complexType name="SectionIncluseBranche"> - <xs:sequence> + <xs:sequence> <xs:element name="Pos" type="xs:string"/> <xs:element name="Xp" type="xs:double"/> - </xs:sequence> + </xs:sequence> <xs:attribute name="NomRef" type="xs:string"/> </xs:complexType> + + <xs:complexType name="SectionsBranches"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="SectionIdem" type="SectionIncluseBranche"/> - <xs:element name="SectionInterpolee" type="SectionIncluseBranche"/> - <xs:element name="SectionProfil" type="SectionIncluseBranche"/> - <xs:element name="SectionSansGeometrie" type="SectionIncluseBranche"/> - <xs:element name="SectionPilote" type="SectionIncluseBranche"/> + <xs:element name="SectionIdem-ref" type="SectionIncluseBranche"/> + <xs:element name="SectionInterpolee-ref" type="SectionIncluseBranche"/> + <xs:element name="SectionProfil-ref" type="SectionIncluseBranche"/> + <xs:element name="SectionSansGeometrie-ref" type="SectionIncluseBranche"/> + <xs:element name="SectionPilote-ref" type="SectionIncluseBranche"/> </xs:choice> </xs:complexType> @@ -75,7 +77,9 @@ <xs:sequence> <xs:element name="Active" type="xs:boolean"/> <xs:element name="Noeud" type="Reference"/> - <xs:element name="Profil" type="Reference"/> + <xs:choice minOccurs="1" maxOccurs="unbounded"> + <xs:element name="Profil" type="Reference"/> + </xs:choice> </xs:sequence> <xs:attribute name="Nom" type="xs:string"/> </xs:complexType> @@ -98,23 +102,27 @@ <!-- Gestion des SECTIONS --> <xs:complexType name="Section"> - <xs:attribute name="Nom" type="xs:string"/> + <xs:attribute name="Nom" type="xs:string"/> </xs:complexType> <xs:complexType name="SectionProfil"> <xs:sequence> + <xs:choice minOccurs="1" maxOccurs="unbounded"> <xs:element name="Profil" type="Reference"/> + </xs:choice> </xs:sequence> <xs:attribute name="Nom" type="xs:string"/> </xs:complexType> <xs:complexType name="Sections"> <xs:choice minOccurs="1" maxOccurs="unbounded"> - <xs:element name="SectionIdem-ref" type="Section"/> - <xs:element name="SectionInterpolee-ref" type="Section"/> - <xs:element name="SectionProfil-ref" type="Section"/> - <xs:element name="SectionSansGeometrie-ref" type="Section"/> - <xs:element name="SectionPilote-ref" type="Section"/> + <xs:element name="SectionIdem" type="Section"/> + <xs:element name="SectionInterpolee" type="Section"/> + <xs:element name="SectionProfil" type="SectionProfil"/> + <xs:element name="SectionSansGeometrie" type="Section"/> + <xs:element name="SectionPilote" type="Section"/> + + </xs:choice> </xs:complexType> @@ -134,9 +142,9 @@ <xs:element name="VersionCrue" type="xs:string"/> <xs:element name="Commentaire" type="xs:string"/> <xs:element name="Noeuds" type="Noeuds"/> - <xs:element name="Branches" type="Branches"/> <xs:element name="Casiers" type="Casiers"/> <xs:element name="Sections" type="Sections"/> + <xs:element name="Branches" type="Branches"/> </xs:choice> </xs:complexType> </xs:element> Deleted: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDSCP.xsd =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDSCP.xsd 2009-03-12 19:44:37 UTC (rev 4528) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDSCP.xsd 2009-03-12 19:45:15 UTC (rev 4529) @@ -1,145 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - - - - - <xs:complexType name="BrancheClassique"> - <xs:sequence> - <xs:element name="CoefBeta" type="xs:double"/> - <xs:element name="CoefRuisQdm" type="xs:double"/> - <xs:element name="CoefRuis" type="xs:double"/> - <xs:element name="Sections" type="Sections"/> - </xs:sequence> - <xs:attribute name="NomRef" type="xs:string"/> - </xs:complexType> - - <xs:complexType name="BranchePDC"> - <xs:sequence> - <xs:element name="Loi" type="xs:string"/> - </xs:sequence> - <xs:attribute name="NomRef" type="xs:string"/> - </xs:complexType> - - <xs:complexType name="BrancheOrifice"> - <xs:sequence> - <xs:choice minOccurs="0" maxOccurs="1"> - <xs:element name="FormulePdc" type="xs:string"/> - </xs:choice> - <xs:choice minOccurs="1" maxOccurs="unbounded"> - <xs:element name="ElemOrifice" type="ElemOrifice"/> - </xs:choice> - </xs:sequence> - <xs:attribute name="NomRef" type="xs:string"/> - </xs:complexType> - - - <xs:complexType name="BrancheSeuil"> - <xs:sequence> - <xs:choice minOccurs="0" maxOccurs="1"> - <xs:element name="FormulePdc" type="xs:string"/> - </xs:choice> - <xs:choice minOccurs="1" maxOccurs="unbounded"> - <xs:element name="ElemSeuilPdc" type="ElemSeuilPDC"/> - </xs:choice> - </xs:sequence> - <xs:attribute name="NomRef" type="xs:string"/> - </xs:complexType> - - <xs:complexType name="BrancheBarrageFilEau"> - <xs:sequence> - <xs:element name="Loi" type="xs:string"/> - <xs:element name="QLimInf" type="xs:double"/> - <xs:element name="QLimSup" type="xs:double"/> - - <xs:choice minOccurs="1" maxOccurs="unbounded"> - <xs:element name="ElemSeuil" type="ElemSeuil"/> - </xs:choice> - </xs:sequence> - <xs:attribute name="NomRef" type="xs:string"/> - </xs:complexType> - - - <xs:complexType name="Branches"> - <xs:choice minOccurs="1" maxOccurs="unbounded"> - <xs:element name="BrancheSaintVenant" type="BrancheClassique"/> - <xs:element name="BrancheSeuilTransversal" type="BrancheSeuil"/> - <xs:element name="BrancheSeuilLateral" type="BrancheSeuil"/> - <!--<xs:element name="BrancheStrickler" type="BrancheClassique"/>--> - <xs:element name="BrancheOrifice" type="BrancheOrifice"/> - <xs:element name="BrancheBarrageFilEau" type="BrancheBarrageFilEau"/> - <xs:element name="BranchePdc" type="BranchePDC"/> - <xs:element name="BrancheBarrageGenerique" type="BrancheBarrageFilEau"/> - <!--<xs:element name="BrancheBarrageRhone" type="BrancheClassique"/>--> - <!--<xs:element name="BrancheEnchainement" type="BrancheClassique"/>--> - <!--<xs:element name="BrancheNiveauxAssocies" type="BrancheClassique"/>--> - - </xs:choice> - </xs:complexType> - - - <!-- ELEMENT ORIFICE --> - <xs:complexType name="ElemOrifice"> - <xs:sequence> - <xs:element name="CoefCtrLim" type="xs:double"/> - <xs:element name="Larg" type="xs:double"/> - <xs:element name="Zseuil" type="xs:double"/> - <xs:element name="Haut" type="xs:double"/> - <xs:element name="CoefD" type="xs:double"/> - <xs:element name="Sens" type="xs:string"/> - </xs:sequence> - - </xs:complexType> - - <!-- ELEMENT SEUILS --> - <xs:complexType name="ElemSeuilPDC"> - <xs:sequence> - <xs:element name="Larg" type="xs:double"/> - <xs:element name="Zseuil" type="xs:double"/> - <xs:element name="CoefD" type="xs:double"/> - <xs:element name="CoefPdc" type="xs:double"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="ElemSeuil"> - <xs:sequence> - <xs:element name="Larg" type="xs:double"/> - <xs:element name="Zseuil" type="xs:double"/> - <xs:element name="CoefD" type="xs:double"/> - </xs:sequence> - </xs:complexType> - - - <!-- section --> - <xs:complexType name="Section"> - <xs:sequence> - <xs:element name="CoefPond" type="xs:double"/> - <xs:element name="CoefConv" type="xs:double"/> - <xs:element name="CoefDiv" type="xs:double"/> - </xs:sequence> - <xs:attribute name="NomRef" type="xs:string"/> - </xs:complexType> - - <xs:complexType name="Sections"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="SectionIdem" type="Section"/> - <xs:element name="SectionInterpolee" type="Section"/> - <xs:element name="SectionProfil" type="Section"/> - <xs:element name="SectionSansGeometrie" type="Section"/> - <xs:element name="SectionPilote" type="Section"/> - </xs:choice> - </xs:complexType> - - - <xs:element name="DSCP" > - <xs:complexType> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="VersionCrue" type="xs:string"/> - <xs:element name="Commentaire" type="xs:string"/> - <xs:element name="Branches" type="Branches"/> - </xs:choice> - </xs:complexType> - </xs:element> - - - </xs:schema> Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideOPTG.xsd =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideOPTG.xsd (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideOPTG.xsd 2009-03-12 19:45:15 UTC (rev 4529) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="OPTG"> + <xs:complexType> + <xs:sequence> + <xs:element name="VersionCrue" type="xs:string" /> + <xs:element name="Commentaire" type="xs:string" /> + <xs:element name="RegleProfPlat" type="xs:double" /> + <xs:element name="ReglePenteRupture" type="xs:double" /> + <xs:element name="RegleDecal" type="xs:double" /> + <xs:element name="RegleLargSeuil" type="xs:double" /> + <xs:element name="ReglePdxMax" type="xs:double" /> + <xs:element name="RegleVarPdxMax" type="xs:double" /> + <xs:element name="ReglePenteMax" type="xs:double" /> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema> \ 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-03-12 19:44:43
|
Revision: 4528 http://fudaa.svn.sourceforge.net/fudaa/?rev=4528&view=rev Author: hadouxad Date: 2009-03-12 19:44:37 +0000 (Thu, 12 Mar 2009) Log Message: ----------- - Refonte DRSO - Debut DPTG Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue10writer.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue9writer.java Deleted: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue10writer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue10writer.java 2009-03-12 19:44:16 UTC (rev 4527) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue10writer.java 2009-03-12 19:44:37 UTC (rev 4528) @@ -1,91 +0,0 @@ -package main.java.org.fudaa.dodico.crue.writer; - -import java.io.File; -import java.util.List; - -import main.java.org.fudaa.dodico.crue.dao.CrueDaoDFRT; -import main.java.org.fudaa.dodico.crue.dao.CrueDaoDPTI; -import main.java.org.fudaa.dodico.crue.dao.CrueDaoDRSO; -import main.java.org.fudaa.dodico.crue.dao.CrueDaoDSCP; -import main.java.org.fudaa.dodico.crue.metier.emh.DonFrt; -import main.java.org.fudaa.dodico.crue.metier.emh.EMH; - -/** - * Writer qui g\xE8re l'io vers le format crue 10. - * - * Utilise du parsing xml - * @author Adrien Hadoux - * - */ -public class Crue10writer { - - /** - * Ecrit le fichier xml \xE0 l'emplacement fichierDRSO - * DRSO - Fichier des donn\xE9es du r\xE9seau (xml) - * a partir des donn\xE9es m\xE9tiers fournies. - */ - public static boolean writeDRSOFile(List<EMH> data, File fichierDRSO,List<String> listeMessageError){ - CrueDaoDRSO dataPersistante=new CrueDaoDRSO(); - //-- remplissage des donnees persistantes avec les data --// - dataPersistante.fillInfosWith(data,listeMessageError); - return dataPersistante.persistData(fichierDRSO,listeMessageError); - } - - - /** - * Ecrit le fichier xml \xE0 l'emplacement fichierDDPTI - * DPTI - Le fichier DPTI d\xE9crit les conditions initiales - * a partir des donn\xE9es m\xE9tiers fournies. - */ - public static boolean writeDPTIFile(List<EMH> data, File fichierDPTI,List<String> listeMessageError){ - CrueDaoDPTI dataPersistante=new CrueDaoDPTI(); - //-- remplissage des donnees persistantes avec les data --// - dataPersistante.fillInfosWith(data,listeMessageError); - return dataPersistante.persistData(fichierDPTI,listeMessageError); - } - - - /** - * Ecrit le fichier xml \xE0 l'emplacement fichierDDPTI - * DSCP - Le fichier DSCP d\xE9crit les variables de calcul pour les branches - * a partir des donn\xE9es m\xE9tiers fournies. - */ - public static boolean writeDSCPFile(List<EMH> data, File fichierDSCP,List<String> listeMessageError){ - CrueDaoDSCP dataPersistante=new CrueDaoDSCP(); - //-- remplissage des donnees persistantes avec les data --// - dataPersistante.fillInfosWith(data,listeMessageError); - return dataPersistante.persistData(fichierDSCP,listeMessageError); - } - - /** - * Ecrit le fichier xml \xE0 l'emplacement fichierDRSO - * DFRT - Fichier des frottements (xml) - * a partir des donn\xE9es m\xE9tiers fournies. - */ - public static boolean writeDFRTFile(List<DonFrt> data, File fichierDFRT,List<String> listeMessageError){ - CrueDaoDFRT dataPersistante=new CrueDaoDFRT(); - //-- remplissage des donnees persistantes avec les data --// - dataPersistante.fillInfosWith(data,listeMessageError); - return dataPersistante.persistData(fichierDFRT,listeMessageError); - } - - - - /** - * Methode qui \xE9crit l'ensemble du projet au format crue. - * TODO: adrien: il faut mettre en param d'entr\xE9e un emhScenario qui contient les noms de tous les fichiers. - * @return - */ - public static boolean writeProjetCrue10(){ - boolean ok=false; - //TODO faire la methode. - - - - - return ok; - } - - - -} Deleted: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue9writer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue9writer.java 2009-03-12 19:44:16 UTC (rev 4527) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue9writer.java 2009-03-12 19:44:37 UTC (rev 4528) @@ -1,11 +0,0 @@ -package main.java.org.fudaa.dodico.crue.writer; - -/** - * writer qui permet d'\xE9crier les structures de crue 09 dans les fichiers appropri\xE9s. - * Utilise fortran writer - * @author Adrien Hadoux - * - */ -public class Crue9writer { - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-03-12 19:44:17
|
Revision: 4527 http://fudaa.svn.sourceforge.net/fudaa/?rev=4527&view=rev Author: hadouxad Date: 2009-03-12 19:44:16 +0000 (Thu, 12 Mar 2009) Log Message: ----------- - Refonte DRSO - Debut DPTG Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Modifications-Obligatoires.txt Copied: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Modifications-Obligatoires.txt (from rev 4525, branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Modifications-Obligatoires.txt) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Modifications-Obligatoires.txt (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Modifications-Obligatoires.txt 2009-03-12 19:44:16 UTC (rev 4527) @@ -0,0 +1,20 @@ +-- Modifications mod\xE9lisations \xE0 soumettre au CNR -- + +- G\xE9n\xE9ral: Important R\xE8gle \xE0 appliquer pour tous les fichiers xml + - Il faut appliquer les 2 r\xE8gles suivantes: + - le nom de balise < > doit \xEAtre unique par fichier. + - pour les occurences d'une m\xEAme balise: suffixer les autres balises r\xE9f\xE9rences par <balise-ref>. + + exemple: fichier DRSO: + les balises sections sont pr\xE9sentes \xE0 la fois a l'int\xE9rieur de <Sections> et de <Branches> avec les m\xEAmes noms. + puisque dans la partie section <Sections> les balises sont des r\xE9f\xE9rences, elles seront suffix\xE9es en + <SectionProfil-ref> <SectionInterpolee-ref> ... + +- Fichier DRSO: + cf exemple ci dessus. + +- Fichier DSCP + + - balise <BrancheSeuilTransversal> et <BrancheSeuilLateral> contiennent des \xE9l\xE9ments <ElemSeuilPdc> au lieu de <ElemSeuil> + car ce sont les balises <BrancheBarrageFilEau> qui contiennent des \xE9l\xE9ments <ElemSeuil> (sans pdc) + En effet avant la contrainte d'unicit\xE9 n'est pas appliqu\xE9e. \ No newline at end of file Property changes on: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Modifications-Obligatoires.txt ___________________________________________________________________ Added: svn:mergeinfo + Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-12 16:15:41 UTC (rev 4526) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-12 19:44:16 UTC (rev 4527) @@ -27,9 +27,9 @@ sinon la balise <Sections> est facultative? - Fichier OPTG: + - Il n'existe pas de structure DonPrtReseau dans le modele Power AMC alors qu'il est sp\xE9cifi\xE9 dans le dictionnaire de donn\xE9es - - Fichier DFRT: - pas de problemes @@ -39,15 +39,44 @@ exemple: <NoeudNiveauContinu NomRef="DRSO#N1"> indique que le noeud fait r\xE9f\xE9rence au noeud du nom N1 du fichier DRSO. Est ce que cette r\xE8gle est g\xE9n\xE9rale? c'est \xE0 dire que tous les objets de dpti sont des r\xE9f\xE9rences de drso et qu'ils ont toujours le mot clef DRSO# devant ? + - Peut il y avoir plusieurs donn\xE9es DPTI d\xE9clar\xE9s pour un m\xEAme \xE9l\xE9ment DRSO ? - Balises <Branches>,fichier modele3.dpti.xml: la balise <BrancheOrifice> contient la balise <OuvPasseDessous> de plus que les autres types de branches. Est-ce bien la seule \xE0 poss\xE9der ce type de balise ou toutes peuvent les poss\xE9der? y'a t'il d'autres cas particuliers comme celui-ci pour les branches ? - Balises <Sections>, fichier modele3.dpti.xml: les sections sont vides. Est ce normal ou cas particulier? Si non Quelles donn\xE9es fournit-on pour les sections dans le fichier dpti (pas d'autres fichier dpti exemples pour les mod\xE8les 4 et 5.) + - Balises <Casiers>, il n'existe pas de structures EMH m\xE9tier pour les profil : pas d'objet DonPrtClInit d\xE9di\xE9. Utilise t-on un objet DonPrtCInitBranche qui contient un parametre Qinit ? - - Fichier DSCP: - Contenu des balises <branche>: - Seules les balises <BrancheOrifice> contiennent des \xE9l\xE9ments <ElemOrifice> ? <BrancheOrifice> peuvent-elles contenir des balises <sections> ? - Seules les balises <BrancheSeuilLateral> et <BrancheSeuilTransversal> contiennent des \xE9l\xE9ments <ElemSeuil> et pr\xE9c\xE9d\xE9 de <FormulePdc>? <BrancheSeuilLateral> et <BrancheSeuilTransversal> peuvent-elles contenir des balises <sections> ? - Pour les balises <BranchesBarrageFilEau> et <BranchePDC>:Peut on avoir un exemple ? Comment persister l'objet loi (r\xE9f\xE9rence, loi compl\xE8te ?) ? - - Pour les balises <BrancheStrickler> et <BrancheBarrageRhone>, sont elles autoris\xE9es dans DSCP ?Dans ce cas quelle est leur structure DSCP car il n'y a pas de donn\xE9es DonCalcSansPrt pour ces branches... \ No newline at end of file + - Pour les balises <BrancheStrickler> et <BrancheBarrageRhone>, sont elles autoris\xE9es dans DSCP ?Dans ce cas quelle est leur structure DSCP car il n'y a pas de donn\xE9es DonCalcSansPrt pour ces branches... + - Peut il y avoir plusieurs donn\xE9es DSCP d\xE9clar\xE9s pour un m\xEAme \xE9l\xE9ment DRSO ? + +- Fichier DPTG: + - Dans l'exemple, pour la balise <PROFILS>il n 'y a pas de r\xE9f\xE9rences aux cat\xE9gories EMH (pour <Sections> et <Branches> il y en a ). Comment relier les objets DonPrtGeo aux objets EMH ? car les objets DonPrtGeo sont de type infoEMH. + - A confirmer: + - Balise <Profils>: ne peut contenir que des balises <ProfilCasier> et <ProfilSection> + - Balise <Sections>:ne peut contenir que des balises <SectionIdem> + - Balise <Branches>:ne peut contenir que des balises <BrancheSaintVenant> + - Balise <Profils>: Est ce qu'un m\xEAme objet profil peut \xEAtre r\xE9f\xE9renc\xE9 dans plusieurs objets EMH du fichier DRSO ? + exemple: nomProfil="toto" pr\xE9sent \xE0 la fois dans 2 sectionProfils du fichier DRSO ? + + + +- Fichier OCAL: pourrait-on avoir un exemple de fichier OCAL ? + +- Fichier PCAL: pourrait-on avoir un exemple de fichier PCAL ? + +- Fichier RCAL: pourrait-on avoir un exemple de fichier RCAL ? + +- Fichier RPTG: pourrait-on avoir un exemple de fichier RPTG ? + +- Fichier ORES: pourrait-on avoir un exemple de fichier ORES ? + +- Fichier PNUM: Il n'existe pas encore de mod\xE9lisation PAMC pour les objets li\xE9s. Que faire? + +- Fichier DCLM: n'existe pas encore de mod\xE9lisation PAMC pour les objets li\xE9s (objet DonClimM vide). Que faire? + +- Fichier DLHY: il n'est pas d\xE9fini dans le dictionnaire de donn\xE9es This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fa...@us...> - 2009-03-12 16:16:04
|
Revision: 4526 http://fudaa.svn.sourceforge.net/fudaa/?rev=4526&view=rev Author: fargeix Date: 2009-03-12 16:15:41 +0000 (Thu, 12 Mar 2009) Log Message: ----------- Modifications diverses Refonde Modified Paths: -------------- trunk/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BCalqueLegende.java trunk/fudaa_devel/ebli/src/org/fudaa/ebli/controle/BSelecteurAncre.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/astuces.txt trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeFilleCalques.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeFillePost.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeImplementation.java trunk/fudaa_devel/fudaa-distrib/refonde/izpack/izpack_fudaa_refonde.xml Modified: trunk/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BCalqueLegende.java =================================================================== --- trunk/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BCalqueLegende.java 2009-03-10 18:01:18 UTC (rev 4525) +++ trunk/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BCalqueLegende.java 2009-03-12 16:15:41 UTC (rev 4526) @@ -106,6 +106,16 @@ c_.anchor = GridBagConstraints.NORTHWEST; } else if (ancre_ == BSelecteurAncre.UP_RIGHT) { c_.anchor = GridBagConstraints.NORTHEAST; + } else if (ancre_ == BSelecteurAncre.UP_CENTRE) { + c_.anchor = GridBagConstraints.NORTH; + } else if (ancre_ == BSelecteurAncre.BOT_CENTRE) { + c_.anchor = GridBagConstraints.SOUTH; + } else if (ancre_ == BSelecteurAncre.MID_LEFT) { + c_.anchor = GridBagConstraints.WEST; + } else if (ancre_ == BSelecteurAncre.MID_RIGHT) { + c_.anchor = GridBagConstraints.EAST; + } else if (ancre_ == BSelecteurAncre.MID_CENTRE) { + c_.anchor = GridBagConstraints.CENTER; } add(pnLegendes_, c_); } Modified: trunk/fudaa_devel/ebli/src/org/fudaa/ebli/controle/BSelecteurAncre.java =================================================================== --- trunk/fudaa_devel/ebli/src/org/fudaa/ebli/controle/BSelecteurAncre.java 2009-03-10 18:01:18 UTC (rev 4525) +++ trunk/fudaa_devel/ebli/src/org/fudaa/ebli/controle/BSelecteurAncre.java 2009-03-12 16:15:41 UTC (rev 4526) @@ -45,7 +45,7 @@ int ancre_; public BSelecteurAncre() { - this(BOT_LEFT); + this(UP_RIGHT); } public static boolean isAncreBottom(final int _i) { @@ -123,7 +123,7 @@ ancre_ = BOT_CENTRE; } else if ((_x >= 0) && (_x < 17) && (_y >= 17) && (_y <= 34)) { ancre_ = MID_LEFT; - } else if ((_x > 34) && (_x < 52) && (_y >= 34) && (_y < 52)) { + } else if ((_x > 34) && (_x < 52) && (_y >= 17) && (_y <= 34)) { ancre_ = MID_RIGHT; } repaint(); Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/astuces.txt =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/astuces.txt 2009-03-10 18:01:18 UTC (rev 4525) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/astuces.txt 2009-03-12 16:15:41 UTC (rev 4526) @@ -1,3 +1,3 @@ CTRL+Q est le raccourci pour sortir de l'application. -ALT+F2 pour obtenir les pr\xE9f\xE9rences. +ALT+F2 pour obtenir les preferences. Dans Edition/Preferences, vous pouvez personnaliser votre bureau. Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeFilleCalques.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeFilleCalques.java 2009-03-10 18:01:18 UTC (rev 4525) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeFilleCalques.java 2009-03-12 16:15:41 UTC (rev 4526) @@ -86,6 +86,8 @@ */ public RefondeFilleCalques(BuCommonInterface _app, BArbreCalque _ac) { super(null, _app); + this.setClosable(false); + this.setTitle("Fen\xEAtre principale"); addInternalFrameListener(_ac); app_= _app; BCalque cqRoot= getVueCalque().getCalque(); Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeFillePost.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeFillePost.java 2009-03-10 18:01:18 UTC (rev 4525) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeFillePost.java 2009-03-12 16:15:41 UTC (rev 4526) @@ -48,7 +48,8 @@ * @author Bertrand Marchand */ public class RefondeFillePost - extends EbliFilleCalques { + extends EbliFilleCalques + implements PropertyChangeListener { /** Num\xE9ro de fen\xE8tre, incr\xE9ment\xE9 \xE0 chaque cr\xE9ation. Ce num\xE9ro ne sert que dans la liste de fen\xE8tres, pour les diff\xE9rentier. */ @@ -111,7 +112,8 @@ // cqRoot.add(cqDesI); // Tools sp\xE9cifiques de la fen\xEAtre CalqueGuiHelper.CALQUE_OUTILS.addPropertyChangeListener( - getArbreCalqueModel()); + getArbreCalqueModel());//_ac.getArbreModel()); + CalqueGuiHelper.CALQUE_OUTILS.addPropertyChangeListener(this); buildTools(); getVueCalque().setBackground(Color.white); setTitle("Fen\xEAtre post " + (++numero_)); @@ -457,4 +459,10 @@ // for (int i=0; i<btTools_.length; i++) btTools_[i].setEnabled(false); // for (int i=0; i<cps.length; i++) cps[i].setEnabled(true); // } + + public void propertyChange(PropertyChangeEvent _evt) { + if (_evt.getPropertyName().equals("ancre")) { + cqLeg_.setAncre(((Integer)_evt.getNewValue()).intValue()); + } + } } Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeImplementation.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeImplementation.java 2009-03-10 18:01:18 UTC (rev 4525) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/refonde/RefondeImplementation.java 2009-03-12 16:15:41 UTC (rev 4526) @@ -89,8 +89,8 @@ new BuInformationsSoftware(); static { isRefonde_.name= "Refonde"; - isRefonde_.version= "5.15f-beta3"; - isRefonde_.date= "18-Fev-2009"; + isRefonde_.version= "5.15f-beta6"; + isRefonde_.date= "12-Mar-2009"; isRefonde_.rights= "1998-2000 GHN & CETMEF\n2000-2005 DeltaCAD & CETMEF"; isRefonde_.contact= "pie...@de..."; isRefonde_.license= "GPL2"; @@ -475,28 +475,40 @@ //------------------------------------------------------------------------------ public void actionPerformed(ActionEvent _evt) { String action= _evt.getActionCommand(); - if (action.equals("CREERPROJET")) + if (action.equals("CREERPROJET")) { cmdNouveauProjet(); - else if (action.equals("OUVRIRPROJET")) + return; + } + else if (action.equals("OUVRIRPROJET")) { cmdOuvrirProjet(); + return; + } else if (action.equals("OUVRIRFICHIERS")) cmdOuvrirFichiers(); - else if (action.equals("ENREGISTRERPROJET")) + else if (action.equals("ENREGISTRERPROJET")) { cmdEnregistrerProjet(); - else if (action.equals("ENREGISTRERPROJETSOUS")) + return; + } + else if (action.equals("ENREGISTRERPROJETSOUS")) { cmdEnregistrerProjetSous(); + return; + } else if (action.equals("ENREGISTRERFICHIERS")) cmdEnregistrerFichiers(); - else if (action.equals("FERMER")) + else if (action.equals("FERMER")) { cmdFermerProjet(); + return; + } else if (action.equals("PROPRIETESPROJET")) cmdProprietesProjet(); else if (action.equals("PROPRIETESBORD")) cmdProprietesBord(); else if (action.equals("PROPRIETESFOND")) cmdProprietesFond(); - else if (action.equals("MAILLER")) + else if (action.equals("MAILLER")) { cmdMailler(); + return; + } else if (action.equals("SUPPRIMERMAILLAGE")) cmdSupprimerMaillage(); else if (action.equals("CALCULERANGLES")) @@ -509,10 +521,15 @@ cmdModifierAngSup(); else if (action.equals("PARAMETRESCALCUL")) cmdParametresCalcul(); - else if (action.equals("CALCULER")) + else if (action.equals("CALCULER")) { cmdExecuterRefonde(); + return; + } else if (action.equals("REPRENDRECALCUL")) + { cmdReprendreCalcul(); + return; + } else if (action.equals("AFFICHERTRACEEXE")) cmdAfficherTraceExe(SERVEUR_REFONDE); else if (action.equals("PREFERENCE")) @@ -523,12 +540,18 @@ cmdVoirNumElements(((AbstractButton)_evt.getSource()).isSelected()); else if (action.equals("VUE3D")) cmdVue3D(); - else if (action.equals("EXPORTERREFONDECALCUL")) + else if (action.equals("EXPORTERREFONDECALCUL")) { cmdExporterRefondeCalcul(); - else if (action.equals("EXPORTERMAILLAGE")) + return; + } + else if (action.equals("EXPORTERMAILLAGE")) { cmdExporterPostfluxMaillage(); - else if (action.equals("IMPORTERMAILLAGE")) + return; + } + else if (action.equals("IMPORTERMAILLAGE")) { cmdImporterMaillage(); + return; + } else if (action.equals("CREERDIGUE")) cmdCreerDigue(); else if (action.equals("SUPPRIMERDIGUE")) @@ -552,8 +575,10 @@ cmdRecentrerNoeud(); else if (action.equals("RECENTRERELEMENT")) cmdRecentrerElement(); - else if (action.startsWith("REOUVRIR")) + else if (action.startsWith("REOUVRIR")) { cmdReouvrir(action); + return; + } // else if (action.equals("TESTER" )) cmdTester(); // else if (action.equals("TESTER2" )) cmdTester2(); else if ( @@ -632,8 +657,8 @@ if (save) oprEnregistrerProjet(); // Nettoyage du desktop + clearDeskTop(); removeInternalFrame(fnCalques_); - clearDeskTop(); projet= null; // Selection de la g\xE9om\xE9trie \xE0 ouvrir RefondeDialogPanneau di; @@ -792,8 +817,8 @@ oprEnregistrerProjet(); // Nettoyage du desktop + clearDeskTop(); removeInternalFrame(fnCalques_); - clearDeskTop(); projet= null; oprOuvrirProjet(fichier); @@ -835,8 +860,8 @@ if (save) oprEnregistrerProjet(); // Nettoyage du desktop + clearDeskTop(); removeInternalFrame(fnCalques_); - clearDeskTop(); projet= null; // Selection du projet \xE0 ouvrir if (diProjet_ == null) { @@ -901,12 +926,12 @@ // setEnabledForAction("RECENTRERNOEUD" ,false); // setEnabledForAction("RECENTRERELEMENT" ,false); // setEnabledForAction("FERMER" ,false); - clearDeskTop(); + // clearDeskTop(); projet= new RefondeProjet(); projet.addMessageListener(this); projet.ouvrir(_fichier); // projet=RefondeProjet.ouvrir(fichier); - fnCalques_.initialise(projet); + fnCalques_.initialise(projet); // Blocage \xE0 corriger dans l'initialisation des calques addInternalFrame(fnCalques_); fnCalques_.restaurer(); statusBar.setProgression(100); @@ -1188,8 +1213,8 @@ try { if (save) oprEnregistrerProjet(); + clearDeskTop(); removeInternalFrame(fnCalques_); - clearDeskTop(); projet= null; // setEnabledForAction("OUVRIRFICHIERS" ,false); // setEnabledForAction("ENREGISTRERPROJET" ,false); Modified: trunk/fudaa_devel/fudaa-distrib/refonde/izpack/izpack_fudaa_refonde.xml =================================================================== --- trunk/fudaa_devel/fudaa-distrib/refonde/izpack/izpack_fudaa_refonde.xml 2009-03-10 18:01:18 UTC (rev 4525) +++ trunk/fudaa_devel/fudaa-distrib/refonde/izpack/izpack_fudaa_refonde.xml 2009-03-12 16:15:41 UTC (rev 4526) @@ -17,7 +17,7 @@ --> <info> <appname>Fudaa-Refonde</appname> - <appversion>5.15f-beta3</appversion> + <appversion>5.15f-beta6</appversion> <authors> <author name="Bertrand MARCHAND" email="de...@fu..."/> </authors> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-03-10 18:01:29
|
Revision: 4525 http://fudaa.svn.sourceforge.net/fudaa/?rev=4525&view=rev Author: hadouxad Date: 2009-03-10 18:01:18 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Fichier DSCP Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHSection.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrt.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheOrifice.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheSaintVenant.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonCalcSansPrtBrancheSeuilLateral.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheOrifice.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/ElemOrifice.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/Loi.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/reader/Crue10reader.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue10writer.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/AppCrueTest.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestClasse.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDFRTFile.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDPTIFile.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDRSOFile.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Modifications-Obligatoires.txt branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDSCP.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactory.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDSCP.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDRSO.xsd branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDSCP.xsd branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DefaultEMHValues.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/fudaa/crue/CruePersistanceErrorManager.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDSCPFile.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueFactoryDao.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/CruePersistanceErrorManager.java Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-10 17:43:46 UTC (rev 4524) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-10 18:01:18 UTC (rev 4525) @@ -15,6 +15,7 @@ <SectionProfil-ref> <SectionInterpolee-ref> ... + - Les lois, dans quels fichiers sont d\xE9crites les lois ? par exemple dans DSCP, pour les cas Pdc et BarrageFilEau, on a des lois, ou sont-elles d\xE9finies ? ***** FICHIERS XML CRUE 10***** - Fichier DRSO: @@ -41,5 +42,12 @@ - Balises <Branches>,fichier modele3.dpti.xml: la balise <BrancheOrifice> contient la balise <OuvPasseDessous> de plus que les autres types de branches. Est-ce bien la seule \xE0 poss\xE9der ce type de balise ou toutes peuvent les poss\xE9der? y'a t'il d'autres cas particuliers comme celui-ci pour les branches ? - Balises <Sections>, fichier modele3.dpti.xml: les sections sont vides. Est ce normal ou cas particulier? Si non Quelles donn\xE9es fournit-on pour les sections dans le fichier dpti (pas d'autres fichier dpti exemples pour les mod\xE8les 4 et 5.) - - \ No newline at end of file + + +- Fichier DSCP: + + - Contenu des balises <branche>: + - Seules les balises <BrancheOrifice> contiennent des \xE9l\xE9ments <ElemOrifice> ? <BrancheOrifice> peuvent-elles contenir des balises <sections> ? + - Seules les balises <BrancheSeuilLateral> et <BrancheSeuilTransversal> contiennent des \xE9l\xE9ments <ElemSeuil> et pr\xE9c\xE9d\xE9 de <FormulePdc>? <BrancheSeuilLateral> et <BrancheSeuilTransversal> peuvent-elles contenir des balises <sections> ? + - Pour les balises <BranchesBarrageFilEau> et <BranchePDC>:Peut on avoir un exemple ? Comment persister l'objet loi (r\xE9f\xE9rence, loi compl\xE8te ?) ? + - Pour les balises <BrancheStrickler> et <BrancheBarrageRhone>, sont elles autoris\xE9es dans DSCP ?Dans ce cas quelle est leur structure DSCP car il n'y a pas de donn\xE9es DonCalcSansPrt pour ces branches... \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Modifications-Obligatoires.txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Modifications-Obligatoires.txt (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Modifications-Obligatoires.txt 2009-03-10 18:01:18 UTC (rev 4525) @@ -0,0 +1,20 @@ +-- Modifications mod\xE9lisations \xE0 soumettre au CNR -- + +- G\xE9n\xE9ral: Important R\xE8gle \xE0 appliquer pour tous les fichiers xml + - Il faut appliquer les 2 r\xE8gles suivantes: + - le nom de balise < > doit \xEAtre unique par fichier. + - pour les occurences d'une m\xEAme balise: suffixer les autres balises r\xE9f\xE9rences par <balise-ref>. + + exemple: fichier DRSO: + les balises sections sont pr\xE9sentes \xE0 la fois a l'int\xE9rieur de <Sections> et de <Branches> avec les m\xEAmes noms. + puisque dans la partie section <Sections> les balises sont des r\xE9f\xE9rences, elles seront suffix\xE9es en + <SectionProfil-ref> <SectionInterpolee-ref> ... + +- Fichier DRSO: + cf exemple ci dessus. + +- Fichier DSCP + + - balise <BrancheSeuilTransversal> et <BrancheSeuilLateral> contiennent des \xE9l\xE9ments <ElemSeuilPdc> au lieu de <ElemSeuil> + car ce sont les balises <BrancheBarrageFilEau> qui contiennent des \xE9l\xE9ments <ElemSeuil> (sans pdc) + En effet avant la contrainte d'unicit\xE9 n'est pas appliqu\xE9e. \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java 2009-03-10 17:43:46 UTC (rev 4524) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java 2009-03-10 18:01:18 UTC (rev 4525) @@ -29,13 +29,13 @@ public void fillInfosWith(List<DonFrt> data,List<String> listeMessageError) { - listeFrottement=CrueFactoryDao.remplirPersistanceAvecFrottemetnsDFRT(data,listeMessageError); + listeFrottement=CrueDaoFactory.remplirPersistanceAvecFrottemetnsDFRT(data,listeMessageError); } public List<DonFrt> fillInfosWithPersistant(Object data,List<String> listeMessageError) { - return CrueFactoryDao.remplirFrottemetnsAvecPersistanceDFRT(listeFrottement,listeMessageError); + return CrueDaoFactory.remplirFrottemetnsAvecPersistanceDFRT(listeFrottement,listeMessageError); } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java 2009-03-10 17:43:46 UTC (rev 4524) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java 2009-03-10 18:01:18 UTC (rev 4525) @@ -22,12 +22,8 @@ */ public class CrueDaoDPTI extends CrueDaoParsing<List<EMH>>{ + /** - * Suffixe ajout\xE9 aux r\xE9f\xE9rences des objets emh du fichier dpti pour indiquer qu'ils r\xE9f\xE8rent aux objets d\xE9finis dans DRSO. - */ - public static final String SUFFIXE_REF_DRSO="DRSO#"; - - /** * la liste des noeuds */ private List<NoeudNiveauContinu> Noeuds; @@ -52,14 +48,14 @@ public void fillInfosWith(List<EMH> data, List<String> listeMessageError) { // TODO Auto-generated method stub //-- etape 1: on remplit les infso des noeuds --// - Noeuds=CrueFactoryDao.remplirPersistanceAvecNoeudDPTI(data,listeMessageError); + Noeuds=CrueDaoFactory.remplirPersistanceAvecNoeudDPTI(data,listeMessageError); //-- etape 2: on remplit les infso des branches --// - Branches=CrueFactoryDao.remplirPersistanceAvecBrancheDPTI(data,listeMessageError); + Branches=CrueDaoFactory.remplirPersistanceAvecBrancheDPTI(data,listeMessageError); //-- etape 3: on remplit les infso des casiers --// - Casiers=CrueFactoryDao.remplirPersistanceAvecCasierDPTI(data,listeMessageError); + Casiers=CrueDaoFactory.remplirPersistanceAvecCasierDPTI(data,listeMessageError); //-- etape 4: on remplit les infso des sections --// @@ -76,14 +72,14 @@ List<EMH> listeEMHDRSO=(List<EMH> )data; //-- remplissage des noeuds --// - CrueFactoryDao.remplirNoeudAvecPersistanceDPTI(Noeuds,listeEMHDRSO,listeMessageError); + CrueDaoFactory.remplirNoeudAvecPersistanceDPTI(Noeuds,listeEMHDRSO,listeMessageError); //-- remplissage des branches --// - CrueFactoryDao.remplirBrancheAvecPersistanceDPTI(Branches, listeEMHDRSO,listeMessageError); + CrueDaoFactory.remplirBrancheAvecPersistanceDPTI(Branches, listeEMHDRSO,listeMessageError); //-- remplissage des casiers --// - CrueFactoryDao.remplirCasierAvecPersistanceDPTI(Casiers, listeEMHDRSO, listeMessageError); + CrueDaoFactory.remplirCasierAvecPersistanceDPTI(Casiers, listeEMHDRSO, listeMessageError); //-- remplissage des sections --// Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-03-10 17:43:46 UTC (rev 4524) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-03-10 18:01:18 UTC (rev 4525) @@ -17,6 +17,11 @@ */ public class CrueDaoDRSO extends CrueDaoParsing<List<EMH>>{ + /** + * Suffixe ajout\xE9 aux r\xE9f\xE9rences des objets emh du fichier dpti pour indiquer qu'ils r\xE9f\xE8rent aux objets d\xE9finis dans DRSO. + */ + public static final String SUFFIXE_REF_DRSO="DRSO#"; + //-- variables qui correspondent \xE0 celle du fichier xml --// // public String VersionCrue="10"; // public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; @@ -53,18 +58,18 @@ public void fillInfosWith(List<EMH> data,List<String> listeMessageError) { //-- etape 1: on remplit les infso des noeuds --// - Noeuds=CrueFactoryDao.remplirPersistanceAvecNoeudDRSO(data,listeMessageError); + Noeuds=CrueDaoFactory.remplirPersistanceAvecNoeudDRSO(data,listeMessageError); //-- etape 2: on remplit les infso des branches --// - Branches=CrueFactoryDao.remplirPersistanceAvecBrancheDRSO(data,listeMessageError); + Branches=CrueDaoFactory.remplirPersistanceAvecBrancheDRSO(data,listeMessageError); //-- etape 3: on remplit les infso des casiers --// - Casiers=CrueFactoryDao.remplirPersistanceAvecCasierDRSO(data,listeMessageError); + Casiers=CrueDaoFactory.remplirPersistanceAvecCasierDRSO(data,listeMessageError); //-- etape 4: on remplit les infso des sections --// - Sections=CrueFactoryDao.remplirPersistanceAvecSectionsDRSO(data,listeMessageError); + Sections=CrueDaoFactory.remplirPersistanceAvecSectionsDRSO(data,listeMessageError); @@ -77,18 +82,18 @@ List<EMH> listeCompleteEMH=new ArrayList<EMH>(); //-- etape 1: on remplit les infso des noeuds --// - List<EMH> listeNoeuds=CrueFactoryDao.remplirNoeudAvecPersistanceDRSO(Noeuds,listeMessageError); + List<EMH> listeNoeuds=CrueDaoFactory.remplirNoeudAvecPersistanceDRSO(Noeuds,listeMessageError); //-- etape 2: les casiers --// - List<EMH> listeCasiers=CrueFactoryDao.remplirCasierAvecPersistanceDRSO(Casiers, listeNoeuds,listeMessageError); + List<EMH> listeCasiers=CrueDaoFactory.remplirCasierAvecPersistanceDRSO(Casiers, listeNoeuds,listeMessageError); //-- etape 3: les branches et les sections de bransche --// - List<EMH> listeBranches=CrueFactoryDao.remplirBrancheAvecPersistanceDRSO(Branches, listeNoeuds,listeMessageError); + List<EMH> listeBranches=CrueDaoFactory.remplirBrancheAvecPersistanceDRSO(Branches, listeNoeuds,listeMessageError); //-- etape 3: les sections a partir des sections cr\xE9es lors du remplissage des branches --// - List<EMH> listeSections= CrueFactoryDao.remplirSectionsAvecPersistanceDRSO(Sections, listeBranches,listeMessageError); + List<EMH> listeSections= CrueDaoFactory.remplirSectionsAvecPersistanceDRSO(Sections, listeBranches,listeMessageError); Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDSCP.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDSCP.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDSCP.java 2009-03-10 18:01:18 UTC (rev 4525) @@ -0,0 +1,64 @@ +package main.java.org.fudaa.dodico.crue.dao; + +import java.util.ArrayList; +import java.util.List; + + +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract; +import main.java.org.fudaa.dodico.crue.metier.emh.EMH; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; + +/** + * Classe persistante qui reprend la meme structure que le fichier xml + * DSCP - Fichier des donn\xE9es de calcul (xml) + * A persister telle qu'elle. + * @author Adrien Hadoux + * + */ +public class CrueDaoDSCP extends CrueDaoParsing<List<EMH>>{ + + + + + /** + * la liste des branches + */ + private List<BrancheAbstract> Branches; + + + + @Override + public void fillInfosWith(List<EMH> data, List<String> listeMessageError) { + // TODO Auto-generated method stub + //-- etape 1: on remplit les infso des branches --// + Branches=CrueDaoFactory.remplirPersistanceAvecBrancheDSCP(data,listeMessageError); + + } + + @Override + List<EMH> fillInfosWithPersistant(Object data,List<String> listeMessageError) { + + if(data==null || ! (data instanceof List)){ + listeMessageError.add(CrueRessource.getS("Impossible de r\xE9cup\xE9rer les donn\xE9es r\xE9saux (DRSO). Les r\xE9f\xE9rences du fichier DSCP ne pourront etre utilis\xE9es.")); + return null; + } + List<EMH> listeEMHDRSO=(List<EMH> )data; + + + //-- remplissage des branches --// + CrueDaoFactory.remplirBrancheAvecPersistanceDSCP(Branches, listeEMHDRSO,listeMessageError); + + return listeEMHDRSO; + } + + @Override + public XStream initXmlParser() { + XStream xstream = new XStream(new DomDriver()); + //-- init du parser --// + (new DaoStructuresFormatDSCP()).initXmlParserForDSCP(xstream); + return xstream; + } + +} \ No newline at end of file Copied: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactory.java (from rev 4516, branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueFactoryDao.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactory.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFactory.java 2009-03-10 18:01:18 UTC (rev 4525) @@ -0,0 +1,1350 @@ +package main.java.org.fudaa.dodico.crue.dao; + + +import java.util.ArrayList; +import java.util.List; +import org.fudaa.ebli.geometrie.GrPoint; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDRSO.*; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.ElemSeuil; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.ElemSeuilPdc; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.ElemSeuilOrifice; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDFRT.*; +import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHBranche; +import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHCasier; +import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHNoeud; +import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHSection; +import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrt; +import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBarrageFilEau; +import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheOrifice; +import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBranchePDC; +import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSaintVenant; +import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSeuilLateral; +import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtBrancheSeuilTransversal; +import main.java.org.fudaa.dodico.crue.metier.emh.DonCalcSansPrtSection; +import main.java.org.fudaa.dodico.crue.metier.emh.DonFrt; +import main.java.org.fudaa.dodico.crue.metier.emh.EMH; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageFilEau; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageGenerique; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageRhone; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheEnchainement; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheNiveauxAssocies; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheOrifice; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBranchePdc; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSaintVenant; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilLongitudinale; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilTransversal; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheStrickler; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHCasierMNT; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHCasierProfil; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionIdem; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionInterpolee; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionProfil; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionSansGeometrie; +import main.java.org.fudaa.dodico.crue.metier.emh.ElemSeuilAvecPdc; +import main.java.org.fudaa.dodico.crue.metier.emh.Loi; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefC; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefH; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefZ; + +/** + * Factory qui se charge de remplir les structures DAO avec les donn\xE9es m\xE9tier et inversement. + * @author Adrien Hadoux + * + */ +public class CrueDaoFactory { + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la premiere partie du fichier DRSO: les Noeuds. + * @param data + * @return + */ + public static List remplirPersistanceAvecNoeudDRSO(List<EMH> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + if(data==null || data.size()==0){ + listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); + }else + for(EMH emh:data ){ + if(emh instanceof CatEMHNoeud){ + CatEMHNoeud noeud=(CatEMHNoeud) emh; + NoeudNiveauContinu noeudPersist=new NoeudNiveauContinu(); + noeudPersist.Nom=noeud.getNom(); + listePersistante.add(noeudPersist); + } + } + return listePersistante; + } + + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes qui constituent la premiere partie du fichier DRSO: les Noeuds. + * @param data + * @return + */ + public static List<EMH> remplirNoeudAvecPersistanceDRSO(List listePersistants,List<String> listeMessageError ){ + List<EMH> listeEMH=new ArrayList(); + + if(listePersistants==null || listePersistants.size()==0){ + listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); + }else + for(Object persist:listePersistants ){ + if(persist instanceof NoeudNiveauContinu){ + NoeudNiveauContinu noeudPersist=(NoeudNiveauContinu) persist; + CatEMHNoeud noeud=new CatEMHNoeud(noeudPersist.Nom); + listeEMH.add(noeud); + } + } + return listeEMH; + } + + + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la deuxieme partie du fichier DRSO: les Branches. + * @param data + * @return + */ + public static List remplirPersistanceAvecBrancheDRSO(List<EMH> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + if(data==null || data.size()==0){ + listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); + }else + for(EMH emh:data ){ + if(emh instanceof CatEMHBranche){ + CatEMHBranche branche=(CatEMHBranche) emh; + BrancheAbstract branchePersist=null; + if (branche instanceof EMHBrancheBarrageFilEau) { + EMHBrancheBarrageFilEau new_name = (EMHBrancheBarrageFilEau) branche; + branchePersist=new BrancheBarrageFilEau(); + }else if (branche instanceof EMHBrancheBarrageGenerique) { + EMHBrancheBarrageGenerique new_name = (EMHBrancheBarrageGenerique) branche; + branchePersist=new BrancheBarrageGenerique(); + }else if (branche instanceof EMHBrancheBarrageRhone) { + EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; + branchePersist=new BrancheBarrageRhone(); + }else if (branche instanceof EMHBrancheEnchainement) { + EMHBrancheEnchainement new_name = (EMHBrancheEnchainement) branche; + branchePersist=new BrancheEnchainement(); + }else if (branche instanceof EMHBrancheNiveauxAssocies) { + EMHBrancheNiveauxAssocies new_name = (EMHBrancheNiveauxAssocies) branche; + branchePersist=new BrancheNiveauxAssocies(); + }else if (branche instanceof EMHBrancheOrifice) { + EMHBrancheOrifice new_name = (EMHBrancheOrifice) branche; + branchePersist=new BrancheOrifice(); + }else if (branche instanceof EMHBranchePdc) { + EMHBranchePdc new_name = (EMHBranchePdc) branche; + branchePersist=new BranchePdc(); + }else if (branche instanceof EMHBrancheSaintVenant) { + EMHBrancheSaintVenant new_name = (EMHBrancheSaintVenant) branche; + branchePersist=new BrancheSaintVenant(); + }else if (branche instanceof EMHBrancheSeuilLongitudinale) { + EMHBrancheSeuilLongitudinale new_name = (EMHBrancheSeuilLongitudinale) branche; + branchePersist=new BrancheSeuilLateral(); + }else if (branche instanceof EMHBrancheSeuilTransversal) { + EMHBrancheSeuilTransversal new_name = (EMHBrancheSeuilTransversal) branche; + branchePersist=new BrancheSeuilTransversal(); + }else if (branche instanceof EMHBrancheStrickler) { + EMHBrancheStrickler new_name = (EMHBrancheStrickler) branche; + branchePersist=new BrancheStrickler(); + } + + if(branchePersist!=null){ + //-- commun --// + BrancheAbstract br=(BrancheAbstract) branchePersist; + br.Active=branche.isActive(); + br.Nom=branche.getNom(); + if(branche.getNoeudAmont()!=null) + br.NdAm=new NdAm(branche.getNoeudAmont().getNom()); + if(branche.getNoeudAval()!=null) + br.NdAv=new NdAv(branche.getNoeudAval().getNom()); + //-- on remplit les sections persistantes avec celle de la branche --// + br.Sections=CrueDaoFactory.remplirPersistanceAvecSectionsBrancheDRSO(branche.getListeSections(),listeMessageError); + listePersistante.add(br); + } + } + } + return listePersistante; + } + + + public static List<EMH> remplirBrancheAvecPersistanceDRSO(List listePersistante,List<EMH> listeNoeuds,List<String> listeMessageError){ + List<EMH> data=new ArrayList(); + if(listePersistante==null || listePersistante.size()==0){ + listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); + }else + for(Object objet:listePersistante ){ + if(objet instanceof BrancheAbstract){ + CatEMHBranche branche=null; + BrancheAbstract branchePersist=(BrancheAbstract) objet; + String nom=branchePersist.Nom; + if (branchePersist instanceof BrancheBarrageFilEau) { + branche = new EMHBrancheBarrageFilEau(nom); + + }else if (branchePersist instanceof BrancheBarrageGenerique) { + branche = new EMHBrancheBarrageGenerique(nom); + + }else if (branchePersist instanceof BrancheBarrageRhone) { + branche = new EMHBrancheBarrageRhone(nom); + + }else if (branchePersist instanceof BrancheEnchainement) { + branche = new EMHBrancheEnchainement(nom); + + }else if (branchePersist instanceof BrancheNiveauxAssocies) { + branche = new EMHBrancheNiveauxAssocies(nom); + + }else if (branchePersist instanceof BrancheOrifice) { + branche = new EMHBrancheOrifice(nom); + + }else if (branchePersist instanceof BranchePdc) { + branche = new EMHBranchePdc(nom); + + }else if (branchePersist instanceof BrancheSaintVenant) { + branche = new EMHBrancheSaintVenant(nom); + + }else if (branchePersist instanceof BrancheSeuilLateral) { + branche = new EMHBrancheSeuilLongitudinale(nom); + + }else if (branchePersist instanceof BrancheSeuilTransversal) { + branche = new EMHBrancheSeuilTransversal(nom); + + }else if (branchePersist instanceof BrancheStrickler) { + branche = new EMHBrancheStrickler(nom); + + } + + if(branche!=null){ + //-- commun --// + + branche.setActive(branchePersist.Active); + //branche.setNom(branchePersist.Nom); + if(branchePersist.NdAm!=null){ + CatEMHNoeud noeudAmont=CatEMHNoeud.findByReference(branchePersist.NdAm.NomRef, listeNoeuds); + if(noeudAmont!=null) + branche.setNoeudAmont(noeudAmont); + else + listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAm.NomRef)); + }else + listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud amont pour la branche "+branche.getNom())); + if(branchePersist.NdAv!=null){ + CatEMHNoeud noeudAval=CatEMHNoeud.findByReference(branchePersist.NdAv.NomRef, listeNoeuds); + if(noeudAval!=null) + branche.setNoeudAval(noeudAval); + else + listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAv.NomRef)); + }else + listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud aval pour la branche "+branche.getNom())); + + //-- on remplit les sections persistantes avec celle de la branche --// + if(branchePersist.Sections!=null) + branche.setListeSections(CrueDaoFactory.remplirSectionsBrancheAvecPersistanceDRSO(branchePersist.Sections,listeMessageError)); + + + data.add(branche); + } + } + } + return data; + } + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la troisi\xE8me partie du fichier DRSO: les Casier. + * @param data + * @return + */ + public static List remplirPersistanceAvecCasierDRSO(List<EMH> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + for(EMH emh:data ){ + if(emh instanceof CatEMHCasier){ + CatEMHCasier casier=(CatEMHCasier)emh; + CasierAbstract casierPersist=null; + if(casier instanceof EMHCasierMNT){ + casierPersist=new CasierMNT(); + }else if(casier instanceof EMHCasierProfil){ + casierPersist= new CasierProfil(); + EMHCasierProfil casierProfil=(EMHCasierProfil) casier; + + ((CasierProfil)casierPersist).Profil= new ReferenceProfil(); + ((CasierProfil)casierPersist).Profil.NomRef=casierProfil.getNomProfil(); + } + //-- commun --// + if(casierPersist!=null){ + casierPersist.Active=casier.isActive(); + if(casier.getNoeud()!=null) + casierPersist.Noeud=new ReferenceNoeud(casier.getNoeud().getNom()); + casierPersist.Nom=casier.getNom(); + listePersistante.add(casierPersist); + } + + + } + } + + return listePersistante; + } + + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH casier a partir des donn\xE9es persistantes qui constituent a troisi\xE8me partie du fichier DRSO: les Casier. + * @param data + * @return + */ + public static List<EMH> remplirCasierAvecPersistanceDRSO(List listePersistants,List<EMH> listeNoeuds ,List<String> listeMessageError){ + List<EMH> listeEMH=new ArrayList(); + if(listePersistants==null || listePersistants.size()==0){ + listeMessageError.add(CrueRessource.getS("Casiers: la liste est vide.")); + }else + for(Object persist:listePersistants ){ + if(persist instanceof CasierAbstract){ + CasierAbstract casierPersist=(CasierAbstract) persist; + String nom=casierPersist.Nom; + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// + CatEMHCasier casier=null; + + //-- on recherche sa sp\xE9cialisation --// + if(casierPersist instanceof CasierProfil){ + casier=new EMHCasierProfil(nom); + if(((CasierProfil)casierPersist).Profil!=null) + ((EMHCasierProfil)casier).setNomProfil(((CasierProfil)casierPersist).Profil.NomRef); + }else if(casierPersist instanceof CasierMNT){ + casier=new EMHCasierMNT(nom); + } + + //-- commun aux objets --// + if(casier!=null){ + casier.setActive(casierPersist.Active); + if(casierPersist.Noeud!=null){ + String reference=casierPersist.Noeud.NomRef; + + + CatEMHNoeud noeudRef=CatEMHNoeud.findByReference(reference, listeNoeuds); + if(noeudRef!=null) + casier.setNoeud(noeudRef); + else + listeMessageError.add(CrueRessource.getS("Casier: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+reference)); + } else + listeMessageError.add(CrueRessource.getS("Casier: Il n'y a pas de noeud pour le casier "+casier.getNom())); + + listeEMH.add(casier); + } + } + } + return listeEMH; + } + + + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la quatri\xE8me partie du fichier DRSO: les Sections-references. + * @param data + * @return + */ + public static List remplirPersistanceAvecSectionsDRSO(List<EMH> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + for(EMH emh:data ){ + if(emh instanceof CatEMHSection){ + CatEMHSection section=(CatEMHSection)emh; + SectionAbstract sectionPersist=null; + if(section instanceof EMHSectionIdem){ + sectionPersist=new SectionRefIdem(); + }else + if(section instanceof EMHSectionInterpolee){ + sectionPersist=new SectionRefInterpolee(); + }else + if(section instanceof EMHSectionProfil){ + sectionPersist=new SectionRefProfil(); + }else + if(section instanceof EMHSectionSansGeometrie){ + sectionPersist=new SectionRefSansGeometrie(); + } + + //-- commun --// + if(sectionPersist!=null){ + sectionPersist.Nom=section.getNom(); + listePersistante.add(sectionPersist); + } + } + } + return listePersistante; + } + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections de branches a partir des donn\xE9es persistantes qui constituent la partie interne d'une partie Branche du fichier DRSO: les Sections. + * @param data + * @return + */ + public static List<CatEMHSection> remplirSectionsBrancheAvecPersistanceDRSO(List listePersistantsBranches,List<String> listeMessageError){ + List<CatEMHSection> listeEMH=new ArrayList<CatEMHSection>(); + if(listePersistantsBranches==null || listePersistantsBranches.size()==0){ + listeMessageError.add(CrueRessource.getS("Sections Branches: la liste est vide.")); + }else + for(Object persist:listePersistantsBranches ){ + if(persist instanceof SectionBrancheAbstract){ + SectionBrancheAbstract sectionPersist=(SectionBrancheAbstract) persist; + + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// + CatEMHSection section=null; + String nom=sectionPersist.NomRef; + //-- on recherche sa sp\xE9cialisation --// + if(sectionPersist instanceof SectionIdem){ + section=new EMHSectionIdem(nom); + + }else if(sectionPersist instanceof SectionInterpolee){ + section=new EMHSectionInterpolee(nom); + }else if(sectionPersist instanceof SectionProfil){ + section=new EMHSectionProfil(nom); + }else if(sectionPersist instanceof SectionSansGeometrie){ + section=new EMHSectionSansGeometrie(nom); + } + + //-- commun aux objets --// + if(section!=null){ + + if(sectionPersist.Pos!=null) + section.setPosition(sectionPersist.Pos); + section.setXp(sectionPersist.Xp); + listeEMH.add(section); + } + } + } + return listeEMH; + } + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections a partir des donn\xE9es persistantes qui constituent a quatrieme partie du fichier DRSO: les Sections. + * @param data + * @return + */ + public static List<EMH> remplirSectionsAvecPersistanceDRSO(List listePersistantsSection,List<EMH> listeBranches,List<String> listeMessageError){ + List<EMH> listeEMH=new ArrayList<EMH>(); + if(listePersistantsSection==null || listePersistantsSection.size()==0){ + listeMessageError.add(CrueRessource.getS("Sections : la liste est vide.")); + }else + for(Object persist:listePersistantsSection ){ + if(persist instanceof SectionAbstract){ + SectionAbstract sectionPersist=(SectionAbstract) persist; + + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// + CatEMHSection section=null; + String reference=sectionPersist.Nom; + section=CatEMHSection.findByReferenceFromBrancheOrSectionEMH(reference, listeBranches); + + + + if(section!=null) + listeEMH.add(section); + else + listeMessageError.add(CrueRessource.getS("Sections : Impossible de trouver la section de r\xE9f\xE9rence "+reference)); + } + } + return listeEMH; + } + + + /** + * Remplit les don\xE9nes persistantes avec la liste des sections d'une branche. + * Remplit toutes les donn\xE9es associ\xE9es aux sections + * @param data + * @return + */ + public static List remplirPersistanceAvecSectionsBrancheDRSO(List<CatEMHSection> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + for(EMH emh:data ){ + if(emh instanceof CatEMHSection){ + CatEMHSection section=(CatEMHSection)emh; + SectionBrancheAbstract sectionPersist=null; + if(section instanceof EMHSectionIdem){ + sectionPersist=new SectionIdem(); + }else + if(section instanceof EMHSectionInterpolee){ + sectionPersist=new SectionInterpolee(); + }else + if(section instanceof EMHSectionProfil){ + sectionPersist=new SectionProfil(); + }else + if(section instanceof EMHSectionSansGeometrie){ + sectionPersist=new SectionSansGeometrie(); + } + + //-- commun --// + if(sectionPersist!=null){ + sectionPersist.NomRef=section.getNom(); + + sectionPersist.Pos=section.getPosition(); + sectionPersist.Xp=section.getXp(); + + + listePersistante.add(sectionPersist); + } + } + } + return listePersistante; + } + + /** + * remplir le fichier DFRT avec les frottemetns + * @param data + * @return + */ + public static List<StriRefPersist> remplirPersistanceAvecFrottemetnsDFRT(List<DonFrt> data,List<String> listeMessageError){ + List<StriRefPersist> listeFrottement=new ArrayList<StriRefPersist>(); + for(DonFrt frt:data){ + StriRefPersist persist=null; + if(frt instanceof StriRefC) + persist=new StriRefCPersist(frt.getNom()); + else + if(frt instanceof StriRefH) + persist=new StriRefHPersist(frt.getNom()); + else + if(frt instanceof StriRefZ) + persist=new StriRefZPersist(frt.getNom()); + + //-- commun --// + if(persist!=null){ + if(frt.getListePoints()!=null && frt.getListePoints().size()>0){ + persist.listePoints=new ArrayList<StringBuffer>(); + for(GrPoint pt:frt.getListePoints()){ + StringBuffer buff=new StringBuffer(""+pt.x_+" "+pt.y_); + persist.listePoints.add(buff); + } + } + listeFrottement.add(persist); + } + + } + return listeFrottement; + } + + /** + * remplir le fichier DFRT avec les frottemetns + * @param data + * @return + */ + public static List<DonFrt> remplirFrottemetnsAvecPersistanceDFRT(List<StriRefPersist> persistListe,List<String> listeMessageError){ + List<DonFrt> data=new ArrayList<DonFrt>(); + if(persistListe==null || persistListe.size()==0){ + listeMessageError.add(CrueRessource.getS("Frottements : la liste est vide.")); + }else + for(StriRefPersist persist:persistListe){ + DonFrt frt=null; + if(persist instanceof StriRefCPersist) + frt=new StriRefC(persist.Nom); + else + if(persist instanceof StriRefHPersist) + frt=new StriRefH(persist.Nom); + else + if(persist instanceof StriRefZPersist) + frt=new StriRefZ(persist.Nom); + + //-- commun --// + if(persist!=null){ + if(persist.listePoints!=null){ + + List<GrPoint> listePoints=new ArrayList<GrPoint>(); + for(StringBuffer buff:persist.listePoints){ + + int indiceCesure=buff.lastIndexOf(" "); + String val1=buff.substring(0, indiceCesure); + String val2=buff.substring(indiceCesure+1, buff.length()); + double x=0; + try{ + x=Double.parseDouble(val1); + + }catch(NumberFormatException e){ + listeMessageError.add(CrueRessource.getS("Frottement: "+frt.getNom()+": impossible de r\xE9cup\xE9rer le r\xE9el du contenu: "+buff)); + } + double y=0; + try{ + y=Double.parseDouble(val2); + }catch(NumberFormatException e){ + listeMessageError.add(CrueRessource.getS("Frottement: "+frt.getNom()+": impossible de r\xE9cup\xE9rer le r\xE9el du contenu: "+buff)); + } + listePoints.add(new GrPoint(x,y,0)); + + } + + + frt.setListePoints(listePoints); + } + data.add(frt); + } + + } + return data; + } + + + /** + * Remplit les donn\xE9es persistante avec les conditions initiales des noeuds + * @param data + * @param listeMessageError + * @return + */ + public static List remplirPersistanceAvecNoeudDPTI(List<EMH> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + if(data==null || data.size()==0){ + listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); + }else + for(EMH emh:data ){ + if(emh instanceof CatEMHNoeud){ + CatEMHNoeud noeud=(CatEMHNoeud) emh; + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu noeudPersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu(); + noeudPersist.NomRef=CrueDaoDRSO.SUFFIXE_REF_DRSO+noeud.getNom(); + noeudPersist.Zini=noeud.getZini(); + listePersistante.add(noeudPersist); + } + } + return listePersistante; + } + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la deuxieme partie du fichier DRSO: les Branches. + * @param data + * @return + */ + public static List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract> remplirPersistanceAvecBrancheDPTI(List<EMH> data,List<String> listeMessageError){ + String suffixe=CrueDaoDRSO.SUFFIXE_REF_DRSO; + List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract> listePersistante=new ArrayList<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract>(); + if(data==null || data.size()==0){ + listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); + }else + for(EMH emh:data ){ + if(emh instanceof CatEMHBranche){ + CatEMHBranche branche=(CatEMHBranche) emh; + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract branchePersist=null; + if (branche instanceof EMHBrancheBarrageFilEau) { + EMHBrancheBarrageFilEau new_name = (EMHBrancheBarrageFilEau) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheBarrageFilEau(); + }else if (branche instanceof EMHBrancheBarrageGenerique) { + EMHBrancheBarrageGenerique new_name = (EMHBrancheBarrageGenerique) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheBarrageGenerique(); + }else if (branche instanceof EMHBrancheBarrageRhone) { + EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheBarrageRhone(); + }else if (branche instanceof EMHBrancheEnchainement) { + EMHBrancheEnchainement new_name = (EMHBrancheEnchainement) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheEnchainement(); + }else if (branche instanceof EMHBrancheNiveauxAssocies) { + EMHBrancheNiveauxAssocies new_name = (EMHBrancheNiveauxAssocies) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheNiveauxAssocies(); + }else if (branche instanceof EMHBrancheOrifice) { + EMHBrancheOrifice new_name = (EMHBrancheOrifice) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice(); + + (( main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice)branchePersist).OuvPasseDessous=new_name.getOuvPasseDessous(); + + }else if (branche instanceof EMHBranchePdc) { + EMHBranchePdc new_name = (EMHBranchePdc) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BranchePdc(); + }else if (branche instanceof EMHBrancheSaintVenant) { + EMHBrancheSaintVenant new_name = (EMHBrancheSaintVenant) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheSaintVenant(); + }else if (branche instanceof EMHBrancheSeuilLongitudinale) { + EMHBrancheSeuilLongitudinale new_name = (EMHBrancheSeuilLongitudinale) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheSeuilLateral(); + }else if (branche instanceof EMHBrancheSeuilTransversal) { + EMHBrancheSeuilTransversal new_name = (EMHBrancheSeuilTransversal) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheSeuilTransversal(); + }else if (branche instanceof EMHBrancheStrickler) { + EMHBrancheStrickler new_name = (EMHBrancheStrickler) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheStrickler(); + } + + if(branchePersist!=null){ + //-- commun --// + + branchePersist.NomRef=suffixe+branche.getNom(); + + branchePersist.Qini=new Double(branche.getQini()); + branchePersist.Qruis=new Double(branche.getQruis()); + + + listePersistante.add(branchePersist); + } + } + } + return listePersistante; + } + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la troisi\xE8me partie du fichier DRSO: les Casier. + * @param data + * @return + */ + public static List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract> remplirPersistanceAvecCasierDPTI(List<EMH> data,List<String> listeMessageError){ + List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract> listePersistante=new ArrayList<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract>(); + for(EMH emh:data ){ + if(emh instanceof CatEMHCasier){ + CatEMHCasier casier=(CatEMHCasier)emh; + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract casierPersist=null; + if(casier instanceof EMHCasierMNT){ + casierPersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierMNT(); + }else if(casier instanceof EMHCasierProfil){ + casierPersist= new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierProfil(); + } + //-- commun --// + if(casierPersist!=null){ + casierPersist.NomRef=CrueDaoDRSO.SUFFIXE_REF_DRSO+casier.getNom(); + casierPersist.Qruis=casier.getQruis(); + listePersistante.add(casierPersist); + } + } + } + return listePersistante; + } + + /** + * Methode qui met a jour les objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes de DPTI et les pr\xE9chargements de DRSO + * @param data + * @return + */ + public static void remplirNoeudAvecPersistanceDPTI(List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu> listePersistants,List<EMH> data,List<String> listeMessageError ){ + if(listePersistants==null || listePersistants.size()==0){ + listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); + }else + for(Object persist:listePersistants ){ + if(persist instanceof main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu){ + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu noeudPersist=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu) persist; + String reference=noeudPersist.NomRef; + if(reference.contains(CrueDaoDRSO.SUFFIXE_REF_DRSO)){ + reference=reference.replace(CrueDaoDRSO.SUFFIXE_REF_DRSO,""); + } + CatEMHNoeud noeud=CatEMHNoeud.findByReference(reference, data); + if(noeud==null){ + listeMessageError.add(CrueRessource.getS("Noeuds : Impossible de trouver le noeud de r\xE9f\xE9rence "+reference)); + }else{ + noeud.setZini(noeudPersist.Zini); + } + } + } + + } + /** + * Methode qui met a jour les objets m\xE9tier EMH branches a partir des donn\xE9es persistantes de DPTI et les pr\xE9chargements de DRSO + * @param data + * @return + */ + public static void remplirBrancheAvecPersistanceDPTI(List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract> listePersistants,List<EMH> data,List<String> listeMessageError ){ + if(listePersistants==null || listePersistants.size()==0){ + listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); + }else + for(Object persist:listePersistants ){ + if(persist instanceof main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract){ + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract branchePersist=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract) persist; + String reference=branchePersist.NomRef; + if(reference.contains(CrueDaoDRSO.SUFFIXE_REF_DRSO)){ + reference=reference.replace(CrueDaoDRSO.SUFFIXE_REF_DRSO,""); + } + CatEMHBranche branche=CatEMHBranche.findByReference(reference, data); + if(branche==null){ + listeMessageError.add(CrueRessource.getS("Branche : Impossible de trouver la branche de r\xE9f\xE9rence "+reference)); + }else{ + if(branchePersist.Qini!=null) + branche.setQini(branchePersist.Qini); + if(branchePersist.Qruis!=null) + branche.setQruis(branchePersist.Qruis); + + //-- cas particuliers --// + if(branchePersist instanceof main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice){ + EMHBrancheOrifice br=(EMHBrancheOrifice)branche; + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice orif=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheOrifice) branchePersist; + if(orif.OuvPasseDessous!=null) + br.setOuvPasseDessous(orif.OuvPasseDessous); + } + } + } + } + } + + + /** + * Methode qui met a jour les objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes de DPTI et les pr\xE9chargements de DRSO + * @param data + * @return + */ + public static void remplirCasierAvecPersistanceDPTI(List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract> listePersistants,List<EMH> data,List<String> listeMessageError ){ + if(listePersistants==null || listePersistants.size()==0){ + listeMessageError.add(CrueRessource.getS("Casiers: la liste est vide.")); + }else + for(Object persist:listePersistants ){ + if(persist instanceof main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract){ + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract casierPersist=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract) persist; + String reference=casierPersist.NomRef; + if(reference.contains(CrueDaoDRSO.SUFFIXE_REF_DRSO)){ + reference=reference.replace(CrueDaoDRSO.SUFFIXE_REF_DRSO,""); + } + CatEMHCasier casier=CatEMHCasier.findByReference(reference, data); + if(casier==null){ + listeMessageError.add(CrueRessource.getS("Casiers : Impossible de trouver le casier de r\xE9f\xE9rence "+reference)); + }else{ + if(casierPersist.Qruis!=null) + casier.setQruis(casierPersist.Qruis); + } + } + } + + } + + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent le fichier fichier DSCP: les Branches. + * @param data + * @return + */ + public static List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract> remplirPersistanceAvecBrancheDSCP(List<EMH> data,List<String> listeMessageError){ + String suffixe=CrueDaoDRSO.SUFFIXE_REF_DRSO; + List<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract> listePersistante=new ArrayList<main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract>(); + if(data==null || data.size()==0){ + listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); + }else + for(EMH emh:data ){ + if(emh instanceof CatEMHBranche){ + CatEMHBranche branche=(CatEMHBranche) emh; + DonCalcSansPrt dataCalc=null; + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheAbstract branchePersist=null; + if (branche instanceof EMHBrancheBarrageFilEau) { + EMHBrancheBarrageFilEau new_name = (EMHBrancheBarrageFilEau) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageFilEau(); + + //-- recuperation de la donnee de calcul de la branche --// + dataCalc=branche.getDSCP(); + if(dataCalc!=null ){ + + if( dataCalc instanceof DonCalcSansPrtBarrageFilEau){ + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageFilEau br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageFilEau)branchePersist; + + //-- recuperation de la formule --// + if(((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam()!=null) + br.Loi=((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam().getNom(); + br.QLimInf=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimInf(); + br.QLimSup=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimSup(); + //-- on remplit la liste des elements seuils --// + + br.ElemSeuils=remplirPersistanceAvecSeuilsBarragesDSCP(((DonCalcSansPrtBarrageFilEau)dataCalc).getListElt()); + + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche barrage Fil d'eau) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + + }else if (branche instanceof EMHBrancheBarrageGenerique) { + EMHBrancheBarrageGenerique new_name = (EMHBrancheBarrageGenerique) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageGenerique(); + //-- recuperation de la donnee de calcul de la branche --// + dataCalc=branche.getDSCP(); + if(dataCalc!=null ){ + + if( dataCalc instanceof DonCalcSansPrtBarrageFilEau){ + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageGenerique br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageGenerique)branchePersist; + + //-- recuperation de la formule --// + if(((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam()!=null) + br.Loi=((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam().getNom(); + br.QLimInf=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimInf(); + br.QLimSup=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimSup(); + //-- on remplit la liste des elements seuils --// + + br.ElemSeuils=remplirPersistanceAvecSeuilsBarragesDSCP(((DonCalcSansPrtBarrageFilEau)dataCalc).getListElt()); + + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche barrage Generique) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + + }else if (branche instanceof EMHBrancheBarrageRhone) { + EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageRhone(); + //-- recuperation de la donnee de calcul de la branche --// + dataCalc=branche.getDSCP(); + if(dataCalc!=null ){ + + if( dataCalc instanceof DonCalcSansPrtBarrageFilEau){ + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageRhone br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageRhone)branchePersist; + + //-- recuperation de la formule --// + if(((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam()!=null) + br.Loi=((DonCalcSansPrtBarrageFilEau)dataCalc).getRegimeDenove_Zam().getNom(); + br.QLimInf=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimInf(); + br.QLimSup=((DonCalcSansPrtBarrageFilEau)dataCalc).getQLimSup(); + //-- on remplit la liste des elements seuils --// + + br.ElemSeuils=remplirPersistanceAvecSeuilsBarragesDSCP(((DonCalcSansPrtBarrageFilEau)dataCalc).getListElt()); + + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche barrage Rhone) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + + } +// else if (branche instanceof EMHBrancheBarrageRhone) { +// EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; +// branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheBarrageRhone(); +// } +// else if (branche instanceof EMHBrancheEnchainement) { +// EMHBrancheEnchainement new_name = (EMHBrancheEnchainement) branche; +// branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheEnchainement(); +// }else if (branche instanceof EMHBrancheNiveauxAssocies) { +// EMHBrancheNiveauxAssocies new_name = (EMHBrancheNiveauxAssocies) branche; +// branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheNiveauxAssocies(); +// } + else if (branche instanceof EMHBrancheOrifice) { + + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheOrifice(); + + //-- recuperation de la donnee de calcul de la branche --// + dataCalc=branche.getDSCP(); + if(dataCalc!=null ){ + + if( dataCalc instanceof DonCalcSansPrtBrancheOrifice){ + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheOrifice br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheOrifice)branchePersist; + + //-- recuperation de la formule --// + br.FormulePdc=((DonCalcSansPrtBrancheOrifice)dataCalc).getFormulePdc(); + //-- on remplit la liste des elements seuils --// + br.ElemOrifices =remplirPersistanceAvecOrificesSeuilsDSCP(((DonCalcSansPrtBrancheOrifice)dataCalc).getElement()); + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche Orifice) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + + }else if (branche instanceof EMHBranchePdc) { + EMHBranchePdc new_name = (EMHBranchePdc) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BranchePdc(); + + //-- recuperation de la donnee de calcul de la branche --// + dataCalc=branche.getDSCP(); + if(dataCalc!=null ){ + + if( dataCalc instanceof DonCalcSansPrtBranchePDC){ + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BranchePdc br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BranchePdc)branchePersist; + + //-- recuperation de la formule --// + if(((DonCalcSansPrtBranchePDC)dataCalc).getPdc_DZ()!=null) + br.Loi=((DonCalcSansPrtBranchePDC)dataCalc).getPdc_DZ().getNom(); + + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Donnee DSCP incorrecte (attendu. donnees branche seuil Longitudinal) pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + }else{ + listeMessageError.add(CrueRessource.getS("Branche : Aucune donnee DSCP pour l'objet branche de r\xE9f\xE9rence"+branche.getNom())); + } + + + }else if (branche instanceof EMHBrancheSaintVenant) { + EMHBrancheSaintVenant new_name = (EMHBrancheSaintVenant) branche; + branchePersist=new main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheSaintVenant(); + //-- recuperation de la donnee de calcul de la branche --// + dataCalc=branche.getDSCP(); + if(dataCalc!=null ){ + + if( dataCalc instanceof DonCalcSansPrtBrancheSaintVenant){ + main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheClassiqueAbstract br=(main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDSCP.BrancheClassiqueAbstract)branchePersist; + + br... [truncated message content] |
From: <bma...@us...> - 2009-03-10 17:43:57
|
Revision: 4524 http://fudaa.svn.sourceforge.net/fudaa/?rev=4524&view=rev Author: bmarchan Date: 2009-03-10 17:43:46 +0000 (Tue, 10 Mar 2009) Log Message: ----------- On peut gerer des calques sans trac?\195?\169 de surfaces. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCasier.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java 2009-03-10 16:39:34 UTC (rev 4523) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java 2009-03-10 17:43:46 UTC (rev 4524) @@ -632,8 +632,18 @@ return 1; } - public boolean setSurfaceModel(final int _idx, final TraceSurfaceModel _model) { - final TraceSurfaceModel surf = getSurfaceModel(_idx); + public final boolean setSurfaceModel(final int _idx, final TraceSurfaceModel _model) { + TraceSurfaceModel surf = getSurfaceModel(_idx); + if (surf==null && _model==null) + return false; + + if (surf==null || _model==null) { + internalSetSurfaceModel(_idx, _model); + surf=getSurfaceModel(_idx); + firePropertyChange(BSelecteurSurfaceModel.getProperty(_idx), null, surf); + return true; + } + if (_model != null && surf != null && surf.updateData(_model)) { firePropertyChange(BSelecteurSurfaceModel.getProperty(_idx), null, surf); repaint(); @@ -642,6 +652,15 @@ return false; } + /** + * A surcharger pour mettre a jour les modeles de trac\xE9 de surface. + * @param _idx L'indice de modele. + * @param _model Le modele. + */ + protected void internalSetSurfaceModel(final int _idx, final TraceSurfaceModel _model) { + surfModel_=_model; + } + public TraceSurfaceModel getSurfaceModel(final int _idx) { return surfModel_; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCasier.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCasier.java 2009-03-10 16:39:34 UTC (rev 4523) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCasier.java 2009-03-10 17:43:46 UTC (rev 4524) @@ -40,7 +40,7 @@ super(_model,_editor); setIconModel(0, new TraceIconModel(TraceIcon.CARRE_PLEIN, 2, new Color(115,88,34))); setLineModel(0, new TraceLigneModel(TraceLigne.LISSE, 2f, new Color(181,139,54))); - surfModel_=new TraceSurfaceModel(TraceSurface.UNIFORME,new Color(255,230,140),null); + setSurfaceModel(0,new TraceSurfaceModel(TraceSurface.UNIFORME,new Color(255,230,140),Color.WHITE)); setName(getExtName()); setTitle(MdlResource.getS("Contours casiers")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-03-10 16:39:43
|
Revision: 4523 http://fudaa.svn.sourceforge.net/fudaa/?rev=4523&view=rev Author: bmarchan Date: 2009-03-10 16:39:34 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Cr?\195?\169ation calque casiers. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayerFactory.java Added Paths: ----------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCasier.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCasier.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/persistence/MdlLayer2dCasierPersistence.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java 2009-03-10 16:38:40 UTC (rev 4522) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlVisuPanel.java 2009-03-10 16:39:34 UTC (rev 4523) @@ -33,8 +33,10 @@ import org.fudaa.fudaa.modeleur.layer.MdlLayer2dDirectionLine; import org.fudaa.fudaa.modeleur.layer.MdlLayer2dLevel; import org.fudaa.fudaa.modeleur.layer.MdlLayer2dProfile; +import org.fudaa.fudaa.modeleur.layer.MdlLayer2dCasier; import org.fudaa.fudaa.modeleur.layer.MdlLayer2dZone; import org.fudaa.fudaa.modeleur.layer.MdlLayerFactory; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.ressource.FudaaResource; import org.fudaa.fudaa.sig.layer.FSigEditor; import org.fudaa.fudaa.sig.layer.FSigImageImportAction; @@ -58,6 +60,7 @@ BGroupeCalque cqSing_; BGroupeCalque cqMdl1d_; BGroupeCalque cqBiefs_; + BGroupeCalque cqCasiers_; /** * Construction des calques. Une partie est d\xE9j\xE0 construite par d\xE9faut dans les classes @@ -121,6 +124,7 @@ buildAltiLayerGroup(_build); buildSingLayerGroup(_build); buildModel1dLayerGroup(_build); + buildCasiersLayerGroup(_build); buildImageGroup(); buildBiefsLayerGroup(); @@ -143,6 +147,9 @@ EbliActionInterface actNewAxe=new CalqueNewCalqueAction(FudaaLib.getS("Nouveau calque axes hydrauliques"),FudaaResource.FUDAA.getIcon("ajouter"),MdlLayerFactory.LAYER1D_AXE,cqMdl1d_,getEditor()); cqMdl1d_.setActions(new EbliActionInterface[] { actNewTrace, actNewAxe}); + EbliActionInterface actNewCasier=new CalqueNewCalqueAction(FudaaLib.getS("Nouveau calque casiers"),FudaaResource.FUDAA.getIcon("ajouter"),MdlLayerFactory.LAYER2D_CASIER,cqCasiers_,getEditor()); + cqCasiers_.setActions(new EbliActionInterface[] { actNewCasier}); + EbliActionInterface actImport = new FSigImageImportAction(this, cqImg_); cqImg_.setActions(new EbliActionInterface[] { actImport }); @@ -245,7 +252,25 @@ cqAxe.setName(BGroupeCalque.findUniqueChildName(cqMdl1d_, cqAxe.getExtName())); cqMdl1d_.add(cqAxe); } + + /** + * Mise en place du groupe du mod\xE8le 1d. + */ + protected void buildCasiersLayerGroup(boolean _build) { + cqCasiers_ = new BGroupeCalque(); + cqCasiers_.setTitle(MdlResource.getS("Casiers")); + cqCasiers_.setName("gcCasier"); + cqCasiers_.putClientProperty(Action.SHORT_DESCRIPTION, MdlResource.getS("Les casiers")); + cqCasiers_.setDestructible(false); + addCalque(cqCasiers_); + if (!_build) return; + + MdlLayer2dCasier cqStore=new MdlLayer2dCasier(getEditor()); + cqStore.setName(BGroupeCalque.findUniqueChildName(cqCasiers_, cqStore.getExtName())); + cqCasiers_.add(cqStore); + } + protected void fillCmdContextuelles(final BuPopupMenu _menu) { if (getScene() != null) { fillMenuWithSceneActions(_menu); Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCasier.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCasier.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCasier.java 2009-03-10 16:39:34 UTC (rev 4523) @@ -0,0 +1,78 @@ +/* + * @creation 20 janv. 08 + * @modification $Date: 2008/05/13 12:10:43 $ + * @license GNU General Public License 2 + * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.fudaa.modeleur.layer; + +import java.awt.Color; + +import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ebli.calque.BCalquePersistenceInterface; +import org.fudaa.ebli.calque.ZCalqueBloc; +import org.fudaa.ebli.calque.ZModeleBloc; +import org.fudaa.ebli.calque.dessin.DeForme; +import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceIconModel; +import org.fudaa.ebli.trace.TraceLigne; +import org.fudaa.ebli.trace.TraceLigneModel; +import org.fudaa.ebli.trace.TraceSurface; +import org.fudaa.ebli.trace.TraceSurfaceModel; +import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dCasierPersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; +import org.fudaa.fudaa.sig.layer.FSigEditor; + +/** + * Un calque pour le stockage et la manipulation des casiers. + * @author Bertrand Marchand + * @version $Id$ + */ +public class MdlLayer2dCasier extends MdlLayer2dLine { + + /** + * Constructeur. Utilise un mod\xE8le de donn\xE9es et un editeur. + * @param _model Modele + * @param _editor Editeur. + */ + private MdlLayer2dCasier(MdlModel2dCasier _model, final FSigEditor _editor) { + super(_model,_editor); + setIconModel(0, new TraceIconModel(TraceIcon.CARRE_PLEIN, 2, new Color(115,88,34))); + setLineModel(0, new TraceLigneModel(TraceLigne.LISSE, 2f, new Color(181,139,54))); + surfModel_=new TraceSurfaceModel(TraceSurface.UNIFORME,new Color(255,230,140),null); + + setName(getExtName()); + setTitle(MdlResource.getS("Contours casiers")); + setAttributForLabels(GISAttributeConstants.LABEL); + setDestructible(true); + } + + public MdlLayer2dCasier(FSigEditor _editor) { + this(new MdlModel2dCasier(_editor,_editor.getMng()),_editor); + } + + public BCalquePersistenceInterface getPersistenceMng() { + return new MdlLayer2dCasierPersistence(); + } + + /** + * Retourne le nom par defaut du calque. + * @return Le nom. + */ + public String getExtName() { + return "storage"; + } + + public int getNbSet() { + return 1; + } + + public boolean canSetSelectable() { + return true; + } + + public boolean canAddForme(int _typeForme) { + return _typeForme==DeForme.POLYGONE || _typeForme==DeForme.ELLIPSE || _typeForme==DeForme.RECTANGLE; + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCasier.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayerFactory.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayerFactory.java 2009-03-10 16:38:40 UTC (rev 4522) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayerFactory.java 2009-03-10 16:39:34 UTC (rev 4523) @@ -25,6 +25,7 @@ public final static int LAYER2D_CONTOUR =7; public final static int LAYER1D_TRACE =8; public final static int LAYER1D_AXE =9; + public final static int LAYER2D_CASIER =10; private static MdlLayerFactory factory_=new MdlLayerFactory(); @@ -62,6 +63,8 @@ return new MdlLayer2dZone(_editor); case LAYER2D_CONTOUR: return new MdlLayer2dContour(_editor); + case LAYER2D_CASIER: + return new MdlLayer2dCasier(_editor); case LAYER1D_TRACE: return new MdlLayer1dTrace(_editor); case LAYER1D_AXE: Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCasier.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCasier.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCasier.java 2009-03-10 16:39:34 UTC (rev 4523) @@ -0,0 +1,44 @@ +/* + * @creation 20 janv. 08 + * @modification $Date: 2008-05-13 12:10:42 $ + * @license GNU General Public License 2 + * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.fudaa.modeleur.layer; + +import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.gis.GISAttribute; +import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ebli.calque.ZModelGeometryListener; + +/** + * Un mod\xE8le de calque pour le calque 2D des casiers. Les casiers sont des g\xE9om\xE9trie composites associant un + * polygone avec un semis de point interne. + * + * @author Bertrand Marchand + * @version $Id$ + */ +public class MdlModel2dCasier extends MdlModel2dLine { + + /** + * Construction d'un modele de profil avec pile de commandes. + * @param _cmd La pile de commandes pour le undo/redo. + */ + public MdlModel2dCasier(final ZModelGeometryListener _listener, final CtuluCommandContainer _cmd) { + super(_listener); + + GISAttribute[] attrs=new GISAttribute[]{ + GISAttributeConstants.BATHY, + GISAttributeConstants.ETAT_GEOM, + GISAttributeConstants.TITRE, + GISAttributeConstants.NATURE, + GISAttributeConstants.VISIBILITE, + GISAttributeConstants.LABEL + }; + // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. + getGeomData().setAttributes(attrs, null); + getGeomData().setAttributeIsZ(GISAttributeConstants.BATHY); + getGeomData().setFixedAttributeValue(GISAttributeConstants.NATURE, GISAttributeConstants.ATT_NATURE_ZN); + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCasier.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/persistence/MdlLayer2dCasierPersistence.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/persistence/MdlLayer2dCasierPersistence.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/persistence/MdlLayer2dCasierPersistence.java 2009-03-10 16:39:34 UTC (rev 4523) @@ -0,0 +1,26 @@ +/* + * @creation 20 janv. 08 + * @modification $Date: 2008-12-01 12:02:10 +0100 (lun., 01 déc. 2008) $ + * @license GNU General Public License 2 + * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.fudaa.modeleur.persistence; + +import org.fudaa.fudaa.modeleur.layer.MdlLayer2dCasier; +import org.fudaa.fudaa.sig.layer.FSigEditor; + +/** + * Gestion de la persistance pour un calque multipoint. + * @author Bertrand Marchand + * @see MdlLayer2dCasier + */ +public class MdlLayer2dCasierPersistence extends MdlLayer2dLinePersistence { + + /** + * Cree un calque du type correct, suivante le gestionnaire de persistence. + */ + protected MdlLayer2dCasier createNewLayer(FSigEditor _editor) { + return new MdlLayer2dCasier(_editor); + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/persistence/MdlLayer2dCasierPersistence.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-03-10 16:38:50
|
Revision: 4522 http://fudaa.svn.sourceforge.net/fudaa/?rev=4522&view=rev Author: bmarchan Date: 2009-03-10 16:38:40 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Correction. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZScene.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZScene.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZScene.java 2009-03-10 16:37:38 UTC (rev 4521) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZScene.java 2009-03-10 16:38:40 UTC (rev 4522) @@ -62,6 +62,19 @@ } /** + * Retourne les indices pour une classe d'objets donn\xE9e. + * @param _clazz La classe d'objets. + * @return Les indices. + */ + public int[] getSelectedForClass(Class<?> _clazz) { + TIntArrayList idxs=new TIntArrayList(); + for (int idx : getSelectedIndexes()) { + if (getObject(idx).getClass().equals(_clazz)) idxs.add(idx); + } + return idxs.toNativeArray(); + } + + /** * @return La liste de selection des atomiques pour la g\xE9om\xE9trie unique s\xE9lectionn\xE9e. <code>null</code> si plusieurs g\xE9om\xE9tries * ou pas en mode atomique. */ @@ -275,8 +288,8 @@ System.arraycopy(isels, 0, iglobsels, ipt, isels.length); ipt+=isels.length; } - idecal+=cqs[i].modeleDonnees().getNombre(); } + idecal+=cqs[i].modeleDonnees().getNombre(); } return iglobsels; // return selection_.getSelectedIndex(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-03-10 16:37:49
|
Revision: 4521 http://fudaa.svn.sourceforge.net/fudaa/?rev=4521&view=rev Author: bmarchan Date: 2009-03-10 16:37:38 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Gestion du trac?\195?\169 de surfaces. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesTraceConfigure.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurface.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlInterpolateProfilePanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java Added Paths: ----------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/controle/BSelecteurSurfaceModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceChooser.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceRenderer.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java 2009-03-10 16:34:25 UTC (rev 4520) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -27,6 +27,7 @@ import org.fudaa.ebli.controle.BSelecteurCheckBox; import org.fudaa.ebli.controle.BSelecteurIconModel; import org.fudaa.ebli.controle.BSelecteurLineModel; +import org.fudaa.ebli.controle.BSelecteurSurfaceModel; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.geometrie.GrMorphisme; import org.fudaa.ebli.geometrie.GrPoint; @@ -39,6 +40,7 @@ import org.fudaa.ebli.palette.BPaletteInfo.InfoData; import org.fudaa.ebli.trace.TraceIconModel; import org.fudaa.ebli.trace.TraceLigneModel; +import org.fudaa.ebli.trace.TraceSurfaceModel; /** * @author deniger @@ -89,9 +91,13 @@ _r.o_.x_ -= delta; } + /** Le modele pour le trac\xE9 des icones. */ protected TraceIconModel iconModel_; - + /** Le modele pour le trac\xE9 des lignes. */ protected TraceLigneModel ligneModel_; + /** Le modele pour le trac\xE9 des surfaces. + * Si null, le selecteur de surface n'est pas repr\xE9sent\xE9 dans la configuration du calque, le trac\xE9 de surface ne se fait pas. */ + protected TraceSurfaceModel surfModel_; protected int alpha_ = 255; /** @@ -345,6 +351,10 @@ if (_p.isDefined(prop)) { setLineModel(i, (TraceLigneModel) _p.get(prop)); } + prop = createPropSurf(i); + if (_p.isDefined(prop)) { + setSurfaceModel(i, (TraceSurfaceModel) _p.get(prop)); + } } if (_p.isDefined("calque.paletteCouleur")) { @@ -359,6 +369,10 @@ return "calque." + BSelecteurLineModel.getProperty(_i); } + private String createPropSurf(final int _i) { + return "calque." + BSelecteurSurfaceModel.getProperty(_i); + } + private String createPropIcon(final int _i) { return "calque." + BSelecteurIconModel.getProperty(_i); } @@ -503,6 +517,10 @@ if (lineModel != null) { res.put(createPropLine(i), new TraceLigneModel(lineModel)); } + final TraceSurfaceModel surfModel = getSurfaceModel(i); + if (surfModel != null) { + res.put(createPropSurf(i), new TraceSurfaceModel(surfModel)); + } } if (EbliLib.isAlphaChanged(alpha_)) { res.put("calque.alpha", alpha_); @@ -526,6 +544,10 @@ if (line != null && line.setCouleur(_v)) { firePropertyChange(BSelecteurLineModel.getProperty(i), null, line); } + final TraceSurfaceModel surf = getSurfaceModel(i); + if (surf != null && surf.setBgColor(_v)) { + firePropertyChange(BSelecteurSurfaceModel.getProperty(i), null, surf); + } } super.setForeground(_v); if (isPaletteCouleurUsed_) { @@ -610,6 +632,20 @@ return 1; } + public boolean setSurfaceModel(final int _idx, final TraceSurfaceModel _model) { + final TraceSurfaceModel surf = getSurfaceModel(_idx); + if (_model != null && surf != null && surf.updateData(_model)) { + firePropertyChange(BSelecteurSurfaceModel.getProperty(_idx), null, surf); + repaint(); + return true; + } + return false; + } + + public TraceSurfaceModel getSurfaceModel(final int _idx) { + return surfModel_; + } + public boolean setLineModel(final int _idx, final TraceLigneModel _model) { final TraceLigneModel ligne = getLineModel(_idx); if (_model != null && ligne != null && ligne.updateData(_model)) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesTraceConfigure.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesTraceConfigure.java 2009-03-10 16:34:25 UTC (rev 4520) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesTraceConfigure.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -7,12 +7,16 @@ */ package org.fudaa.ebli.calque; +import java.util.List; + import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BSelecteurIconModel; import org.fudaa.ebli.controle.BSelecteurInterface; import org.fudaa.ebli.controle.BSelecteurLineModel; +import org.fudaa.ebli.controle.BSelecteurSurfaceModel; import org.fudaa.ebli.trace.TraceIconModel; import org.fudaa.ebli.trace.TraceLigneModel; +import org.fudaa.ebli.trace.TraceSurfaceModel; /** * @author fred deniger @@ -21,18 +25,18 @@ public class ZCalqueAffichageDonneesTraceConfigure extends BCalqueConfigureSectionAbstract { final int idx_; - final String propIcon_; - final String propLine_; + String propIcon_; + String propLine_; + String propSurf_; public ZCalqueAffichageDonneesTraceConfigure(final ZCalqueAffichageDonneesAbstract _target, final int _idx) { super(_target, _target.getNbSet() == 1 ? EbliLib.getS("Style") : _target.getSetTitle(_idx)); idx_ = _idx; propIcon_ = BSelecteurIconModel.getProperty(idx_); - if (_target.getLineModel(idx_) == null) { - propLine_ = null; - } else { + if (_target.getLineModel(idx_)!=null) propLine_ = BSelecteurLineModel.getProperty(idx_); - } + if (_target.getSurfaceModel(_idx)!=null) + propSurf_=BSelecteurSurfaceModel.getProperty(idx_); } protected ZCalqueAffichageDonneesAbstract getCq() { @@ -42,29 +46,50 @@ public boolean setProperty(final String _key, final Object _newProp) { if (_key == propIcon_) { return getCq().setIconModel(idx_, (TraceIconModel) _newProp); - } - return getCq().setLineModel(idx_, (TraceLigneModel) _newProp); + else if (_key==propLine_) { + return getCq().setLineModel(idx_, (TraceLigneModel) _newProp); + } + else { + return getCq().setSurfaceModel(idx_, (TraceSurfaceModel) _newProp); + } } public Object getProperty(final String _key) { if (_key.equals(propIcon_)) { return getCq().getIconModel(idx_); - } - return getCq().getLineModel(idx_); + else if (_key.equals(propLine_)) { + return getCq().getLineModel(idx_); + } + else { + return getCq().getSurfaceModel(idx_); + } } public BSelecteurInterface[] createSelecteurs() { - final BSelecteurIconModel selecteurIconModel = new BSelecteurIconModel(propIcon_); - selecteurIconModel.setTitle(EbliLib.getS("Trac\xE9 des points")); - if (propLine_ == null) { - return new BSelecteurInterface[] { selecteurIconModel }; + + int nbsel=(propIcon_==null?0:1)+(propLine_==null?0:1)+(propSurf_==null?0:1); + BSelecteurInterface[] sel=new BSelecteurInterface[nbsel]; + + int isel=0; + if (propIcon_!=null) { + final BSelecteurIconModel selecteurIconModel = new BSelecteurIconModel(propIcon_); + selecteurIconModel.setTitle(EbliLib.getS("Trac\xE9 des points")); + sel[isel++]=selecteurIconModel; } - final BSelecteurLineModel selecteurLineModel = new BSelecteurLineModel(propLine_); - selecteurLineModel.setTitle(EbliLib.getS("Trac\xE9 des lignes")); - return new BSelecteurInterface[] { selecteurIconModel, selecteurLineModel }; + if (propLine_!=null) { + final BSelecteurLineModel selecteurLineModel = new BSelecteurLineModel(propLine_); + selecteurLineModel.setTitle(EbliLib.getS("Trac\xE9 des lignes")); + sel[isel++]=selecteurLineModel; + } + + if (propSurf_!=null) { + final BSelecteurSurfaceModel selecteurSurfaceModel = new BSelecteurSurfaceModel(propSurf_); + selecteurSurfaceModel.setTitle(EbliLib.getS("Trac\xE9 des surfaces")); + sel[isel++]=selecteurSurfaceModel; + } + return sel; } - } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java 2009-03-10 16:34:25 UTC (rev 4520) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -50,7 +50,6 @@ import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.CoordinateSequence; import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.LinearRing; @@ -62,18 +61,16 @@ * @author Bertrand Marchand * @version $Id$ */ -public class ZCalqueGeometry extends ZCalqueAffichageDonneesLineAbstract implements ZModelGeometryListener { +public class ZCalqueGeometry<M extends ZModeleGeometry> extends ZCalqueAffichageDonneesLineAbstract implements ZModelGeometryListener { /** true si selection en mode sommets */ transient protected boolean isAtomicMode_; /** Le mod\xE8le des g\xE9om\xE9tries */ - protected ZModeleGeometry modele_; + protected M modele_; /** La selection a utilise dans le mode selection sommets */ protected EbliListeSelectionMulti selectionMulti_; /** Pour le trac\xE9 de la selection en mode atomique. */ protected ZSelectionTrace traceAtomic_; - /** Le mod\xE8le pour le trac\xE9 de surfaces */ - protected TraceSurfaceModel surfModel_; /** L'attribut utilis\xE9 pour afficher les labels */ protected GISAttributeInterface attrLabels_=null; /** Le finder pour une recherche sur le calque */ @@ -83,12 +80,11 @@ * Le seul constructeur, avec le mod\xE8le. * @param _modele le modele du calque */ - public ZCalqueGeometry(final ZModeleGeometry _modele) { + public ZCalqueGeometry(final M _modele) { modele_ = _modele; if(modele_!=null) modele_.addModelListener(this); iconModel_ = new TraceIconModel(TraceIcon.CARRE_PLEIN, 2, Color.BLACK); - surfModel_=new TraceSurfaceModel(TraceSurface.INVISIBLE, Color.BLACK,null); } protected EbliListeSelectionMulti creeSelectionMulti() { @@ -424,7 +420,7 @@ /** * @param _modele Modele */ - public void modele(final ZModeleGeometry _modele) { + public void modele(final M _modele) { if (modele_ != _modele) { if(modele_!=null) modele_.removeModelListener(this); @@ -436,7 +432,7 @@ } } - public ZModeleGeometry modeleDonnees() { + public M modeleDonnees() { return modele_; } @@ -448,18 +444,13 @@ if ((modele_ == null) || (modele_.getNombre() <= 0)) { return; } + + // Trac\xE9 des surfaces + paintSurfaces(_g, _versEcran, _versReel, _clipReel); + final GrBoite clip = _clipReel; final GrMorphisme versEcran = _versEcran; final int nombre = modele_.getNombre(); - - final TraceIconModel iconeModel = iconModel_ == null ? null : new TraceIconModel(iconModel_); - - final TraceIcon icone; - if (isRapide()) { - icone=new TraceIcon(TraceIcon.CARRE,2,iconeModel.getCouleur()); - } - else - icone = iconeModel == null ? null : new TraceIcon(iconeModel); final TraceLigne tl; if (isRapide()) @@ -467,48 +458,9 @@ else tl= ligneModel_.buildCopy(); - final TraceSurface ts=surfModel_.buildCopy(); - final GrBoite bPoly = new GrBoite(); bPoly.o_ = new GrPoint(); bPoly.e_ = new GrPoint(); - - // Les surfaces, si a tracer - if (!isRapide()) { - TIntArrayList x=new TIntArrayList(50); - TIntArrayList y=new TIntArrayList(50); - - for (int i = nombre - 1; i >= 0; i--) { - if (!modele_.isGeometryReliee(i) || !modele_.isGeometryFermee(i)) - continue; - - // il n'y a pas de points pour cette g\xE9om\xE9trie - final int nbPoints=modele_.getNbPointForGeometry(i); - if (nbPoints <= 0) - continue; - // La g\xE9ometrie n'est pas visible - if (!modele_.isGeometryVisible(i)) - continue; - - modele_.getDomaineForGeometry(i, bPoly); - // Si la boite du polygone n'est pas dans la boite d'affichage on passe - if (bPoly.intersectionXY(clip) == null) { - continue; - } - - x.reset(); - y.reset(); - final GrPoint pt=new GrPoint(); - for (int j=0; j<nbPoints; j++) { - // le point de dest est initialise - modele_.point(pt, i, j); - pt.autoApplique(versEcran); - x.add((int)pt.x_); - y.add((int)pt.y_); - } - ts.remplitPolygone((Graphics2D)_g,x.toNativeArray(),y.toNativeArray()); - } - } // on part de la fin : comme ca la premiere ligne apparait au-dessus for (int i = nombre - 1; i >= 0; i--) { @@ -550,7 +502,85 @@ modele_.point(ptOri, i, nbPoints - 1); ptOri.autoApplique(versEcran); } + + // Les icones sur les atomiques + paintIconsOnAtomics(_g, _versEcran, _versReel, _clipReel); + // Enfin les labels sur les atomiques. + paintLabelsOnAtomics(_g, _versEcran, _versReel, _clipReel); + } + + protected void paintSurfaces(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { + + final GrBoite clip = _clipReel; + final GrMorphisme versEcran = _versEcran; + final int nombre = modele_.getNombre(); + final GrBoite bPoly = new GrBoite(); + final TraceSurface ts; + if (surfModel_!=null) { + ts=surfModel_.buildCopy(); + ts.setCouleurFond(EbliLib.getAlphaColor(ts.getCouleurFond(), alpha_)); + } + else { + ts=null; + } + + // Les surfaces, si a tracer + if (!isRapide() && ts!=null && ts.getTypeSurface()!=TraceSurface.INVISIBLE) { + TIntArrayList x=new TIntArrayList(50); + TIntArrayList y=new TIntArrayList(50); + + for (int i = nombre - 1; i >= 0; i--) { + if (!modele_.isGeometryReliee(i) || !modele_.isGeometryFermee(i)) + continue; + + // il n'y a pas de points pour cette g\xE9om\xE9trie + final int nbPoints=modele_.getNbPointForGeometry(i); + if (nbPoints <= 0) + continue; + // La g\xE9ometrie n'est pas visible + if (!modele_.isGeometryVisible(i)) + continue; + + modele_.getDomaineForGeometry(i, bPoly); + // Si la boite du polygone n'est pas dans la boite d'affichage on passe + if (bPoly.intersectionXY(clip) == null) { + continue; + } + + x.reset(); + y.reset(); + final GrPoint pt=new GrPoint(); + for (int j=0; j<nbPoints; j++) { + // le point de dest est initialise + modele_.point(pt, i, j); + pt.autoApplique(versEcran); + x.add((int)pt.x_); + y.add((int)pt.y_); + } + ts.remplitPolygone((Graphics2D)_g,x.toNativeArray(),y.toNativeArray()); + } + } + } + + protected void paintIconsOnAtomics(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { + + final GrBoite clip = _clipReel; + final GrMorphisme versEcran = _versEcran; + final int nombre = modele_.getNombre(); + final GrBoite bPoly = new GrBoite(); + + final TraceIconModel iconeModel = iconModel_ == null ? null : new TraceIconModel(iconModel_); + + final TraceIcon icone; + if (isRapide()) { + icone=new TraceIcon(TraceIcon.CARRE,2,iconeModel.getCouleur()); + } + else + icone = iconeModel == null ? null : new TraceIcon(iconeModel); + // on trace les icones apres pour qu'ils soient dessin\xE9s au-dessus des lignes. if (icone != null) { for (int i = nombre - 1; i >= 0; i--) { @@ -585,8 +615,16 @@ } } } + } + + protected void paintLabelsOnAtomics(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { - // Enfin les labels sur les atomiques. + final GrBoite clip = _clipReel; + final GrMorphisme versEcran = _versEcran; + final int nombre = modele_.getNombre(); + final GrBoite bPoly = new GrBoite(); + if (attrLabels_!=null && !isRapide()) { GISZoneCollection geomData = modeleDonnees().getGeomData(); int idxLabels=geomData.getIndiceOf(attrLabels_); @@ -1046,20 +1084,6 @@ } } - public boolean setSurfaceModel(final TraceSurfaceModel _model) { - final TraceSurfaceModel surf = getSurfaceModel(); - if (_model != null && surf != null && surf.updateData(_model)) { -// firePropertyChange(BSelecteurLineModel.getProperty(_idx), null, surf); - repaint(); - return true; - } - return false; - } - - public TraceSurfaceModel getSurfaceModel() { - return surfModel_; - } - public boolean setTitle(final String _title) { final boolean r = super.setTitle(_title); if (r && modele_ != null && modele_.getGeomData() != null) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java 2009-03-10 16:34:25 UTC (rev 4520) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -161,6 +161,9 @@ if ((modele_ == null) || (modele_.getNombre() <= 0)) { return; } + + paintSurfaces(_g, _versEcran, _versReel, _clipReel); + final GrBoite clip = _clipReel; final GrMorphisme versEcran = _versEcran; final int nombre = modele_.getNombre(); @@ -258,97 +261,11 @@ } } - // on trace les icones apres pour qu'ils soient dessin\xE9s au-dessus des lignes. - if (icone != null && !isRapide()) { - for (int i = nombre - 1; i >= 0; i--) { - // il n'y a pas de points pour cette ligne - if (modele_.getNbPointForGeometry(i) <= 0) { - continue; - } - // La g\xE9ometrie n'est pas visible - if (!modele_.isGeometryVisible(i)) - continue; - - modele_.getDomaineForGeometry(i, bPoly); - // Si la boite du polygone n'est pas dans la boite d'affichage on passe - if (bPoly.intersectionXY(clip) == null) { - continue; - } - final int nbPoints = modele_.getNbPointForGeometry(i); - if (nbPoints <= 0) { - continue; - } - initTrace(iconeModel, i); - final GrPoint ptDest = new GrPoint(); - for (int j = nbPoints - 1; j >= 0; j--) { - // le point de dest est initialise - modele_.point(ptDest, i, j); - ptDest.autoApplique(versEcran); - icone.paintIconCentre(this, _g, ptDest.x_, ptDest.y_); - } - } - } - + // Les icones sur les atomiques + if (!isRapide()) + paintIconsOnAtomics(_g, _versEcran, _versReel, _clipReel); // Enfin les labels sur les atomiques. - if (attrLabels_!=null && !isRapide()) { - GISZoneCollection geomData = modeleDonnees().getGeomData(); - int idxLabels=geomData.getIndiceOf(attrLabels_); - - if (idxLabels!=-1) { - final FontMetrics fm = _g.getFontMetrics(); - final Color fgColor = _g.getColor(); - final Color bgColor = getBackground(); - - for (int i=nombre-1; i>=0; i--) { - // il n'y a pas de points pour cette ligne - if (modele_.getNbPointForGeometry(i)<=0) { - continue; - } - // La g\xE9ometrie n'est pas visible - if (!modele_.isGeometryVisible(i)) - continue; - - modele_.getDomaineForGeometry(i, bPoly); - // Si la boite du polygone n'est pas dans la boite d'affichage on - // passe - if (bPoly.intersectionXY(clip)==null) { - continue; - } - final int nbPoints=modele_.getNbPointForGeometry(i); - if (nbPoints<=0) { - continue; - } - - GISAttributeModel mdl=(GISAttributeModel)geomData.getModel(idxLabels).getObjectValueAt(i); - - final GrPoint ptDest=new GrPoint(); - for (int j=nbPoints-1; j>=0; j--) { - modele_.point(ptDest, i, j); - if (!_clipReel.contientXY(ptDest)) { - continue; - } - - // Les labels : Uniquement si le string correspondant n'est pas "". - Object o=mdl.getObjectValueAt(j); - if (o==null) - continue; - String s=o.toString().trim(); - if (s.equals("")) - continue; - - ptDest.autoApplique(versEcran); - final Rectangle2D rec=fm.getStringBounds(s, _g); - double x=ptDest.x_-rec.getWidth()/2; - double y=ptDest.y_-3; - rec.setFrame(x, y-fm.getAscent(), rec.getWidth(), fm.getAscent()+2); - _g.setColor(bgColor); - _g.fill(rec); - _g.setColor(fgColor); - _g.drawString(s, (int)x, (int)y); - } - } - } - } + paintLabelsOnAtomics(_g, _versEcran, _versReel, _clipReel); } public void setLineModelOuvert(final TraceLigneModel _model) { Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/controle/BSelecteurSurfaceModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/controle/BSelecteurSurfaceModel.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/controle/BSelecteurSurfaceModel.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -0,0 +1,186 @@ +/* + * @creation 10 Mars 2009 + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.ebli.controle; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.beans.PropertyChangeListener; + +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import org.fudaa.ebli.commun.EbliLib; +import org.fudaa.ebli.trace.TraceSurface; +import org.fudaa.ebli.trace.TraceSurfaceChooser; +import org.fudaa.ebli.trace.TraceSurfaceModel; + +import com.memoire.bu.BuComboBox; +import com.memoire.bu.BuGridLayout; +import com.memoire.bu.BuPanel; +import com.memoire.fu.FuLog; + +/** + * Un selecteur pour un modele de surface. Seule la couleur de fond du trac\xE9 est g\xE9r\xE9e. + * @author Bertrand Marchand + * @version $Id$ + */ +public class BSelecteurSurfaceModel extends BSelecteurAbstract implements ItemListener, ChangeListener { + + public static final String DEFAULT_PROPERTY = "surfaceModel"; + + public static final String getProperty(final int _idx) { + return _idx == 0 ? DEFAULT_PROPERTY : DEFAULT_PROPERTY + _idx; + } + BSelecteurColorChooserBt btColor_; + BuComboBox cbType_; + TraceSurfaceModel old_; + + TraceSurfaceChooser typeModel_; + + protected class BSelecteurColorTarget implements BSelecteurTargetInterface { + Color currentColor_; + + public void addPropertyChangeListener(final String _key, final PropertyChangeListener _l) {} + + public Object getMin(final String _key) { + return null; + } + + public Object getMoy(final String _key) { + return null; + } + + public Object getProperty(final String _key) { + return currentColor_; + } + + public void removePropertyChangeListener(final String _key, final PropertyChangeListener _l) {} + + public boolean setProperty(final String _key, final Object _newProp) { + currentColor_ = (Color) _newProp; + fireDataChanged(false, true); + return true; + } + + } + + public BSelecteurSurfaceModel() { + this(DEFAULT_PROPERTY, null); + } + + public BSelecteurSurfaceModel(final String _prop) { + this(_prop, null); + } + + public BSelecteurSurfaceModel(final String _property, final TraceSurfaceModel _tsm) { + super(_property); + cbType_ = new BuComboBox(); + + typeModel_ = new TraceSurfaceChooser(true); + cbType_.setModel(typeModel_); + cbType_.setRenderer(typeModel_.getCellRenderer()); + cbType_.setPreferredSize(new Dimension(60, 15)); + cbType_.addItemListener(this); + btColor_ = new BSelecteurColorChooserBt(); + final BSelecteurColorTarget selecteurColorTarget = new BSelecteurColorTarget(); + if (_tsm != null) { + selecteurColorTarget.currentColor_ = _tsm.getBgColor(); + typeModel_.setSelectedType(_tsm.getType()); + } + btColor_.setSelecteurTarget(selecteurColorTarget); + title_ = EbliLib.getS("Surface"); + } + + protected void fireDataChanged(final boolean _type, final boolean _color) { + if (isUpdating_) { + return; + } + if (FuLog.isTrace()) { + FuLog.trace("ETR: " + getClass().getName() + " data change type=" + _type + + "; color=" + _color); + } + final TraceSurfaceModel d = getNewData(); + if (_type) { + d.setBgColorIgnored(); + } else if (_color) { + d.setTypeIgnored(); + } + if (!d.equals(old_)) { + if (FuLog.isTrace()) { + FuLog.trace("new trace " + d); + } + firePropertyChange(getProperty(), d); + } + } + + public void updateFromTarget() { + final TraceSurfaceModel tsm = (TraceSurfaceModel) super.getTargetValue(); + isUpdating_ = true; + old_ = tsm; + final int type = tsm == null ? 0 : tsm.getType(); + if (type >= 0) { + typeModel_.setSelectedType(type); + } else { + cbType_.setSelectedItem(null); + } + final BSelecteurColorTarget colorTarget = (BSelecteurColorTarget) btColor_.getTarget(); + colorTarget.currentColor_ = (tsm == null ? Color.BLACK : tsm.getBgColor()); + btColor_.updateFromTarget(); + + } + + public JPanel buildPanel() { + final JPanel r = new BuPanel(); + buildPanel(r, true); + return r; + } + + public void buildPanel(final JPanel _pn, final boolean _layout) { + if (_layout) { + _pn.setLayout(new BuGridLayout(2, 3, 3, true, false)); + } + _pn.add(cbType_); + _pn.add(btColor_.getPn()); + + } + + public JComponent getComponent() { + return buildPanel(); + } + + public JComponent[] getComponents() { + return new JComponent[] { cbType_, btColor_.getPn() }; + } + + public TraceSurfaceModel getNewData() { + return new TraceSurfaceModel(typeModel_.getSelectedType(), + ((BSelecteurColorTarget) btColor_.getTarget()).currentColor_,Color.WHITE); + } + + public final TraceSurfaceChooser getTypeModel() { + return typeModel_; + } + + public void itemStateChanged(final ItemEvent _e) { + if (_e.getStateChange() == ItemEvent.DESELECTED) { + return; + } + final boolean enable = typeModel_.getSelectedType() != TraceSurface.INVISIBLE; + btColor_.setEnabled(enable); + fireDataChanged(true, false); + } + + public void stateChanged(final ChangeEvent _e) { + fireDataChanged(false, false); + } + +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/controle/BSelecteurSurfaceModel.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurface.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurface.java 2009-03-10 16:34:25 UTC (rev 4520) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurface.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -100,6 +100,10 @@ model_ = new TraceSurfaceModel(_d.model_); } + public void setModel(final TraceSurfaceModel _model) { + model_ = _model; + } + /** * Renvoie le texturePaint correspondant. * Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceChooser.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceChooser.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceChooser.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -0,0 +1,109 @@ +/* + * @creation 10 Mars 2009 + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.ebli.trace; + +import java.awt.Color; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.AbstractListModel; +import javax.swing.ComboBoxModel; +import javax.swing.ListCellRenderer; + +/** + * Un chooser de types de trac\xE9s de surfaces. + * @author Bertrand Marchand + * @version $Id$ + */ +public class TraceSurfaceChooser extends AbstractListModel implements ComboBoxModel { + + private TraceSurfaceModel[] surfaces_; + + private Object selected_; + + public TraceSurfaceChooser() { + this(true); + } + + public TraceSurfaceChooser(final boolean _addInvisible) { + List<TraceSurfaceModel> lsurf=new ArrayList<TraceSurfaceModel>(); + + if (_addInvisible) + lsurf.add(new TraceSurfaceModel(TraceSurface.INVISIBLE, Color.BLACK, Color.WHITE)); + + lsurf.add(new TraceSurfaceModel(TraceSurface.UNIFORME, Color.BLACK, Color.WHITE)); + lsurf.add(new TraceSurfaceModel(TraceSurface.HACHURE_DROITE, Color.BLACK, Color.WHITE)); + lsurf.add(new TraceSurfaceModel(TraceSurface.HACHURE_GAUCHE, Color.BLACK, Color.WHITE)); + lsurf.add(new TraceSurfaceModel(TraceSurface.HACHURE_HORIZONTAL, Color.BLACK, Color.WHITE)); + lsurf.add(new TraceSurfaceModel(TraceSurface.HACHURE_VERTICAL, Color.BLACK, Color.WHITE)); + lsurf.add(new TraceSurfaceModel(TraceSurface.POINTILLE, Color.BLACK, Color.WHITE)); + + surfaces_=lsurf.toArray(new TraceSurfaceModel[0]); + } + + public Object getSelectedItem() { + return selected_; + } + + public void setCouleur(final Color _c) { + if (_c == null) { + return; + } + if (!_c.equals(surfaces_[0].getBgColor())) { + for (int i = surfaces_.length - 1; i >= 0; i--) { + surfaces_[i].setBgColor(_c); + } + } + fireContentsChanged(this, 0, getSize()); + } + + /** + * @return le type de surface a selectionner + */ + public int getSelectedType() { + if (selected_ == null) { + return TraceSurface.INVISIBLE; + } + return ((TraceSurfaceModel) selected_).getType(); + } + + /** + * @param _i : le type de surface a selectionner + */ + public void setSelectedType(final int _i) { + for (int i = surfaces_.length - 1; i >= 0; i--) { + if (surfaces_[i].getType() == _i) { + setSelectedItem(surfaces_[i]); + return; + } + } + setSelectedItem(null); + + } + + public void setSelectedItem(final Object _anItem) { + if (_anItem != selected_) { + selected_ = _anItem; + fireContentsChanged(this, -1, -1); + } + } + + public Object getElementAt(final int _index) { + return surfaces_[_index]; + } + + public int getSize() { + return surfaces_.length; + } + + /** + * @return un renderer pour ce model + */ + public ListCellRenderer getCellRenderer() { + return new TraceSurfaceRenderer(); + } +} \ No newline at end of file Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceChooser.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceRenderer.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceRenderer.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceRenderer.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -0,0 +1,142 @@ +/* + * @creation 10 Mars 2009 + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.ebli.trace; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; + +import javax.swing.JComponent; +import javax.swing.JList; +import javax.swing.JTable; +import javax.swing.ListCellRenderer; +import javax.swing.UIManager; +import javax.swing.table.TableCellRenderer; + +import com.memoire.bu.BuLabel; + +import org.fudaa.ctulu.CtuluLibString; +import org.fudaa.ctulu.gui.CtuluCellRenderer; + +/** + * Un renderer pour les trac\xE9s de surfaces. + * + * @author Bertrand Marchand + * @version $Id$ + */ +public final class TraceSurfaceRenderer extends JComponent implements TableCellRenderer, ListCellRenderer { + + private final TraceSurface ts_; + BuLabel lbNo_; + + /** + * Initialisation variables internes. + */ + public TraceSurfaceRenderer() { + ts_ = new TraceSurface(); + } + + protected void paintComponent(final Graphics _g) { + if (ts_.getTypeSurface()==TraceSurface.INVISIBLE) { + return; + } + + final Dimension d = getSize(); + int[] x=new int[4]; + int[] y=new int[4]; + x[0]=2; + y[0]=2; + x[1]=d.width-4; + y[1]=2; + x[2]=d.width-4; + y[2]=d.height-4; + x[3]=2; + y[3]=d.height-4; + + final Color old = _g.getColor(); + _g.setColor(getBackground()); + ((Graphics2D) _g).fill(_g.getClip()); + Graphics2D g2d=(Graphics2D)_g; + ts_.remplitPolygone(g2d, x, y); + _g.setColor(old); + } + + private void buildLb() { + if (lbNo_ == null) { + lbNo_ = new BuLabel(); + lbNo_.setOpaque(true); + } + } + + public Component getListCellRendererComponent(final JList _list, final Object _value, final int _index, + final boolean _isSelected, final boolean _cellHasFocus) { + JComponent r = this; + if (_value == null) { + buildLb(); + lbNo_.setText(CtuluLibString.ESPACE); + r = lbNo_; + } else { + ts_.setModel((TraceSurfaceModel) _value); + if (ts_.getTypeSurface() == TraceSurface.INVISIBLE) { + buildLb(); + lbNo_.setText(CtuluLibString.ESPACE); + r = lbNo_; + } + } + if (_isSelected) { + r.setForeground(_list.getSelectionForeground()); + r.setBackground(_list.getSelectionBackground()); + } else { + r.setBackground(_list.getBackground()); + r.setForeground(_list.getForeground()); + } + r.setBorder((_cellHasFocus) ? UIManager.getBorder("List.focusCellHighlightBorder") + : CtuluCellRenderer.BORDER_NO_FOCUS); + return r; + } + + public Dimension getPreferredSize() { + final Dimension d = super.getPreferredSize(); + final int s = 15; + d.width = 15; + if (d.height < s) { + d.height = s; + } + return d; + } + + public Component getTableCellRendererComponent(final JTable _table, final Object _value, final boolean _isSelected, + final boolean _hasFocus, final int _row, final int _column) { + JComponent r = this; + if (_value == null) { + if (lbNo_ == null) { + lbNo_ = new BuLabel(CtuluLibString.ESPACE); + lbNo_.setOpaque(true); + } + r = lbNo_; + } + if (_isSelected) { + r.setForeground(_table.getSelectionForeground()); + r.setBackground(_table.getSelectionBackground()); + } + if (_hasFocus) { + r.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); + r.setForeground(UIManager.getColor("Table.focusCellForeground")); + r.setBackground(UIManager.getColor("Table.focusCellBackground")); + } else { + r.setBorder(CtuluCellRenderer.BORDER_NO_FOCUS); + r.setForeground(_table.getForeground()); + r.setBackground(_table.getBackground()); + } + if (_value != null) { + ts_.setModel((TraceSurfaceModel) _value); + } + return r; + } +} \ No newline at end of file Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceSurfaceRenderer.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlInterpolateProfilePanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlInterpolateProfilePanel.java 2009-03-10 16:34:25 UTC (rev 4520) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlInterpolateProfilePanel.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -178,7 +178,7 @@ cqTmp_.setLineModel(0, ligne); cqTmp_.setLineModel(1, ligne); final TraceSurfaceModel surfMdl=new TraceSurfaceModel(TraceSurface.UNIFORME,new Color(255,50,0,40),null); - cqTmp_.setSurfaceModel(surfMdl); + cqTmp_.setSurfaceModel(0,surfMdl); pn_.getVueCalque().getCalque().enPremier(cqTmp_); pn_.getCqInfos().enPremier(); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java 2009-03-10 16:34:25 UTC (rev 4520) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java 2009-03-10 16:37:38 UTC (rev 4521) @@ -140,7 +140,7 @@ cqTmp_.setLineModel(0, ligne); cqTmp_.setLineModel(1, ligne); final TraceSurfaceModel surfMdl=new TraceSurfaceModel(TraceSurface.UNIFORME,new Color(255,50,0,40),null); - cqTmp_.setSurfaceModel(surfMdl); + cqTmp_.setSurfaceModel(0,surfMdl); pn_.getVueCalque().getCalque().enPremier(cqTmp_); pn_.getCqInfos().enPremier(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-03-10 16:34:33
|
Revision: 4520 http://fudaa.svn.sourceforge.net/fudaa/?rev=4520&view=rev Author: bmarchan Date: 2009-03-10 16:34:25 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionBloc.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueBloc.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleBloc.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleBlocDefault.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionBloc.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionBloc.java 2009-03-10 16:21:47 UTC (rev 4519) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionBloc.java 2009-03-10 16:34:25 UTC (rev 4520) @@ -1,6 +1,5 @@ /* * @creation 6 mars 2009 - * @modification $Date:$ * @license GNU General Public License 2 * @copyright (c)1998-2009 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -19,7 +18,7 @@ * * @statut Experimental * @author Bertrand Marchand - * @version $Id:$ + * @version $Id$ */ public class GISZoneCollectionBloc extends GISZoneCollectionGeometry { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueBloc.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueBloc.java 2009-03-10 16:21:47 UTC (rev 4519) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueBloc.java 2009-03-10 16:34:25 UTC (rev 4520) @@ -1,6 +1,5 @@ /* - * @creation 31 mars 2005 - * @modification $Date: 2008-10-30 10:47:50 +0100 (jeu., 30 oct. 2008) $ + * @creation 10 mars 2009 * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleBloc.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleBloc.java 2009-03-10 16:21:47 UTC (rev 4519) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleBloc.java 2009-03-10 16:34:25 UTC (rev 4520) @@ -1,6 +1,5 @@ /* - * @creation 31 mars 2005 - * @modification $Date: 2009-01-23 17:12:37 +0100 (ven., 23 janv. 2009) $ + * @creation 10 mars 2009 * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleBlocDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleBlocDefault.java 2009-03-10 16:21:47 UTC (rev 4519) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleBlocDefault.java 2009-03-10 16:34:25 UTC (rev 4520) @@ -1,6 +1,5 @@ /* - * @creation 4 avr. 2005 - * @modification $Date: 2008-11-12 14:36:43 +0100 (mer., 12 nov. 2008) $ + * @creation 10 Mars 2009 * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-03-10 16:22:03
|
Revision: 4519 http://fudaa.svn.sourceforge.net/fudaa/?rev=4519&view=rev Author: bmarchan Date: 2009-03-10 16:21:47 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Calque permettant la gestion de blocs (g?\195?\169om?\195?\169tries composites). statut : EXPERIMENTAL. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometryCollection.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java Added Paths: ----------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionBloc.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueBloc.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleBloc.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleBlocDefault.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometry.java 2009-03-10 15:58:58 UTC (rev 4518) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometry.java 2009-03-10 16:21:47 UTC (rev 4519) @@ -22,6 +22,12 @@ */ long getId(); + /** + * Implementation du pattern visitor. Le visitor parcours l'arbre des g\xE9om\xE9tries jusqu'aux g\xE9om\xE9tries simples, et r\xE9alise + * un traitement sur celles-ci (modification, stockage d'information, etc). Le traitement est d\xE9finit dans le visitor. + * @param _v Le visitor. + * @return false : Si la visite doit \xEAtre interrompue. + */ boolean accept(GISVisitor _v); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometryCollection.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometryCollection.java 2009-03-10 15:58:58 UTC (rev 4518) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometryCollection.java 2009-03-10 16:21:47 UTC (rev 4519) @@ -7,24 +7,123 @@ */ package org.fudaa.ctulu.gis; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryCollection; import com.vividsolutions.jts.geom.GeometryFactory; /** - * @author fred deniger + * Une Geometry de type bloc agregeant d'autres g\xE9ometries simples. Le bloc n'accepte pas de contenir d'autres collections. + * @author Bertrand Marchand + * @status Experimental * @version $Id: GISGeometryCollection.java,v 1.2 2006-09-19 14:36:53 deniger Exp $ */ -public class GISGeometryCollection extends GeometryCollection implements GISGeometry { +public class GISGeometryCollection extends GeometryCollection implements GISCoordinateSequenceContainerInterface { + CollectionCoordinateSequence seq_; + + private class CollectionCoordinateSequence implements CoordinateSequence { + private int idxgeom_; + private int idxsom_; + private GISGeometryCollection coll_; + public CollectionCoordinateSequence(GISGeometryCollection _coll) { + coll_=_coll; + } + + public Object clone() { + return new CollectionCoordinateSequence(coll_); + } + + public Envelope expandEnvelope(Envelope _env) { + _env.expandToInclude(coll_.getEnvelopeInternal()); + return _env; + } + + public Coordinate getCoordinate(int _index) { + computeIndex2Geom(_index); + return ((GISCoordinateSequenceContainerInterface)coll_.geometries[idxgeom_]).getCoordinateSequence().getCoordinate(idxsom_); + } + + private void computeIndex2Geom(int _idx) { + int idecal=0; + for (int i=0; i<coll_.geometries.length; i++) { + int nb=coll_.geometries[i].getNumPoints(); + if (_idx<idecal+nb) { + idxgeom_=i; + idxsom_=_idx-idecal; + return; + } + idecal+=nb; + } + } + + public void getCoordinate(int _index, Coordinate _coord) { + computeIndex2Geom(_index); + ((GISCoordinateSequenceContainerInterface)coll_.geometries[idxgeom_]).getCoordinateSequence().getCoordinate(idxsom_,_coord); + } + + public Coordinate getCoordinateCopy(int _index) { + return (Coordinate)getCoordinate(_index).clone(); + } + + public int getDimension() { + return coll_.getDimension(); + } + + public double getOrdinate(int _index, int _ordinateIndex) { + computeIndex2Geom(_index); + return ((GISCoordinateSequenceContainerInterface)coll_.geometries[idxgeom_]).getCoordinateSequence().getOrdinate(idxsom_, _ordinateIndex); + } + + public double getX(int _index) { + return getOrdinate(_index, 0); + } + + public double getY(int _index) { + return getOrdinate(_index, 1); + } + + public void setOrdinate(int _index, int _ordinateIndex, double _value) { + computeIndex2Geom(_index); + ((GISCoordinateSequenceContainerInterface)coll_.geometries[idxgeom_]).getCoordinateSequence().setOrdinate(idxsom_, _ordinateIndex, + _value); + } + + public int size() { + return coll_.getNumPoints(); + } + + public Coordinate[] toCoordinateArray() { + return coll_.getCoordinates(); + } + } + public GISGeometryCollection(final Geometry[] _geometries, final GeometryFactory _factory) { super(_geometries, _factory); + + if (containsCollection(_geometries)) + throw new IllegalArgumentException("Geometries can't be collections"); } + protected boolean containsCollection(Geometry[] _geoms) { + for (Geometry g: _geoms) { + if (g instanceof GISGeometryCollection) return true; + } + return false; + } + public boolean accept(final GISVisitor _v) { return _v.visitGeometryCollection(this); } public long getId() { return -1; } + public CoordinateSequence getCoordinateSequence() { + if (seq_==null) { + seq_=new CollectionCoordinateSequence(this); + } + return seq_; + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java 2009-03-10 15:58:58 UTC (rev 4518) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java 2009-03-10 16:21:47 UTC (rev 4519) @@ -143,7 +143,7 @@ } public GeometryCollection createGeometryCollection(final Geometry[] _geometries){ - return super.createGeometryCollection(_geometries); + return new GISGeometryCollection(_geometries,this); } public GISMultiPolyligne createMultiLineString(final LineString[] _lineStrings){ Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionBloc.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionBloc.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionBloc.java 2009-03-10 16:21:47 UTC (rev 4519) @@ -0,0 +1,55 @@ +/* + * @creation 6 mars 2009 + * @modification $Date:$ + * @license GNU General Public License 2 + * @copyright (c)1998-2009 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.ctulu.gis; + +import org.fudaa.ctulu.CtuluCommandContainer; + +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.Geometry; + +/** + * Une zone qui contient des blocs {@link GISGeometryCollection}. Les attributs portent sur la totalit\xE9 d'un bloc. + * Ils ne sont pas d\xE9clin\xE9s par g\xE9om\xE9trie contenues dans le bloc. En cas d'attribut atomique, celui porte dans l'ordre sur + * tous les sommets de toutes les g\xE9om\xE9tries contenues dans le bloc. + * + * @statut Experimental + * @author Bertrand Marchand + * @version $Id:$ + */ +public class GISZoneCollectionBloc extends GISZoneCollectionGeometry { + + + @Override + public void addCoordinateSequence(CoordinateSequence _seq, Object[] _datas, CtuluCommandContainer _cmd) { + throw new IllegalAccessError("Can't call this method"); + } + + @Override + public int addGeometry(Geometry _geom, Object[] _data, CtuluCommandContainer _cmd) { + if (!(_geom instanceof GISGeometryCollection)) + throw new IllegalArgumentException("Bad type geometry"); + + return super.addGeometry(_geom, _data, _cmd); + } + + @Override + public Class<? extends GISGeometryCollection> getDataStoreClass() { + return GISGeometryCollection.class; + } + + @Override + public void setCoordinateSequence(int _idx, CoordinateSequence seq, CtuluCommandContainer _cmd) { + throw new IllegalAccessError("Can't call this method"); + } + + @Override + public double getDoubleValue(int att, int geom) { + throw new IllegalAccessError("Can't call this method"); + } + +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionBloc.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueBloc.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueBloc.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueBloc.java 2009-03-10 16:21:47 UTC (rev 4519) @@ -0,0 +1,291 @@ +/* + * @creation 31 mars 2005 + * @modification $Date: 2008-10-30 10:47:50 +0100 (jeu., 30 oct. 2008) $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.ebli.calque; + +import gnu.trove.TIntArrayList; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; + +import org.fudaa.ctulu.CtuluListSelection; +import org.fudaa.ebli.commun.EbliLib; +import org.fudaa.ebli.geometrie.GrBoite; +import org.fudaa.ebli.geometrie.GrMorphisme; +import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.ebli.geometrie.GrSegment; +import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceIconModel; +import org.fudaa.ebli.trace.TraceLigne; +import org.fudaa.ebli.trace.TraceSurface; + +/** + * Un calque g\xE9rant des blocs, \xE0 un niveau global ou atomique.<p> + * Le niveau atomique des blocs est le niveau points. Le calque s'appuie sur un mod\xE8le + * {@link ZModeleBloc}. + * + * @author Bertrand Marchand + * @status Experimental + * @version $Id$ + */ +public class ZCalqueBloc extends ZCalqueGeometry<ZModeleBloc> { + + /** + * Le seul constructeur, avec le mod\xE8le. + * @param _modele le modele du calque + */ + public ZCalqueBloc(final ZModeleBloc _modele) { + super(_modele); + iconModel_ = new TraceIconModel(TraceIcon.CARRE_PLEIN, 2, Color.BLACK); + } + + public CtuluListSelection selection(final GrPoint _pt, final int _tolerance) { + if (modele_.getNombre() == 0) { + return null; + } + final GrBoite bClip = getDomaine(); + if (bClip == null) { + return null; + } + final double distanceReel = GrMorphisme.convertDistanceXY(getVersReel(), _tolerance); + if ((!bClip.contientXY(_pt)) && (bClip.distanceXY(_pt) > distanceReel)) { + return null; + } + + final GrPoint pt=new GrPoint(); + final GrSegment poly = new GrSegment(new GrPoint(), new GrPoint()); + final GrBoite bPoly = new GrBoite(new GrPoint(), new GrPoint()); + + for (int ibloc = modele_.getNombre() - 1; ibloc >= 0; ibloc--) { + if (!modele_.isGeometryVisible(ibloc)) continue; + + modele_.getDomaineForGeometry(ibloc, bPoly); + if (!bPoly.contientXY(_pt) && bPoly.distanceXY(_pt)>=distanceReel) + continue; + + int nbGeom=modele_.getNbGeometryForBloc(ibloc); + for (int igeom=nbGeom-1; igeom>=0; igeom--) { + if (modele_.isGeometryRelieeForBloc(ibloc,igeom)) { + for (int j=modele_.getNbPointForGeometry(ibloc,igeom)-1; j>0; j--) { + modele_.point(poly.e_, ibloc, igeom, j); + modele_.point(poly.o_, ibloc, igeom, j-1); + if (poly.distanceXY(_pt)<distanceReel) { + final CtuluListSelection r=new CtuluListSelection(1); + r.setSelectionInterval(ibloc, ibloc); + return r; + } + } + if (modele_.isGeometryFermeeForBloc(ibloc,igeom)) { + modele_.point(poly.e_, ibloc, igeom, 0); + modele_.point(poly.o_, ibloc, igeom, modele_.getNbPointForGeometry(ibloc, igeom)-1); + if (poly.distanceXY(_pt)<distanceReel) { + final CtuluListSelection r=new CtuluListSelection(1); + r.setSelectionInterval(ibloc, ibloc); + return r; + } + } + } + else { + for (int j=modele_.getNbPointForGeometry(ibloc, igeom)-1; j>=0; j--) { + modele_.point(pt, ibloc, igeom, j); + if (pt.distanceXY(_pt)<distanceReel) { + final CtuluListSelection r=new CtuluListSelection(1); + r.setSelectionInterval(ibloc, ibloc); + return r; + } + } + } + } + } + return null; + } + + public void paintDonnees(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { + if ((modele_ == null) || (modele_.getNombre() <= 0)) { + return; + } + final GrBoite clip = _clipReel; + final GrMorphisme versEcran = _versEcran; + final int nbBloc = modele_.getNombre(); + + final TraceLigne tl; + if (isRapide()) + tl=new TraceLigne(TraceLigne.LISSE,1,ligneModel_.getCouleur()); + else + tl= ligneModel_.buildCopy(); + + final TraceSurface ts; + if (surfModel_!=null) { + ts=surfModel_.buildCopy(); + ts.setCouleurFond(EbliLib.getAlphaColor(ts.getCouleurFond(), alpha_)); + } + else { + ts=null; + } + + final GrBoite bPoly = new GrBoite(); + bPoly.o_ = new GrPoint(); + bPoly.e_ = new GrPoint(); + + // Les surfaces, si a tracer + if (!isRapide() && ts!=null && ts.getTypeSurface()!=TraceSurface.INVISIBLE) { + TIntArrayList x=new TIntArrayList(50); + TIntArrayList y=new TIntArrayList(50); + + for (int ibloc=nbBloc-1; ibloc>=0; ibloc--) { + // La g\xE9ometrie n'est pas visible + if (!modele_.isGeometryVisible(ibloc)) + continue; + + modele_.getDomaineForGeometry(ibloc, bPoly); + // Si la boite du polygone n'est pas dans la boite d'affichage on + // passe + if (bPoly.intersectionXY(clip)==null) { + continue; + } + + int nbGeom=modele_.getNbGeometryForBloc(ibloc); + for (int igeom=nbGeom-1; igeom>=0; igeom--) { + if (!modele_.isGeometryRelieeForBloc(ibloc, igeom) || + !modele_.isGeometryFermeeForBloc(ibloc, igeom)) + continue; + + // il n'y a pas de points pour cette g\xE9om\xE9trie + final int nbPoints=modele_.getNbPointForGeometry(ibloc,igeom); + if (nbPoints<=0) + continue; + + x.reset(); + y.reset(); + final GrPoint pt=new GrPoint(); + for (int j=0; j<nbPoints; j++) { + // le point de dest est initialise + modele_.point(pt, ibloc, igeom, j); + pt.autoApplique(versEcran); + x.add((int)pt.x_); + y.add((int)pt.y_); + } + ts.remplitPolygone((Graphics2D)_g, x.toNativeArray(), y.toNativeArray()); + } + } + } + + // on part de la fin : comme ca la premiere ligne apparait au-dessus + for (int ibloc = nbBloc - 1; ibloc >= 0; ibloc--) { + // La g\xE9ometrie n'est pas visible + if (!modele_.isGeometryVisible(ibloc)) + continue; + + modele_.getDomaineForGeometry(ibloc, bPoly); + // Si la boite du polygone n'est pas dans la boite d'affichage on passe + if (bPoly.intersectionXY(clip) == null) { + continue; + } + + int nbGeom=modele_.getNbGeometryForBloc(ibloc); + for (int idxgeom=nbGeom-1; idxgeom>=0; idxgeom--) { + if (!modele_.isGeometryRelieeForBloc(ibloc, idxgeom)) + continue; + + // il n'y a pas de points pour cette g\xE9om\xE9trie + final int nbPoints=modele_.getNbPointForGeometry(ibloc, idxgeom); + if (nbPoints<=0) + continue; + + final GrPoint ptOri=new GrPoint(); + modele_.point(ptOri, ibloc, idxgeom, nbPoints-1); + ptOri.autoApplique(versEcran); + + if (!isRapide()) + initTrace(ligneModel_, ibloc); + final GrPoint ptDest=new GrPoint(); + for (int j=nbPoints-2; j>=0; j--) { + // le point de dest est initialise + modele_.point(ptDest, ibloc, idxgeom, j); + ptDest.autoApplique(versEcran); + tl.dessineTrait(_g, ptOri.x_, ptOri.y_, ptDest.x_, ptDest.y_); + ptOri.initialiseAvec(ptDest); + } + if (modele_.isGeometryFermeeForBloc(ibloc,idxgeom)) { + modele_.point(ptOri, ibloc, idxgeom, nbPoints-1); + ptOri.autoApplique(versEcran); + tl.dessineTrait(_g, ptOri.x_, ptOri.y_, ptDest.x_, ptDest.y_); + } + } + } + + // On trace les icones + paintIconsOnAtomics(_g, _versEcran, _versReel, _clipReel); + // Enfin les labels sur les atomiques. + paintLabelsOnAtomics(_g, _versEcran, _versReel, _clipReel); + } + + public void paintSelectionSimple(final Graphics _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, + final GrBoite _clipReel, CtuluListSelection _sel) { + if ((isRapide()) || (isSelectionEmpty())) { + return; + } + final GrBoite clip = _clipReel; + if (getDomaine() == null || !getDomaine().intersectXY(clip)) { + return; + + } + final GrMorphisme versEcran = _versEcran; + Color cs = _trace.getColor(); + if (isAttenue()) { + cs = attenueCouleur(cs); + } + _g.setColor(cs); + final TraceLigne tlSelection = _trace.getLigne(); + final TraceIcon ic = _trace.getIcone(); + final int nbBloc = Math.min(_sel.getMaxIndex(), modele_.getNombre() - 1); + + final GrBoite btGeom = new GrBoite(); + btGeom.e_ = new GrPoint(); + btGeom.o_ = new GrPoint(); + for (int ibloc = nbBloc; ibloc >= 0; ibloc--) { + if (!_sel.isSelected(ibloc)) { + continue; + } + modele_.getDomaineForGeometry(ibloc, btGeom); + // Si la boite de la geometrie n'est pas dans la boite d'affichage on passe + if (btGeom.intersectionXY(clip) == null) { + continue; + } + + final int nbGeom=modele_.getNbGeometryForBloc(ibloc); + for (int igeom=nbGeom-1; igeom>=0; igeom--) { + final int nbPoints=modele_.getNbPointForGeometry(ibloc,igeom); + boolean bferm=modele_.isGeometryFermeeForBloc(ibloc,igeom); + boolean breli=modele_.isGeometryRelieeForBloc(ibloc,igeom); + + final GrPoint ptOri=new GrPoint(); + modele_.point(ptOri, ibloc, igeom, nbPoints-1); + ptOri.autoApplique(versEcran); + ic.paintIconCentre(this, _g, ptOri.x_, ptOri.y_); + final GrPoint ptDest=new GrPoint(); + for (int j=nbPoints-2; j>=0; j--) { + // le point de dest est initialise + modele_.point(ptDest, ibloc, igeom, j); + ptDest.autoApplique(versEcran); + ic.paintIconCentre(this, _g, ptDest.x_, ptDest.y_); + if (breli) + tlSelection.dessineTrait((Graphics2D)_g, ptOri.x_, ptOri.y_, ptDest.x_, ptDest.y_); + ptOri.initialiseAvec(ptDest); + } + if (bferm) { + modele_.point(ptOri, ibloc, igeom, nbPoints-1); + ptOri.autoApplique(versEcran); + if (breli) + tlSelection.dessineTrait((Graphics2D)_g, ptOri.x_, ptOri.y_, ptDest.x_, ptDest.y_); + } + } + } + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueBloc.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleBloc.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleBloc.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleBloc.java 2009-03-10 16:21:47 UTC (rev 4519) @@ -0,0 +1,32 @@ +/* + * @creation 31 mars 2005 + * @modification $Date: 2009-01-23 17:12:37 +0100 (ven., 23 janv. 2009) $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.ebli.calque; + +import org.fudaa.ctulu.gis.GISZoneCollectionBloc; +import org.fudaa.ebli.geometrie.GrPoint; + +/** + * Un mod\xE8le contenant des blocs. Les modifications apport\xE9es au mod\xE8le peuvent \xEAtre \xE9cout\xE9es. + * + * @author Bertrand Marchand + * @status Experimental + * @see {@link GISZoneCollectionBloc}, {@link ZCalqueBloc}, + * @version $Id$ + */ +public interface ZModeleBloc extends ZModeleGeometry { + + int getNbGeometryForBloc(int _idxBloc); + + int getNbPointForGeometry(int _idxBloc, int _idxGeom); + + boolean isGeometryFermeeForBloc(int _idxBloc, int _idxGeom); + + boolean isGeometryRelieeForBloc(int _idxBloc, int _idxGeom); + + boolean point(GrPoint _pt, int _idxBloc, int _idxGeom, int _pointIdx); +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleBloc.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleBlocDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleBlocDefault.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleBlocDefault.java 2009-03-10 16:21:47 UTC (rev 4519) @@ -0,0 +1,68 @@ +/* + * @creation 4 avr. 2005 + * @modification $Date: 2008-11-12 14:36:43 +0100 (mer., 12 nov. 2008) $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.ebli.calque.edition; + +import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface; +import org.fudaa.ctulu.gis.GISGeometryCollection; +import org.fudaa.ctulu.gis.GISZoneCollectionBloc; +import org.fudaa.ebli.calque.ZCalqueBloc; +import org.fudaa.ebli.calque.ZModeleBloc; +import org.fudaa.ebli.geometrie.GrPoint; + +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.LineString; + +/** + * Un mod\xE8le contenant des blocs. Les modifications apport\xE9es au mod\xE8le peuvent \xEAtre \xE9cout\xE9es. + * + * @author Bertrand Marchand + * @status Experimental + * @see {@link GISZoneCollectionBloc}, {@link ZCalqueBloc}, + * @version $Id$ + */ +public class ZModeleBlocDefault extends ZModeleGeometryDefault + implements ZModeleBloc { + + public ZModeleBlocDefault() { + this(new GISZoneCollectionBloc()); + } + + public ZModeleBlocDefault(GISZoneCollectionBloc _zone) { + super(_zone); + } + + public int getNbGeometryForBloc(int _idxBloc) { + return getGeomData().getGeometry(_idxBloc).getNumGeometries(); + } + + public int getNbPointForGeometry(int _idxBloc, int _idxGeom) { + Geometry g=((GISGeometryCollection)geometries_.getGeometry(_idxBloc)).getGeometryN(_idxGeom); + return g.getNumPoints(); + } + + public boolean isGeometryFermeeForBloc(int _idxBloc, int _idxGeom) { + Geometry g=((GISGeometryCollection)geometries_.getGeometry(_idxBloc)).getGeometryN(_idxGeom); + return (g instanceof LineString && ((LineString)g).isClosed()); + } + + public boolean isGeometryRelieeForBloc(int _idxBloc, int _idxGeom) { + Geometry g=((GISGeometryCollection)geometries_.getGeometry(_idxBloc)).getGeometryN(_idxGeom); + return (g instanceof LineString); + } + + public boolean point(GrPoint _pt, int _idxBloc, int _idxGeom, int _pointIdx) { + final CoordinateSequence g=((GISCoordinateSequenceContainerInterface)((GISGeometryCollection)geometries_.getGeometry(_idxBloc)). + getGeometryN(_idxGeom)).getCoordinateSequence(); + _pt.x_ = g.getX(_pointIdx); + _pt.y_ = g.getY(_pointIdx); + _pt.z_=g.getOrdinate(_pointIdx, 2); + + return true; + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleBlocDefault.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-03-10 15:59:08
|
Revision: 4518 http://fudaa.svn.sourceforge.net/fudaa/?rev=4518&view=rev Author: bmarchan Date: 2009-03-10 15:58:58 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Correctif sur le collage des sommets. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/CutCopyPasteManager.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/CutCopyPasteManager.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/CutCopyPasteManager.java 2009-03-08 15:16:35 UTC (rev 4517) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/CutCopyPasteManager.java 2009-03-10 15:58:58 UTC (rev 4518) @@ -74,21 +74,21 @@ * manipulation de la fen\xEAtre. */ protected class EventFrameManager extends InternalFrameAdapter { - public boolean blockPaste_=false; - public boolean blockCopy_=false; - public boolean blockCut_=false; + public boolean disablePaste_=false; + public boolean disableCopy_=false; + public boolean disableCut_=false; public void internalFrameActivated(InternalFrameEvent e) { - blockPaste_=false; - blockCopy_=false; - blockCut_=false; + disablePaste_=false; + disableCopy_=false; + disableCut_=false; updateButtons(); } public void internalFrameDeactivated(InternalFrameEvent e) { - blockPaste_=true; - blockCopy_=true; - blockCut_=true; + disablePaste_=true; + disableCopy_=true; + disableCut_=true; updateButtons(); } } @@ -98,13 +98,13 @@ * calques. */ protected class EventSelectedGeometriesManager implements ZSelectionListener { - public boolean blockPaste_=false; - public boolean blockCopy_=false; - public boolean blockCut_=false; + public boolean disablePaste_=false; + public boolean disableCopy_=false; + public boolean disableCut_=false; public void selectionChanged(ZSelectionEvent _evt) { - blockCopy_=zScene_.isSelectionEmpty(); - blockCut_=zScene_.isSelectionEmpty()||zScene_.isAtomicMode(); + disableCopy_=zScene_.isSelectionEmpty(); + disableCut_=zScene_.isSelectionEmpty()||zScene_.isAtomicMode(); updateButtons(); } } @@ -114,14 +114,13 @@ * l'arbre des calques. */ protected class EventSelectedCalquesManager implements TreeSelectionListener { - public boolean blockPaste_=false; - public boolean blockCopy_=false; - public boolean blockCut_=false; + public boolean disablePaste_=false; + public boolean disableCopy_=false; + public boolean disableCut_=false; public void valueChanged(TreeSelectionEvent e) { - blockCut_=!(mdlFille2d_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueEditable); - blockCopy_=blockCut_; - blockPaste_=blockCut_; + disableCut_=!(mdlFille2d_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueEditable); + disablePaste_=!(mdlFille2d_.getArbreCalqueModel().getSelectedCalque() instanceof ZCalqueEditable); updateButtons(); } } @@ -153,9 +152,9 @@ * Active les boutons qui doivent l'\xEAtre. */ protected void updateButtons() { - copyAction_.setEnabled(!eventManager1_.blockCopy_&&!eventManager2_.blockCopy_&&!eventManager3_.blockCopy_); - pasteAction_.setEnabled((models_.size()>0||coordinates_.size()>0)&&!eventManager1_.blockPaste_&&!eventManager2_.blockPaste_&&!eventManager3_.blockPaste_); - cutAction_.setEnabled(!eventManager1_.blockCut_&&!eventManager2_.blockCut_&&!eventManager3_.blockCut_); + copyAction_.setEnabled(!eventManager1_.disableCopy_&&!eventManager2_.disableCopy_&&!eventManager3_.disableCopy_); + pasteAction_.setEnabled((models_.size()>0||coordinates_.size()>0)&&!eventManager1_.disablePaste_&&!eventManager2_.disablePaste_&&!eventManager3_.disablePaste_); + cutAction_.setEnabled(!eventManager1_.disableCut_&&!eventManager2_.disableCut_&&!eventManager3_.disableCut_); } public void copy() { @@ -166,6 +165,7 @@ int[] idxScene=zScene_.getLayerSelectionMulti().getIdxSelected(); if (idxScene!=null) { for(int i=0;i<idxScene.length;i++) { + int idx=zScene_.sceneId2LayerId(idxScene[i]); // Extraction des informations sur la zone GISZoneCollection zone=((ZModeleEditable) zScene_.getLayerForId(idxScene[i]).modeleDonnees()).getGeomData(); GISAttributeInterface attrZ=zone.getAttributeIsZ(); @@ -173,16 +173,16 @@ if(attrZ!=null) idxAttrZ=zone.getIndiceOf(zone.getAttributeIsZ()); // La g\xE9om\xE9trie \xE0 traiter - CoordinateSequence seqGeom=zone.getCoordinateSequence(zScene_.sceneId2LayerId(idxScene[i])); + CoordinateSequence seqGeom=zone.getCoordinateSequence(idx); int[] selectedIdx=zScene_.getLayerSelectionMulti().getSelection(idxScene[i]).getSelectedIndex(); // Extraction des coordonn\xE9es for(int j=0;j<selectedIdx.length;j++) { Coordinate coord=seqGeom.getCoordinate(selectedIdx[j]); if(attrZ!=null) { if(attrZ.isAtomicValue()) - coord.z=(Double) ((GISAttributeModel) zone.getValue(idxAttrZ, zScene_.sceneId2LayerId(idxScene[i]))).getObjectValueAt(selectedIdx[j]); + coord.z=(Double) ((GISAttributeModel) zone.getValue(idxAttrZ, idx)).getObjectValueAt(selectedIdx[j]); else - coord.z=(Double) zone.getValue(selectedIdx[j], idxAttrZ); + coord.z=(Double) zone.getValue(idxAttrZ,idx); } coordinates_.add(coord); } @@ -249,7 +249,7 @@ } // Collage de points else { - cmd=new CtuluCommandComposite(FudaaLib.getS("Coller des points")); + cmd=new CtuluCommandComposite(FudaaLib.getS("Coller des sommets")); ZCalqueEditable calque=((ZCalqueEditable)zScene_.getCalqueActif()); ZModeleEditable modele=(ZModeleEditable)calque.modeleDonnees(); GISZoneCollection zone=modele.getGeomData(); @@ -279,9 +279,9 @@ Object[] data=new Object[zone.getNbAttributes()]; if (attrZ!=null) if (attrZ.isAtomicValue()) { - data[idxAttrZ]=new double[coordSeq.size()]; + data[idxAttrZ]=new Double[coordSeq.size()]; for (int i=0; i<coordSeq.size(); i++) - ((double[])data[idxAttrZ])[i]=coordSeq.getOrdinate(i, 2); + ((Double[])data[idxAttrZ])[i]=new Double(coordSeq.getOrdinate(i, 2)); } else { boolean allSame=true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2009-03-08 15:16:46
|
Revision: 4517 http://fudaa.svn.sourceforge.net/fudaa/?rev=4517&view=rev Author: deniger Date: 2009-03-08 15:16:35 +0000 (Sun, 08 Mar 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoDataType.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoEntite.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoEntiteGenerate.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoKeyword.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacSourceMng.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/animation/EbliAnimation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportHelper.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/TrLauncherDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/mv/TestProfile.java branches/Prepro-0.92-SNAPSHOT/fudaa/test/org/fudaa/fudaa/tr/Test3D.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoArtemisv5p9.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoEstel2dv5p9.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoEstel3dv5p9.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoPostel3dv5p9.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoSisyphev5p9.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoSpartacus2dv5p9.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoStbtelv5p9.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoTelemac2dv5p9.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoTelemac3dv5p9.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoTomawacv5p9.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoDataType.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoDataType.java 2009-03-06 18:45:46 UTC (rev 4516) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoDataType.java 2009-03-08 15:16:35 UTC (rev 4517) @@ -10,12 +10,11 @@ import java.util.Collection; import java.util.Iterator; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluLibArray; -import org.fudaa.ctulu.CtuluLibMessage; import org.fudaa.ctulu.CtuluLibString; +import com.memoire.fu.FuLog; + /** * @author deniger * @version $Id: DicoDataType.java,v 1.24 2007-06-28 09:25:08 deniger Exp $ @@ -87,13 +86,10 @@ } public String getInvalideMessage(final String _data) { - if (_data == null) { - return DicoResource.getS("Valeur nulle"); - } + if (_data == null) { return DicoResource.getS("Valeur nulle"); } final String t = _data.toUpperCase(); - if (((CtuluLibArray.findObject(TRUE_VALUES, t) < 0) && (CtuluLibArray.findObject(FALSE_VALUES, t) < 0))) { - return DicoResource.getS("Valeur non reconnue"); - } + if (((CtuluLibArray.findObject(TRUE_VALUES, t) < 0) && (CtuluLibArray.findObject(FALSE_VALUES, t) < 0))) { return DicoResource + .getS("Valeur non reconnue"); } return null; } @@ -110,9 +106,7 @@ } public boolean isValide(final String _data) { - if (_data == null) { - return false; - } + if (_data == null) { return false; } final String t = _data.toUpperCase(); return ((CtuluLibArray.findObject(TRUE_VALUES, t) >= 0) || (CtuluLibArray.findObject(FALSE_VALUES, t) >= 0)) ? true : false; @@ -142,9 +136,7 @@ } public String getDefaultValue() { - if (isChoiceEnable()) { - return super.getDefaultValue(); - } + if (isChoiceEnable()) { return super.getDefaultValue(); } return CtuluLibString.EMPTY_STRING; } @@ -188,12 +180,8 @@ } public final boolean isValide(final String _data) { - if (_data.length() == 0) { - return true; - } - if (isChoiceEnable()) { - return isValideIntern(_data); - } + if (_data.length() == 0) { return true; } + if (isChoiceEnable()) { return isValideIntern(_data); } return true; } @@ -237,16 +225,12 @@ } protected final String getInvalideMessageIntern(final String _data) { - if (!isValide(_data)) { - return DicoResource.getS("La valeur ne correspond pas \xE0 un choix impos\xE9"); - } + if (!isValide(_data)) { return DicoResource.getS("La valeur ne correspond pas \xE0 un choix impos\xE9"); } return null; } protected boolean isValideIntern(final String _data) { - if (isEditable_) { - return true; - } + if (isEditable_) { return true; } return (CtuluLibArray.findObject(choiceKeys_, _data) < 0) ? false : true; } @@ -281,9 +265,7 @@ * @return les valeurs */ public final String[] getChoiceValues() { - if (choiceValues_ == null) { - return null; - } + if (choiceValues_ == null) { return null; } final String[] r = new String[choiceValues_.length]; System.arraycopy(choiceValues_, 0, r, 0, r.length); return r; @@ -305,9 +287,7 @@ * @return la valeur correspondante dans les choix geres par ce type */ public String getValue(final String _keys) { - if (!isChoiceEnable()) { - return null; - } + if (!isChoiceEnable()) { return null; } final int tempi = CtuluLibArray.findObject(choiceKeys_, _keys); return tempi < 0 ? null : choiceValues_[tempi]; } @@ -353,14 +333,11 @@ * @param _values le tableau des valeurs correspondantes */ public void setChoice(final String[] _keys, final String[] _values) { - if (_keys == null) { - throw new IllegalArgumentException("keywords null"); - } + if (_keys == null) { throw new IllegalArgumentException("keywords null"); } choiceKeys_ = _keys; choiceValues_ = _values; - if ((choiceValues_ != null) && (choiceKeys_.length != choiceValues_.length)) { - throw new IllegalArgumentException("Arrays have different size"); - } + if ((choiceValues_ != null) && (choiceKeys_.length != choiceValues_.length)) { throw new IllegalArgumentException( + "Arrays have different size"); } } } @@ -386,9 +363,7 @@ * @return la valeur correspondante dans les choix geres par ce type */ public final String getValue(final String _keys) { - if (!isChoiceEnable()) { - return null; - } + if (!isChoiceEnable()) { return null; } int tempi = CtuluLibArray.findObject(choiceKeys_, _keys); if (_keys != null && tempi < 0 && _keys.length() > 1 && _keys.endsWith(CtuluLibString.DOT)) { tempi = CtuluLibArray.findObject(choiceKeys_, _keys.substring(0, _keys.length() - 1)); @@ -398,18 +373,15 @@ protected final boolean isValideIntern(final String _data) { final boolean r = super.isValideIntern(_data); - if (!r && _data != null && _data.endsWith(CtuluLibString.DOT)) { - return isValideIntern(_data.substring(0, _data.length() - 1)); - } + if (!r && _data != null && _data.endsWith(CtuluLibString.DOT)) { return isValideIntern(_data.substring(0, _data + .length() - 1)); } return r; } public String getControleDescription() { if (controle_) { - if (minOnly_) { - return DicoResource.getS("Valeur sup\xE9rieure \xE0 {0}", CtuluLibString.getString(min_)); - } + if (minOnly_) { return DicoResource.getS("Valeur sup\xE9rieure \xE0 {0}", CtuluLibString.getString(min_)); } return DicoResource.getS("Valeur comprise dans l'intervalle [{0},{1}]", CtuluLibString.getString(min_), CtuluLibString.getString(max_)); } @@ -431,9 +403,7 @@ } public String getDefaultValue() { - if (isChoiceEnable()) { - return super.getDefaultValue(); - } + if (isChoiceEnable()) { return super.getDefaultValue(); } return CtuluLibString.ZERO; } @@ -446,9 +416,7 @@ } public final String getInvalideMessage(final String _data) { - if (isChoiceEnable()) { - return getInvalideMessageIntern(_data); - } + if (isChoiceEnable()) { return getInvalideMessageIntern(_data); } int t; try { t = Integer.parseInt(_data); @@ -458,10 +426,9 @@ if (controle_) { if ((minOnly_) && (t < min_)) { return DicoResource.getS("La valeur doit \xEAtre sup\xE9rieure \xE0 {0}", CtuluLibString.getString(min_)); - } else if ((t < min_) || (t > max_)) { - return DicoResource.getS("La valeur doit appartenir \xE0 l'intervalle [ {0},{1}]", CtuluLibString - .getString(min_), CtuluLibString.getString(max_)); - } + } else if ((t < min_) || (t > max_)) { return DicoResource.getS( + "La valeur doit appartenir \xE0 l'intervalle [ {0},{1}]", CtuluLibString.getString(min_), CtuluLibString + .getString(max_)); } } return null; } @@ -514,9 +481,7 @@ } public boolean isValide(final String _data) { - if (isChoiceEnable()) { - return isValideIntern(_data); - } + if (isChoiceEnable()) { return isValideIntern(_data); } int t; try { t = Integer.parseInt(_data); @@ -526,9 +491,7 @@ if (controle_) { if ((minOnly_) && (t < min_)) { return false; - } else if ((t < min_) || (t > max_)) { - return false; - } + } else if ((t < min_) || (t > max_)) { return false; } } return true; } @@ -641,9 +604,7 @@ * @return la version immutable pour le type entier */ public static ImmutableEntier getImmutableEntier(final Entier _s) { - if (_s.isChoiceEnable() || _s.isControle()) { - return new ImmutableEntier(_s); - } + if (_s.isChoiceEnable() || _s.isControle()) { return new ImmutableEntier(_s); } return EMPTY; } @@ -687,9 +648,7 @@ * @return la version immutable (EMPTY si pas de controle) */ public static ImmutableReel getImmutableReel(final Reel _s) { - if (_s.isControle()) { - return new ImmutableReel(_s); - } + if (_s.isControle()) { return new ImmutableReel(_s); } return EMPTY; } @@ -730,9 +689,7 @@ public String getControleDescription() { if (controle_) { - if (minOnly_) { - return DicoResource.getS("Valeur sup\xE9rieure \xE0 {0}", Double.toString(min_)); - } + if (minOnly_) { return DicoResource.getS("Valeur sup\xE9rieure \xE0 {0}", Double.toString(min_)); } return DicoResource.getS("Valeur comprise dans l'intervalle [{0},{1}]", Double.toString(min_), Double .toString(max_)); } @@ -754,9 +711,7 @@ } public String getDefaultValue() { - if (isChoiceEnable()) { - return super.getDefaultValue(); - } + if (isChoiceEnable()) { return super.getDefaultValue(); } return CtuluLibString.ZERO; } @@ -858,16 +813,14 @@ } public final boolean isValide(final String _data) { - if (isChoiceEnable()) { - return isValideIntern(_data); - } + if (isChoiceEnable()) { return isValideIntern(_data); } double t = 0D; String data = _data; - if (CtuluLibMessage.DEBUG) { - if (data.indexOf('d') > 0) { - data = _data.replace('d', 'E'); - } + // if (CtuluLibMessage.DEBUG) { + if (data.indexOf('d') > 0) { + data = _data.replace('d', 'E'); } + // } if (data.indexOf('D') > 0) { data = _data.replace('D', 'E'); } @@ -879,9 +832,7 @@ if (controle_) { if ((minOnly_) && (t < min_)) { return false; - } else if ((t < min_) || (t > max_)) { - return false; - } + } else if ((t < min_) || (t > max_)) { return false; } } return true; } @@ -925,13 +876,9 @@ * @return true si toutes les valeurs sont valides. */ public final static boolean areAllValid(final DicoDataType _dt, final Collection _s) { - if (_s == null) { - return false; - } + if (_s == null) { return false; } for (final Iterator iter = _s.iterator(); iter.hasNext();) { - if (!_dt.isValide((String) iter.next())) { - return false; - } + if (!_dt.isValide((String) iter.next())) { return false; } } return true; } @@ -942,14 +889,10 @@ * @return true si toutes les valeurs sont valides */ public final static boolean areAllValid(final DicoDataType _dt, final String[] _s) { - if (_s == null) { - return false; - } + if (_s == null) { return false; } final int n = _s.length - 1; for (int i = n; i >= 0; i--) { - if (!_dt.isValide(_s[i])) { - return false; - } + if (!_dt.isValide(_s[i])) { return false; } } return true; } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoEntite.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoEntite.java 2009-03-06 18:45:46 UTC (rev 4516) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoEntite.java 2009-03-08 15:16:35 UTC (rev 4517) @@ -658,6 +658,7 @@ public Vecteur(final String _nom, final DicoDataType _t, final String _sepChar) { super(_nom, _t); sepChar_ = _sepChar; + if(sepChar_==null) sepChar_=getSep(); nbElem_ = -1; } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoEntiteGenerate.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoEntiteGenerate.java 2009-03-06 18:45:46 UTC (rev 4516) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoEntiteGenerate.java 2009-03-08 15:16:35 UTC (rev 4517) @@ -86,9 +86,7 @@ * @param _t le type des donnees */ public DicoEntiteGenerate(final DicoDataTypeGenerate _t) { - if (_t == null) { - throw new IllegalArgumentException("Le type must be not null"); - } + if (_t == null) { throw new IllegalArgumentException("Le type must be not null"); } type_ = _t; } @@ -191,9 +189,7 @@ final String _varArrayByLanguage) throws IOException { writeByLanguage(_out, noms_, _varArrayByLanguage); final String var = printNew(_out, _type, _varNbLanguageName, _varArrayByLanguage); - if (var == null) { - return null; - } + if (var == null) { return null; } _out.writeln(var + ".setNiveau(" + niveau_ + getParFerm(), true); // aide if (aides_ != null) { @@ -250,17 +246,13 @@ protected abstract DicoEntite getEntite(int _l, boolean _initialyzeAll); protected String isDefautValuesValides() { - if (defautValues_ == null) { - return null; - } + if (defautValues_ == null) { return null; } final int l = defautValues_.length; DicoEntite ent; for (int i = 0; i < l; i++) { ent = getEntite(i, false); final String s = ent.getInvalideMessage(defautValues_[i]); - if (s != null) { - return getGuill() + defautValues_[i] + getGuill() + get2Pt() + DodicoLib.getS("non valide"); - } + if (s != null) { return getGuill() + defautValues_[i] + getGuill() + get2Pt() + DodicoLib.getS("non valide"); } } return null; } @@ -331,9 +323,7 @@ public String getFrenchRubriqueInComportFormat() { if (rubriques_ != null) { final String[] rInL = rubriques_[0]; - if (rInL == null) { - return null; - } + if (rInL == null) { return null; } final StringBuffer b = new StringBuffer(50); final char rSep = DicoKeyword.getComportRubriqueSep(); final int l = rInL.length; @@ -371,9 +361,7 @@ if (listByLangage[0].size() == 0) { // c'est peut-etre un mot-cle final int id = _name.lastIndexOf('*'); - if ((id > 0) && (id < _name.length())) { - return getEntiteGenerationWithFrenchName(_name.substring(id + 1), _ent); - } + if ((id > 0) && (id < _name.length())) { return getEntiteGenerationWithFrenchName(_name.substring(id + 1), _ent); } return null; } final String[][] r = new String[l][]; @@ -417,9 +405,7 @@ public void computeActionAffichage(final DicoKeyword _kw, final DicoEntiteGenerate[] _entites, final List _m, final CtuluAnalyze _analyze) { - if ((_m == null) || (_m.size() <= 0)) { - return; - } + if ((_m == null) || (_m.size() <= 0)) { return; } comportData_ = new ComportData[_m.size()]; int index = 0; for (final Iterator it = _m.iterator(); it.hasNext();) { @@ -429,7 +415,6 @@ int idxFin = stemp.indexOf(')'); String rubrOuEntite = null; - if ((idxDeb > 0) && (idxFin > idxDeb)) { String substring = stemp.substring(idxDeb + 1, idxFin); rubrOuEntite = DicoKeyword.computeValue(substring); @@ -582,12 +567,11 @@ public Vecteur(final DicoDataTypeGenerate _t, final String _sepChar) { super(_t); sepChar_ = _sepChar; + if (sepChar_ == null) sepChar_ = DicoEntite.getSep(); } public void computeDefaultValues(final String[] _array) { - if (_array == null) { - return; - } + if (_array == null) { return; } final int n = _array.length - 1; for (int i = n; i >= 0; i--) { final String string = _array[i]; @@ -660,9 +644,7 @@ } public void computeDefaultValues(final String[] _array) { - if (_array == null) { - return; - } + if (_array == null) { return; } final int n = _array.length - 1; for (int i = n; i >= 0; i--) { final String string = _array[i]; @@ -731,22 +713,17 @@ static class IndexComparator implements Comparator { public int compare(final Object _o1, final Object _o2) { - if ((!(_o1 instanceof DicoEntite)) || (!(_o2 instanceof DicoEntite))) { - throw new IllegalArgumentException("Comparator can process telemac keyword only"); - } + if ((!(_o1 instanceof DicoEntite)) || (!(_o2 instanceof DicoEntite))) { throw new IllegalArgumentException( + "Comparator can process telemac keyword only"); } final DicoEntite t1 = (DicoEntite) _o1; final DicoEntite t2 = (DicoEntite) _o2; // si les types de donnees sont du meme type - if (!t1.type_.getClass().isInstance(t2.type_)) { - throw new IllegalArgumentException("Only keywords with same type (logical,real,..) are comparable"); - } - if (t1.equalsEntite(t2)) { - return 0; - } + if (!t1.type_.getClass().isInstance(t2.type_)) { throw new IllegalArgumentException( + "Only keywords with same type (logical,real,..) are comparable"); } + if (t1.equalsEntite(t2)) { return 0; } final int r = t1.getIndex() - t2.getIndex(); - if (r == 0) { - throw new IllegalArgumentException(t1.getNom() + " and " + t2.getNom() + " have identic index" + t1.getIndex()); - } + if (r == 0) { throw new IllegalArgumentException(t1.getNom() + " and " + t2.getNom() + " have identic index" + + t1.getIndex()); } return r; } } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoKeyword.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoKeyword.java 2009-03-06 18:45:46 UTC (rev 4516) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/dico/DicoKeyword.java 2009-03-08 15:16:35 UTC (rev 4517) @@ -236,7 +236,7 @@ r = new DicoDataTypeGenerate.Reel(); } else if ("REAL".equals(_type)) { r = new DicoDataTypeGenerate.Reel(); - } else if (getTypeLogique().equals(_type)) { + } else if (getTypeLogique().equals(_type)|| "LOGICAL".equals(_type)) { r = new DicoDataTypeGenerate.Binaire(); } return r; Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacSourceMng.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacSourceMng.java 2009-03-06 18:45:46 UTC (rev 4516) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacSourceMng.java 2009-03-08 15:16:35 UTC (rev 4517) @@ -264,17 +264,13 @@ return getSource(_idx).getVx(); } else if (_ent == vyEnt_) { return getSource(_idx).getVy(); - } else if (_ent == traceurEnt_) { - return getSource(_idx).getT(); - } + } else if (_ent == traceurEnt_) { return getSource(_idx).getT(); } new Throwable().printStackTrace(); return 0; } private double getValueFromArray(final String[] _tab, final int _i) { - if (_tab == null || _i >= _tab.length) { - return 0; - } + if (_tab == null || _i >= _tab.length) { return 0; } return Double.parseDouble(_tab[_i]); } @@ -312,6 +308,10 @@ } traceurEnt_ = (DicoEntite.Vecteur) model.getEntiteFor(new String[] { "VALEURS DU TRACEUR AUX SOURCES", "VALUES OF THE TRACER AT THE SOURCES" }); + if (traceurEnt_ == null) { + traceurEnt_ = (DicoEntite.Vecteur) model.getEntiteFor(new String[] { "VALEURS DES TRACEURS DES SOURCES", + "VALUES OF THE TRACERS AT THE SOURCES" }); + } vxEnt_ = (DicoEntite.Vecteur) model.getEntiteFor(new String[] { "VITESSES DES SOURCES SELON X", "VELOCITIES OF THE SOURCES ALONG X" }); if (vxEnt_ == null) { @@ -377,9 +377,7 @@ return _s.setVx(_d); } else if (_ent == vyEnt_) { return _s.setVy(_d); - } else if (_ent == traceurEnt_) { - return _s.setT(_d); - } + } else if (_ent == traceurEnt_) { return _s.setT(_d); } new Throwable().printStackTrace(); return false; } @@ -398,9 +396,7 @@ } protected void majFromDico(final DicoEntite.Vecteur _v) { - if (sources_ == null) { - return; - } + if (sources_ == null) { return; } final String[] vals = getValueFromDico(_v, sources_.getSize(), null); if (vals == null || vals.length != sources_.getSize()) { dico_.setValue(_v, computeValueForDico(_v)); @@ -441,15 +437,9 @@ * @param _cmd le receveur de commande */ public void addSource(final String[] _vals, final CtuluCommandContainer _cmd) { - if ((_vals == null) || (_vals.length != vectEnt_.size())) { - return; - } - if ((_vals[0] == null) || (_vals[0].trim().length() == 0)) { - return; - } - if ((_vals[1] == null) || (_vals[1].trim().length() == 0)) { - return; - } + if ((_vals == null) || (_vals.length != vectEnt_.size())) { return; } + if ((_vals[0] == null) || (_vals[0].trim().length() == 0)) { return; } + if ((_vals[1] == null) || (_vals[1].trim().length() == 0)) { return; } final H2dTelemacSource sip = new H2dTelemacSource(); for (int i = 0; i < _vals.length; i++) { final DicoEntite.Vecteur v = (DicoEntite.Vecteur) vectEnt_.get(i); @@ -536,14 +526,10 @@ * @return la valeur commune ou null si non commune */ public String getCommonValues(final int[] _selectedSiphon, final DicoEntite.Vecteur _ent) { - if (_selectedSiphon == null || _selectedSiphon.length == 0) { - return null; - } + if (_selectedSiphon == null || _selectedSiphon.length == 0) { return null; } final String init = getDisplayValue(_selectedSiphon[0], _ent); for (int i = _selectedSiphon.length - 1; i > 0; i--) { - if (!init.equals(getDisplayValue(_selectedSiphon[i], _ent))) { - return null; - } + if (!init.equals(getDisplayValue(_selectedSiphon[i], _ent))) { return null; } } return init; } @@ -584,9 +570,7 @@ */ public double[] getCommonSiphonEndsValues(final int[] _idxSiphon, final int[] _idxExtremiteSelec) { if ((_idxSiphon == null) || (_idxSiphon.length == 0) || (_idxExtremiteSelec == null) - || (_idxExtremiteSelec.length != _idxSiphon.length)) { - return null; - } + || (_idxExtremiteSelec.length != _idxSiphon.length)) { return null; } final int[] var1 = getSiphonSource1IndexVar(); final int[] var2 = getSiphonSource2IndexVar(); final double[] r = new double[var1.length]; @@ -640,9 +624,7 @@ } public String getDefaultValue(final DicoEntite _ent) { - if (defaultValues_ != null && defaultValues_.containsKey(_ent)) { - return (String) defaultValues_.get(_ent); - } + if (defaultValues_ != null && defaultValues_.containsKey(_ent)) { return (String) defaultValues_.get(_ent); } return _ent.getType().getDefaultValue(); } @@ -758,9 +740,7 @@ * @return tableau de la meme taille que idxValues contenant les valeurs communes. */ public Double[] getSiphonCommonValuesFor(final int[] _idxSiphon, final int[] _idxValues) { - if (_idxValues == null) { - return null; - } + if (_idxValues == null || getNbSiphon() == 0) { return null; } final Double[] r = new Double[_idxValues.length]; if ((_idxSiphon != null) && (_idxSiphon.length > 0)) { H2dtelemacSiphon sip = getSiphon(_idxSiphon[0]); @@ -824,8 +804,8 @@ } /* *//** - * @return true si le mot-cle definissant le debit est cree - */ + * @return true si le mot-cle definissant le debit est cree + */ /* * public boolean isDebitDefined(){ return dico_.isValueSetFor(qEnt_); } */ @@ -919,9 +899,7 @@ * @param _analyse le receveur des erreurs. */ public void loadSiphons(final H2dTelemacSiphonContainer _c, final CtuluAnalyze _analyse) { - if (_c == null || _c.getNbSiphon() == 0) { - return; - } + if (_c == null || _c.getNbSiphon() == 0) { return; } // que faire si des siphons ont d\xE9ja ete importes if (siphons_ != null) { new Throwable().printStackTrace(); @@ -1118,9 +1096,7 @@ * @return true si enleve */ public boolean removeListener(final H2dtelemacSiponListener _l) { - if (listener_ != null) { - return listener_.remove(_l); - } + if (listener_ != null) { return listener_.remove(_l); } return false; } @@ -1130,9 +1106,7 @@ */ public int[] getSiphonUsingSource(final int[] _idxSource) { // pas de siphons ou parametres incorrect on renvoie tableau vide - if (siphons_ == null || (_idxSource == null) || (_idxSource.length == 0)) { - return new int[0]; - } + if (siphons_ == null || (_idxSource == null) || (_idxSource.length == 0)) { return new int[0]; } final TIntArrayList r = new TIntArrayList(); for (int i = siphons_.getSize() - 1; i >= 0; i--) { if (getSiphon(i).useOneSource(_idxSource)) { @@ -1148,9 +1122,7 @@ */ public TIntIntHashMap getSiphonUsingSourceAndEnds(final int[] _idxSource) { // pas de siphons ou parametres incorrect on renvoie tableau vide - if (siphons_ == null || (_idxSource == null) || (_idxSource.length == 0)) { - return new TIntIntHashMap(); - } + if (siphons_ == null || (_idxSource == null) || (_idxSource.length == 0)) { return new TIntIntHashMap(); } final TIntIntHashMap r = new TIntIntHashMap(); for (int i = siphons_.getSize() - 1; i >= 0; i--) { final int result = getSiphon(i).useOneSourceAndWhichEnd(_idxSource); @@ -1167,13 +1139,9 @@ */ public boolean isSiphonUsingSource(final int[] _idxSource) { // pas de siphons ou parametres incorrect on renvoie tableau vide - if (siphons_ == null || (_idxSource == null) || (_idxSource.length == 0)) { - return false; - } + if (siphons_ == null || (_idxSource == null) || (_idxSource.length == 0)) { return false; } for (int i = siphons_.getSize() - 1; i >= 0; i--) { - if (getSiphon(i).useOneSource(_idxSource)) { - return true; - } + if (getSiphon(i).useOneSource(_idxSource)) { return true; } } return false; } @@ -1184,13 +1152,9 @@ */ public boolean isSiphonUsingSource(final int _idxSource) { // pas de siphons ou parametres incorrect on renvoie tableau vide - if (siphons_ == null || (_idxSource < 0)) { - return false; - } + if (siphons_ == null || (_idxSource < 0)) { return false; } for (int i = siphons_.getSize() - 1; i >= 0; i--) { - if (getSiphon(i).useSource(_idxSource)) { - return true; - } + if (getSiphon(i).useSource(_idxSource)) { return true; } } return false; } @@ -1201,13 +1165,9 @@ */ public int getSiphonUsingSource(final int _idxSource) { // pas de siphons ou parametres incorrect on renvoie tableau vide - if (siphons_ == null || (_idxSource < 0)) { - return -1; - } + if (siphons_ == null || (_idxSource < 0)) { return -1; } for (int i = siphons_.getSize() - 1; i >= 0; i--) { - if (getSiphon(i).useSource(_idxSource)) { - return i; - } + if (getSiphon(i).useSource(_idxSource)) { return i; } } return -1; } @@ -1217,9 +1177,7 @@ * @return les indices des sources utilisees par les siphons */ public int[] getSrcUsedByCulvert(final int[] _idxCulvert) { - if (siphons_ == null || (_idxCulvert == null) || (_idxCulvert.length == 0)) { - return new int[0]; - } + if (siphons_ == null || (_idxCulvert == null) || (_idxCulvert.length == 0)) { return new int[0]; } // normalement une arraylist suffit pour savoir quels sources sont utilisees // au cas telemac autorise plusieurs siphons sur une source final TIntHashSet r = new TIntHashSet(); Added: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoArtemisv5p9.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoArtemisv5p9.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/dico/DicoArtemisv5p9.java 2009-03-08 15:16:35 UTC (rev 4517) @@ -0,0 +1,2703 @@ +/* + *File generated by fudaa + */ + +package + org.fudaa.dodico.telemac.dico; + +import org.fudaa.dodico.dico.*; +/** + * @author deniger + */ + +public class + DicoArtemisv5p9 + extends DicoModelAbstract +{ + public + DicoArtemisv5p9 + () + { + super(); + } + public + DicoArtemisv5p9 +(int _l) + { + super(_l); + } + public + DicoArtemisv5p9 +(String _l) + { + super(_l); + } + public final String getCodeName() + { + return "artemis"; + } + public final String getVersion() + { + return "v5p9"; + } + protected String[] createNoms() + { + String[] noms; + if(languageIndex_==0) + { + noms=new String[]{"ACCELERATION DE LA PESANTEUR","ALPHA","ANGLE MAXIMUM DE PROPAGATION","ANGLE MINIMUM DE PROPAGATION","BALAYAGE EN PERIODE","BIBLIOTHEQUES","BINAIRE DU FICHIER DE GEOMETRIE","BINAIRE DU FICHIER DES RESULTATS","CHAINE BIDON","COEFFICIENT DE FROTTEMENT", + "COEFFICIENT DE RELAXATION","COEFFICIENT DE RIDES","CONDITIONS INITIALES","COORDONNEES DE L'ORIGINE","COTE INITIALE","DATE DE L'ORIGINE DES TEMPS","DEFERLEMENT","DESCRIPTION DES LIBRAIRIES","DIAMETRE50","DIAMETRE90", + "DICTIONNAIRE","DIRECTION DE PROPAGATION DE LA HOULE","DISCRETISATION EN ESPACE","EXECUTABLE PAR DEFAUT","EXECUTABLE PARALLELE PAR DEFAUT","EXPOSANT S","FACTEUR DE FROTTEMENT","FACTEUR DE FROTTEMENT IMPOSE","FICHIER DE DONNEES BINAIRE 1","FICHIER DE DONNEES BINAIRE 2", + "FICHIER DE DONNEES FORMATE 1","FICHIER DE DONNEES FORMATE 2","FICHIER DE GEOMETRIE","FICHIER DE REFERENCE","FICHIER DES CONDITIONS AUX LIMITES","FICHIER DES FONDS","FICHIER DES PARAMETRES","FICHIER DES RESULTATS","FICHIER DES RESULTATS BINAIRE","FICHIER DES RESULTATS FORMATE", + "FICHIER FORTRAN","FORMULATION DU DEFERLEMENT","FORMULATION DU FROTTEMENT DE FOND","FROTTEMENT","GAMMA","GAMMAS","GDALLY","HAUTEUR INITIALE","HEURE DE L'ORIGINE DES TEMPS","HOULE ALEATOIRE MONODIRECTIONNELLE", + "HOULE ALEATOIRE MULTIDIRECTIONNELLE","INFORMATIONS SUR LE SOLVEUR","KDALLY","LISSAGE DES HAUTEURS DE HOULE","LISSAGES DU FOND","LISTE DES FICHIERS","LOI DE FROTTEMENT SUR LE FOND","LONGUEUR DU VECTEUR","MASSE VOLUMIQUE DU FLUIDE","MASSE VOLUMIQUE DU SEDIMENT", + "MAXIMUM D'ITERATIONS POUR LE SOLVEUR","MAXIMUM DE SOUS-ITERATIONS","MOT DE PASSE CRAY","NOMBRE DE DIRECTIONS DE DISCRETISATION","NOMBRE DE PERIODES DE DISCRETISATION","NOMBRE DE VARIABLES PRIVEES","NUMERO DE COMPTE","NUMERO DE VERSION","OPTION DU SOLVEUR","PAS POUR LE BALAYAGE EN PERIODE", + "PERIODE DE DEBUT POUR LE BALAYAGE EN PERIODE","PERIODE DE FIN POUR LE BALAYAGE EN PERIODE","PERIODE DE LA HOULE","PERIODE DE PIC","PERIODE DE SORTIE GRAPHIQUE","PERIODE DE SORTIE LISTING","PERIODE MAXIMUM DU SPECTRE","PERIODE MINIMUM DU SPECTRE","PLACE MEMOIRE CRAY","PRECISION DU SOLVEUR", + "PRECISION SUR LES SOUS-ITERATIONS","PRECONDITIONNEMENT","PRIORITE","PROCESSEURS PARALLELES","PRODUIT MATRICE-VECTEUR","REGIME HYDRAULIQUE IMPOSE","RELAXATION SUR LA DISSIPATION","RUGOSITE DE PEAU SEULE","SOLVEUR","SORTIE LISTING", + "STANDARD DU FICHIER DE GEOMETRIE","STANDARD DU FICHIER DES RESULTATS","STOCKAGE DES MATRICES","TEMPS MACHINE CRAY","TITRE","TYPE DU REGIME HYDRAULIQUE","USER CRAY","VALEUR MINIMUM DE H","VALIDATION","VARIABLES A IMPRIMER", + "VARIABLES POUR LES SORTIES GRAPHIQUES","VISCOSITE CINEMATIQUE DU FLUIDE","ZERO"}; + } + else if(languageIndex_==1) + { + noms=new String[]{"ACCOUNT NUMBER","ALPHA","BEGINNING PERIOD FOR PERIOD SCANNING","BIDON STRING","BINARY DATA FILE 1","BINARY DATA FILE 2","BINARY RESULTS FILE","BOTTOM FRICTION LAW","BOTTOM TOPOGRAPHY FILE","BOTTOM TOPOGRAPHY SMOOTHING", + "BOUNDARY CONDITIONS FILE","BREAKING","BREAKING LAW","CPU TIME","DEFAULT EXECUTABLE","DEFAULT PARALLEL EXECUTABLE","DESCRIPTION DES LIBRARIES","DIAMETER50","DIAMETER90","DICTIONARY", + "DIRECTION OF WAVE PROPAGATION","DISCRETIZATION IN SPACE","DISSIPATION RELAXATION","ENDING PERIOD FOR PERIOD SCANNING","FLUID KINEMATIC VISCOSITY","FLUID SPECIFIC MASS","FORMATTED DATA FILE 1","FORMATTED DATA FILE 2","FORMATTED RESULTS FILE","FORTRAN FILE", + "FRICTION","FRICTION COEFFICIENT","FRICTION FACTOR","FRICTION FACTOR IMPOSED","GAMMA","GAMMAS","GDALLY","GEOMETRY FILE","GEOMETRY FILE BINARY","GEOMETRY FILE STANDARD", + "GRAPHIC PRINTOUT PERIOD","GRAVITY ACCELERATION","HYDRAULIC REGIME IMPOSED","HYDRAULIC REGIME TYPE","INFORMATIONS ABOUT SOLVER","INITIAL CONDITIONS","INITIAL DEPTH","INITIAL WATER LEVEL","KDALLY","LAW OF BOTTOM FRICTION", + "LIBRARIES","LIST OF FILES","LISTING PRINTOUT","LISTING PRINTOUT PERIOD","MATRIX STORAGE","MATRIX-VECTOR PRODUCT","MAXIMUM ANGLE OF PROPAGATION","MAXIMUM NUMBER OF ITERATIONS FOR SOLVER","MAXIMUM OF SUB-ITERATIONS","MAXIMUM SPECTRAL PERIOD", + "MEMORY SPACE","MINIMUM ANGLE OF PROPAGATION","MINIMUM SPECTRAL PERIOD","MINIMUM VALUE FOR H","MONODIRECTIONAL RANDOM WAVE","MULTIDIRECTIONAL RANDOM WAVE","NUMBER OF DIRECTIONS","NUMBER OF PERIODS","NUMBER OF PRIVATE VARIABLES","ORIGIN COORDINATES", + "ORIGINAL DATE OF TIME","ORIGINAL HOUR OF TIME","PARALLEL PROCESSORS","PASSWORD","PEAK PERIOD","PERIOD SCANNING","PRECONDITIONING","PRIORITY","REFERENCE FILE","RELAXATION COEFFICIENT", + "RELEASE","RESULTS FILE","RESULTS FILE BINARY","RESULTS FILE STANDARD","RIPPLES COEFFICIENT","S EXPONENT","SEDIMENT SPECIFIC WEIGHT","SKIN ROUGHNESS ONLY","SOLVER","SOLVER ACCURACY", + "SOLVER OPTION","STEERING FILE","STEP FOR PERIOD SCANNING","SUB-ITERATIONS ACCURACY","TITLE","USER CRAY","VALIDATION","VARIABLES FOR GRAPHIC PRINTOUTS","VARIABLES TO BE PRINTED","VECTOR LENGTH", + "WAVE HEIGHTS SMOOTHING","WAVE PERIOD","ZERO"}; + } + else noms=null; + return noms; + } + protected final DicoEntite[] createEntites() + { + DicoComportValues[] comportValues; + DicoEntite.Simple entiteSimple; + DicoEntite.Tableau entiteTableau; + DicoEntite.Vecteur entiteVecteur; + DicoDataType.Entier typeEntier; + DicoDataType.Binaire typeBinaire; + DicoDataType.Chaine typeChaine; + DicoDataType.Reel typeReel; + String[] choiceKeys; + String[][] choiceValues; + String[] valueByLanguage=new String[2]; + DicoEntite[] entites=new DicoEntite[103]; + + //start FICHIER DE GEOMETRIE + typeChaine=new DicoDataType.Chaine(); + typeChaine.setFileType(true); + choiceKeys=null; + choiceValues=new String[][] {{"geo"} + ,{"geo"} }; + typeChaine.setChoice(choiceValues[languageIndex_],choiceKeys); + typeChaine.setEditable(true); + + valueByLanguage[0]="FICHIER DE GEOMETRIE"; + valueByLanguage[1]="GEOMETRY FILE"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeChaine); + entiteSimple.setNiveau(1); + valueByLanguage[0]="Nom du fichier contenant le maillage du calcul a realiser."; + valueByLanguage[1]="Name of the file which contains the computational mesh."; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="ENTREES-SORTIES,FICHIERS"; + valueByLanguage[1]="INPUT-OUTPUT,FILES"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + entites[0]=entiteSimple.getImmutable(); + + + //start BINAIRE DU FICHIER DES RESULTATS + typeChaine=new DicoDataType.Chaine(); + choiceKeys=null; + choiceValues=new String[][] {{"IBM","I3E","STD"} + ,{"IBM","I3E","STD"} }; + typeChaine.setChoice(choiceValues[languageIndex_],choiceKeys); + typeChaine.setEditable(true); + + valueByLanguage[0]="BINAIRE DU FICHIER DES RESULTATS"; + valueByLanguage[1]="RESULTS FILE BINARY"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeChaine); + entiteSimple.setNiveau(2); + valueByLanguage[0]="Type du binaire utilise pour l'ecriture du fichier des resultats." + +"\nCe type depend de la machine sur laquelle le fichier a ete genere." + +"\nLes valeurs possibles sont les memes que pour le fichier de geometrie."; + valueByLanguage[1]="Binary type used to write on the results file. This type depends on " + +"\nthe machine used to create this file. Allowed values are the same" + +"\nas used for the geometry file."; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="ENTREES-SORTIES,FICHIERS"; + valueByLanguage[1]="INPUT-OUTPUT,FILES"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="STD"; + valueByLanguage[1]="STD"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[1]=entiteSimple.getImmutable(); + + + //start TITRE + typeChaine=new DicoDataType.Chaine(); + + valueByLanguage[0]="TITRE"; + valueByLanguage[1]="TITLE"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeChaine); + entiteSimple.setNiveau(1); + valueByLanguage[0]="Titre du cas etudie."; + valueByLanguage[1]="Title of the studied case."; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="ENTREES-SORTIES,GENERALITES"; + valueByLanguage[1]="INPUT-OUTPUT,INFORMATION"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="PAS DE TITRE DANS LE FICHIER CAS"; + valueByLanguage[1]="NO TITLE IN THE STEERING FILE"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[2]=entiteSimple.getImmutable(); + + + //start LONGUEUR DU VECTEUR + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="LONGUEUR DU VECTEUR"; + valueByLanguage[1]="VECTOR LENGTH"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="LONGUEUR DU VECTEUR POUR LES MACHINES VECTORIELLES"; + valueByLanguage[1]="VECTOR LENGTH ON VECTOR MACHINES"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="ENTREES-SORTIES,GENERALITES"; + valueByLanguage[1]="INPUT-OUTPUT,INFORMATION"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="128"; + valueByLanguage[1]="128"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[3]=entiteSimple.getImmutable(); + + + //start LOI DE FROTTEMENT SUR LE FOND + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="LOI DE FROTTEMENT SUR LE FOND"; + valueByLanguage[1]="LAW OF BOTTOM FRICTION"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="Non utilise dans ARTEMIS. On le laisse par coherence avec TELEMAC2D"; + valueByLanguage[1]="Not used in ARTEMIS. It is kept for consistence with TELEMAC2D"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="DISSIPATION"; + valueByLanguage[1]="DISSIPATION"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="0"; + valueByLanguage[1]="0"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[4]=entiteSimple.getImmutable(); + + + //start STOCKAGE DES MATRICES + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="STOCKAGE DES MATRICES"; + valueByLanguage[1]="MATRIX STORAGE"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="1 : EBE classique 2 : EBE assemble 3 : par segment" + +"\n attention, avec 2, il faut une numerotation speciale des points"; + valueByLanguage[1]="1 : classical EBE 2 : assembled EBE 3 : edge by edge" + +"\n beware, with option 2, a special numbering of points is required"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="PARAMETRES NUMERIQUES"; + valueByLanguage[1]="NUMERICAL PARAMETERS"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="3"; + valueByLanguage[1]="3"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[5]=entiteSimple.getImmutable(); + + + //start PRODUIT MATRICE-VECTEUR + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="PRODUIT MATRICE-VECTEUR"; + valueByLanguage[1]="MATRIX-VECTOR PRODUCT"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="1 : Ancien Produit 2 : Nouveau Produit Frontal"; + valueByLanguage[1]="1 : Classical Product 2 : New Frontal Product"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="PARAMETRES NUMERIQUES"; + valueByLanguage[1]="NUMERICAL PARAMETERS"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="1"; + valueByLanguage[1]="1"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[6]=entiteSimple.getImmutable(); + + + //start USER CRAY + typeChaine=new DicoDataType.Chaine(); + + valueByLanguage[0]="USER CRAY"; + valueByLanguage[1]="USER CRAY"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeChaine); + entiteSimple.setNiveau(1); + valueByLanguage[0]="Userid CRAY de l'utilisateur."; + valueByLanguage[1]="Userid CRAY of the user."; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="ENTREES-SORTIES,GENERALITES"; + valueByLanguage[1]="INPUT-OUTPUT,INFORMATION"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + entites[7]=entiteSimple.getImmutable(); + + + //start PERIODE DE SORTIE GRAPHIQUE + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="PERIODE DE SORTIE GRAPHIQUE"; + valueByLanguage[1]="GRAPHIC PRINTOUT PERIOD"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(1); + valueByLanguage[0]="Determine la periode, en nombre de periodes de houle," + +"\nd'impression des VARIABLES POUR LES SORTIES GRAPHIQUES (voir ce mot-" + +"\ncle) dans le FICHIER DES RESULTATS"; + valueByLanguage[1]="Fixes the period, in number of wave periods, for the writing" + +"\nof the VARIABLES FOR GRAPHIC PRINTOUTS (see this key-word) in the" + +"\nRESULTS FILE"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="ENTREES-SORTIES,GRAPHIQUES ET LISTING"; + valueByLanguage[1]="INPUT-OUTPUT,GRAPHICS AND LISTING"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="1"; + valueByLanguage[1]="1"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[8]=entiteSimple.getImmutable(); + + + //start PERIODE DE SORTIE LISTING + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="PERIODE DE SORTIE LISTING"; + valueByLanguage[1]="LISTING PRINTOUT PERIOD"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(1); + valueByLanguage[0]="Determine la periode, en nombre de periodes de houle," + +"\nd'impression des VARIABLES A IMPRIMER (voir ce mot-cle). Pour la mise" + +"\nau point, il faut savoir que la sortie des resultats est effectuee" + +"\nsystematiquement sur le fichier de retour d'execution du code" + +"\n(actuellement accessible par le menu 3.e de SPF sur IBM)"; + valueByLanguage[1]="Fixes the period, in number of wave periods, for the writing" + +"\nof the VARIABLES TO BE PRINTED (see this key-word)"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="ENTREES-SORTIES,GRAPHIQUES ET LISTING"; + valueByLanguage[1]="INPUT-OUTPUT,GRAPHICS AND LISTING"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="1"; + valueByLanguage[1]="1"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[9]=entiteSimple.getImmutable(); + + + //start MAXIMUM D'ITERATIONS POUR LE SOLVEUR + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="MAXIMUM D'ITERATIONS POUR LE SOLVEUR"; + valueByLanguage[1]="MAXIMUM NUMBER OF ITERATIONS FOR SOLVER"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="Les algorithmes utilises pour la resolution du systeme" + +"\nmatriciel etant iteratifs, il est necessaire de limiter le nombre" + +"\nd'iterations autorisees"; + valueByLanguage[1]="Algorithms used for solving the matrix system are iterative." + +"\nIt is then necessary to limit the maximum number of iterations"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="PARAMETRES NUMERIQUES,SOLVEUR"; + valueByLanguage[1]="NUMERICAL PARAMETERS,SOLVER"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="60000"; + valueByLanguage[1]="60000"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[10]=entiteSimple.getImmutable(); + + + //start NOMBRE DE PERIODES DE DISCRETISATION + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="NOMBRE DE PERIODES DE DISCRETISATION"; + valueByLanguage[1]="NUMBER OF PERIODS"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(1); + valueByLanguage[0]="Valeur utilisee avec l'option :" + +"\n HOULE ALEATOIRE MONODIRECTIONNELLE = OUI" + +"\n ou avec l'option" + +"\n HOULE ALEATOIRE MULTIDIRECTIONNELLE = OUI" + +"\nPour un calcul en houle aleatoire monodirectionnelle ou" + +"\nmultidirectionnelle, nombre de bandes d'egale energie servant a" + +"\ndiscretiser le spectre d'energie en frequence."; + valueByLanguage[1]="Used with otion :" + +"\n MONODIRECTIONAL RANDOM WAVE = YES" + +"\n or" + +"\n MULTIDIRECTIONAL RANDOM WAVE = YES" + +"\nIt fixes the number of iso-energy frequency bands which discretize" + +"\nthe enrgy spectrum."; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="PARAMETRES PHYSIQUES"; + valueByLanguage[1]="PHYSICAL PARAMETERS"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="5"; + valueByLanguage[1]="5"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[11]=entiteSimple.getImmutable(); + + + //start LISSAGES DU FOND + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="LISSAGES DU FOND"; + valueByLanguage[1]="BOTTOM TOPOGRAPHY SMOOTHING"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="Nombre de lissages effectues sur la topographie." + +"\nchaque lissage, effectue a l'aide d'une matrice de masse," + +"\nest conservatif." + +"\nUtilise lorsque les donnees de bathymetrie donnent des resultats" + +"\ntrop irreguliers apres interpolation."; + valueByLanguage[1]="Number of smoothings done on the topography." + +"\nEach smoothing, using a mass matrix, is conservative." + +"\nIt is used when bathymetric data provide too irregular results" + +"\nafter interpolation."; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="EQUATIONS,LISSAGE"; + valueByLanguage[1]="EQUATIONS,SMOOTHINGS"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="0"; + valueByLanguage[1]="0"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[12]=entiteSimple.getImmutable(); + + + //start COTE INITIALE + typeReel=new DicoDataType.Reel(); + + valueByLanguage[0]="COTE INITIALE"; + valueByLanguage[1]="INITIAL WATER LEVEL"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeReel); + entiteSimple.setNiveau(1); + valueByLanguage[0]="Valeur utilisee avec l'option CONDITIONS INITIALES : COTE CONSTANTE."; + valueByLanguage[1]="Used with the option INITIAL CONDITIONS : CONSTANT ELEVATION."; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="EQUATIONS CONDITIONS INITIALES"; + valueByLanguage[1]="INITIAL CONDITIONS EQUATIONS"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="0."; + valueByLanguage[1]="0."; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[13]=entiteSimple.getImmutable(); + + + //start PRECONDITIONNEMENT + typeEntier=new DicoDataType.Entier(); + choiceKeys=new String[]{"0","2","3","5","7"}; + choiceValues=new String[][] {{"pas de preconditionnement","preconditionnement diagonal","preconditionnement bloc-diagonal","preconditionnement diagonal en valeur absolue","preconditionnement de Crout par element"} + ,{"no preconditioning","diagonal preconditioning","block-diagonal preconditioning","absolute value diagonal preconditioning","Crout preconditioning"} }; + typeEntier.setChoice(choiceKeys,choiceValues[languageIndex_]); + + valueByLanguage[0]="PRECONDITIONNEMENT"; + valueByLanguage[1]="PRECONDITIONING"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="Permet de preconditionner le systeme de l'etape de propagation afin" + +"\nd'accelerer la convergence lors de sa resolution." + +"\n - 0 : pas de preconditionnement," + +"\n - 2 : preconditionnement diagonal." + +"\n - 3 : preconditionnement bloc-diagonal." + +"\n - 5 : preconditionnement diagonal en valeur absolue." + +"\n - 7 : preconditionnement de Crout par element." + +"\nCertains preconditionnements sont cumulables" + +"\n(les diagonaux 2 ou 3 avec les autres)" + +"\nPour cette raison on ne retient que les nombres premiers pour" + +"\ndesigner les preconditionnements. Si l'on souhaite en cumuler" + +"\nplusieurs on formera le produit des options correspondantes."; + valueByLanguage[1]="Enables to apply preconditionning the matrix system to accelerate" + +"\nthe convergence of the solver." + +"\n - 0 : no preconditionning" + +"\n - 2 : diagonal preconditionning" + +"\n - 3 : block-diagonal preconditionning" + +"\n - 5 : diagonal preconditionning in absolute value" + +"\n - 7 : Element Crout preconditionning." + +"\nFew of them can be combined" + +"\n(numbers 2 or 3 with the other)" + +"\nTo combine some preconditionning, impose the product of the previous" + +"\nnumbers : example 6 means preconditionnig 2 and 3 applied."; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="PARAMETRES NUMERIQUES,SOLVEUR"; + valueByLanguage[1]="NUMERICAL PARAMETERS,SOLVER"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="2"; + valueByLanguage[1]="2"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[14]=entiteSimple.getImmutable(); + + + //start SOLVEUR + typeEntier=new DicoDataType.Entier(); + choiceKeys=new String[]{"1","2","3","4","5","6","7","8"}; + choiceValues=new String[][] {{"gradient conjugue","residu conjugue","gradient conjugue sur equation normale","erreur minimale","gradient conjugue carre (non programme)","CGSTAB","GMRES","direct"} + ,{"conjugate gradient","conjugate residual","conjugate gradient on a normal equation","minimum error","squared conjugate gradient","CGSTAB","GMRES","direct"} }; + typeEntier.setChoice(choiceKeys,choiceValues[languageIndex_]); + + valueByLanguage[0]="SOLVEUR"; + valueByLanguage[1]="SOLVER"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="Permet de choisir le solveur utilise pour la resolution de l'etape de" + +"\npropagation. Toutes les methodes proposees actuellement s'apparentent" + +"\nau Gradient Conjugue. Ce sont :" + +"\n 1 : gradient conjugue" + +"\n 2 : residu conjugue" + +"\n 3 : gradient conjugue sur equation normale" + +"\n 4 : erreur minimale" + +"\n 5 : gradient conjugue carre (non programme)" + +"\n 6 : gradient conjugue de type CGSTAB" + +"\n 7 : GMRES" + +"\n 8 : solveur direct"; + valueByLanguage[1]="Enables to choose the solver used for solving the matrix system." + +"\nThey are :" + +"\n 1 : conjugate gradient" + +"\n 2 : conjugate residual" + +"\n 3 : conjugate gradient on the normal equation" + +"\n 4 : minimum error" + +"\n 5 : squarred conjugate gradient (not programmed)" + +"\n 6 : CGSTAB conjugate gradient" + +"\n 7 : GMRES" + +"\n 8 : direct solver"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="PARAMETRES NUMERIQUES,SOLVEUR"; + valueByLanguage[1]="NUMERICAL PARAMETERS,SOLVER"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="8"; + valueByLanguage[1]="8"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[15]=entiteSimple.getImmutable(); + + + //start OPTION DU SOLVEUR + typeEntier=new DicoDataType.Entier(); + + valueByLanguage[0]="OPTION DU SOLVEUR"; + valueByLanguage[1]="SOLVER OPTION"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="Parametre definissant la dimension de l'espace de Krylov" + +"\npour le solveur 7 (GMRES)"; + valueByLanguage[1]="Defines the dimension of the Krylov space when using" + +"\nthe solver 7 (GMRES)"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="PARAMETRES NUMERIQUES,SOLVEUR"; + valueByLanguage[1]="NUMERICAL PARAMETERS,SOLVER"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="3"; + valueByLanguage[1]="3"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[16]=entiteSimple.getImmutable(); + + + //start STANDARD DU FICHIER DE GEOMETRIE + typeEntier=new DicoDataType.Entier(); + choiceKeys=new String[]{"1","2","3"}; + choiceValues=new String[][] {{"LEONARD","RUBENS","SELAFIN"} + ,{"LEONARD","RUBENS","SELAFIN"} }; + typeEntier.setChoice(choiceKeys,choiceValues[languageIndex_]); + typeEntier.setEditable(true); + + valueByLanguage[0]="STANDARD DU FICHIER DE GEOMETRIE"; + valueByLanguage[1]="GEOMETRY FILE STANDARD"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="Adapte la lecture du FICHIER DE GEOMETRIE au standard choisi pour" + +"\ncelui-ci. Ce peut etre :" + +"\n - 1 : un maillage regulier au standard LEONARD," + +"\n - 2 : un maillage quelconque au standard RUBENS," + +"\n - 3 : un maillage quelconque au standard SELAFIN."; + valueByLanguage[1]="Adapts the reading of the GEOMETRY FILE to the specific standard :" + +"\n - 1 : regular mesh on standard LEONARD" + +"\n - 2 : any mesh on standard RUBENS" + +"\n - 3 : any mesh on standard SELAFIN"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="ENTREES-SORTIES,FICHIERS"; + valueByLanguage[1]="INPUT-OUTPUT,FILES"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="3"; + valueByLanguage[1]="3"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[17]=entiteSimple.getImmutable(); + + + //start STANDARD DU FICHIER DES RESULTATS + typeEntier=new DicoDataType.Entier(); + choiceKeys=new String[]{"1","2","3"}; + choiceValues=new String[][] {{"LEONARD","RUBENS","SELAFIN"} + ,{"LEONARD","RUBENS","SELAFIN"} }; + typeEntier.setChoice(choiceKeys,choiceValues[languageIndex_]); + typeEntier.setEditable(true); + + valueByLanguage[0]="STANDARD DU FICHIER DES RESULTATS"; + valueByLanguage[1]="RESULTS FILE STANDARD"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeEntier); + entiteSimple.setNiveau(2); + valueByLanguage[0]="Standard du fichier des resultats :" + +"\n - 1 : un maillage regulier au standard LEONARD," + +"\n - 2 : un maillage quelconque au standard RUBENS," + +"\n - 3 : un maillage quelconque au standard SELAFIN."; + valueByLanguage[1]="Specific standard of the results file :" + +"\n - 1 : regular mesh on standard LEONARD" + +"\n - 2 : any mesh on standard RUBENS" + +"\n - 3 : any mesh on standard SELAFIN"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="ENTREES-SORTIES,FICHIERS"; + valueByLanguage[1]="INPUT-OUTPUT,FILES"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="3"; + valueByLanguage[1]="3"; + entiteSimple.setDefautValue(valueByLanguage[languageIndex_]); + entites[18]=entiteSimple.getImmutable(); + + + //start PERIODE DE PIC + typeReel=new DicoDataType.Reel(); + + valueByLanguage[0]="PERIODE DE PIC"; + valueByLanguage[1]="PEAK PERIOD"; + entiteSimple=new DicoEntite.Simple(valueByLanguage[languageIndex_],typeReel); + entiteSimple.setNiveau(1); + valueByLanguage[0]="Valeur utilisee avec l'option :" + +"\n HOULE ALEATOIRE MONODIRECTIONNELLE = OUI" + +"\n ou avec l'option" + +"\n HOULE ALEATOIRE MULTIDIRECTIONNELLE = OUI" + +"\nFixe la periode de pic (en sec) du spectre d'energie."; + valueByLanguage[1]="Used with otion :" + +"\n MONODIRECTIONAL RANDOM WAVE = YES" + +"\n or" + +"\n MULTIDIRECTIONAL RANDOM WAVE = YES" + +"\nFixes the peak period (in sec) of the energy spectrum"; + entiteSimple.setAide(valueByLanguage[languageIndex_]); + valueByLanguage[0]="PARAMETRES PHYSIQUES"; + valueByLanguage[1]="PHYSICAL PARAMETERS"; + entiteSimple.setRubrique(valueByLanguage[languageIndex_]); + valueByLanguage[0]="10.0"... [truncated message content] |
From: <had...@us...> - 2009-03-06 18:46:18
|
Revision: 4516 http://fudaa.svn.sourceforge.net/fudaa/?rev=4516&view=rev Author: hadouxad Date: 2009-03-06 18:45:46 +0000 (Fri, 06 Mar 2009) Log Message: ----------- persistence dpti mise en place des controlleurs xsd test unitaires strict test avec donnes erronnes pour eprouver les moulinettes Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoOPTG.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDFRT.xsd branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheOrifice.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/reader/Crue10reader.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue10writer.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/AppCrueTest.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/CruePersistanceErrorManager.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDFRTFile.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDRSOFile.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueFactoryDao.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDPTI.xsd branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideTest.xsd branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestClasse.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDPTIFile.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/componentTestClasse.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/testXsd.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-06 14:58:09 UTC (rev 4515) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-06 18:45:46 UTC (rev 4516) @@ -39,5 +39,7 @@ Est ce que cette r\xE8gle est g\xE9n\xE9rale? c'est \xE0 dire que tous les objets de dpti sont des r\xE9f\xE9rences de drso et qu'ils ont toujours le mot clef DRSO# devant ? - Balises <Branches>,fichier modele3.dpti.xml: la balise <BrancheOrifice> contient la balise <OuvPasseDessous> de plus que les autres types de branches. - Est-ce bien la seule \xE0 poss\xE9der ce type de balise ou toutes peuvent les poss\xE9der? y'a t'il d'autres cas particuliers comme celui-ci pour les branches ? + Est-ce bien la seule \xE0 poss\xE9der ce type de balise ou toutes peuvent les poss\xE9der? y'a t'il d'autres cas particuliers comme celui-ci pour les branches ? + - Balises <Sections>, fichier modele3.dpti.xml: les sections sont vides. Est ce normal ou cas particulier? Si non Quelles donn\xE9es fournit-on pour les sections dans le fichier dpti (pas d'autres fichier dpti exemples pour les mod\xE8les 4 et 5.) + \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java 2009-03-06 14:58:09 UTC (rev 4515) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java 2009-03-06 18:45:46 UTC (rev 4516) @@ -29,13 +29,13 @@ public void fillInfosWith(List<DonFrt> data,List<String> listeMessageError) { - listeFrottement=CrueDaoFillInfos.remplirPersistanceAvecFrottemetnsDFRT(data,listeMessageError); + listeFrottement=CrueFactoryDao.remplirPersistanceAvecFrottemetnsDFRT(data,listeMessageError); } - public List<DonFrt> fillInfosWithPersistant(List<String> listeMessageError) { - return CrueDaoFillInfos.remplirFrottemetnsAvecPersistanceDFRT(listeFrottement,listeMessageError); + public List<DonFrt> fillInfosWithPersistant(Object data,List<String> listeMessageError) { + return CrueFactoryDao.remplirFrottemetnsAvecPersistanceDFRT(listeFrottement,listeMessageError); } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java 2009-03-06 14:58:09 UTC (rev 4515) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java 2009-03-06 18:45:46 UTC (rev 4516) @@ -1,8 +1,10 @@ package main.java.org.fudaa.dodico.crue.dao; +import java.util.ArrayList; import java.util.List; import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract; import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract; @@ -20,9 +22,11 @@ */ public class CrueDaoDPTI extends CrueDaoParsing<List<EMH>>{ + /** + * Suffixe ajout\xE9 aux r\xE9f\xE9rences des objets emh du fichier dpti pour indiquer qu'ils r\xE9f\xE8rent aux objets d\xE9finis dans DRSO. + */ + public static final String SUFFIXE_REF_DRSO="DRSO#"; - - /** * la liste des noeuds */ @@ -45,21 +49,55 @@ private List<SectionAbstract> Sections; @Override - void fillInfosWith(List<EMH> data, List<String> listeMessageError) { + public void fillInfosWith(List<EMH> data, List<String> listeMessageError) { // TODO Auto-generated method stub + //-- etape 1: on remplit les infso des noeuds --// + Noeuds=CrueFactoryDao.remplirPersistanceAvecNoeudDPTI(data,listeMessageError); + //-- etape 2: on remplit les infso des branches --// + Branches=CrueFactoryDao.remplirPersistanceAvecBrancheDPTI(data,listeMessageError); + + + //-- etape 3: on remplit les infso des casiers --// + Casiers=CrueFactoryDao.remplirPersistanceAvecCasierDPTI(data,listeMessageError); + + + //-- etape 4: on remplit les infso des sections --// + Sections=new ArrayList<SectionAbstract>(); } @Override - List<EMH> fillInfosWithPersistant(List<String> listeMessageError) { - // TODO Auto-generated method stub - return null; + List<EMH> fillInfosWithPersistant(Object data,List<String> listeMessageError) { + + if(data==null || ! (data instanceof List)){ + listeMessageError.add(CrueRessource.getS("Impossible de r\xE9cup\xE9rer les donn\xE9es r\xE9saux (DRSO). Les r\xE9f\xE9rences du fichier DPTI ne pourront etre utilis\xE9es.")); + return null; + } + List<EMH> listeEMHDRSO=(List<EMH> )data; + + //-- remplissage des noeuds --// + CrueFactoryDao.remplirNoeudAvecPersistanceDPTI(Noeuds,listeEMHDRSO,listeMessageError); + + //-- remplissage des branches --// + CrueFactoryDao.remplirBrancheAvecPersistanceDPTI(Branches, listeEMHDRSO,listeMessageError); + + + //-- remplissage des casiers --// + CrueFactoryDao.remplirCasierAvecPersistanceDPTI(Casiers, listeEMHDRSO, listeMessageError); + + //-- remplissage des sections --// + + //TODO pour le moment rien mais il faudrait demander des pr\xE9cisions --// + + return listeEMHDRSO; } @Override - XStream initXmlParser() { - // TODO Auto-generated method stub - return null; + public XStream initXmlParser() { + XStream xstream = new XStream(new DomDriver()); + //-- init du parser --// + (new DaoStructuresFormatDPTI()).initXmlParserForDPTI(xstream); + return xstream; } } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-03-06 14:58:09 UTC (rev 4515) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-03-06 18:45:46 UTC (rev 4516) @@ -53,18 +53,18 @@ public void fillInfosWith(List<EMH> data,List<String> listeMessageError) { //-- etape 1: on remplit les infso des noeuds --// - Noeuds=CrueDaoFillInfos.remplirPersistanceAvecNoeudDRSO(data,listeMessageError); + Noeuds=CrueFactoryDao.remplirPersistanceAvecNoeudDRSO(data,listeMessageError); //-- etape 2: on remplit les infso des branches --// - Branches=CrueDaoFillInfos.remplirPersistanceAvecBrancheDRSO(data,listeMessageError); + Branches=CrueFactoryDao.remplirPersistanceAvecBrancheDRSO(data,listeMessageError); //-- etape 3: on remplit les infso des casiers --// - Casiers=CrueDaoFillInfos.remplirPersistanceAvecCasierDRSO(data,listeMessageError); + Casiers=CrueFactoryDao.remplirPersistanceAvecCasierDRSO(data,listeMessageError); //-- etape 4: on remplit les infso des sections --// - Sections=CrueDaoFillInfos.remplirPersistanceAvecSectionsDRSO(data,listeMessageError); + Sections=CrueFactoryDao.remplirPersistanceAvecSectionsDRSO(data,listeMessageError); @@ -72,23 +72,23 @@ } @Override - public List<EMH> fillInfosWithPersistant(List<String> listeMessageError) { + public List<EMH> fillInfosWithPersistant(Object data,List<String> listeMessageError) { List<EMH> listeCompleteEMH=new ArrayList<EMH>(); //-- etape 1: on remplit les infso des noeuds --// - List<EMH> listeNoeuds=CrueDaoFillInfos.remplirNoeudAvecPersistanceDRSO(Noeuds,listeMessageError); + List<EMH> listeNoeuds=CrueFactoryDao.remplirNoeudAvecPersistanceDRSO(Noeuds,listeMessageError); //-- etape 2: les casiers --// - List<EMH> listeCasiers=CrueDaoFillInfos.remplirCasierAvecPersistanceDRSO(Casiers, listeNoeuds,listeMessageError); + List<EMH> listeCasiers=CrueFactoryDao.remplirCasierAvecPersistanceDRSO(Casiers, listeNoeuds,listeMessageError); //-- etape 3: les branches et les sections de bransche --// - List<EMH> listeBranches=CrueDaoFillInfos.remplirBrancheAvecPersistanceDRSO(Branches, listeNoeuds,listeMessageError); + List<EMH> listeBranches=CrueFactoryDao.remplirBrancheAvecPersistanceDRSO(Branches, listeNoeuds,listeMessageError); //-- etape 3: les sections a partir des sections cr\xE9es lors du remplissage des branches --// - List<EMH> listeSections= CrueDaoFillInfos.remplirSectionsAvecPersistanceDRSO(Sections, listeBranches,listeMessageError); + List<EMH> listeSections= CrueFactoryDao.remplirSectionsAvecPersistanceDRSO(Sections, listeBranches,listeMessageError); Deleted: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java 2009-03-06 14:58:09 UTC (rev 4515) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java 2009-03-06 18:45:46 UTC (rev 4516) @@ -1,566 +0,0 @@ -package main.java.org.fudaa.dodico.crue.dao; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; - -import org.fudaa.ebli.geometrie.GrPoint; -import org.fudaa.ebli.ressource.EbliResource; - -import com.lowagie.text.Section; - -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDRSO.*; -import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDFRT.*; -import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHBranche; -import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHCasier; -import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHNoeud; -import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHSection; -import main.java.org.fudaa.dodico.crue.metier.emh.DonFrt; -import main.java.org.fudaa.dodico.crue.metier.emh.EMH; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageFilEau; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageGenerique; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageRhone; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheEnchainement; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheNiveauxAssocies; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheOrifice; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBranchePdc; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSaintVenant; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilLongitudinale; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilTransversal; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheStrickler; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHCasierMNT; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHCasierProfil; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionIdem; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionInterpolee; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionProfil; -import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionSansGeometrie; -import main.java.org.fudaa.dodico.crue.metier.emh.StriRefC; -import main.java.org.fudaa.dodico.crue.metier.emh.StriRefH; -import main.java.org.fudaa.dodico.crue.metier.emh.StriRefZ; - -/** - * Classe qui se charge de remplir les structures DAO avec els donn\xE9es m\xE9tier. - * @author Adrien Hadoux - * - */ -public class CrueDaoFillInfos { - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la premiere partie du fichier DRSO: les Noeuds. - * @param data - * @return - */ - public static List remplirPersistanceAvecNoeudDRSO(List<EMH> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - if(data==null || data.size()==0){ - listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); - }else - for(EMH emh:data ){ - if(emh instanceof CatEMHNoeud){ - CatEMHNoeud noeud=(CatEMHNoeud) emh; - NoeudNiveauContinu noeudPersist=new NoeudNiveauContinu(); - noeudPersist.Nom=noeud.getNom(); - listePersistante.add(noeudPersist); - } - } - return listePersistante; - } - - - /** - * Methode qui remplit une arrayList d'objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes qui constituent la premiere partie du fichier DRSO: les Noeuds. - * @param data - * @return - */ - public static List<EMH> remplirNoeudAvecPersistanceDRSO(List listePersistants,List<String> listeMessageError ){ - List<EMH> listeEMH=new ArrayList(); - - if(listePersistants==null || listePersistants.size()==0){ - listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); - }else - for(Object persist:listePersistants ){ - if(persist instanceof NoeudNiveauContinu){ - NoeudNiveauContinu noeudPersist=(NoeudNiveauContinu) persist; - CatEMHNoeud noeud=new CatEMHNoeud(noeudPersist.Nom); - listeEMH.add(noeud); - } - } - return listeEMH; - } - - - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la deuxieme partie du fichier DRSO: les Branches. - * @param data - * @return - */ - public static List remplirPersistanceAvecBrancheDRSO(List<EMH> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - if(data==null || data.size()==0){ - listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); - }else - for(EMH emh:data ){ - if(emh instanceof CatEMHBranche){ - CatEMHBranche branche=(CatEMHBranche) emh; - BrancheAbstract branchePersist=null; - if (branche instanceof EMHBrancheBarrageFilEau) { - EMHBrancheBarrageFilEau new_name = (EMHBrancheBarrageFilEau) branche; - branchePersist=new BrancheBarrageFilEau(); - }else if (branche instanceof EMHBrancheBarrageGenerique) { - EMHBrancheBarrageGenerique new_name = (EMHBrancheBarrageGenerique) branche; - branchePersist=new BrancheBarrageGenerique(); - }else if (branche instanceof EMHBrancheBarrageRhone) { - EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; - branchePersist=new BrancheBarrageRhone(); - }else if (branche instanceof EMHBrancheEnchainement) { - EMHBrancheEnchainement new_name = (EMHBrancheEnchainement) branche; - branchePersist=new BrancheEnchainement(); - }else if (branche instanceof EMHBrancheNiveauxAssocies) { - EMHBrancheNiveauxAssocies new_name = (EMHBrancheNiveauxAssocies) branche; - branchePersist=new BrancheNiveauxAssocies(); - }else if (branche instanceof EMHBrancheOrifice) { - EMHBrancheOrifice new_name = (EMHBrancheOrifice) branche; - branchePersist=new BrancheOrifice(); - }else if (branche instanceof EMHBranchePdc) { - EMHBranchePdc new_name = (EMHBranchePdc) branche; - branchePersist=new BranchePdc(); - }else if (branche instanceof EMHBrancheSaintVenant) { - EMHBrancheSaintVenant new_name = (EMHBrancheSaintVenant) branche; - branchePersist=new BrancheSaintVenant(); - }else if (branche instanceof EMHBrancheSeuilLongitudinale) { - EMHBrancheSeuilLongitudinale new_name = (EMHBrancheSeuilLongitudinale) branche; - branchePersist=new BrancheSeuilLateral(); - }else if (branche instanceof EMHBrancheSeuilTransversal) { - EMHBrancheSeuilTransversal new_name = (EMHBrancheSeuilTransversal) branche; - branchePersist=new BrancheSeuilTransversal(); - }else if (branche instanceof EMHBrancheStrickler) { - EMHBrancheStrickler new_name = (EMHBrancheStrickler) branche; - branchePersist=new BrancheStrickler(); - } - - if(branchePersist!=null){ - //-- commun --// - BrancheAbstract br=(BrancheAbstract) branchePersist; - br.Active=branche.isActive(); - br.Nom=branche.getNom(); - if(branche.getNoeudAmont()!=null) - br.NdAm=new NdAm(branche.getNoeudAmont().getNom()); - if(branche.getNoeudAval()!=null) - br.NdAv=new NdAv(branche.getNoeudAval().getNom()); - //-- on remplit les sections persistantes avec celle de la branche --// - br.Sections=CrueDaoFillInfos.remplirPersistanceAvecSectionsBrancheDRSO(branche.getListeSections(),listeMessageError); - listePersistante.add(br); - } - } - } - return listePersistante; - } - - - public static List<EMH> remplirBrancheAvecPersistanceDRSO(List listePersistante,List<EMH> listeNoeuds,List<String> listeMessageError){ - List<EMH> data=new ArrayList(); - if(listePersistante==null || listePersistante.size()==0){ - listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); - }else - for(Object objet:listePersistante ){ - if(objet instanceof BrancheAbstract){ - CatEMHBranche branche=null; - BrancheAbstract branchePersist=(BrancheAbstract) objet; - String nom=branchePersist.Nom; - if (branchePersist instanceof BrancheBarrageFilEau) { - branche = new EMHBrancheBarrageFilEau(nom); - - }else if (branchePersist instanceof BrancheBarrageGenerique) { - branche = new EMHBrancheBarrageGenerique(nom); - - }else if (branchePersist instanceof BrancheBarrageRhone) { - branche = new EMHBrancheBarrageRhone(nom); - - }else if (branchePersist instanceof BrancheEnchainement) { - branche = new EMHBrancheEnchainement(nom); - - }else if (branchePersist instanceof BrancheNiveauxAssocies) { - branche = new EMHBrancheNiveauxAssocies(nom); - - }else if (branchePersist instanceof BrancheOrifice) { - branche = new EMHBrancheOrifice(nom); - - }else if (branchePersist instanceof BranchePdc) { - branche = new EMHBranchePdc(nom); - - }else if (branchePersist instanceof BrancheSaintVenant) { - branche = new EMHBrancheSaintVenant(nom); - - }else if (branchePersist instanceof BrancheSeuilLateral) { - branche = new EMHBrancheSeuilLongitudinale(nom); - - }else if (branchePersist instanceof BrancheSeuilTransversal) { - branche = new EMHBrancheSeuilTransversal(nom); - - }else if (branchePersist instanceof BrancheStrickler) { - branche = new EMHBrancheStrickler(nom); - - } - - if(branche!=null){ - //-- commun --// - - branche.setActive(branchePersist.Active); - //branche.setNom(branchePersist.Nom); - if(branchePersist.NdAm!=null){ - CatEMHNoeud noeudAmont=CatEMHNoeud.findByReference(branchePersist.NdAm.NomRef, listeNoeuds); - if(noeudAmont!=null) - branche.setNoeudAmont(noeudAmont); - else - listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAm.NomRef)); - }else - listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud amont pour la branche "+branche.getNom())); - if(branchePersist.NdAv!=null){ - CatEMHNoeud noeudAval=CatEMHNoeud.findByReference(branchePersist.NdAv.NomRef, listeNoeuds); - if(noeudAval!=null) - branche.setNoeudAval(noeudAval); - else - listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAv.NomRef)); - }else - listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud aval pour la branche "+branche.getNom())); - - //-- on remplit les sections persistantes avec celle de la branche --// - if(branchePersist.Sections!=null) - branche.setListeSections(CrueDaoFillInfos.remplirSectionsBrancheAvecPersistanceDRSO(branchePersist.Sections,listeMessageError)); - - - data.add(branche); - } - } - } - return data; - } - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la troisi\xE8me partie du fichier DRSO: les Casier. - * @param data - * @return - */ - public static List remplirPersistanceAvecCasierDRSO(List<EMH> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - for(EMH emh:data ){ - if(emh instanceof CatEMHCasier){ - CatEMHCasier casier=(CatEMHCasier)emh; - CasierAbstract casierPersist=null; - if(casier instanceof EMHCasierMNT){ - casierPersist=new CasierMNT(); - }else if(casier instanceof EMHCasierProfil){ - casierPersist= new CasierProfil(); - EMHCasierProfil casierProfil=(EMHCasierProfil) casier; - - ((CasierProfil)casierPersist).Profil= new ReferenceProfil(); - ((CasierProfil)casierPersist).Profil.NomRef=casierProfil.getNomProfil(); - } - //-- commun --// - if(casierPersist!=null){ - casierPersist.Active=casier.isActive(); - if(casier.getNoeud()!=null) - casierPersist.Noeud=new ReferenceNoeud(casier.getNoeud().getNom()); - casierPersist.Nom=casier.getNom(); - listePersistante.add(casierPersist); - } - - - } - } - - return listePersistante; - } - - - /** - * Methode qui remplit une arrayList d'objets m\xE9tier EMH casier a partir des donn\xE9es persistantes qui constituent a troisi\xE8me partie du fichier DRSO: les Casier. - * @param data - * @return - */ - public static List<EMH> remplirCasierAvecPersistanceDRSO(List listePersistants,List<EMH> listeNoeuds ,List<String> listeMessageError){ - List<EMH> listeEMH=new ArrayList(); - if(listePersistants==null || listePersistants.size()==0){ - listeMessageError.add(CrueRessource.getS("Casiers: la liste est vide.")); - }else - for(Object persist:listePersistants ){ - if(persist instanceof CasierAbstract){ - CasierAbstract casierPersist=(CasierAbstract) persist; - String nom=casierPersist.Nom; - //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// - CatEMHCasier casier=null; - - //-- on recherche sa sp\xE9cialisation --// - if(casierPersist instanceof CasierProfil){ - casier=new EMHCasierProfil(nom); - if(((CasierProfil)casierPersist).Profil!=null) - ((EMHCasierProfil)casier).setNomProfil(((CasierProfil)casierPersist).Profil.NomRef); - }else if(casierPersist instanceof CasierMNT){ - casier=new EMHCasierMNT(nom); - } - - //-- commun aux objets --// - if(casier!=null){ - casier.setActive(casierPersist.Active); - if(casierPersist.Noeud!=null){ - String reference=casierPersist.Noeud.NomRef; - - - CatEMHNoeud noeudRef=CatEMHNoeud.findByReference(reference, listeNoeuds); - if(noeudRef!=null) - casier.setNoeud(noeudRef); - else - listeMessageError.add(CrueRessource.getS("Casier: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+reference)); - } else - listeMessageError.add(CrueRessource.getS("Casier: Il n'y a pas de noeud pour le casier "+casier.getNom())); - - listeEMH.add(casier); - } - } - } - return listeEMH; - } - - - - /** - * Methode qui remplit une arrayList d'objets persistants qui constituent la quatri\xE8me partie du fichier DRSO: les Sections-references. - * @param data - * @return - */ - public static List remplirPersistanceAvecSectionsDRSO(List<EMH> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - for(EMH emh:data ){ - if(emh instanceof CatEMHSection){ - CatEMHSection section=(CatEMHSection)emh; - SectionAbstract sectionPersist=null; - if(section instanceof EMHSectionIdem){ - sectionPersist=new SectionRefIdem(); - }else - if(section instanceof EMHSectionInterpolee){ - sectionPersist=new SectionRefInterpolee(); - }else - if(section instanceof EMHSectionProfil){ - sectionPersist=new SectionRefProfil(); - }else - if(section instanceof EMHSectionSansGeometrie){ - sectionPersist=new SectionRefSansGeometrie(); - } - - //-- commun --// - if(sectionPersist!=null){ - sectionPersist.NomRef=section.getNom(); - listePersistante.add(sectionPersist); - } - } - } - return listePersistante; - } - - /** - * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections de branches a partir des donn\xE9es persistantes qui constituent la partie interne d'une partie Branche du fichier DRSO: les Sections. - * @param data - * @return - */ - public static List<CatEMHSection> remplirSectionsBrancheAvecPersistanceDRSO(List listePersistantsBranches,List<String> listeMessageError){ - List<CatEMHSection> listeEMH=new ArrayList<CatEMHSection>(); - if(listePersistantsBranches==null || listePersistantsBranches.size()==0){ - listeMessageError.add(CrueRessource.getS("Sections Branches: la liste est vide.")); - }else - for(Object persist:listePersistantsBranches ){ - if(persist instanceof SectionBrancheAbstract){ - SectionBrancheAbstract sectionPersist=(SectionBrancheAbstract) persist; - - //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// - CatEMHSection section=null; - String nom=sectionPersist.NomRef; - //-- on recherche sa sp\xE9cialisation --// - if(sectionPersist instanceof SectionIdem){ - section=new EMHSectionIdem(nom); - - }else if(sectionPersist instanceof SectionInterpolee){ - section=new EMHSectionInterpolee(nom); - }else if(sectionPersist instanceof SectionProfil){ - section=new EMHSectionProfil(nom); - }else if(sectionPersist instanceof SectionSansGeometrie){ - section=new EMHSectionSansGeometrie(nom); - } - - //-- commun aux objets --// - if(section!=null){ - - if(sectionPersist.Pos!=null) - section.setPosition(sectionPersist.Pos); - section.setXp(sectionPersist.Xp); - listeEMH.add(section); - } - } - } - return listeEMH; - } - - /** - * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections a partir des donn\xE9es persistantes qui constituent a quatrieme partie du fichier DRSO: les Sections. - * @param data - * @return - */ - public static List<EMH> remplirSectionsAvecPersistanceDRSO(List listePersistantsSection,List<EMH> listeBranches,List<String> listeMessageError){ - List<EMH> listeEMH=new ArrayList<EMH>(); - if(listePersistantsSection==null || listePersistantsSection.size()==0){ - listeMessageError.add(CrueRessource.getS("Sections : la liste est vide.")); - }else - for(Object persist:listePersistantsSection ){ - if(persist instanceof SectionAbstract){ - SectionAbstract sectionPersist=(SectionAbstract) persist; - - //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// - CatEMHSection section=null; - String reference=sectionPersist.NomRef; - section=CatEMHSection.findByReferenceFromBrancheOrSectionEMH(reference, listeBranches); - - - - if(section!=null) - listeEMH.add(section); - else - listeMessageError.add(CrueRessource.getS("Sections : Impossible de trouver la section de r\xE9f\xE9rence "+reference)); - } - } - return listeEMH; - } - - - /** - * Remplit les don\xE9nes persistantes avec la liste des sections d'une branche. - * Remplit toutes les donn\xE9es associ\xE9es aux sections - * @param data - * @return - */ - public static List remplirPersistanceAvecSectionsBrancheDRSO(List<CatEMHSection> data,List<String> listeMessageError){ - List listePersistante=new ArrayList(); - for(EMH emh:data ){ - if(emh instanceof CatEMHSection){ - CatEMHSection section=(CatEMHSection)emh; - SectionBrancheAbstract sectionPersist=null; - if(section instanceof EMHSectionIdem){ - sectionPersist=new SectionIdem(); - }else - if(section instanceof EMHSectionInterpolee){ - sectionPersist=new SectionInterpolee(); - }else - if(section instanceof EMHSectionProfil){ - sectionPersist=new SectionProfil(); - }else - if(section instanceof EMHSectionSansGeometrie){ - sectionPersist=new SectionSansGeometrie(); - } - - //-- commun --// - if(sectionPersist!=null){ - sectionPersist.NomRef=section.getNom(); - - sectionPersist.Pos=section.getPosition(); - sectionPersist.Xp=section.getXp(); - - - listePersistante.add(sectionPersist); - } - } - } - return listePersistante; - } - - /** - * remplir le fichier DFRT avec les frottemetns - * @param data - * @return - */ - public static List<StriRefPersist> remplirPersistanceAvecFrottemetnsDFRT(List<DonFrt> data,List<String> listeMessageError){ - List<StriRefPersist> listeFrottement=new ArrayList<StriRefPersist>(); - for(DonFrt frt:data){ - StriRefPersist persist=null; - if(frt instanceof StriRefC) - persist=new StriRefCPersist(frt.getNom()); - else - if(frt instanceof StriRefH) - persist=new StriRefHPersist(frt.getNom()); - else - if(frt instanceof StriRefZ) - persist=new StriRefZPersist(frt.getNom()); - - //-- commun --// - if(persist!=null){ - if(frt.getListePoints()!=null && frt.getListePoints().size()>0){ - persist.listePoints=new ArrayList<StringBuffer>(); - for(GrPoint pt:frt.getListePoints()){ - StringBuffer buff=new StringBuffer(""+pt.x_+" "+pt.y_); - persist.listePoints.add(buff); - } - } - listeFrottement.add(persist); - } - - } - return listeFrottement; - } - - /** - * remplir le fichier DFRT avec les frottemetns - * @param data - * @return - */ - public static List<DonFrt> remplirFrottemetnsAvecPersistanceDFRT(List<StriRefPersist> persistListe,List<String> listeMessageError){ - List<DonFrt> data=new ArrayList<DonFrt>(); - if(persistListe==null || persistListe.size()==0){ - listeMessageError.add(CrueRessource.getS("Frottements : la liste est vide.")); - }else - for(StriRefPersist persist:persistListe){ - DonFrt frt=null; - if(persist instanceof StriRefCPersist) - frt=new StriRefC(persist.Nom); - else - if(persist instanceof StriRefHPersist) - frt=new StriRefH(persist.Nom); - else - if(persist instanceof StriRefZPersist) - frt=new StriRefZ(persist.Nom); - - //-- commun --// - if(persist!=null){ - if(persist.listePoints!=null){ - - List<GrPoint> listePoints=new ArrayList<GrPoint>(); - for(StringBuffer buff:persist.listePoints){ - - int indiceCesure=buff.lastIndexOf(" "); - String val1=buff.substring(0, indiceCesure); - String val2=buff.substring(indiceCesure+1, buff.length()); - double x=0; - try{ - x=Double.parseDouble(val1); - - }catch(NumberFormatException e){ - listeMessageError.add(CrueRessource.getS("Frottement: "+frt.getNom()+": impossible de r\xE9cup\xE9rer le r\xE9el du contenu: "+buff)); - } - double y=0; - try{ - y=Double.parseDouble(val2); - }catch(NumberFormatException e){ - listeMessageError.add(CrueRessource.getS("Frottement: "+frt.getNom()+": impossible de r\xE9cup\xE9rer le r\xE9el du contenu: "+buff)); - } - listePoints.add(new GrPoint(x,y,0)); - - } - - - frt.setListePoints(listePoints); - } - data.add(frt); - } - - } - return data; - } - -} Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoOPTG.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoOPTG.java 2009-03-06 14:58:09 UTC (rev 4515) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoOPTG.java 2009-03-06 18:45:46 UTC (rev 4516) @@ -54,7 +54,7 @@ } - public ElemSeuil fillInfosWithPersistant(List<String> listeMessageError) { + public ElemSeuil fillInfosWithPersistant(Object data,List<String> listeMessageError) { // TODO Auto-generated method stub return null; } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java 2009-03-06 14:58:09 UTC (rev 4515) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java 2009-03-06 18:45:46 UTC (rev 4516) @@ -1,14 +1,24 @@ package main.java.org.fudaa.dodico.crue.dao; +import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.io.OutputStreamWriter; import java.util.ArrayList; +import java.util.Date; import java.util.List; +import org.fudaa.ctulu.CtuluLibFile; + +import main.java.org.fudaa.dodico.crue.dao.validatorXML.ValidatorXml; import main.java.org.fudaa.dodico.crue.metier.emh.ElemSeuil; import com.memoire.fu.FuLog; @@ -23,7 +33,7 @@ public abstract class CrueDaoParsing<T> { public String VersionCrue="0.0"; - public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; + public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa le "+new Date(System.currentTimeMillis()); /** * Initiazlise le parser xstream avec les bons alias des noms de balises. * @return @@ -39,10 +49,11 @@ /** * Cr\xE9e une structure m\xE9tier \xE0 partir des informations persistantes. - * Utiliser poru le remplissage de la structure m\xE9tier apr\xE8s lecture du fichier xml. + * Utiliser pour le remplissage de la structure m\xE9tier apr\xE8s lecture du fichier xml. + * Utilise en plus des donn\xE9es li\xE9es. * @return */ - abstract T fillInfosWithPersistant(List<String> listeMessageError); + abstract T fillInfosWithPersistant(Object dataLinked,List<String> listeMessageError); /** * Execute la persistance des donn\xE9es dans le fichier donn\xE9 en parametre. @@ -51,10 +62,13 @@ public boolean persistData(File fichier,List<String> listeMessageError) { boolean isOk=true; ObjectOutputStream out=null; + OutputStreamWriter writer=null; try { - out = initXmlParser().createObjectOutputStream(new FileWriter(fichier),"Fichier"); - //--on enregistre la donn\xE9e au bon format --// - out.writeObject(this); + writer=new OutputStreamWriter(new FileOutputStream(fichier),"UTF-8"); + XStream parser=initXmlParser(); + String contentXml=parser.toXML(this); + contentXml=ValidatorXml.enteteXml+"\n"+contentXml; + writer.write(contentXml); } catch (IOException e) { // TODO Auto-generated catch block FuLog.debug(e.getMessage()); @@ -63,7 +77,8 @@ } finally{ try { - out.close(); + //out.close(); + writer.close(); return isOk; } catch (IOException e) { // TODO Auto-generated catch block @@ -79,40 +94,27 @@ * @param fichier * @return */ - public T getPersistData(File fichier,List<String> listeMessageError){ + public T getPersistData(Object dataLinked,File fichier,List<String> listeMessageError){ //-- la data a r\xE9cup\xE9rer --// T newData=null; - boolean isOk=true; - ObjectInputStream in=null; try { - in = initXmlParser().createObjectInputStream(new FileReader(fichier)); + XStream parser=initXmlParser(); + String content=CtuluLibFile.litFichierTexte(fichier); //--on charge la donn\xE9e persistante au bon format --// - CrueDaoParsing<T> dataPersistante=(CrueDaoParsing<T>) in.readObject(); + CrueDaoParsing<T> dataPersistante=(CrueDaoParsing<T>)parser.fromXML(content); //-- on genere la donn\xE9es m\xE9tier a partir de la donnee persistante--// - newData=dataPersistante.fillInfosWithPersistant(listeMessageError); + newData=dataPersistante.fillInfosWithPersistant(dataLinked,listeMessageError); } catch (IOException e) { // TODO Auto-generated catch block FuLog.debug(e.getMessage()); listeMessageError.add(e.getMessage()); - isOk=false; - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - FuLog.debug(e.getMessage()); - listeMessageError.add(e.getMessage()); - isOk=false; - } + + } finally{ - try { - in.close(); return newData; - } catch (IOException e) { - // TODO Auto-generated catch block - FuLog.debug(e.getMessage()); - listeMessageError.add(e.getMessage()); - } } - return null; + } } Copied: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueFactoryDao.java (from rev 4512, branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueFactoryDao.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueFactoryDao.java 2009-03-06 18:45:46 UTC (rev 4516) @@ -0,0 +1,773 @@ +package main.java.org.fudaa.dodico.crue.dao; + + +import java.util.ArrayList; +import java.util.List; +import org.fudaa.ebli.geometrie.GrPoint; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDRSO.*; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDFRT.*; +import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHBranche; +import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHCasier; +import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHNoeud; +import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHSection; +import main.java.org.fudaa.dodico.crue.metier.emh.DonFrt; +import main.java.org.fudaa.dodico.crue.metier.emh.EMH; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageFilEau; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageGenerique; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageRhone; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheEnchainement; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheNiveauxAssocies; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheOrifice; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBranchePdc; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSaintVenant; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilLongitudinale; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheSeuilTransversal; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheStrickler; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHCasierMNT; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHCasierProfil; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionIdem; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionInterpolee; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionProfil; +import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionSansGeometrie; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefC; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefH; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefZ; + +/** + * Factory qui se charge de remplir les structures DAO avec les donn\xE9es m\xE9tier et inversement. + * @author Adrien Hadoux + * + */ +public class CrueFactoryDao { + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la premiere partie du fichier DRSO: les Noeuds. + * @param data + * @return + */ + public static List remplirPersistanceAvecNoeudDRSO(List<EMH> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + if(data==null || data.size()==0){ + listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); + }else + for(EMH emh:data ){ + if(emh instanceof CatEMHNoeud){ + CatEMHNoeud noeud=(CatEMHNoeud) emh; + NoeudNiveauContinu noeudPersist=new NoeudNiveauContinu(); + noeudPersist.Nom=noeud.getNom(); + listePersistante.add(noeudPersist); + } + } + return listePersistante; + } + + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes qui constituent la premiere partie du fichier DRSO: les Noeuds. + * @param data + * @return + */ + public static List<EMH> remplirNoeudAvecPersistanceDRSO(List listePersistants,List<String> listeMessageError ){ + List<EMH> listeEMH=new ArrayList(); + + if(listePersistants==null || listePersistants.size()==0){ + listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); + }else + for(Object persist:listePersistants ){ + if(persist instanceof NoeudNiveauContinu){ + NoeudNiveauContinu noeudPersist=(NoeudNiveauContinu) persist; + CatEMHNoeud noeud=new CatEMHNoeud(noeudPersist.Nom); + listeEMH.add(noeud); + } + } + return listeEMH; + } + + + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la deuxieme partie du fichier DRSO: les Branches. + * @param data + * @return + */ + public static List remplirPersistanceAvecBrancheDRSO(List<EMH> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + if(data==null || data.size()==0){ + listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); + }else + for(EMH emh:data ){ + if(emh instanceof CatEMHBranche){ + CatEMHBranche branche=(CatEMHBranche) emh; + BrancheAbstract branchePersist=null; + if (branche instanceof EMHBrancheBarrageFilEau) { + EMHBrancheBarrageFilEau new_name = (EMHBrancheBarrageFilEau) branche; + branchePersist=new BrancheBarrageFilEau(); + }else if (branche instanceof EMHBrancheBarrageGenerique) { + EMHBrancheBarrageGenerique new_name = (EMHBrancheBarrageGenerique) branche; + branchePersist=new BrancheBarrageGenerique(); + }else if (branche instanceof EMHBrancheBarrageRhone) { + EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; + branchePersist=new BrancheBarrageRhone(); + }else if (branche instanceof EMHBrancheEnchainement) { + EMHBrancheEnchainement new_name = (EMHBrancheEnchainement) branche; + branchePersist=new BrancheEnchainement(); + }else if (branche instanceof EMHBrancheNiveauxAssocies) { + EMHBrancheNiveauxAssocies new_name = (EMHBrancheNiveauxAssocies) branche; + branchePersist=new BrancheNiveauxAssocies(); + }else if (branche instanceof EMHBrancheOrifice) { + EMHBrancheOrifice new_name = (EMHBrancheOrifice) branche; + branchePersist=new BrancheOrifice(); + }else if (branche instanceof EMHBranchePdc) { + EMHBranchePdc new_name = (EMHBranchePdc) branche; + branchePersist=new BranchePdc(); + }else if (branche instanceof EMHBrancheSaintVenant) { + EMHBrancheSaintVenant new_name = (EMHBrancheSaintVenant) branche; + branchePersist=new BrancheSaintVenant(); + }else if (branche instanceof EMHBrancheSeuilLongitudinale) { + EMHBrancheSeuilLongitudinale new_name = (EMHBrancheSeuilLongitudinale) branche; + branchePersist=new BrancheSeuilLateral(); + }else if (branche instanceof EMHBrancheSeuilTransversal) { + EMHBrancheSeuilTransversal new_name = (EMHBrancheSeuilTransversal) branche; + branchePersist=new BrancheSeuilTransversal(); + }else if (branche instanceof EMHBrancheStrickler) { + EMHBrancheStrickler new_name = (EMHBrancheStrickler) branche; + branchePersist=new BrancheStrickler(); + } + + if(branchePersist!=null){ + //-- commun --// + BrancheAbstract br=(BrancheAbstract) branchePersist; + br.Active=branche.isActive(); + br.Nom=branche.getNom(); + if(branche.getNoeudAmont()!=null) + br.NdAm=new NdAm(branche.getNoeudAmont().getNom()); + if(branche.getNoeudAval()!=null) + br.NdAv=new NdAv(branche.getNoeudAval().getNom()); + //-- on remplit les sections persistantes avec celle de la branche --// + br.Sections=CrueFactoryDao.remplirPersistanceAvecSectionsBrancheDRSO(branche.getListeSections(),listeMessageError); + listePersistante.add(br); + } + } + } + return listePersistante; + } + + + public static List<EMH> remplirBrancheAvecPersistanceDRSO(List listePersistante,List<EMH> listeNoeuds,List<String> listeMessageError){ + List<EMH> data=new ArrayList(); + if(listePersistante==null || listePersistante.size()==0){ + listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); + }else + for(Object objet:listePersistante ){ + if(objet instanceof BrancheAbstract){ + CatEMHBranche branche=null; + BrancheAbstract branchePersist=(BrancheAbstract) objet; + String nom=branchePersist.Nom; + if (branchePersist instanceof BrancheBarrageFilEau) { + branche = new EMHBrancheBarrageFilEau(nom); + + }else if (branchePersist instanceof BrancheBarrageGenerique) { + branche = new EMHBrancheBarrageGenerique(nom); + + }else if (branchePersist instanceof BrancheBarrageRhone) { + branche = new EMHBrancheBarrageRhone(nom); + + }else if (branchePersist instanceof BrancheEnchainement) { + branche = new EMHBrancheEnchainement(nom); + + }else if (branchePersist instanceof BrancheNiveauxAssocies) { + branche = new EMHBrancheNiveauxAssocies(nom); + + }else if (branchePersist instanceof BrancheOrifice) { + branche = new EMHBrancheOrifice(nom); + + }else if (branchePersist instanceof BranchePdc) { + branche = new EMHBranchePdc(nom); + + }else if (branchePersist instanceof BrancheSaintVenant) { + branche = new EMHBrancheSaintVenant(nom); + + }else if (branchePersist instanceof BrancheSeuilLateral) { + branche = new EMHBrancheSeuilLongitudinale(nom); + + }else if (branchePersist instanceof BrancheSeuilTransversal) { + branche = new EMHBrancheSeuilTransversal(nom); + + }else if (branchePersist instanceof BrancheStrickler) { + branche = new EMHBrancheStrickler(nom); + + } + + if(branche!=null){ + //-- commun --// + + branche.setActive(branchePersist.Active); + //branche.setNom(branchePersist.Nom); + if(branchePersist.NdAm!=null){ + CatEMHNoeud noeudAmont=CatEMHNoeud.findByReference(branchePersist.NdAm.NomRef, listeNoeuds); + if(noeudAmont!=null) + branche.setNoeudAmont(noeudAmont); + else + listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAm.NomRef)); + }else + listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud amont pour la branche "+branche.getNom())); + if(branchePersist.NdAv!=null){ + CatEMHNoeud noeudAval=CatEMHNoeud.findByReference(branchePersist.NdAv.NomRef, listeNoeuds); + if(noeudAval!=null) + branche.setNoeudAval(noeudAval); + else + listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAv.NomRef)); + }else + listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud aval pour la branche "+branche.getNom())); + + //-- on remplit les sections persistantes avec celle de la branche --// + if(branchePersist.Sections!=null) + branche.setListeSections(CrueFactoryDao.remplirSectionsBrancheAvecPersistanceDRSO(branchePersist.Sections,listeMessageError)); + + + data.add(branche); + } + } + } + return data; + } + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la troisi\xE8me partie du fichier DRSO: les Casier. + * @param data + * @return + */ + public static List remplirPersistanceAvecCasierDRSO(List<EMH> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + for(EMH emh:data ){ + if(emh instanceof CatEMHCasier){ + CatEMHCasier casier=(CatEMHCasier)emh; + CasierAbstract casierPersist=null; + if(casier instanceof EMHCasierMNT){ + casierPersist=new CasierMNT(); + }else if(casier instanceof EMHCasierProfil){ + casierPersist= new CasierProfil(); + EMHCasierProfil casierProfil=(EMHCasierProfil) casier; + + ((CasierProfil)casierPersist).Profil= new ReferenceProfil(); + ((CasierProfil)casierPersist).Profil.NomRef=casierProfil.getNomProfil(); + } + //-- commun --// + if(casierPersist!=null){ + casierPersist.Active=casier.isActive(); + if(casier.getNoeud()!=null) + casierPersist.Noeud=new ReferenceNoeud(casier.getNoeud().getNom()); + casierPersist.Nom=casier.getNom(); + listePersistante.add(casierPersist); + } + + + } + } + + return listePersistante; + } + + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH casier a partir des donn\xE9es persistantes qui constituent a troisi\xE8me partie du fichier DRSO: les Casier. + * @param data + * @return + */ + public static List<EMH> remplirCasierAvecPersistanceDRSO(List listePersistants,List<EMH> listeNoeuds ,List<String> listeMessageError){ + List<EMH> listeEMH=new ArrayList(); + if(listePersistants==null || listePersistants.size()==0){ + listeMessageError.add(CrueRessource.getS("Casiers: la liste est vide.")); + }else + for(Object persist:listePersistants ){ + if(persist instanceof CasierAbstract){ + CasierAbstract casierPersist=(CasierAbstract) persist; + String nom=casierPersist.Nom; + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// + CatEMHCasier casier=null; + + //-- on recherche sa sp\xE9cialisation --// + if(casierPersist instanceof CasierProfil){ + casier=new EMHCasierProfil(nom); + if(((CasierProfil)casierPersist).Profil!=null) + ((EMHCasierProfil)casier).setNomProfil(((CasierProfil)casierPersist).Profil.NomRef); + }else if(casierPersist instanceof CasierMNT){ + casier=new EMHCasierMNT(nom); + } + + //-- commun aux objets --// + if(casier!=null){ + casier.setActive(casierPersist.Active); + if(casierPersist.Noeud!=null){ + String reference=casierPersist.Noeud.NomRef; + + + CatEMHNoeud noeudRef=CatEMHNoeud.findByReference(reference, listeNoeuds); + if(noeudRef!=null) + casier.setNoeud(noeudRef); + else + listeMessageError.add(CrueRessource.getS("Casier: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+reference)); + } else + listeMessageError.add(CrueRessource.getS("Casier: Il n'y a pas de noeud pour le casier "+casier.getNom())); + + listeEMH.add(casier); + } + } + } + return listeEMH; + } + + + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la quatri\xE8me partie du fichier DRSO: les Sections-references. + * @param data + * @return + */ + public static List remplirPersistanceAvecSectionsDRSO(List<EMH> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + for(EMH emh:data ){ + if(emh instanceof CatEMHSection){ + CatEMHSection section=(CatEMHSection)emh; + SectionAbstract sectionPersist=null; + if(section instanceof EMHSectionIdem){ + sectionPersist=new SectionRefIdem(); + }else + if(section instanceof EMHSectionInterpolee){ + sectionPersist=new SectionRefInterpolee(); + }else + if(section instanceof EMHSectionProfil){ + sectionPersist=new SectionRefProfil(); + }else + if(section instanceof EMHSectionSansGeometrie){ + sectionPersist=new SectionRefSansGeometrie(); + } + + //-- commun --// + if(sectionPersist!=null){ + sectionPersist.NomRef=section.getNom(); + listePersistante.add(sectionPersist); + } + } + } + return listePersistante; + } + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections de branches a partir des donn\xE9es persistantes qui constituent la partie interne d'une partie Branche du fichier DRSO: les Sections. + * @param data + * @return + */ + public static List<CatEMHSection> remplirSectionsBrancheAvecPersistanceDRSO(List listePersistantsBranches,List<String> listeMessageError){ + List<CatEMHSection> listeEMH=new ArrayList<CatEMHSection>(); + if(listePersistantsBranches==null || listePersistantsBranches.size()==0){ + listeMessageError.add(CrueRessource.getS("Sections Branches: la liste est vide.")); + }else + for(Object persist:listePersistantsBranches ){ + if(persist instanceof SectionBrancheAbstract){ + SectionBrancheAbstract sectionPersist=(SectionBrancheAbstract) persist; + + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// + CatEMHSection section=null; + String nom=sectionPersist.NomRef; + //-- on recherche sa sp\xE9cialisation --// + if(sectionPersist instanceof SectionIdem){ + section=new EMHSectionIdem(nom); + + }else if(sectionPersist instanceof SectionInterpolee){ + section=new EMHSectionInterpolee(nom); + }else if(sectionPersist instanceof SectionProfil){ + section=new EMHSectionProfil(nom); + }else if(sectionPersist instanceof SectionSansGeometrie){ + section=new EMHSectionSansGeometrie(nom); + } + + //-- commun aux objets --// + if(section!=null){ + + if(sectionPersist.Pos!=null) + section.setPosition(sectionPersist.Pos); + section.setXp(sectionPersist.Xp); + listeEMH.add(section); + } + } + } + return listeEMH; + } + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections a partir des donn\xE9es persistantes qui constituent a quatrieme partie du fichier DRSO: les Sections. + * @param data + * @return + */ + public static List<EMH> remplirSectionsAvecPersistanceDRSO(List listePersistantsSection,List<EMH> listeBranches,List<String> listeMessageError){ + List<EMH> listeEMH=new ArrayList<EMH>(); + if(listePersistantsSection==null || listePersistantsSection.size()==0){ + listeMessageError.add(CrueRessource.getS("Sections : la liste est vide.")); + }else + for(Object persist:listePersistantsSection ){ + if(persist instanceof SectionAbstract){ + SectionAbstract sectionPersist=(SectionAbstract) persist; + + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// + CatEMHSection section=null; + String reference=sectionPersist.NomRef; + section=CatEMHSection.findByReferenceFromBrancheOrSectionEMH(reference, listeBranches); + + + + if(section!=null) + listeEMH.add(section); + else + listeMessageError.add(CrueRessource.getS("Sections : Impossible de trouver la section de r\xE9f\xE9rence "+reference)); + } + } + return listeEMH; + } + + + /** + * Remplit les don\xE9nes persistantes avec la liste des sections d'une branche. + * Remplit toutes les donn\xE9es associ\xE9es aux sections + * @param data + * @return + */ + public static List remplirPersistanceAvecSectionsBrancheDRSO(List<CatEMHSection> data,List<String> listeMessageError){ + List listePersistante=new ArrayList(); + for(EMH emh:data ){ + if(emh instanceof CatEMHSection){ + CatEMHSection section=(CatEMHSection)emh; + SectionBrancheAbstract sectionPersist=null; + if(section instanceof EMHSectionIdem){ + sectionPersist=new SectionIdem(); + }else + if(section instanceof EMHSectionInterpolee){ + sectionPersist=new SectionInterpolee(); + }else + if(section instanceof EMHSectionProfil){ + sectionPersist=new SectionProfil(); + }else + if(section instanceof EMHSectionSansGeometrie){ + sectionPersist=new SectionSansGeometrie(); + } + + //-- commun --// + if(sectionPersist!=null){ + sectionPersist.NomRef=section.getNom(); + + sectionPersist.Pos=section.getPosition(); + sectionPersist.Xp=section.getXp(); + + + listePersistante.add(sectionPersist); + } + } + } + return listePersistante; + } + + /** + * remplir le fichier DFRT avec les frottemetns + * @param data + * @return + */ + public static List<StriRefPersist> remplirPersistanceAvecFrottemetnsDFRT(List<DonFrt> data,List<String> listeMessageError){ + List<StriRefPersist> listeFrottement=new ArrayList<StriRefPersist>(); + for(DonFrt frt:data){ + StriRefPersist persist=null; + if(frt instanceof StriRefC) + persist=new StriRefCPersist(frt.getNom()); + else + if(frt instanceof StriRefH) + persist=new StriRefHPersist(frt.getNom()); + else + if(frt instanceof StriRefZ) + persist=new StriRefZPersist(frt.getNom()); + + //-- commun --// + if(persist!=null){ + if(frt.getListePoints()!=null && frt.getListePoints().size()>0){ + persist.listePoints=new ArrayList<StringBuffer>(); + for(GrPoint pt:frt.getListePoints()){ + StringBuffer buff=new StringBuffer(""+pt.x_+" "+pt.y_); + persist.listePoints.add(buff); + } + } + listeFrottement.add(persist); + } + + } + return listeFrottement; + } + + /** + * remplir le fichier DFRT avec les frottemetns + * @param data + * @return + */ + public static List<DonFrt> remplirFrottemetnsAvecPersistanceDFRT(List<StriRefPersist> persistListe,List<String> listeMessageError){ + List<DonFrt> data=new ArrayList<DonFrt>(); + if(persistListe==null || persistListe.size()==0){ + listeMessageError.add(CrueRessource.getS("Frottements : la liste est vide.")); + }else + for(StriRefPersist persist:persistListe){ + DonFrt frt=null; + if(persist instanceof StriRefCPersist) + frt=new StriRefC(persist.Nom); + else + if(persist instanceof StriRefHPersist) + frt=new StriRefH(persist.Nom); + else + if(persist instanceof StriRefZPersist) + frt=new... [truncated message content] |
From: <bma...@us...> - 2009-03-06 14:58:19
|
Revision: 4515 http://fudaa.svn.sourceforge.net/fudaa/?rev=4515&view=rev Author: bmarchan Date: 2009-03-06 14:58:09 +0000 (Fri, 06 Mar 2009) Log Message: ----------- Nettoyage et renommage. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlDecimationPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlImplementation.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlInterpolateProfilePanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectImportPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlRefinementPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlSceneEditor.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/ZDialog.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dAxe.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dBank.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dLimiteStockage.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dTrace.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCloud.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dConstraintLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dContour.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dDirectionLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dLevel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dProfile.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dZone.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/ExportPanel.java Added Paths: ----------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneOrganizePointAction.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneProfilInterpolationAction.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/resource/ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/resource/MdlResource.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/resource/mdl_en.fr_txt Removed Paths: ------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlResource.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneOrganizePoint.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneProfilInterpolation.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/mdl_en.fr_txt Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlDecimationPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlDecimationPanel.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlDecimationPanel.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -14,6 +14,7 @@ import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.gui.CtuluDialogPanel; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import com.memoire.bu.BuGridLayout; import com.memoire.bu.BuRadioButton; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -34,8 +34,8 @@ import org.fudaa.fudaa.modeleur.action.SceneInvertAction; import org.fudaa.fudaa.modeleur.action.SceneLinearisePolyligneAction; import org.fudaa.fudaa.modeleur.action.SceneMoveInLayerAction; -import org.fudaa.fudaa.modeleur.action.SceneOrganizePoint; -import org.fudaa.fudaa.modeleur.action.SceneProfilInterpolation; +import org.fudaa.fudaa.modeleur.action.SceneOrganizePointAction; +import org.fudaa.fudaa.modeleur.action.SceneProfilInterpolationAction; import org.fudaa.fudaa.modeleur.action.SceneProjectionAction; import org.fudaa.fudaa.modeleur.action.SceneRefinementAction; import org.fudaa.fudaa.sig.layer.FSigEditor; @@ -84,10 +84,10 @@ acts.add(new SceneInterpolationAction((MdlSceneEditor)sceneEditor_)); acts.add(new SceneInvertAction((MdlSceneEditor)sceneEditor_)); acts.add(new SceneProjectionAction((MdlSceneEditor)sceneEditor_)); - acts.add(new SceneProfilInterpolation((MdlSceneEditor)sceneEditor_)); + acts.add(new SceneProfilInterpolationAction((MdlSceneEditor)sceneEditor_)); acts.add(new SceneLinearisePolyligneAction((MdlSceneEditor) sceneEditor_)); - acts.add(new SceneOrganizePoint((MdlSceneEditor) sceneEditor_, "x")); - acts.add(new SceneOrganizePoint((MdlSceneEditor) sceneEditor_, "y")); + acts.add(new SceneOrganizePointAction((MdlSceneEditor) sceneEditor_, "x")); + acts.add(new SceneOrganizePointAction((MdlSceneEditor) sceneEditor_, "y")); acts.add(null); acts.add(new SceneAbscisseCurviligneAction(this)); acts.add(null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlImplementation.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlImplementation.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlImplementation.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -44,6 +44,7 @@ import org.fudaa.fudaa.modeleur.action.MdlShow1DFrameAction; import org.fudaa.fudaa.modeleur.action.MdlShow2DFrameAction; import org.fudaa.fudaa.modeleur.modeleur1d.MdlFille1d; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.ressource.FudaaResource; import org.fudaa.fudaa.sig.FSigProjectPersistence; import org.fudaa.fudaa.sig.FSigResource; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlInterpolateProfilePanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlInterpolateProfilePanel.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlInterpolateProfilePanel.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -41,6 +41,7 @@ import org.fudaa.ebli.trace.TraceSurface; import org.fudaa.ebli.trace.TraceSurfaceModel; import org.fudaa.fudaa.commun.FudaaLib; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.FSigLib; import com.memoire.bu.BuBorderLayout; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectImportPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectImportPanel.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectImportPanel.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -41,6 +41,7 @@ import org.fudaa.fudaa.commun.save.FudaaSaveZipLoader; import org.fudaa.fudaa.modeleur.MdlImplementation.MdlFileFilter; import org.fudaa.fudaa.modeleur.MdlProjectImportTreeModel.LayerNode; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.FSigLib; import com.memoire.bu.BuInformationsSoftware; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -36,6 +36,7 @@ import org.fudaa.ebli.trace.TraceLigneModel; import org.fudaa.ebli.trace.TraceSurface; import org.fudaa.ebli.trace.TraceSurfaceModel; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.FSigLib; import com.memoire.bu.BuLabel; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlRefinementPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlRefinementPanel.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlRefinementPanel.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -14,6 +14,7 @@ import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.gui.CtuluDialogPanel; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import com.memoire.bu.BuGridLayout; import com.memoire.bu.BuRadioButton; Deleted: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlResource.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlResource.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlResource.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -1,39 +0,0 @@ -/** - * @creation 2002-09-25 - * @modification $Date: 2006/09/19 15:10:20 $ - * @license GNU General Public License 2 - * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail de...@fu... - */ -package org.fudaa.fudaa.modeleur; - -import com.memoire.bu.BuResource; - -import org.fudaa.fudaa.ressource.FudaaResource; - -/** - * Des ressources pour Fudaa-Modeleur, en particulier la traduction de langage. - * @version $Id: FSigResource.java,v 1.4 2006/09/19 15:10:20 deniger Exp $ - * @author Bertrand Marchand - */ -public final class MdlResource extends FudaaResource { - - public final static MdlResource MDL = new MdlResource(FudaaResource.FUDAA); - - private MdlResource(final BuResource _b) { - super(_b); - } - - public static String getS(final String _s) { - return MDL.getString(_s); - } - - public static String getS(final String _s, final String _v0) { - return MDL.getString(_s, _v0); - } - - public static String getS(final String _s, final String _v0, final String _v1) { - return MDL.getString(_s, _v0, _v1); - } - -} \ No newline at end of file Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlSceneEditor.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlSceneEditor.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlSceneEditor.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -51,6 +51,7 @@ import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.modeleur.layer.MdlModel2dLine; import org.fudaa.fudaa.modeleur.layer.MdlModel2dMultiPoint; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.CoordinateSequence; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/ZDialog.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/ZDialog.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/ZDialog.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -18,6 +18,7 @@ import javax.swing.JPanel; import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuLabel; Deleted: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneOrganizePoint.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneOrganizePoint.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneOrganizePoint.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -1,61 +0,0 @@ -/* - * @creation 22 janv. 2009 - * @modification $Date:$ - * @license GNU General Public License 2 - * @copyright (c)1998-2009 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail fud...@li... - */ -package org.fudaa.fudaa.modeleur.action; - -import java.awt.event.ActionEvent; - -import org.fudaa.ctulu.CtuluLib; -import org.fudaa.ebli.calque.ZSelectionEvent; -import org.fudaa.ebli.calque.ZSelectionListener; -import org.fudaa.ebli.commun.EbliActionSimple; -import org.fudaa.fudaa.commun.FudaaLib; -import org.fudaa.fudaa.modeleur.MdlSceneEditor; - -/** - * Allow to reorganize geometries with criterion. The criterions can be x or y. - * @author Emmanuel MARTIN - * @version $Id:$ - */ -public class SceneOrganizePoint extends EbliActionSimple implements ZSelectionListener { - - public static final String x="x"; - public static final String y="y"; - - /** The criterion used */ - protected String criterion_; - protected MdlSceneEditor sceneEditor_; - - /** - * @param _sceneEditor - * @param _criterion - * the criterion, can be x or y. Put directly the string "x" or - * SceneOrganizePoint.x. As you want. - */ - public SceneOrganizePoint(MdlSceneEditor _sceneEditor, String _criterion) { - super(FudaaLib.getS("R\xE9organisation sur ")+(_criterion==null?"":_criterion), null, "REORGANIZE_POLYLIGNE"); - sceneEditor_=_sceneEditor; - criterion_=_criterion; - if(sceneEditor_==null||criterion_==null) - throw new IllegalArgumentException(FudaaLib.getS("Les param\xE8tres ne doivent pas \xEAtre null")); - if(!criterion_.equals(x)&&!criterion_.equals(y)) - throw new IllegalArgumentException(FudaaLib.getS("Le crit\xE8re n'a pas \xE9t\xE9 reconnu.")); - sceneEditor_.getScene().addSelectionListener(this); - } - - public void selectionChanged(ZSelectionEvent _evt) { - setEnabled(!sceneEditor_.getScene().isSelectionEmpty()); - } - - public String getEnableCondition() { - return CtuluLib.getS("<p>S\xE9lectionner une ou plusieurs g\xE9om\xE9trie(s)."); - } - - public void actionPerformed(final ActionEvent _e) { - sceneEditor_.organizePoint(criterion_); - } -} Copied: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneOrganizePointAction.java (from rev 4514, branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneOrganizePoint.java) =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneOrganizePointAction.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneOrganizePointAction.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -0,0 +1,61 @@ +/* + * @creation 22 janv. 2009 + * @modification $Date:$ + * @license GNU General Public License 2 + * @copyright (c)1998-2009 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.fudaa.modeleur.action; + +import java.awt.event.ActionEvent; + +import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ebli.calque.ZSelectionEvent; +import org.fudaa.ebli.calque.ZSelectionListener; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.fudaa.commun.FudaaLib; +import org.fudaa.fudaa.modeleur.MdlSceneEditor; + +/** + * Allow to reorganize geometries with criterion. The criterions can be x or y. + * @author Emmanuel MARTIN + * @version $Id$ + */ +public class SceneOrganizePointAction extends EbliActionSimple implements ZSelectionListener { + + public static final String x="x"; + public static final String y="y"; + + /** The criterion used */ + protected String criterion_; + protected MdlSceneEditor sceneEditor_; + + /** + * @param _sceneEditor + * @param _criterion + * the criterion, can be x or y. Put directly the string "x" or + * SceneOrganizePoint.x. As you want. + */ + public SceneOrganizePointAction(MdlSceneEditor _sceneEditor, String _criterion) { + super(FudaaLib.getS("R\xE9organisation sur ")+(_criterion==null?"":_criterion), null, "REORGANIZE_POLYLIGNE"); + sceneEditor_=_sceneEditor; + criterion_=_criterion; + if(sceneEditor_==null||criterion_==null) + throw new IllegalArgumentException(FudaaLib.getS("Les param\xE8tres ne doivent pas \xEAtre null")); + if(!criterion_.equals(x)&&!criterion_.equals(y)) + throw new IllegalArgumentException(FudaaLib.getS("Le crit\xE8re n'a pas \xE9t\xE9 reconnu.")); + sceneEditor_.getScene().addSelectionListener(this); + } + + public void selectionChanged(ZSelectionEvent _evt) { + setEnabled(!sceneEditor_.getScene().isSelectionEmpty()); + } + + public String getEnableCondition() { + return CtuluLib.getS("<p>S\xE9lectionner une ou plusieurs g\xE9om\xE9trie(s)."); + } + + public void actionPerformed(final ActionEvent _e) { + sceneEditor_.organizePoint(criterion_); + } +} Deleted: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneProfilInterpolation.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneProfilInterpolation.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneProfilInterpolation.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -1,74 +0,0 @@ -/* - * @creation 26 nov. 2008 - * @modification $Date$ - * @license GNU General Public License 2 - * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail fud...@li... - */ -package org.fudaa.fudaa.modeleur.action; - -import java.awt.event.ActionEvent; - -import org.fudaa.ctulu.CtuluLib; -import org.fudaa.ctulu.gis.GISAttributeConstants; -import org.fudaa.ctulu.gis.GISZoneCollection; -import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; -import org.fudaa.ebli.calque.ZModeleGeometry; -import org.fudaa.ebli.calque.ZScene; -import org.fudaa.ebli.calque.ZSelectionEvent; -import org.fudaa.ebli.calque.ZSelectionListener; -import org.fudaa.ebli.calque.ZScene.SceneSelectionHelper; -import org.fudaa.ebli.commun.EbliActionSimple; -import org.fudaa.fudaa.modeleur.MdlSceneEditor; -import org.fudaa.fudaa.ressource.FudaaResource; - -import com.memoire.bu.BuResource; - -/** - * Une action pour projeter une g\xE9om\xE9trie sur un ou des semis de points. - * @author Emmanuel MARTIN - */ -public class SceneProfilInterpolation extends EbliActionSimple implements ZSelectionListener { - MdlSceneEditor sceneEditor_; - - public SceneProfilInterpolation(MdlSceneEditor _sceneEditor) { - super(FudaaResource.FUDAA.getString("Cr\xE9er un profil depuis une trace"), null, "INTERPOLE_PROFIL"); - setDefaultToolTip(FudaaResource.FUDAA.getString("Cr\xE9e un profil par interpolation sur un nuage de points depuis une trace")); - sceneEditor_=_sceneEditor; - sceneEditor_.getScene().addSelectionListener(this); - } - - public void actionPerformed(final ActionEvent _e) { - sceneEditor_.interpolateProfile(); - } - - public void updateForSelectionChanged() { - ZScene scn=sceneEditor_.getScene(); - SceneSelectionHelper hlp=sceneEditor_.getScene().getSelectionHelper(); - boolean b=false; - // Si la selection est en mode globale et qu'une seule g\xE9om\xE9trie est selectionn\xE9e. - if(!scn.isAtomicMode()&&hlp.getUniqueSelectedIdx()!=-1){ - int idGeom=scn.sceneId2LayerId(hlp.getUniqueSelectedIdx()); - ZCalqueAffichageDonneesInterface calque=scn.getLayerForId(hlp.getUniqueSelectedIdx()); - // La nature de la g\xE9om\xE9trie est bien trace profil - if(calque.modeleDonnees() instanceof ZModeleGeometry){ - GISZoneCollection zone=((ZModeleGeometry) calque.modeleDonnees()).getGeomData(); - int iattNat=zone.getIndiceOf(GISAttributeConstants.NATURE); - if (iattNat!=-1) - b=zone.getValue(iattNat, idGeom).equals(GISAttributeConstants.ATT_NATURE_TP); - } - } - setEnabled(b); - } - - public String getEnableCondition() { - return CtuluLib.getS("S\xE9lectionner une trace de profil."); - } - - /* (non-Javadoc) - * @see org.fudaa.ebli.calque.ZSelectionListener#selectionChanged(org.fudaa.ebli.calque.ZSelectionEvent) - */ - public void selectionChanged(ZSelectionEvent _evt) { - updateForSelectionChanged(); - } -} Copied: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneProfilInterpolationAction.java (from rev 4514, branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneProfilInterpolation.java) =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneProfilInterpolationAction.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/action/SceneProfilInterpolationAction.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -0,0 +1,74 @@ +/* + * @creation 26 nov. 2008 + * @modification $Date$ + * @license GNU General Public License 2 + * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail fud...@li... + */ +package org.fudaa.fudaa.modeleur.action; + +import java.awt.event.ActionEvent; + +import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISZoneCollection; +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.calque.ZModeleGeometry; +import org.fudaa.ebli.calque.ZScene; +import org.fudaa.ebli.calque.ZSelectionEvent; +import org.fudaa.ebli.calque.ZSelectionListener; +import org.fudaa.ebli.calque.ZScene.SceneSelectionHelper; +import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.fudaa.modeleur.MdlSceneEditor; +import org.fudaa.fudaa.ressource.FudaaResource; + +import com.memoire.bu.BuResource; + +/** + * Une action pour projeter une g\xE9om\xE9trie sur un ou des semis de points. + * @author Emmanuel MARTIN + */ +public class SceneProfilInterpolationAction extends EbliActionSimple implements ZSelectionListener { + MdlSceneEditor sceneEditor_; + + public SceneProfilInterpolationAction(MdlSceneEditor _sceneEditor) { + super(FudaaResource.FUDAA.getString("Cr\xE9er un profil depuis une trace"), null, "INTERPOLE_PROFIL"); + setDefaultToolTip(FudaaResource.FUDAA.getString("Cr\xE9e un profil par interpolation sur un nuage de points depuis une trace")); + sceneEditor_=_sceneEditor; + sceneEditor_.getScene().addSelectionListener(this); + } + + public void actionPerformed(final ActionEvent _e) { + sceneEditor_.interpolateProfile(); + } + + public void updateForSelectionChanged() { + ZScene scn=sceneEditor_.getScene(); + SceneSelectionHelper hlp=sceneEditor_.getScene().getSelectionHelper(); + boolean b=false; + // Si la selection est en mode globale et qu'une seule g\xE9om\xE9trie est selectionn\xE9e. + if(!scn.isAtomicMode()&&hlp.getUniqueSelectedIdx()!=-1){ + int idGeom=scn.sceneId2LayerId(hlp.getUniqueSelectedIdx()); + ZCalqueAffichageDonneesInterface calque=scn.getLayerForId(hlp.getUniqueSelectedIdx()); + // La nature de la g\xE9om\xE9trie est bien trace profil + if(calque.modeleDonnees() instanceof ZModeleGeometry){ + GISZoneCollection zone=((ZModeleGeometry) calque.modeleDonnees()).getGeomData(); + int iattNat=zone.getIndiceOf(GISAttributeConstants.NATURE); + if (iattNat!=-1) + b=zone.getValue(iattNat, idGeom).equals(GISAttributeConstants.ATT_NATURE_TP); + } + } + setEnabled(b); + } + + public String getEnableCondition() { + return CtuluLib.getS("S\xE9lectionner une trace de profil."); + } + + /* (non-Javadoc) + * @see org.fudaa.ebli.calque.ZSelectionListener#selectionChanged(org.fudaa.ebli.calque.ZSelectionEvent) + */ + public void selectionChanged(ZSelectionEvent _evt) { + updateForSelectionChanged(); + } +} Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dAxe.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dAxe.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dAxe.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -15,8 +15,8 @@ import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer1dAxePersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dBank.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dBank.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dBank.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -14,8 +14,8 @@ import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dBankPersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dLimiteStockage.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dLimiteStockage.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dLimiteStockage.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -14,8 +14,8 @@ import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer1dLimiteStockageLinePersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dTrace.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dTrace.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer1dTrace.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -15,8 +15,8 @@ import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer1dTracePersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCloud.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCloud.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dCloud.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -20,9 +20,9 @@ import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.trace.TraceIcon; import org.fudaa.ebli.trace.TraceIconModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dCloudPersistence; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dMultiPointPersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dConstraintLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dConstraintLine.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dConstraintLine.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -15,8 +15,8 @@ import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dConstraintLinePersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dContour.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dContour.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dContour.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -17,8 +17,8 @@ import org.fudaa.ebli.trace.TraceIconModel; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dContourPersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dDirectionLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dDirectionLine.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dDirectionLine.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -15,8 +15,8 @@ import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dDirectionLinePersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dLevel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dLevel.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dLevel.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -19,8 +19,8 @@ import org.fudaa.ebli.find.EbliFindExpressionContainerInterface; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dLevelPersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; import org.nfunk.jep.Variable; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dProfile.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dProfile.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dProfile.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -18,10 +18,10 @@ import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dLevelPersistence; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dLinePersistence; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dProfilePersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; import org.fudaa.fudaa.sig.layer.FSigLayerLineEditable; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dZone.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dZone.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlLayer2dZone.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -17,8 +17,8 @@ import org.fudaa.ebli.trace.TraceIconModel; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.fudaa.modeleur.MdlResource; import org.fudaa.fudaa.modeleur.persistence.MdlLayer2dZonePersistence; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.layer.FSigEditor; /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -12,7 +12,7 @@ import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeDouble; import org.fudaa.ebli.calque.ZModelGeometryListener; -import org.fudaa.fudaa.modeleur.MdlResource; +import org.fudaa.fudaa.modeleur.resource.MdlResource; /** * Un mod\xE8le de calque pour le calque 2D lignes de niveaux. Les lignes de niveau sont des lignes XY Deleted: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/mdl_en.fr_txt =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/mdl_en.fr_txt 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/mdl_en.fr_txt 2009-03-06 14:58:09 UTC (rev 4515) @@ -1 +0,0 @@ -Fond de carte=Raster map \ No newline at end of file Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/ExportPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/ExportPanel.java 2009-03-05 20:31:20 UTC (rev 4514) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/modeleur1d/view/ExportPanel.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -19,7 +19,7 @@ import org.fudaa.ctulu.gui.CtuluDialogPanel; import org.fudaa.ctulu.gui.CtuluFileChooserPanel; import org.fudaa.fudaa.commun.FudaaLib; -import org.fudaa.fudaa.modeleur.MdlResource; +import org.fudaa.fudaa.modeleur.resource.MdlResource; import org.fudaa.fudaa.sig.FSigLib; import com.memoire.bu.BuFileFilter; Copied: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/resource/MdlResource.java (from rev 4503, branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlResource.java) =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/resource/MdlResource.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/resource/MdlResource.java 2009-03-06 14:58:09 UTC (rev 4515) @@ -0,0 +1,39 @@ +/** + * @creation 2002-09-25 + * @modification $Date: 2006/09/19 15:10:20 $ + * @license GNU General Public License 2 + * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne + * @mail de...@fu... + */ +package org.fudaa.fudaa.modeleur.resource; + +import com.memoire.bu.BuResource; + +import org.fudaa.fudaa.ressource.FudaaResource; + +/** + * Des ressources pour Fudaa-Modeleur, en particulier la traduction de langage. + * @version $Id: FSigResource.java,v 1.4 2006/09/19 15:10:20 deniger Exp $ + * @author Bertrand Marchand + */ +public final class MdlResource extends FudaaResource { + + public final static MdlResource MDL = new MdlResource(FudaaResource.FUDAA); + + private MdlResource(final BuResource _b) { + super(_b); + } + + public static String getS(final String _s) { + return MDL.getString(_s); + } + + public static String getS(final String _s, final String _v0) { + return MDL.getString(_s, _v0); + } + + public static String getS(final String _s, final String _v0, final String _v1) { + return MDL.getString(_s, _v0, _v1); + } + +} \ No newline at end of file Copied: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/resource/mdl_en.fr_txt (from rev 4503, branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/mdl_en.fr_txt) =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/resource/mdl_en.fr_txt (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/resource/mdl_en.fr_txt 2009-03-06 14:58:09 UTC (rev 4515) @@ -0,0 +1 @@ +Fond de carte=Raster map \ 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: <de...@us...> - 2009-03-05 20:31:28
|
Revision: 4514 http://fudaa.svn.sourceforge.net/fudaa/?rev=4514&view=rev Author: deniger Date: 2009-03-05 20:31:20 +0000 (Thu, 05 Mar 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java 2009-03-05 20:30:08 UTC (rev 4513) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java 2009-03-05 20:31:20 UTC (rev 4514) @@ -35,7 +35,7 @@ final Map map = new HashMap(11); map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.getArtemisId()), versions); map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.getEstel2dId()), new String[] { "v5p4", "v5p5", "v5p7", - "v5p8" }); + "v5p8","v5p9" }); map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.getPostel3dId()), versions); map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.getSisypheId()), versions); map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.getStbtelId()), versions); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2009-03-05 20:30:18
|
Revision: 4513 http://fudaa.svn.sourceforge.net/fudaa/?rev=4513&view=rev Author: deniger Date: 2009-03-05 20:30:08 +0000 (Thu, 05 Mar 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java 2009-03-05 18:29:20 UTC (rev 4512) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java 2009-03-05 20:30:08 UTC (rev 4513) @@ -31,7 +31,7 @@ public final static TelemacDicoManager INSTANCE = new TelemacDicoManager(); static { - final String[] versions = new String[] { "v5p4", "v5p5", "v5p6", "v5p7", "v5p8" }; + final String[] versions = new String[] { "v5p4", "v5p5", "v5p6", "v5p7", "v5p8","v5p9" }; final Map map = new HashMap(11); map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.getArtemisId()), versions); map.put(new TelemacDicoFileFormat(H2dTelemacDicoParams.getEstel2dId()), new String[] { "v5p4", "v5p5", "v5p7", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-03-05 18:29:26
|
Revision: 4512 http://fudaa.svn.sourceforge.net/fudaa/?rev=4512&view=rev Author: hadouxad Date: 2009-03-05 18:29:20 +0000 (Thu, 05 Mar 2009) Log Message: ----------- * mise en place du syst?\195?\168me d'erreur * mise en place du contr?\195?\180le xsd et ?\195?\169criture de la xsd de dfrt (pour le moment il est pas encore au point) * persistance du fichier DPTI: d?\195?\169but de persistance. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoOPTG.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/reader/Crue10reader.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue10writer.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/AppCrueTest.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDFRTFile.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDRSOFile.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueRessource.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDPTI.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDFRT.xsd branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/CruePersistanceErrorManager.java Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-05 18:29:20 UTC (rev 4512) @@ -29,11 +29,15 @@ -- Fichier DRSO: - - positionner plusieurs valeurs dans la balise <PointFF>a b </PointFF> - ou g\xE9rer comme suit: - <PointFF> - <x>a</x> - <y>b</y> - </PointFF> +- Fichier DFRT: + + - pas de problemes + +- Fichier DPTI: + - Dans le fichier modele3.dpti.xml, on peut voir que les objets emh d\xE9pendent des objets d\xE9crits dans le fichier DRSO: + exemple: <NoeudNiveauContinu NomRef="DRSO#N1"> indique que le noeud fait r\xE9f\xE9rence au noeud du nom N1 du fichier DRSO. + Est ce que cette r\xE8gle est g\xE9n\xE9rale? c'est \xE0 dire que tous les objets de dpti sont des r\xE9f\xE9rences de drso et qu'ils ont + toujours le mot clef DRSO# devant ? + - Balises <Branches>,fichier modele3.dpti.xml: la balise <BrancheOrifice> contient la balise <OuvPasseDessous> de plus que les autres types de branches. + Est-ce bien la seule \xE0 poss\xE9der ce type de balise ou toutes peuvent les poss\xE9der? y'a t'il d'autres cas particuliers comme celui-ci pour les branches ? \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -18,8 +18,8 @@ */ public class CrueDaoDFRT extends CrueDaoParsing<List<DonFrt>>{ //-- variables qui correspondent \xE0 celle du fichier xml --// - public String VersionCrue="10"; - public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; +// public String VersionCrue="10"; +// public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; /** * Il faut ajouter un parametre dans xstream pour lui indiquer de degager les balises 'collections' @@ -28,14 +28,14 @@ List<StriRefPersist> listeFrottement; - public void fillInfosWith(List<DonFrt> data) { - listeFrottement=CrueDaoFillInfos.remplirPersistanceAvecFrottemetnsDFRT(data); + public void fillInfosWith(List<DonFrt> data,List<String> listeMessageError) { + listeFrottement=CrueDaoFillInfos.remplirPersistanceAvecFrottemetnsDFRT(data,listeMessageError); } - public List<DonFrt> fillInfosWithPersistant() { - return CrueDaoFillInfos.remplirFrottemetnsAvecPersistanceDFRT(listeFrottement); + public List<DonFrt> fillInfosWithPersistant(List<String> listeMessageError) { + return CrueDaoFillInfos.remplirFrottemetnsAvecPersistanceDFRT(listeFrottement,listeMessageError); } Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDPTI.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -0,0 +1,65 @@ +package main.java.org.fudaa.dodico.crue.dao; + +import java.util.List; + +import com.thoughtworks.xstream.XStream; + +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.BrancheAbstract; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.CasierAbstract; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.NoeudNiveauContinu; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDPTI.SectionAbstract; +import main.java.org.fudaa.dodico.crue.metier.emh.EMH; + +/** + * Classe persistante qui reprend la meme structure que le fichier xml + * A persister telle qu'elle. + * Le fichier DPTI d\xE9crit les conditions initiales + * (dont les manoeuvres d'ouvrages) d'un mod\xE8le CrueX. Son p\xE9rim\xE8tre est le mod\xE8le + * @author Adrien Hadoux + * + */ +public class CrueDaoDPTI extends CrueDaoParsing<List<EMH>>{ + + + + + /** + * la liste des noeuds + */ + private List<NoeudNiveauContinu> Noeuds; + + /** + * la liste des branches + */ + private List<BrancheAbstract> Branches; + + /** + * la liste des casiers + */ + private List<CasierAbstract> Casiers; + + + /** + * la liste des sections + */ + private List<SectionAbstract> Sections; + + @Override + void fillInfosWith(List<EMH> data, List<String> listeMessageError) { + // TODO Auto-generated method stub + + } + + @Override + List<EMH> fillInfosWithPersistant(List<String> listeMessageError) { + // TODO Auto-generated method stub + return null; + } + + @Override + XStream initXmlParser() { + // TODO Auto-generated method stub + return null; + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -18,8 +18,8 @@ public class CrueDaoDRSO extends CrueDaoParsing<List<EMH>>{ //-- variables qui correspondent \xE0 celle du fichier xml --// - public String VersionCrue="10"; - public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; +// public String VersionCrue="10"; +// public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; /** * la liste des noeuds @@ -50,21 +50,21 @@ } @Override - public void fillInfosWith(List<EMH> data) { + public void fillInfosWith(List<EMH> data,List<String> listeMessageError) { //-- etape 1: on remplit les infso des noeuds --// - Noeuds=CrueDaoFillInfos.remplirPersistanceAvecNoeudDRSO(data); + Noeuds=CrueDaoFillInfos.remplirPersistanceAvecNoeudDRSO(data,listeMessageError); //-- etape 2: on remplit les infso des branches --// - Branches=CrueDaoFillInfos.remplirPersistanceAvecBrancheDRSO(data); + Branches=CrueDaoFillInfos.remplirPersistanceAvecBrancheDRSO(data,listeMessageError); //-- etape 3: on remplit les infso des casiers --// - Casiers=CrueDaoFillInfos.remplirPersistanceAvecCasierDRSO(data); + Casiers=CrueDaoFillInfos.remplirPersistanceAvecCasierDRSO(data,listeMessageError); //-- etape 4: on remplit les infso des sections --// - Sections=CrueDaoFillInfos.remplirPersistanceAvecSectionsDRSO(data); + Sections=CrueDaoFillInfos.remplirPersistanceAvecSectionsDRSO(data,listeMessageError); @@ -72,23 +72,23 @@ } @Override - public List<EMH> fillInfosWithPersistant() { + public List<EMH> fillInfosWithPersistant(List<String> listeMessageError) { List<EMH> listeCompleteEMH=new ArrayList<EMH>(); //-- etape 1: on remplit les infso des noeuds --// - List<EMH> listeNoeuds=CrueDaoFillInfos.remplirNoeudAvecPersistanceDRSO(Noeuds); + List<EMH> listeNoeuds=CrueDaoFillInfos.remplirNoeudAvecPersistanceDRSO(Noeuds,listeMessageError); //-- etape 2: les casiers --// - List<EMH> listeCasiers=CrueDaoFillInfos.remplirCasierAvecPersistanceDRSO(Casiers, listeNoeuds); + List<EMH> listeCasiers=CrueDaoFillInfos.remplirCasierAvecPersistanceDRSO(Casiers, listeNoeuds,listeMessageError); //-- etape 3: les branches et les sections de bransche --// - List<EMH> listeBranches=CrueDaoFillInfos.remplirBrancheAvecPersistanceDRSO(Branches, listeNoeuds); + List<EMH> listeBranches=CrueDaoFillInfos.remplirBrancheAvecPersistanceDRSO(Branches, listeNoeuds,listeMessageError); //-- etape 3: les sections a partir des sections cr\xE9es lors du remplissage des branches --// - List<EMH> listeSections= CrueDaoFillInfos.remplirSectionsAvecPersistanceDRSO(Sections, listeBranches); + List<EMH> listeSections= CrueDaoFillInfos.remplirSectionsAvecPersistanceDRSO(Sections, listeBranches,listeMessageError); Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -1,8 +1,12 @@ package main.java.org.fudaa.dodico.crue.dao; +import java.awt.Point; import java.util.ArrayList; import java.util.List; +import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.ebli.ressource.EbliResource; + import com.lowagie.text.Section; import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDRSO.*; @@ -46,8 +50,11 @@ * @param data * @return */ - public static List remplirPersistanceAvecNoeudDRSO(List<EMH> data){ + public static List remplirPersistanceAvecNoeudDRSO(List<EMH> data,List<String> listeMessageError){ List listePersistante=new ArrayList(); + if(data==null || data.size()==0){ + listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); + }else for(EMH emh:data ){ if(emh instanceof CatEMHNoeud){ CatEMHNoeud noeud=(CatEMHNoeud) emh; @@ -58,15 +65,19 @@ } return listePersistante; } - - + + /** * Methode qui remplit une arrayList d'objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes qui constituent la premiere partie du fichier DRSO: les Noeuds. * @param data * @return */ - public static List<EMH> remplirNoeudAvecPersistanceDRSO(List listePersistants ){ + public static List<EMH> remplirNoeudAvecPersistanceDRSO(List listePersistants,List<String> listeMessageError ){ List<EMH> listeEMH=new ArrayList(); + + if(listePersistants==null || listePersistants.size()==0){ + listeMessageError.add(CrueRessource.getS("Noeuds: la liste est vide.")); + }else for(Object persist:listePersistants ){ if(persist instanceof NoeudNiveauContinu){ NoeudNiveauContinu noeudPersist=(NoeudNiveauContinu) persist; @@ -76,16 +87,19 @@ } return listeEMH; } - - + + /** * Methode qui remplit une arrayList d'objets persistants qui constituent la deuxieme partie du fichier DRSO: les Branches. * @param data * @return */ - public static List remplirPersistanceAvecBrancheDRSO(List<EMH> data){ + public static List remplirPersistanceAvecBrancheDRSO(List<EMH> data,List<String> listeMessageError){ List listePersistante=new ArrayList(); + if(data==null || data.size()==0){ + listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); + }else for(EMH emh:data ){ if(emh instanceof CatEMHBranche){ CatEMHBranche branche=(CatEMHBranche) emh; @@ -135,7 +149,7 @@ if(branche.getNoeudAval()!=null) br.NdAv=new NdAv(branche.getNoeudAval().getNom()); //-- on remplit les sections persistantes avec celle de la branche --// - br.Sections=CrueDaoFillInfos.remplirPersistanceAvecSectionsBrancheDRSO(branche.getListeSections()); + br.Sections=CrueDaoFillInfos.remplirPersistanceAvecSectionsBrancheDRSO(branche.getListeSections(),listeMessageError); listePersistante.add(br); } } @@ -143,9 +157,12 @@ return listePersistante; } - - public static List<EMH> remplirBrancheAvecPersistanceDRSO(List listePersistante,List<EMH> listeNoeuds){ + + public static List<EMH> remplirBrancheAvecPersistanceDRSO(List listePersistante,List<EMH> listeNoeuds,List<String> listeMessageError){ List<EMH> data=new ArrayList(); + if(listePersistante==null || listePersistante.size()==0){ + listeMessageError.add(CrueRessource.getS("Branches: la liste est vide.")); + }else for(Object objet:listePersistante ){ if(objet instanceof BrancheAbstract){ CatEMHBranche branche=null; @@ -153,73 +170,79 @@ String nom=branchePersist.Nom; if (branchePersist instanceof BrancheBarrageFilEau) { branche = new EMHBrancheBarrageFilEau(nom); - + }else if (branchePersist instanceof BrancheBarrageGenerique) { branche = new EMHBrancheBarrageGenerique(nom); - + }else if (branchePersist instanceof BrancheBarrageRhone) { branche = new EMHBrancheBarrageRhone(nom); - + }else if (branchePersist instanceof BrancheEnchainement) { branche = new EMHBrancheEnchainement(nom); - + }else if (branchePersist instanceof BrancheNiveauxAssocies) { branche = new EMHBrancheNiveauxAssocies(nom); - + }else if (branchePersist instanceof BrancheOrifice) { branche = new EMHBrancheOrifice(nom); - + }else if (branchePersist instanceof BranchePdc) { branche = new EMHBranchePdc(nom); - + }else if (branchePersist instanceof BrancheSaintVenant) { branche = new EMHBrancheSaintVenant(nom); - + }else if (branchePersist instanceof BrancheSeuilLateral) { branche = new EMHBrancheSeuilLongitudinale(nom); - + }else if (branchePersist instanceof BrancheSeuilTransversal) { branche = new EMHBrancheSeuilTransversal(nom); - + }else if (branchePersist instanceof BrancheStrickler) { branche = new EMHBrancheStrickler(nom); - + } if(branche!=null){ //-- commun --// - + branche.setActive(branchePersist.Active); //branche.setNom(branchePersist.Nom); if(branchePersist.NdAm!=null){ - CatEMHNoeud noeudAmont=CatEMHNoeud.findByReference(branchePersist.NdAm.NomRef, listeNoeuds); + CatEMHNoeud noeudAmont=CatEMHNoeud.findByReference(branchePersist.NdAm.NomRef, listeNoeuds); if(noeudAmont!=null) - branche.setNoeudAmont(noeudAmont); - } + branche.setNoeudAmont(noeudAmont); + else + listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAm.NomRef)); + }else + listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud amont pour la branche "+branche.getNom())); if(branchePersist.NdAv!=null){ - CatEMHNoeud noeudAval=CatEMHNoeud.findByReference(branchePersist.NdAv.NomRef, listeNoeuds); + CatEMHNoeud noeudAval=CatEMHNoeud.findByReference(branchePersist.NdAv.NomRef, listeNoeuds); if(noeudAval!=null) - branche.setNoeudAval(noeudAval); - } - + branche.setNoeudAval(noeudAval); + else + listeMessageError.add(CrueRessource.getS("Branches: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+branchePersist.NdAv.NomRef)); + }else + listeMessageError.add(CrueRessource.getS("Branches: Il n'y a pas de noeud aval pour la branche "+branche.getNom())); + //-- on remplit les sections persistantes avec celle de la branche --// if(branchePersist.Sections!=null) - branche.setListeSections(CrueDaoFillInfos.remplirSectionsBrancheAvecPersistanceDRSO(branchePersist.Sections)); - - + branche.setListeSections(CrueDaoFillInfos.remplirSectionsBrancheAvecPersistanceDRSO(branchePersist.Sections,listeMessageError)); + + data.add(branche); } } } return data; } - + /** * Methode qui remplit une arrayList d'objets persistants qui constituent la troisi\xE8me partie du fichier DRSO: les Casier. * @param data * @return */ - public static List remplirPersistanceAvecCasierDRSO(List<EMH> data){ + public static List remplirPersistanceAvecCasierDRSO(List<EMH> data,List<String> listeMessageError){ List listePersistante=new ArrayList(); for(EMH emh:data ){ if(emh instanceof CatEMHCasier){ @@ -230,7 +253,7 @@ }else if(casier instanceof EMHCasierProfil){ casierPersist= new CasierProfil(); EMHCasierProfil casierProfil=(EMHCasierProfil) casier; - + ((CasierProfil)casierPersist).Profil= new ReferenceProfil(); ((CasierProfil)casierPersist).Profil.NomRef=casierProfil.getNomProfil(); } @@ -256,51 +279,57 @@ * @param data * @return */ - public static List<EMH> remplirCasierAvecPersistanceDRSO(List listePersistants,List<EMH> listeNoeuds ){ + public static List<EMH> remplirCasierAvecPersistanceDRSO(List listePersistants,List<EMH> listeNoeuds ,List<String> listeMessageError){ List<EMH> listeEMH=new ArrayList(); + if(listePersistants==null || listePersistants.size()==0){ + listeMessageError.add(CrueRessource.getS("Casiers: la liste est vide.")); + }else for(Object persist:listePersistants ){ if(persist instanceof CasierAbstract){ CasierAbstract casierPersist=(CasierAbstract) persist; String nom=casierPersist.Nom; //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// CatEMHCasier casier=null; - + //-- on recherche sa sp\xE9cialisation --// if(casierPersist instanceof CasierProfil){ casier=new EMHCasierProfil(nom); if(((CasierProfil)casierPersist).Profil!=null) - ((EMHCasierProfil)casier).setNomProfil(((CasierProfil)casierPersist).Profil.NomRef); + ((EMHCasierProfil)casier).setNomProfil(((CasierProfil)casierPersist).Profil.NomRef); }else if(casierPersist instanceof CasierMNT){ casier=new EMHCasierMNT(nom); } - + //-- commun aux objets --// if(casier!=null){ casier.setActive(casierPersist.Active); if(casierPersist.Noeud!=null){ String reference=casierPersist.Noeud.NomRef; - - + + CatEMHNoeud noeudRef=CatEMHNoeud.findByReference(reference, listeNoeuds); - if(noeudRef!=null) - casier.setNoeud(noeudRef); - } - + if(noeudRef!=null) + casier.setNoeud(noeudRef); + else + listeMessageError.add(CrueRessource.getS("Casier: Impossible de trouver le noeud avec la r\xE9f\xE9rence "+reference)); + } else + listeMessageError.add(CrueRessource.getS("Casier: Il n'y a pas de noeud pour le casier "+casier.getNom())); + listeEMH.add(casier); } } } return listeEMH; } - - - + + + /** * Methode qui remplit une arrayList d'objets persistants qui constituent la quatri\xE8me partie du fichier DRSO: les Sections-references. * @param data * @return */ - public static List remplirPersistanceAvecSectionsDRSO(List<EMH> data){ + public static List remplirPersistanceAvecSectionsDRSO(List<EMH> data,List<String> listeMessageError){ List listePersistante=new ArrayList(); for(EMH emh:data ){ if(emh instanceof CatEMHSection){ @@ -318,7 +347,7 @@ if(section instanceof EMHSectionSansGeometrie){ sectionPersist=new SectionRefSansGeometrie(); } - + //-- commun --// if(sectionPersist!=null){ sectionPersist.NomRef=section.getNom(); @@ -334,22 +363,22 @@ * @param data * @return */ - public static List<CatEMHSection> remplirSectionsBrancheAvecPersistanceDRSO(List listePersistantsBranches){ - - - + public static List<CatEMHSection> remplirSectionsBrancheAvecPersistanceDRSO(List listePersistantsBranches,List<String> listeMessageError){ List<CatEMHSection> listeEMH=new ArrayList<CatEMHSection>(); + if(listePersistantsBranches==null || listePersistantsBranches.size()==0){ + listeMessageError.add(CrueRessource.getS("Sections Branches: la liste est vide.")); + }else for(Object persist:listePersistantsBranches ){ if(persist instanceof SectionBrancheAbstract){ SectionBrancheAbstract sectionPersist=(SectionBrancheAbstract) persist; - + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// CatEMHSection section=null; String nom=sectionPersist.NomRef; //-- on recherche sa sp\xE9cialisation --// if(sectionPersist instanceof SectionIdem){ section=new EMHSectionIdem(nom); - + }else if(sectionPersist instanceof SectionInterpolee){ section=new EMHSectionInterpolee(nom); }else if(sectionPersist instanceof SectionProfil){ @@ -357,10 +386,10 @@ }else if(sectionPersist instanceof SectionSansGeometrie){ section=new EMHSectionSansGeometrie(nom); } - + //-- commun aux objets --// if(section!=null){ - + if(sectionPersist.Pos!=null) section.setPosition(sectionPersist.Pos); section.setXp(sectionPersist.Xp); @@ -370,38 +399,45 @@ } return listeEMH; } - + /** * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections a partir des donn\xE9es persistantes qui constituent a quatrieme partie du fichier DRSO: les Sections. * @param data * @return */ - public static List<EMH> remplirSectionsAvecPersistanceDRSO(List listePersistantsSection,List<EMH> listeBranches){ + public static List<EMH> remplirSectionsAvecPersistanceDRSO(List listePersistantsSection,List<EMH> listeBranches,List<String> listeMessageError){ List<EMH> listeEMH=new ArrayList<EMH>(); + if(listePersistantsSection==null || listePersistantsSection.size()==0){ + listeMessageError.add(CrueRessource.getS("Sections : la liste est vide.")); + }else for(Object persist:listePersistantsSection ){ if(persist instanceof SectionAbstract){ SectionAbstract sectionPersist=(SectionAbstract) persist; - + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// CatEMHSection section=null; String reference=sectionPersist.NomRef; section=CatEMHSection.findByReferenceFromBrancheOrSectionEMH(reference, listeBranches); + + + if(section!=null) listeEMH.add(section); - + else + listeMessageError.add(CrueRessource.getS("Sections : Impossible de trouver la section de r\xE9f\xE9rence "+reference)); } } return listeEMH; } - - + + /** * Remplit les don\xE9nes persistantes avec la liste des sections d'une branche. * Remplit toutes les donn\xE9es associ\xE9es aux sections * @param data * @return */ - public static List remplirPersistanceAvecSectionsBrancheDRSO(List<CatEMHSection> data){ + public static List remplirPersistanceAvecSectionsBrancheDRSO(List<CatEMHSection> data,List<String> listeMessageError){ List listePersistante=new ArrayList(); for(EMH emh:data ){ if(emh instanceof CatEMHSection){ @@ -419,28 +455,28 @@ if(section instanceof EMHSectionSansGeometrie){ sectionPersist=new SectionSansGeometrie(); } - + //-- commun --// if(sectionPersist!=null){ sectionPersist.NomRef=section.getNom(); - - sectionPersist.Pos=section.getPosition(); - sectionPersist.Xp=section.getXp(); - - + + sectionPersist.Pos=section.getPosition(); + sectionPersist.Xp=section.getXp(); + + listePersistante.add(sectionPersist); } } } return listePersistante; } - + /** * remplir le fichier DFRT avec les frottemetns * @param data * @return */ - public static List<StriRefPersist> remplirPersistanceAvecFrottemetnsDFRT(List<DonFrt> data){ + public static List<StriRefPersist> remplirPersistanceAvecFrottemetnsDFRT(List<DonFrt> data,List<String> listeMessageError){ List<StriRefPersist> listeFrottement=new ArrayList<StriRefPersist>(); for(DonFrt frt:data){ StriRefPersist persist=null; @@ -452,13 +488,19 @@ else if(frt instanceof StriRefZ) persist=new StriRefZPersist(frt.getNom()); - + //-- commun --// if(persist!=null){ - persist.listePoints=frt.getListePoints(); + if(frt.getListePoints()!=null && frt.getListePoints().size()>0){ + persist.listePoints=new ArrayList<StringBuffer>(); + for(GrPoint pt:frt.getListePoints()){ + StringBuffer buff=new StringBuffer(""+pt.x_+" "+pt.y_); + persist.listePoints.add(buff); + } + } listeFrottement.add(persist); } - + } return listeFrottement; } @@ -468,8 +510,11 @@ * @param data * @return */ - public static List<DonFrt> remplirFrottemetnsAvecPersistanceDFRT(List<StriRefPersist> persistListe){ + public static List<DonFrt> remplirFrottemetnsAvecPersistanceDFRT(List<StriRefPersist> persistListe,List<String> listeMessageError){ List<DonFrt> data=new ArrayList<DonFrt>(); + if(persistListe==null || persistListe.size()==0){ + listeMessageError.add(CrueRessource.getS("Frottements : la liste est vide.")); + }else for(StriRefPersist persist:persistListe){ DonFrt frt=null; if(persist instanceof StriRefCPersist) @@ -480,16 +525,42 @@ else if(persist instanceof StriRefZPersist) frt=new StriRefZ(persist.Nom); - + //-- commun --// if(persist!=null){ - if(persist.listePoints!=null) - frt.setListePoints(persist.listePoints); + if(persist.listePoints!=null){ + + List<GrPoint> listePoints=new ArrayList<GrPoint>(); + for(StringBuffer buff:persist.listePoints){ + + int indiceCesure=buff.lastIndexOf(" "); + String val1=buff.substring(0, indiceCesure); + String val2=buff.substring(indiceCesure+1, buff.length()); + double x=0; + try{ + x=Double.parseDouble(val1); + + }catch(NumberFormatException e){ + listeMessageError.add(CrueRessource.getS("Frottement: "+frt.getNom()+": impossible de r\xE9cup\xE9rer le r\xE9el du contenu: "+buff)); + } + double y=0; + try{ + y=Double.parseDouble(val2); + }catch(NumberFormatException e){ + listeMessageError.add(CrueRessource.getS("Frottement: "+frt.getNom()+": impossible de r\xE9cup\xE9rer le r\xE9el du contenu: "+buff)); + } + listePoints.add(new GrPoint(x,y,0)); + + } + + + frt.setListePoints(listePoints); + } data.add(frt); } - + } return data; } - + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoOPTG.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoOPTG.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoOPTG.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -4,6 +4,7 @@ import java.io.FileWriter; import java.io.IOException; import java.io.ObjectOutputStream; +import java.util.List; import main.java.org.fudaa.dodico.crue.metier.emh.ElemSeuil; @@ -36,13 +37,7 @@ double RegleVarPdxMax; double ReglePenteMax; - /** - * Prend en parametre un objet m\xE9tier correspondant: - */ - public CrueDaoOPTG(ElemSeuil element){ - //-- appel a fillInfosWith --// - fillInfosWith(element); - } + public XStream initXmlParser(){ @@ -54,12 +49,12 @@ - public void fillInfosWith(ElemSeuil data) { + public void fillInfosWith(ElemSeuil data,List<String> listeMessageError) { // TODO Auto-generated method stub } - public ElemSeuil fillInfosWithPersistant() { + public ElemSeuil fillInfosWithPersistant(List<String> listeMessageError) { // TODO Auto-generated method stub return null; } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -6,6 +6,8 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.List; import main.java.org.fudaa.dodico.crue.metier.emh.ElemSeuil; @@ -20,7 +22,8 @@ */ public abstract class CrueDaoParsing<T> { - + public String VersionCrue="0.0"; + public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; /** * Initiazlise le parser xstream avec les bons alias des noms de balises. * @return @@ -32,20 +35,20 @@ * Cette m\xE9thode est appel\xE9e dans le constructeur. * @param data */ - abstract void fillInfosWith(T data); + abstract void fillInfosWith(T data,List<String> listeMessageError); /** * Cr\xE9e une structure m\xE9tier \xE0 partir des informations persistantes. * Utiliser poru le remplissage de la structure m\xE9tier apr\xE8s lecture du fichier xml. * @return */ - abstract T fillInfosWithPersistant(); + abstract T fillInfosWithPersistant(List<String> listeMessageError); /** * Execute la persistance des donn\xE9es dans le fichier donn\xE9 en parametre. * @return */ - public boolean persistData(File fichier) { + public boolean persistData(File fichier,List<String> listeMessageError) { boolean isOk=true; ObjectOutputStream out=null; try { @@ -55,6 +58,7 @@ } catch (IOException e) { // TODO Auto-generated catch block FuLog.debug(e.getMessage()); + listeMessageError.add(e.getMessage()); isOk=false; } finally{ @@ -64,6 +68,7 @@ } catch (IOException e) { // TODO Auto-generated catch block FuLog.debug(e.getMessage()); + listeMessageError.add(e.getMessage()); } } return false; @@ -74,7 +79,7 @@ * @param fichier * @return */ - public T getPersistData(File fichier){ + public T getPersistData(File fichier,List<String> listeMessageError){ //-- la data a r\xE9cup\xE9rer --// T newData=null; boolean isOk=true; @@ -85,14 +90,16 @@ CrueDaoParsing<T> dataPersistante=(CrueDaoParsing<T>) in.readObject(); //-- on genere la donn\xE9es m\xE9tier a partir de la donnee persistante--// - newData=dataPersistante.fillInfosWithPersistant(); + newData=dataPersistante.fillInfosWithPersistant(listeMessageError); } catch (IOException e) { // TODO Auto-generated catch block FuLog.debug(e.getMessage()); + listeMessageError.add(e.getMessage()); isOk=false; } catch (ClassNotFoundException e) { // TODO Auto-generated catch block FuLog.debug(e.getMessage()); + listeMessageError.add(e.getMessage()); isOk=false; } finally{ @@ -102,6 +109,7 @@ } catch (IOException e) { // TODO Auto-generated catch block FuLog.debug(e.getMessage()); + listeMessageError.add(e.getMessage()); } } return null; Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueRessource.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueRessource.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueRessource.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -0,0 +1,65 @@ +package main.java.org.fudaa.dodico.crue.dao; + +import org.fudaa.ebli.ressource.EbliResource; + +import org.fudaa.fudaa.ressource.FudaaResource; + +import com.memoire.bu.BuIcon; +import com.memoire.bu.BuResource; + +/** + * Ressources crue. + * + * @author Adrien Hadoux + * + */ +public class CrueRessource extends FudaaResource { + + public final static CrueRessource CR = new CrueRessource(BuResource.BU); + + private CrueRessource(final BuResource _b) { + super(_b); + } + + public static String getS(final String _s) { + return EbliResource.EBLI.getString(_s); + } + + public static String getS(final String _s, final String _v0) { + return EbliResource.EBLI.getString(_s, _v0); + } + + public static String getS(final String _s, final String _v0, + final String _v1) { + return EbliResource.EBLI.getString(_s, _v0, _v1); + } + + public static BuIcon getMeshIcon() { + return EbliResource.EBLI.getIcon("crue"); + } + + public static String getMeshName() { + return CrueRessource.getS("Meshview"); + } + + public static BuIcon getSupervisorIcon() { + return EbliResource.EBLI.getIcon("crue-super"); + } + + public static BuIcon getCrueIcon() { + return EbliResource.EBLI.getIcon("crue-post"); + } + + public static BuIcon getScopIcon() { + return EbliResource.EBLI.getIcon("curves"); + } + + public static String getCrueName() { + return CrueRessource.getS("Crue"); + } + + public static String getEditorName() { + return CrueRessource.getS("Editeur"); + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -47,7 +47,7 @@ xstream.alias("StriRefH", StriRefHPersist.class); //-- custom pour les points grpoint qui composent le fichier --// - xstream.alias("PointFF", Point.class); + xstream.alias("PointFF", StringBuffer.class); //-- il faut virer le type liste pour forcer a afficher les balises sans balises couvrantes --// xstream.addImplicitCollection(CrueDaoDFRT.class, "listeFrottement"); @@ -59,7 +59,7 @@ public static abstract class StriRefPersist { public String Nom; - public List<Point> listePoints; + public List<StringBuffer> listePoints; public StriRefPersist(String nom){ Nom=nom; } Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDPTI.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDPTI.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDPTI.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -0,0 +1,323 @@ +package main.java.org.fudaa.dodico.crue.dao; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.converters.SingleValueConverter; + +/** + * Toutes les structures dao utilis\xE9es et les inits du parser xml pour le format DPTI. + * Toutes ces structures sont n\xE9cessaires pour bien formatter le contenu xml. + * Ici il n'y a pas besoin de d\xE9finir de sttructures suppl\xE9mentaires. + * @author Adrien Hadoux + * + */ +public class DaoStructuresFormatDPTI { + + + public void initXmlParserForDRSO(XStream xstream ){ + //-- creation des alias pour que ce soit + parlant dans le xml file --// + xstream.alias("DPTI", CrueDaoDRSO.class); + //-- liste des initialisations n\xE9cessaires pour le formattage des donn\xE9es--// + initXmlParserNode(xstream); + initXmlParserBranche(xstream); + initXmlParserCasier(xstream); + initXmlParserSection(xstream); + } + + /** + * init parser pour les nodes et pouvoir mettre l'attribut Nom en d\xE9but de balise. + * @param xstream + */ + public void initXmlParserNode(XStream xstream ){ + //-- alias gestion pour les noeuds --// + xstream.alias("NoeudNiveauContinu", NoeudNiveauContinu.class); + //-- mettre attribut Nom comme attribut de la balise Noeud et son converter appropri\xE9 --// + //-- creation des alias pour que ce soit + parlant dans le xml file --// + xstream.useAttributeFor(NoeudNiveauContinu.class, "NomRef"); + xstream.registerConverter(new NoeudNiveauContinuConverter()); + } + + /** + * Init le parser avec les infos des branches. + * @param xstream + */ + public void initXmlParserBranche(XStream xstream ){ + //-- gestion des branches --// + xstream.alias("BrancheSaintVenant", BrancheSaintVenant.class); + xstream.alias("BrancheSeuilLateral", BrancheSeuilLateral.class); + xstream.alias("BrancheStrickler", BrancheStrickler.class); + xstream.alias("BrancheOrifice", BrancheOrifice.class); + xstream.alias("BrancheSeuilTransversal", BrancheSeuilTransversal.class); + xstream.alias("BrancheBarrageFilEau", BrancheBarrageFilEau.class); + xstream.alias("BranchePdc", BranchePdc.class); + xstream.alias("BrancheBarrageGenerique",BrancheBarrageGenerique.class); + + //-- mettre attribut Nom comme attribut de la balise branche,noeud et section et son converter appropri\xE9 --// + + //-- mettre le nom de la branche dans la balise --// + xstream.useAttributeFor(BrancheAbstract.class, "NomRef"); + xstream.registerConverter(new BrancheSaintVenantConverter()); + xstream.registerConverter(new BrancheSeuilLateralConverter()); + xstream.registerConverter(new BrancheStricklerConverter()); + xstream.registerConverter(new BrancheOrificeConverter()); + xstream.registerConverter(new BrancheSeuilTransversalConverter()); + xstream.registerConverter(new BrancheBarrageFilEauConverter()); + xstream.registerConverter(new BranchePdcConverter()); + xstream.registerConverter(new BrancheBarrageGeneriqueConverter()); + xstream.registerConverter(new BrancheBarrageRhoneConverter()); + xstream.registerConverter(new BrancheEnchainementConverter()); + xstream.registerConverter(new BrancheNiveauxAssociesConverter()); + } + /** + * Init le parser avec les infos des casiers. + * @param xstream + */ + public void initXmlParserCasier(XStream xstream ){ + xstream.alias("CasierProfil", CasierProfil.class); + xstream.alias("CasierMNT", CasierMNT.class); + xstream.useAttributeFor(CasierAbstract.class, "NomRef"); + xstream.registerConverter(new CasierProfilConverter()); + xstream.registerConverter(new CasierMNTConverter()); + } + + + /** + * Init le parser avec les infos des sections. + * @param xstream + */ + public void initXmlParserSection(XStream xstream ){ + //-- gestion des sections --// + xstream.alias("SectionIdem", SectionRefIdem.class); + xstream.alias("SectionSansGeometrie", SectionRefSansGeometrie.class); + xstream.alias("SectionProfil", SectionRefProfil.class); + xstream.alias("SectionInterpolee", SectionRefInterpolee.class); + xstream.alias("SectionPilote", SectionRefPilote.class); + + xstream.useAttributeFor(SectionAbstract.class, "NomRef"); + xstream.registerConverter(new SectionRefIdemConverter()); + xstream.registerConverter(new SectionRefSansGeometrieConverter()); + xstream.registerConverter(new SectionRefProfilConverter()); + xstream.registerConverter(new SectionRefInterpoleeConverter()); + xstream.registerConverter(new SectionRefPiloteConverter()); + } + + + + public static class NoeudNiveauContinu{ + public String NomRef; + public Double Zini; + } + + + + /** + * Il faut cr\xE9er et ajouter ce converter pour inclure le nom du noeud niveau continu dans le fichier xml + */ + public class NoeudNiveauContinuConverter implements SingleValueConverter { + public String toString(Object obj) { + return ((NoeudNiveauContinu) obj).NomRef; + } + public Object fromString(String name) { + NoeudNiveauContinu n=new NoeudNiveauContinu(); + n.NomRef=name; + return n; + } + public boolean canConvert(Class type) { + return type.isInstance(NoeudNiveauContinu.class); + } +} + + + //*************************GESTION DES BRANCHES ************************* + + /** + * Element branche possible + * @author Adrien Hadoux + * + */ + public static class BrancheAbstract{ + public String NomRef; + public Double Qini; + public Double Qruis; + + + } + + + public static class BrancheSaintVenant extends BrancheAbstract{} + public static class BrancheSeuilLateral extends BrancheAbstract{} + public static class BrancheStrickler extends BrancheAbstract{} + public static class BrancheOrifice extends BrancheAbstract{ + public Double OuvPasseDessous; + } + public static class BrancheSeuilTransversal extends BrancheAbstract{} + public static class BrancheBarrageFilEau extends BrancheAbstract{} + public static class BranchePdc extends BrancheAbstract{} + + public static class BrancheBarrageGenerique extends BrancheAbstract{} + public static class BrancheBarrageRhone extends BrancheAbstract{} + public static class BrancheEnchainement extends BrancheAbstract{} + public static class BrancheNiveauxAssocies extends BrancheAbstract{} + /** + * le converter abstract pour les branches. + * Il faudra ensuite en d\xE9clarer un pour chaque type de branche afin de cr\xE9er le bon type de modele. + * @author Adrien Hadoux + * + */ + public abstract class BrancheConverter implements SingleValueConverter { + public String toString(Object obj) { + return ((BrancheAbstract) obj).NomRef; + } + public abstract Object fromString(String name); + public boolean canConvert(Class type) { + return type.isInstance(BrancheAbstract.class); + }} + + + + + public class BrancheSaintVenantConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheSaintVenant branche=new BrancheSaintVenant(); + branche.NomRef=name; + return branche;}} + public class BrancheSeuilLateralConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheSeuilLateral branche=new BrancheSeuilLateral(); + branche.NomRef=name; + return branche;}} + + public class BrancheStricklerConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheStrickler branche=new BrancheStrickler(); + branche.NomRef=name; + return branche;}} + + public class BrancheOrificeConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheOrifice branche=new BrancheOrifice(); + branche.NomRef=name; + return branche;}} + + public class BrancheSeuilTransversalConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheSeuilTransversal branche=new BrancheSeuilTransversal(); + branche.NomRef=name; + return branche;}} + + public class BrancheBarrageFilEauConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheBarrageFilEau branche=new BrancheBarrageFilEau(); + branche.NomRef=name; + return branche;}} + + public class BranchePdcConverter extends BrancheConverter { + public Object fromString(String name) { + BranchePdc branche=new BranchePdc(); + branche.NomRef=name; + return branche;}} + + public class BrancheBarrageGeneriqueConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheBarrageGenerique branche=new BrancheBarrageGenerique(); + branche.NomRef=name; + return branche;}} + + public class BrancheBarrageRhoneConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheBarrageRhone branche=new BrancheBarrageRhone(); + branche.NomRef=name; + return branche;}} + + public class BrancheEnchainementConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheEnchainement branche=new BrancheEnchainement(); + branche.NomRef=name; + return branche;}} + + public class BrancheNiveauxAssociesConverter extends BrancheConverter { + public Object fromString(String name) { + BrancheNiveauxAssocies branche=new BrancheNiveauxAssocies(); + branche.NomRef=name; + return branche;}} + + + //*************************GESTION DES CASIERS ************************* + public static class CasierAbstract{ + public String NomRef; + public Double Qruis; + } + public static class CasierProfil extends CasierAbstract{ + + } + public static class CasierMNT extends CasierAbstract{} + + public abstract class CasierAbstractConverter implements SingleValueConverter { + public String toString(Object obj) { + return ((CasierAbstract) obj).NomRef; } + public abstract Object fromString(String name); + public boolean canConvert(Class type) { + return type.isInstance(CasierAbstract.class); + }} + public class CasierProfilConverter extends CasierAbstractConverter { + public Object fromString(String name){ + CasierProfil casier=new CasierProfil(); + casier.NomRef=name; + return casier; } } + + public class CasierMNTConverter extends CasierAbstractConverter { + public Object fromString(String name){ + CasierMNT casier=new CasierMNT(); + casier.NomRef=name; + return casier; } } + + + //*************************GESTION DES SECTIONS ************************* + public static class SectionAbstract{ + public String NomRef; + + } + public static class SectionRefIdem extends SectionAbstract{} + public static class SectionRefInterpolee extends SectionAbstract{} + public static class SectionRefProfil extends SectionAbstract{} + public static class SectionRefSansGeometrie extends SectionAbstract{} + public static class SectionRefPilote extends SectionAbstract{} + + public abstract class SectionRefConverter implements SingleValueConverter { + public String toString(Object obj) { + return ((SectionAbstract) obj).NomRef; + } + public abstract Object fromString(String name); + public boolean canConvert(Class type) { + return type.isInstance(SectionAbstract.class); + }} + public class SectionRefIdemConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefIdem section=new SectionRefIdem(); + section.NomRef=name; + return section;}} + + public class SectionRefInterpoleeConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefInterpolee section=new SectionRefInterpolee(); + section.NomRef=name; + return section;}} + + public class SectionRefProfilConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefProfil section=new SectionRefProfil(); + section.NomRef=name; + return section;}} + + public class SectionRefSansGeometrieConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefSansGeometrie section=new SectionRefSansGeometrie(); + section.NomRef=name; + return section;}} + + public class SectionRefPiloteConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefPilote section=new SectionRefPilote(); + section.NomRef=name; + return section;}} + +} Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/ValidatorXml.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -0,0 +1,120 @@ +package main.java.org.fudaa.dodico.crue.dao.validatorXML; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.List; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.jdom.Document; +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +import com.memoire.fu.FuLog; + +/** + * Classe validator xml qui utilise les xsd pour v\xE9rifier que le fichier est valide. + * @author Adrien Hadoux + * + */ +public class ValidatorXml { + + static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"; + static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + static boolean isValid=true; + /** + * ref vers le fichier xsd DFRT. + */ + static final String xsdDFRT="valideDFRT.xsd"; + + + + /** + * valide fichier dfrt + * @param xmlFile + * @return + */ + public static boolean validDFRT(String xmlFile,List<String> listeMessageError){ return validXMLWithDOM(xmlFile, xsdDFRT, listeMessageError);} + + /** + * Initialise le validator avec els infos et le bon fichier xsd + * @param factory + * @param xsdFile + */ + public static void initXmlValidator(DocumentBuilderFactory factory ,String xsdFile){ + factory.setIgnoringComments(true); + factory.setNamespaceAware(true); + factory.setValidating(true); + factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); + File fichier= ValidatorXml.getFile(xsdFile) ; + + factory.setAttribute(JAXP_SCHEMA_SOURCE, fichier); + } + + /** + * recupere la bonne xsd + * @param fileName + * @return + */ + public static File getFile(String fileName){ + File file= null; + URL url = ValidatorXml.class.getResource(fileName); + file = new File(url.getFile()); + return file; + } + + + /** + * Realise la validation avec le bon fichier xsd + * @param xmlFile + * @param xsdFile + * @return + */ + public static boolean validXMLWithDOM(String xmlFile, String xsdFile,final List<String> listeMessageError) { + isValid = true; // Valide jusqu'\xE0 ce qu'une erreur se produise ! + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + //-- on init la factory DOM --// + ValidatorXml.initXmlValidator(dbf, xsdFile); + try { + // Parsage du fichier XML avec DOM + DocumentBuilder db = dbf.newDocumentBuilder(); + db.setErrorHandler(new ErrorHandler() { + public void fatalError(SAXParseException e) { + FuLog.debug("Erreur de validation XSD - Erreur fatal"); + listeMessageError.add(e.getMessage()); + isValid = false; + } + public void error(SAXParseException e) { + FuLog.debug("Erreur de validation XSD - Erreur"); + listeMessageError.add(e.getMessage()); + isValid = false; + } + public void warning(SAXParseException e) { + FuLog.debug("Erreur de validation XSD - Warning"); + listeMessageError.add(e.getMessage()); + isValid = false; + } + }); + org.w3c.dom.Document doc = db.parse(new File(xmlFile)); + } catch (ParserConfigurationException pcee) { + FuLog.debug(pcee.getMessage()); + listeMessageError.add(pcee.getMessage()); + return false; + } catch (IOException ioe) { + FuLog.debug(ioe.getMessage()); + listeMessageError.add(ioe.getMessage()); + return false; + } catch (SAXException saxe) { + FuLog.debug(saxe.getMessage()); + listeMessageError.add(saxe.getMessage()); + return false; + } + return isValid; + } + +} Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDFRT.xsd =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDFRT.xsd (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/validatorXML/valideDFRT.xsd 2009-03-05 18:29:20 UTC (rev 4512) @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.org/valideDFRT/" targetNamespace="http://www.example.org/valideDFRT/"> + + <complexType name="StriRefC"> + <sequence> + <element name="PointFF" type="tns:PointFF" maxOccurs="unbounded" minOccurs="1"></element> + </sequence></complexType> + + <complexType name="StriRefZ"> + <sequence> + <element name="PointFF" type="tns:PointFF"></element> + </sequence> + </complexType> + + <complexType name="StriRefH"> + <sequence> + <element name="PointFF" type="tns:PointFF" maxOccurs="unbounded" minOccurs="1"></element> + </sequence> + </complexType> + + <complexType name="PointFF"> + <sequence> + <element name="x" type="double"></element> + <element name="y" type="double"></element> + </sequence> + </complexType> + + <complexType name="DFRT"> + <sequence> + <element name="StriRefH" type="tns:StriRefH" + maxOccurs="unbounded" minOccurs="0"> + </element> + <element name="StriRefZ" type="tns:StriRefZ" + maxOccurs="unbounded" minOccurs="0"> + </element> + <element name="StriRefC" type="tns:StriRefC" maxOccurs="unbounded" minOccurs="0"></element> + </sequence> + </complexType> + + <complexType name="Fichier"> + <sequence> + <element name="DFRT" type="tns:DFRT" maxOccurs="1" minOccurs="1"></element> + </sequence> + </complexType> + + <element name="Fichier" type="tns:Fichier"></element> + + <element name="DFRT" type="tns:DFRT"></element> + + <element name="PointFF" type="tns:PointFF"></element> + + <element name="StriRefC" type="tns:StriRefC"></element> + + <element name="StriRefZ" type="tns:StriRefZ"></element> + + <element name="StriRefH" type="tns:StriRefH"></element> +</schema> \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -29,6 +29,41 @@ private CatEMHNoeud noeudAmont_; private CatEMHNoeud noeudAval_; + /** + * Conditions initiales et manoeuvres aux branches (DPTI) + */ + private double Qini_; + /** + * Conditions initiales et manoeuvres aux branches (DPTI) + */ + private double Qruis_; + + + + public double getQini() { + return Qini_; + } + + + + public void setQini(double qini) { + Qini_ = qini; + } + + + + public double getQruis() { + return Qruis_; + } + + + + public void setQruis(double qruis) { + Qruis_ = qruis; + } + + + public CatEMHBranche(String nom) { super(nom); // TODO Auto-generated constructor stub Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -10,6 +10,23 @@ private boolean isActive_; private CatEMHNoeud noeud_; +/** + * Conditions initiales aux casiers + */ +private double qruis_; + +public double getQruis() { + return qruis_; +} + + + +public void setQruis(double qruis) { + this.qruis_ = qruis; +} + + + public CatEMHCasier(String nom) { super(nom); // TODO Auto-generated constructor stub Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -9,10 +9,21 @@ */ public class CatEMHNoeud extends EMH{ - + /** + * Conditions initiales et manoeuvres aux noeuds (DPTI) + */ + double Zini_; + public double getZini() { + return Zini_; + } + + public void setZini(double zini) { + Zini_ = zini; + } + public CatEMHNoeud(String nom) { super(nom); Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java 2009-03-05 16:57:34 UTC (rev 4511) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java 2009-03-05 18:29:20 UTC (rev 4512) @@ -12,7 +12,7 @@ * */ public abstract class DonFrt { - protected List<Point> point_; + protected List<GrPoint> point_; /** * reference. */ @@ -20,7 +20,7 @@ public DonFrt(String nom){ nom_=nom; - point_=new ArrayList<Point>(); + point_=new ArrayList<GrPoint>(); } public String getNom() { @@ -31,28 +31,25 @@ this.nom_ = nom; } - public Point getPoint(int i) { + public GrPoint getPoint(int i) { return point_.get(i); } - public GrPoint getGrPoint(int i) { - GrPoint val=new GrPoint(point_.get(i).x,point_.get(i).y,0); - return val; - } - public void setPoint(Point point,int i) { + + public void setPoint(GrPoint point,int i) { this.point_.set(i, point); } - public boolean addPoint(Point p){ + public boolean addPoint(GrPoint p){ return point_.add(p); } - public List<Point> getListePoints(){ + public List<GrPoint> getListePoints(){ return point_; } - public void setListePoints( List<Point> liste){ + public void setListePoints( List<GrPoint> liste){ point_=liste; } } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/... [truncated message content] |
From: <bma...@us...> - 2009-03-05 16:57:44
|
Revision: 4511 http://fudaa.svn.sourceforge.net/fudaa/?rev=4511&view=rev Author: bmarchan Date: 2009-03-05 16:57:34 +0000 (Thu, 05 Mar 2009) Log Message: ----------- Tache #193 : Conservation de l'ordre des lignes directrices fichiers rubar ST. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java 2009-03-05 16:02:15 UTC (rev 4510) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java 2009-03-05 16:57:34 UTC (rev 4511) @@ -68,6 +68,7 @@ } // Vrai si les points dupliqu\xE9 doivent le rester. boolean keepDuplicatePoints=true; + in_.setJumpBlankLine(true); in_.setBlankZero(true); in_.setCommentInOneField("#"); @@ -77,16 +78,19 @@ final List<String> names=new ArrayList<String>(200); final List<String> pks=new ArrayList<String>(200); final List<Coordinate> coordinatesEnCours = new ArrayList<Coordinate>(); - // Contient les listes de coordonn\xE9es pour les lignes directrices (Map<String,ArrayList<Coordinate>> en Java 1.5) - final Map<String, List<Coordinate>> mdirs=new HashMap<String, List<Coordinate>>(20); + + // Listes des coordonn\xE9es pour les lignes directrices + final List<List<Coordinate>> lcoordldir=new ArrayList<List<Coordinate>>(20); + // Liste des noms des lignes directrices + final List<String> lnameldirs=new ArrayList<String>(20); final int[] fmt = new int[] { 13, 13, 13, 1, 3 }; final int[] fmt1Line=new int[]{6,6,6,6,13,1,42}; Coordinate last = null; String name=""; String pk=""; + try { - while (true) { if (isSt_) { in_.readFields(fmt1Line); @@ -107,11 +111,16 @@ // Ligne directrice eventuelle. Pas de controle que la ligne directrice est bien sur tous les profils. String namedir=in_.stringField(4).trim(); if (!"".equals(namedir)) { - List<Coordinate> coordldir=(List<Coordinate>)mdirs.get(namedir); - if (coordldir==null) { + List<Coordinate> coordldir; + int ind=lnameldirs.indexOf(namedir); + if (ind==-1) { coordldir=new ArrayList<Coordinate>(200); - mdirs.put(namedir,coordldir); + lnameldirs.add(namedir); + lcoordldir.add(coordldir); } + else { + coordldir=lcoordldir.get(ind); + } coordldir.add((Coordinate) last.clone()); } @@ -181,13 +190,13 @@ } // Lignes directrices - if (mdirs.size()>0) { + if (lnameldirs.size()>0) { final GISZoneCollectionLigneBrisee zdirs = new GISZoneCollectionLigneBrisee(null); // Pour \xEAtre sur de la correspondance nom/coordonn\xE9es - String[] namedirs=(String[])mdirs.keySet().toArray(new String[0]); + String[] namedirs=lnameldirs.toArray(new String[0]); LineString[] ldirs=new LineString[namedirs.length]; for (int i=0; i<namedirs.length; i++) { - ldirs[i]=GISLib.createLineOrLinearFromList((List<Coordinate>)(mdirs.get(namedirs[i]))); + ldirs[i]=GISLib.createLineOrLinearFromList(lcoordldir.get(i)); } zdirs.addAllLineStringClosedOrNode(ldirs, null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2009-03-05 16:02:26
|
Revision: 4510 http://fudaa.svn.sourceforge.net/fudaa/?rev=4510&view=rev Author: hadouxad Date: 2009-03-05 16:02:15 +0000 (Thu, 05 Mar 2009) Log Message: ----------- corrections lot 3 Post stabilit?\195?\169s de l'appli Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.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/MvProfileCourbeGroup.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/TrPostCourbeModel.java 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/dialogSpec/TrPostWizardCourbeTemporelle.java 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-03-05 15:55:13 UTC (rev 4509) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersectionsResultsBuilder.java 2009-03-05 16:02:15 UTC (rev 4510) @@ -28,10 +28,12 @@ final TIntObjectHashMap pool_ = new TIntObjectHashMap(20); - private final LineString initLine_; + private LineString initLine_; - public EfLineIntersectionsResultsBuilder(final LineString initLine,final EfLineIntersectionsResultsI _res, + + +public EfLineIntersectionsResultsBuilder(final LineString initLine,final EfLineIntersectionsResultsI _res, final EfLineIntersectionsCorrectionTester _tester) { super(); res_ = _res; @@ -74,4 +76,9 @@ public LineString getInitLine() { return initLine_; } + +public void setInitLine(LineString line) { + initLine_=line; } + +} 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-03-05 15:55:13 UTC (rev 4509) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroup.java 2009-03-05 16:02:15 UTC (rev 4510) @@ -52,10 +52,12 @@ // comp_ = l; // } - private EGParent.TreeNodes getEgParent() { + public EGParent.TreeNodes getEgParent() { return n_; } - + public void setEgParent(EGParent.TreeNodes n) { + n_=n; + } void fillWithInfo(final BPaletteInfo.InfoData _table, final CtuluListSelectionInterface _selectedPt) { _table.setTitle(EbliLib.getS("Groupe:") + CtuluLibString.ESPACE + getTitle()); _table.put(EbliLib.getS("Nombre de courbes"), CtuluLibString.getString(getChildCount())); 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-03-05 15:55:13 UTC (rev 4509) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileBuilder.java 2009-03-05 16:02:15 UTC (rev 4510) @@ -212,8 +212,13 @@ } // on doit construire les courbes for (int t = 0; t < nbTIme; t++) { - final MVProfileCourbeModel model = new MVProfileCourbeModel(var, data_.getData(), time[t], getResBuilder(var, - _prog), _prog); + + EfLineIntersectionsResultsBuilder builder= getResBuilder(var, _prog); + if(selectedLine_!=null) + builder.setInitLine(selectedLine_); + else + builder.setInitLine(initLine_); + final MVProfileCourbeModel model = new MVProfileCourbeModel(var, data_.getData(), time[t],builder , _prog); EGCourbeChild child; if (isTime) { String title = var.toString() + CtuluLibString.ESPACE; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeGroup.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeGroup.java 2009-03-05 15:55:13 UTC (rev 4509) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileCourbeGroup.java 2009-03-05 16:02:15 UTC (rev 4510) @@ -7,7 +7,11 @@ */ package org.fudaa.fudaa.meshviewer.profile; +import java.util.Iterator; + import org.fudaa.ctulu.CtuluVariable; +import org.fudaa.ebli.courbe.EGCourbeChild; +import org.fudaa.ebli.courbe.EGGrapheDuplicator; import org.fudaa.ebli.courbe.EGGroup; /** @@ -33,4 +37,29 @@ return var_; } +@Override +public EGGroup duplicate(EGGrapheDuplicator _duplicator) { + + + // -- duplication de l objet --// + EGGroup duplic = new MvProfileCourbeGroup(var_); + duplic.setVisible(this.isVisible_); + duplic.setTitle(this.getTitle()); + duplic.setEgParent(this.getEgParent()); + duplic.setAxeY(this.getAxeY().duplicate()); + for (Iterator it = this.getChildren().iterator(); it.hasNext();) { + Object item = it.next(); + if (item instanceof EGCourbeChild) { + duplic.addEGComponent((EGCourbeChild)((EGCourbeChild) item).duplicate(duplic,_duplicator)); + } + + } + + return duplic; + + } + + + +} 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-03-05 15:55:13 UTC (rev 4509) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2009-03-05 16:02:15 UTC (rev 4510) @@ -215,13 +215,17 @@ MvProfileTarget target = new TrPostProfileAction.ProfileAdapter(_src, impl.getCurrentProject()); MvProfileBuilder builder = new MvProfileBuilderFromLine(target, impl, polyligne, vue2d, new MvProfileCoteTester()); // -- intersectionResultI --// - EfLineIntersectionsResultsI res = builder.getDefaultRes(_model.variable_, impl.getMainProgression()); + EfLineIntersectionsResultsI res = builder.getDefaultRes(newVariable, impl.getMainProgression()); // -- EfLineIntersectionsResultsBuilder --// - EfLineIntersectionsResultsBuilder efbuilder = new EfLineIntersectionsResultsBuilder(polyligne, _model.res_, + EfLineIntersectionsResultsBuilder efbuilder = new EfLineIntersectionsResultsBuilder(polyligne,res, new MvProfileCoteTester()); MVProfileCourbeModel newModele = new MVProfileCourbeModel(newVariable, _src, newTimeStep, efbuilder, impl .getMainProgression()); + //-- on recalcule les y --// + newModele.res_=res; + newModele.computeY(impl.getMainProgression()); + // -- titre --// String title = newVariable.toString() + CtuluLibString.ESPACE; if (newVariable.getCommonUnit() != null) title += "(" + newVariable.getCommonUnit() + ")" + CtuluLibString.ESPACE; @@ -907,6 +911,13 @@ for (int i = 0; i < root.components_.size(); i++) { // -- ajout du groupe duplique --// + +// if(root.getGroup(i) instanceof MvProfileCourbeGroup){ +// //-- creation du groupe au sens Mv avec hashmappage...--// +// MvProfileCourbeGroup newGroup= duplic.getGroup((MvProfileCourbeGroup)root.getGroup(i), true); +// Eggroot.getGroup(i).duplicate(_duplicator) +// +// }else duplic.add(root.getGroup(i).duplicate(_duplicator)); } 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-03-05 15:55:13 UTC (rev 4509) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2009-03-05 16:02:15 UTC (rev 4510) @@ -122,6 +122,11 @@ // TODO Auto-generated method stub return ptIdx_; } + + public String getSelectionPointName() { + // TODO Auto-generated method stub + return "("+ptIdx_.x_+";"+ptIdx_.y_+")"; + } @Override public void setSelectionPoint(Object point) { @@ -243,6 +248,11 @@ // TODO Auto-generated method stub return new Integer(ptIdx_); } + + public String getSelectionPointName() { + // TODO Auto-generated method stub + return ""+ptIdx_; + } @Override public void setSelectionPoint(Object point) { @@ -429,6 +439,7 @@ public abstract String getInfosPoint(); public abstract Object getSelectionPoint(); + public abstract String getSelectionPointName(); public abstract void setSelectionPoint(Object point); /** * Methode appelee pour rejouer les donnees d'une courbe en cas de rechargement avec d'autres donnees. Modified: 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 2009-03-05 15:55:13 UTC (rev 4509) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrReplayCurvesData.java 2009-03-05 16:02:15 UTC (rev 4510) @@ -193,8 +193,8 @@ } if(modeEdition){ //-- ajout de l'action sonde --// - final ZCalqueSondeInteraction sonde = vue2d.getController().addCalqueSondeInteraction(); - toolbarCalque.add(new CalqueActionSonde(sonde, vue2d.getArbreCalqueModel())); +// final ZCalqueSondeInteraction sonde = vue2d.getController().addCalqueSondeInteraction(); +// toolbarCalque.add(new CalqueActionSonde(sonde, vue2d.getArbreCalqueModel())); //--ajout de l'action rechercher--// EbliActionAbstract action=new EbliActionSimple("Rechercher",EbliResource.EBLI.getIcon("rechercher"),"RECH"){ @@ -706,7 +706,7 @@ //-- on rejoue les donn\xE9es avec les nouvelles valeurs --// if(this.ecraser_.isSelected()) - implementation.message("La courbe actuelle de mod\xE8le: variable:"+modele.getVar()+", point N\xB0 "+modele.getSelectionPoint()+" va \xEAtre recalcul\xE9e pour les donn\xE9es suivantes:\n" + implementation.message("La courbe actuelle de mod\xE8le: variable:"+modele.getVar()+", point N\xB0 "+modele.getSelectionPointName()+" va \xEAtre recalcul\xE9e pour les donn\xE9es suivantes:\n" +"Variable: "+newVariable.getName()+", point N\xB0 "+newPointReel); @@ -760,6 +760,7 @@ GISZoneCollectionPoint collectionPoint=new GISZoneCollectionPoint(); LineString listePoints=modele.getBuilder().getInitLine(); //-- ajout des coordonnees --// + if(listePoints!=null){ Object[][] dataP=new Object[listePoints.getNumPoints()][2]; for(int i=0;i<listePoints.getNumPoints();i++){ collectionPoint.add(listePoints.getCoordinateN(i).x,listePoints.getCoordinateN(i).y,0); @@ -767,7 +768,7 @@ dataP[i][1]=listePoints.getCoordinateN(i).y; } - + } //ZModelePointEditable modelePointEdit=new ZModelePointEditable(collectionPoint); @@ -853,7 +854,7 @@ */ public boolean replayProfilSpatialFor( TrPostSource srcChoisie,TrPostVisuPanel vue2d,MvProfileTreeModel tree,MVProfileCourbeModel modele,TrPostCommonImplementation implementation){ H2dVariableType newVariable=vue2d.getSelectedVarInCalqueActif();; - int newTimeStep_=-1; + int newTimeStep_=vue2d.getSelectedTimeInCalqueActif(); if (vue2d.isSelectionOkForEvolution()) { int[] newPoints=null; @@ -897,11 +898,14 @@ //-- on recupere la ligne avec la ligne formee des sondes --// List<GrPoint> listePoints=vue2d.getLigneBriseeFormSonde(); if(listePoints!=null && listePoints.size()>1){ + LineString lineInit=modele.getBuilder().getInitLine(); + String title=""; + if(lineInit!=null) + title=" [P1("+format(lineInit.getCoordinateN(0).x,2)+";"+format(lineInit.getCoordinateN(0).y,2)+")"+";"+ + "P"+lineInit.getNumPoints()+"("+format(lineInit.getCoordinateN(lineInit.getNumPoints()-1).x,2)+";"+format(lineInit.getCoordinateN(lineInit.getNumPoints()-1).y,2)+")]"; - String title=" [P1("+format(modele.getBuilder().getInitLine().getCoordinateN(0).x,2)+";"+format(modele.getBuilder().getInitLine().getCoordinateN(0).y,2)+")"+";"+ - "P"+modele.getBuilder().getInitLine().getNumPoints()+"("+format(modele.getBuilder().getInitLine().getCoordinateN(modele.getBuilder().getInitLine().getNumPoints()-1).x,2)+";"+format(modele.getBuilder().getInitLine().getCoordinateN(modele.getBuilder().getInitLine().getNumPoints()-1).y,2)+")]"; String title2=" [P1("+format(listePoints.get(0).x_,2)+";"+format(listePoints.get(0).y_,2)+")"+";"+ - "P"+modele.getBuilder().getInitLine().getNumPoints()+"("+format(listePoints.get(listePoints.size()-1).x_,2)+";"+format(listePoints.get(listePoints.size()-1).y_,2)+")]"; + "P"+listePoints.size()+"("+format(listePoints.get(listePoints.size()-1).x_,2)+";"+format(listePoints.get(listePoints.size()-1).y_,2)+")]"; //-- on rejoue les donn\xE9es avec les nouvelles valeurs --// if(this.ecraser_.isSelected()){ implementation.message("La courbe actuelle de mod\xE8le: variable:"+modele.getVariable()+", de pas de temps "+srcChoisie.getTimeStep(modele.getActiveTimeIdx())+" et de polyligne d'extr\xE9mit\xE9s "+title+"\n" + Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java 2009-03-05 15:55:13 UTC (rev 4509) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java 2009-03-05 16:02:15 UTC (rev 4510) @@ -919,7 +919,10 @@ } // -- on ajoute le point interpol\xE9 --// - if (create) listePoints_.add(interpol); + if (create){ + listePoints_.add(interpol); + model.fireTableDataChanged(); + } else { listePoints_.set(indexToModify, interpol); model.fireTableRowsUpdated(indexToModify, indexToModify); @@ -927,10 +930,16 @@ } else { // -- on ajoute le point reel --// - if (create) listePoints_.add(indice); + if (create){ + listePoints_.add(indice); + model.fireTableDataChanged(); + } else { listePoints_.set(indexToModify, indice); model.fireTableRowsUpdated(indexToModify, indexToModify); +// if(panelSelectionPoints!=null) +// panelSelectionPoints.revalidate(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-03-05 15:55:16
|
Revision: 4509 http://fudaa.svn.sourceforge.net/fudaa/?rev=4509&view=rev Author: bmarchan Date: 2009-03-05 15:55:13 +0000 (Thu, 05 Mar 2009) Log Message: ----------- Taches #191 + #192 : Restaure viewport automatique apr?\195?\168s import + Correction info nb de points/polylignes import?\195?\169es sur Rubar ST. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarSt.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2009-03-04 10:45:58 UTC (rev 4508) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2009-03-05 15:55:13 UTC (rev 4509) @@ -691,6 +691,9 @@ } } + /** + * Restaure le viewport sur le domaine \xE9tendu \xE0 tous les calques. + */ public void restaurer() { final BCalqueInteraction cq = unsetCurrentInteractifCalque(); final GrBoite b = pn_.getVueCalque().getCalque().getDomaine(); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2009-03-04 10:45:58 UTC (rev 4508) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2009-03-05 15:55:13 UTC (rev 4509) @@ -729,6 +729,9 @@ controller_.removeCalqueInteraction(_b); } + /** + * Restaure le viewport sur le domaine \xE9tendu \xE0 tous les calques. + */ public void restaurer() { controller_.restaurer(); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java 2009-03-04 10:45:58 UTC (rev 4508) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java 2009-03-05 15:55:13 UTC (rev 4509) @@ -113,7 +113,7 @@ return; } - final MdlWizardImport importWizard=new MdlWizardImport(getPanel().getDonneesCalque(), getEnglobPolygone(), ed, + final MdlWizardImport importWizard=new MdlWizardImport(getPanel(), getEnglobPolygone(), ed, ((FSigVisuPanel)getPanel()).getImpl(), ((FSigVisuPanel)getPanel()).getCmdMng()); final BuWizardDialog dialog=new BuWizardDialog(CtuluLibSwing.getFrameAncestorHelper(super.getPanel()), importWizard); importWizard.setDialog(dialog); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java 2009-03-04 10:45:58 UTC (rev 4508) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java 2009-03-05 15:55:13 UTC (rev 4509) @@ -44,6 +44,7 @@ import org.fudaa.ctulu.gis.GISZoneCollection; import org.fudaa.ebli.calque.BGroupeCalque; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesAbstract; +import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.calque.ZModeleGeometry; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.calque.edition.ZCalqueEditable; @@ -77,15 +78,17 @@ protected final CtuluUI impl_; protected GISAttributeInterface[] src_; protected final DefaultListModel srcAtt_ = new DefaultListModel(); + protected final ZEbliCalquesPanel pnCalques_; /** * @param _previewZone la zone a utiliser pour la pr\xE9visualisation * @param _selectedLayer le calque en cours de selection: peut-etre null * @param _impl l'impl parent */ - public MdlWizardImport(BGroupeCalque _racine, GISPolygone[] _previewZone, ZCalqueEditable _selectedLayer, CtuluUI _impl, CtuluCommandManager _mng) { + public MdlWizardImport(ZEbliCalquesPanel _pn, GISPolygone[] _previewZone, ZCalqueEditable _selectedLayer, CtuluUI _impl, CtuluCommandManager _mng) { mng_=_mng; - calqueRacine_=_racine; + calqueRacine_=_pn.getDonneesCalque(); + pnCalques_=_pn; impl_ = _impl; previewZone_ = _previewZone; selectedLayer_ = _selectedLayer; @@ -139,6 +142,7 @@ task.start(new Runnable() { public void run() { importData(task.getStateReceiver()); + pnCalques_.restaurer(); } }); super.doTask(); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarSt.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarSt.java 2009-03-04 10:45:58 UTC (rev 4508) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarSt.java 2009-03-05 15:55:13 UTC (rev 4509) @@ -59,18 +59,20 @@ final GISZoneCollectionLigneBrisee[] res = (GISZoneCollectionLigneBrisee[]) op.getSource(); boolean blines=false; - final GISVisitorCount counter=new GISVisitorCount(); for (int i=0; i<res.length; i++) { if (res[i]==null||res[i].getNumGeometries()==0) continue; blines=true; - res[i].accept(counter); - _r.nbPointTotal_+=counter.nbPt_; + // Ajout de l'attribut ETAT_GEOM _r.findOrCreateAttribute(GISAttributeConstants.ETAT_GEOM.getID(), String.class, false); GISDataModelAttributeAdapter adapter = new GISDataModelAttributeAdapter(res[i]); adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, _fileOrigine); - // GISAttributeInterface[] attrs=res[i].getAttributes(); + + final GISVisitorCount counter=new GISVisitorCount(); + res[i].accept(counter); + _r.nbPointTotal_+=counter.nbPtTotal_; + if(counter.nbPt_>0) { _r.nbPoint_+=counter.nbPt_; _r.pointModel_.add(GISDataModelFilterAdapter.buildPointAdapter(adapter, attrs)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jm_...@us...> - 2009-03-04 10:46:09
|
Revision: 4508 http://fudaa.svn.sourceforge.net/fudaa/?rev=4508&view=rev Author: jm_lacombe Date: 2009-03-04 10:45:58 +0000 (Wed, 04 Mar 2009) Log Message: ----------- rien Modified Paths: -------------- branches/Fudaa_Mascaret_3_0/fudaa_devel/fudaa-distrib/mascaret/copie_signature_jar_fudaamascaret.bat Modified: branches/Fudaa_Mascaret_3_0/fudaa_devel/fudaa-distrib/mascaret/copie_signature_jar_fudaamascaret.bat =================================================================== --- branches/Fudaa_Mascaret_3_0/fudaa_devel/fudaa-distrib/mascaret/copie_signature_jar_fudaamascaret.bat 2009-03-03 19:23:12 UTC (rev 4507) +++ branches/Fudaa_Mascaret_3_0/fudaa_devel/fudaa-distrib/mascaret/copie_signature_jar_fudaamascaret.bat 2009-03-04 10:45:58 UTC (rev 4508) @@ -1,3 +1,3 @@ -copy ..\..\..\distrib\build\jar\mascaret\fudaa-mascaret.jar fudaa-mascaret.jar -jarsigner -storepass farah1 -keystore mes_cles Fudaa-Mascaret.jar cle_de_test +copy ..\..\..\distrib\build\jar\mascaret\fudaa-mascaret.jar fudaa-mascaret.jar +jarsigner -storepass farah1 -keystore mes_cles Fudaa-Mascaret.jar cle_de_test pause \ 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-03-03 19:23:20
|
Revision: 4507 http://fudaa.svn.sourceforge.net/fudaa/?rev=4507&view=rev Author: hadouxad Date: 2009-03-03 19:23:12 +0000 (Tue, 03 Mar 2009) Log Message: ----------- * fignol?\195?\169 les lectures/?\195?\169critures DRSO. ca marche tr?\195?\168s bien * r?\195?\169alis?\195?\169 les test junit (test affiche xml, test ?\195?\169criture/lecture/?\195?\169criture) * j'ai persist?\195?\169 le fichier DRST (les frottements) * test junit pour le fichier DRST. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-03 19:21:31 UTC (rev 4506) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-03 19:23:12 UTC (rev 4507) @@ -30,4 +30,10 @@ - Fichier DRSO: + - positionner plusieurs valeurs dans la balise <PointFF>a b </PointFF> + ou g\xE9rer comme suit: + <PointFF> + <x>a</x> + <y>b</y> + </PointFF> \ 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-03-03 19:21:41
|
Revision: 4506 http://fudaa.svn.sourceforge.net/fudaa/?rev=4506&view=rev Author: hadouxad Date: 2009-03-03 19:21:31 +0000 (Tue, 03 Mar 2009) Log Message: ----------- * fignol?\195?\169 les lectures/?\195?\169critures DRSO. ca marche tr?\195?\168s bien * r?\195?\169alis?\195?\169 les test junit (test affiche xml, test ?\195?\169criture/lecture/?\195?\169criture) * j'ai persist?\195?\169 le fichier DRST (les frottements) * test junit pour le fichier DRST. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDRSO.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHSection.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageFilEau.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageGenerique.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageRhone.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheEnchainement.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheNiveauxAssocies.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheOrifice.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBranchePdc.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSaintVenant.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSeuilLongitudinale.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSeuilTransversal.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheStrickler.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHCasierMNT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHCasierProfil.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHNoeudNiveauContinu.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSectionIdem.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSectionInterpolee.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSectionProfil.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHSectionSansGeometrie.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/StriRefC.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/StriRefH.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/StriRefZ.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/reader/Crue10reader.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/writer/Crue10writer.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/testSave/ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/lib/fgis.jar branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/lib/fgis.src.jar branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/fudaa/crue/Crue.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/fudaa/crue/CrueCommomImplementation.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/AppCrueTest.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDFRTFile.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/TestCrueDRSOFile.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/fudaa/crue/App.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/AppTest.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/Crue.java branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/test/java/org/fudaa/fudaa/crue/CrueCommomImplementation.java Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/Fichiers_donnees_Crue/Questions-ModelisationDonnees.txt 2009-03-03 19:21:31 UTC (rev 4506) @@ -0,0 +1,33 @@ +-- Questions mod\xE9lisations \xE0 soumettre au CNR -- + + +***** CRUE 10 ***** + + +- G\xE9n\xE9ral: Important R\xE8gle \xE0 appliquer pour tous les fichiers xml + - Il faut appliquer les 2 r\xE8gles suivantes: + - le nom de balise < > doit \xEAtre unique par fichier. + - pour les occurences d'une m\xEAme balise: suffixer les autres balises r\xE9f\xE9rences par <balise-ref>. + + exemple: fichier DRSO: + les balises sections sont pr\xE9sentes \xE0 la fois a l'int\xE9rieur de <Sections> et de <Branches> avec les m\xEAmes noms. + puisque dans la partie section <Sections> les balises sont des r\xE9f\xE9rences, elles seront suffix\xE9es en + <SectionProfil-ref> <SectionInterpolee-ref> ... + + +***** FICHIERS XML CRUE 10***** + +- Fichier DRSO: + - balise casier: pourrait -n avoir des exemples de balises casierMNT (on a que des exemples casierProfil avec les fichiers pour le moment. ) + - balise casier/branche: on fait appel \xE0 une r\xE9f\xE9rence \xE0 un profil: Ou est-il d\xE9crit? + - balise branche: seul les noms des balises changenet(type de branche, saintvenant, orifice...), la structure + est toujours la m\xEAme (actif,noeud amont,aval, liste des sections). Est-ce normal? N'y a t'il pas de donn\xE9es sp\xE9cifiques suppl\xE9mentaires selon le type (pas pr\xE9sent dans les fichiers exemples). + - balise <Branches>. y sont d\xE9crit compl\xE8tement les sections (Pos,Xp) alors que dans la balise <Sections> il y a seulement des r\xE9f\xE9rences vers ces sections. Il ne faudrait pas plutot faire l'inverse? + sinon la balise <Sections> est facultative? + +- Fichier OPTG: + + + +- Fichier DRSO: + \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/lib/fgis.jar =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/lib/fgis.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/lib/fgis.src.jar =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/lib/fgis.src.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDFRT.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -0,0 +1,50 @@ +package main.java.org.fudaa.dodico.crue.dao; + +import java.util.List; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; + +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDFRT.StriRefPersist; +import main.java.org.fudaa.dodico.crue.metier.emh.DonFrt; +import main.java.org.fudaa.dodico.crue.metier.emh.EMH; + +/** + * Classe persistante qui reprend la meme structure que le fichier xml + *DFRT - Fichier des donn\xE9es de frottement (xml) + * A persister telle qu'elle. + * @author Adrien Hadoux + * + */ +public class CrueDaoDFRT extends CrueDaoParsing<List<DonFrt>>{ + //-- variables qui correspondent \xE0 celle du fichier xml --// + public String VersionCrue="10"; + public String Commentaire="G\xE9n\xE9r\xE9 par Fudaa "; + + /** + * Il faut ajouter un parametre dans xstream pour lui indiquer de degager les balises 'collections' + * car il n'y en a pas dans ce fichier. + */ + List<StriRefPersist> listeFrottement; + + + public void fillInfosWith(List<DonFrt> data) { + listeFrottement=CrueDaoFillInfos.remplirPersistanceAvecFrottemetnsDFRT(data); + + } + + + public List<DonFrt> fillInfosWithPersistant() { + return CrueDaoFillInfos.remplirFrottemetnsAvecPersistanceDFRT(listeFrottement); + } + + + public XStream initXmlParser() { + XStream xstream = new XStream(new DomDriver()); + //-- initialisation du format de la structure des documents --// + (new DaoStructuresFormatDFRT()).initXmlParserForDFRT(xstream); + return xstream; + } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoDRSO.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -1,6 +1,7 @@ package main.java.org.fudaa.dodico.crue.dao; import java.awt.font.MultipleMaster; +import java.util.ArrayList; import java.util.List; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.converters.SingleValueConverter; @@ -10,6 +11,7 @@ /** * Classe persistante qui reprend la meme structure que le fichier xml * DRSO - Fichier des donn\xE9es du r\xE9seau (xml) + * A persister telle qu'elle. * @author Adrien Hadoux * */ @@ -71,8 +73,33 @@ @Override public List<EMH> fillInfosWithPersistant() { - // TODO Auto-generated method stub - return null; + + List<EMH> listeCompleteEMH=new ArrayList<EMH>(); + + //-- etape 1: on remplit les infso des noeuds --// + List<EMH> listeNoeuds=CrueDaoFillInfos.remplirNoeudAvecPersistanceDRSO(Noeuds); + + //-- etape 2: les casiers --// + List<EMH> listeCasiers=CrueDaoFillInfos.remplirCasierAvecPersistanceDRSO(Casiers, listeNoeuds); + + + //-- etape 3: les branches et les sections de bransche --// + List<EMH> listeBranches=CrueDaoFillInfos.remplirBrancheAvecPersistanceDRSO(Branches, listeNoeuds); + + //-- etape 3: les sections a partir des sections cr\xE9es lors du remplissage des branches --// + + List<EMH> listeSections= CrueDaoFillInfos.remplirSectionsAvecPersistanceDRSO(Sections, listeBranches); + + + + + + //-- on ajoute tout dans la liste compl\xE8te --// + listeCompleteEMH.addAll(listeNoeuds); + listeCompleteEMH.addAll(listeCasiers); + listeCompleteEMH.addAll(listeBranches); + listeCompleteEMH.addAll(listeSections); + return listeCompleteEMH; } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoFillInfos.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -6,10 +6,12 @@ import com.lowagie.text.Section; import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDRSO.*; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDFRT.*; import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHBranche; import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHCasier; import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHNoeud; import main.java.org.fudaa.dodico.crue.metier.emh.CatEMHSection; +import main.java.org.fudaa.dodico.crue.metier.emh.DonFrt; import main.java.org.fudaa.dodico.crue.metier.emh.EMH; import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageFilEau; import main.java.org.fudaa.dodico.crue.metier.emh.EMHBrancheBarrageGenerique; @@ -28,6 +30,9 @@ import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionInterpolee; import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionProfil; import main.java.org.fudaa.dodico.crue.metier.emh.EMHSectionSansGeometrie; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefC; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefH; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefZ; /** * Classe qui se charge de remplir les structures DAO avec els donn\xE9es m\xE9tier. @@ -53,6 +58,26 @@ } return listePersistante; } + + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH noeuds a partir des donn\xE9es persistantes qui constituent la premiere partie du fichier DRSO: les Noeuds. + * @param data + * @return + */ + public static List<EMH> remplirNoeudAvecPersistanceDRSO(List listePersistants ){ + List<EMH> listeEMH=new ArrayList(); + for(Object persist:listePersistants ){ + if(persist instanceof NoeudNiveauContinu){ + NoeudNiveauContinu noeudPersist=(NoeudNiveauContinu) persist; + CatEMHNoeud noeud=new CatEMHNoeud(noeudPersist.Nom); + listeEMH.add(noeud); + } + } + return listeEMH; + } + + /** * Methode qui remplit une arrayList d'objets persistants qui constituent la deuxieme partie du fichier DRSO: les Branches. @@ -64,15 +89,14 @@ for(EMH emh:data ){ if(emh instanceof CatEMHBranche){ CatEMHBranche branche=(CatEMHBranche) emh; - Object branchePersist=null; + BrancheAbstract branchePersist=null; if (branche instanceof EMHBrancheBarrageFilEau) { EMHBrancheBarrageFilEau new_name = (EMHBrancheBarrageFilEau) branche; branchePersist=new BrancheBarrageFilEau(); }else if (branche instanceof EMHBrancheBarrageGenerique) { EMHBrancheBarrageGenerique new_name = (EMHBrancheBarrageGenerique) branche; branchePersist=new BrancheBarrageGenerique(); - } - else if (branche instanceof EMHBrancheBarrageRhone) { + }else if (branche instanceof EMHBrancheBarrageRhone) { EMHBrancheBarrageRhone new_name = (EMHBrancheBarrageRhone) branche; branchePersist=new BrancheBarrageRhone(); }else if (branche instanceof EMHBrancheEnchainement) { @@ -101,8 +125,6 @@ branchePersist=new BrancheStrickler(); } - - if(branchePersist!=null){ //-- commun --// BrancheAbstract br=(BrancheAbstract) branchePersist; @@ -111,19 +133,92 @@ if(branche.getNoeudAmont()!=null) br.NdAm=new NdAm(branche.getNoeudAmont().getNom()); if(branche.getNoeudAval()!=null) - br.NdAv=new NdAm(branche.getNoeudAval().getNom()); + br.NdAv=new NdAv(branche.getNoeudAval().getNom()); //-- on remplit les sections persistantes avec celle de la branche --// br.Sections=CrueDaoFillInfos.remplirPersistanceAvecSectionsBrancheDRSO(branche.getListeSections()); - listePersistante.add(br); } - } } return listePersistante; } + + public static List<EMH> remplirBrancheAvecPersistanceDRSO(List listePersistante,List<EMH> listeNoeuds){ + List<EMH> data=new ArrayList(); + for(Object objet:listePersistante ){ + if(objet instanceof BrancheAbstract){ + CatEMHBranche branche=null; + BrancheAbstract branchePersist=(BrancheAbstract) objet; + String nom=branchePersist.Nom; + if (branchePersist instanceof BrancheBarrageFilEau) { + branche = new EMHBrancheBarrageFilEau(nom); + + }else if (branchePersist instanceof BrancheBarrageGenerique) { + branche = new EMHBrancheBarrageGenerique(nom); + + }else if (branchePersist instanceof BrancheBarrageRhone) { + branche = new EMHBrancheBarrageRhone(nom); + + }else if (branchePersist instanceof BrancheEnchainement) { + branche = new EMHBrancheEnchainement(nom); + + }else if (branchePersist instanceof BrancheNiveauxAssocies) { + branche = new EMHBrancheNiveauxAssocies(nom); + + }else if (branchePersist instanceof BrancheOrifice) { + branche = new EMHBrancheOrifice(nom); + + }else if (branchePersist instanceof BranchePdc) { + branche = new EMHBranchePdc(nom); + + }else if (branchePersist instanceof BrancheSaintVenant) { + branche = new EMHBrancheSaintVenant(nom); + + }else if (branchePersist instanceof BrancheSeuilLateral) { + branche = new EMHBrancheSeuilLongitudinale(nom); + + }else if (branchePersist instanceof BrancheSeuilTransversal) { + branche = new EMHBrancheSeuilTransversal(nom); + + }else if (branchePersist instanceof BrancheStrickler) { + branche = new EMHBrancheStrickler(nom); + + } + if(branche!=null){ + //-- commun --// + + branche.setActive(branchePersist.Active); + //branche.setNom(branchePersist.Nom); + if(branchePersist.NdAm!=null){ + CatEMHNoeud noeudAmont=CatEMHNoeud.findByReference(branchePersist.NdAm.NomRef, listeNoeuds); + if(noeudAmont!=null) + branche.setNoeudAmont(noeudAmont); + } + if(branchePersist.NdAv!=null){ + CatEMHNoeud noeudAval=CatEMHNoeud.findByReference(branchePersist.NdAv.NomRef, listeNoeuds); + if(noeudAval!=null) + branche.setNoeudAval(noeudAval); + } + + //-- on remplit les sections persistantes avec celle de la branche --// + if(branchePersist.Sections!=null) + branche.setListeSections(CrueDaoFillInfos.remplirSectionsBrancheAvecPersistanceDRSO(branchePersist.Sections)); + + + data.add(branche); + } + } + } + return data; + } + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la troisi\xE8me partie du fichier DRSO: les Casier. + * @param data + * @return + */ public static List remplirPersistanceAvecCasierDRSO(List<EMH> data){ List listePersistante=new ArrayList(); for(EMH emh:data ){ @@ -157,27 +252,170 @@ /** - * Remplit les don\xE9nes persistantes avec la liste des sections . + * Methode qui remplit une arrayList d'objets m\xE9tier EMH casier a partir des donn\xE9es persistantes qui constituent a troisi\xE8me partie du fichier DRSO: les Casier. * @param data * @return */ + public static List<EMH> remplirCasierAvecPersistanceDRSO(List listePersistants,List<EMH> listeNoeuds ){ + List<EMH> listeEMH=new ArrayList(); + for(Object persist:listePersistants ){ + if(persist instanceof CasierAbstract){ + CasierAbstract casierPersist=(CasierAbstract) persist; + String nom=casierPersist.Nom; + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// + CatEMHCasier casier=null; + + //-- on recherche sa sp\xE9cialisation --// + if(casierPersist instanceof CasierProfil){ + casier=new EMHCasierProfil(nom); + if(((CasierProfil)casierPersist).Profil!=null) + ((EMHCasierProfil)casier).setNomProfil(((CasierProfil)casierPersist).Profil.NomRef); + }else if(casierPersist instanceof CasierMNT){ + casier=new EMHCasierMNT(nom); + } + + //-- commun aux objets --// + if(casier!=null){ + casier.setActive(casierPersist.Active); + if(casierPersist.Noeud!=null){ + String reference=casierPersist.Noeud.NomRef; + + + CatEMHNoeud noeudRef=CatEMHNoeud.findByReference(reference, listeNoeuds); + if(noeudRef!=null) + casier.setNoeud(noeudRef); + } + + listeEMH.add(casier); + } + } + } + return listeEMH; + } + + + + /** + * Methode qui remplit une arrayList d'objets persistants qui constituent la quatri\xE8me partie du fichier DRSO: les Sections-references. + * @param data + * @return + */ public static List remplirPersistanceAvecSectionsDRSO(List<EMH> data){ List listePersistante=new ArrayList(); for(EMH emh:data ){ if(emh instanceof CatEMHSection){ CatEMHSection section=(CatEMHSection)emh; + SectionAbstract sectionPersist=null; + if(section instanceof EMHSectionIdem){ + sectionPersist=new SectionRefIdem(); + }else + if(section instanceof EMHSectionInterpolee){ + sectionPersist=new SectionRefInterpolee(); + }else + if(section instanceof EMHSectionProfil){ + sectionPersist=new SectionRefProfil(); + }else + if(section instanceof EMHSectionSansGeometrie){ + sectionPersist=new SectionRefSansGeometrie(); + } + + //-- commun --// + if(sectionPersist!=null){ + sectionPersist.NomRef=section.getNom(); + listePersistante.add(sectionPersist); + } + } + } + return listePersistante; + } + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections de branches a partir des donn\xE9es persistantes qui constituent la partie interne d'une partie Branche du fichier DRSO: les Sections. + * @param data + * @return + */ + public static List<CatEMHSection> remplirSectionsBrancheAvecPersistanceDRSO(List listePersistantsBranches){ + + + + List<CatEMHSection> listeEMH=new ArrayList<CatEMHSection>(); + for(Object persist:listePersistantsBranches ){ + if(persist instanceof SectionBrancheAbstract){ + SectionBrancheAbstract sectionPersist=(SectionBrancheAbstract) persist; + + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// + CatEMHSection section=null; + String nom=sectionPersist.NomRef; + //-- on recherche sa sp\xE9cialisation --// + if(sectionPersist instanceof SectionIdem){ + section=new EMHSectionIdem(nom); + + }else if(sectionPersist instanceof SectionInterpolee){ + section=new EMHSectionInterpolee(nom); + }else if(sectionPersist instanceof SectionProfil){ + section=new EMHSectionProfil(nom); + }else if(sectionPersist instanceof SectionSansGeometrie){ + section=new EMHSectionSansGeometrie(nom); + } + + //-- commun aux objets --// + if(section!=null){ + + if(sectionPersist.Pos!=null) + section.setPosition(sectionPersist.Pos); + section.setXp(sectionPersist.Xp); + listeEMH.add(section); + } + } + } + return listeEMH; + } + + /** + * Methode qui remplit une arrayList d'objets m\xE9tier EMH sections a partir des donn\xE9es persistantes qui constituent a quatrieme partie du fichier DRSO: les Sections. + * @param data + * @return + */ + public static List<EMH> remplirSectionsAvecPersistanceDRSO(List listePersistantsSection,List<EMH> listeBranches){ + List<EMH> listeEMH=new ArrayList<EMH>(); + for(Object persist:listePersistantsSection ){ + if(persist instanceof SectionAbstract){ + SectionAbstract sectionPersist=(SectionAbstract) persist; + + //-- on d\xE9clare une version abstraite EMH m\xE9tier du type --// + CatEMHSection section=null; + String reference=sectionPersist.NomRef; + section=CatEMHSection.findByReferenceFromBrancheOrSectionEMH(reference, listeBranches); + if(section!=null) + listeEMH.add(section); + + } + } + return listeEMH; + } + + + /** + * Remplit les don\xE9nes persistantes avec la liste des sections d'une branche. + * Remplit toutes les donn\xE9es associ\xE9es aux sections + * @param data + * @return + */ + public static List remplirPersistanceAvecSectionsBrancheDRSO(List<CatEMHSection> data){ + List listePersistante=new ArrayList(); + for(EMH emh:data ){ + if(emh instanceof CatEMHSection){ + CatEMHSection section=(CatEMHSection)emh; SectionBrancheAbstract sectionPersist=null; if(section instanceof EMHSectionIdem){ sectionPersist=new SectionIdem(); }else if(section instanceof EMHSectionInterpolee){ sectionPersist=new SectionInterpolee(); - } - else + }else if(section instanceof EMHSectionProfil){ sectionPersist=new SectionProfil(); - } - else + }else if(section instanceof EMHSectionSansGeometrie){ sectionPersist=new SectionSansGeometrie(); } @@ -185,28 +423,73 @@ //-- commun --// if(sectionPersist!=null){ sectionPersist.NomRef=section.getNom(); - sectionPersist.Pos=section.getPosition(); - sectionPersist.Xp=section.getXp(); + sectionPersist.Pos=section.getPosition(); + sectionPersist.Xp=section.getXp(); + + listePersistante.add(sectionPersist); } - } - - } - return listePersistante; } + + /** + * remplir le fichier DFRT avec les frottemetns + * @param data + * @return + */ + public static List<StriRefPersist> remplirPersistanceAvecFrottemetnsDFRT(List<DonFrt> data){ + List<StriRefPersist> listeFrottement=new ArrayList<StriRefPersist>(); + for(DonFrt frt:data){ + StriRefPersist persist=null; + if(frt instanceof StriRefC) + persist=new StriRefCPersist(frt.getNom()); + else + if(frt instanceof StriRefH) + persist=new StriRefHPersist(frt.getNom()); + else + if(frt instanceof StriRefZ) + persist=new StriRefZPersist(frt.getNom()); + + //-- commun --// + if(persist!=null){ + persist.listePoints=frt.getListePoints(); + listeFrottement.add(persist); + } + + } + return listeFrottement; + } - /** - * Remplit les don\xE9nes persistantes avec la liste des sections d'une branche. + * remplir le fichier DFRT avec les frottemetns * @param data * @return */ - public static List remplirPersistanceAvecSectionsBrancheDRSO(List<CatEMHSection> data){ - return null; + public static List<DonFrt> remplirFrottemetnsAvecPersistanceDFRT(List<StriRefPersist> persistListe){ + List<DonFrt> data=new ArrayList<DonFrt>(); + for(StriRefPersist persist:persistListe){ + DonFrt frt=null; + if(persist instanceof StriRefCPersist) + frt=new StriRefC(persist.Nom); + else + if(persist instanceof StriRefHPersist) + frt=new StriRefH(persist.Nom); + else + if(persist instanceof StriRefZPersist) + frt=new StriRefZ(persist.Nom); + + //-- commun --// + if(persist!=null){ + if(persist.listePoints!=null) + frt.setListePoints(persist.listePoints); + data.add(frt); + } + + } + return data; } - + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/CrueDaoParsing.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -49,7 +49,7 @@ boolean isOk=true; ObjectOutputStream out=null; try { - out = initXmlParser().createObjectOutputStream(new FileWriter(fichier)); + out = initXmlParser().createObjectOutputStream(new FileWriter(fichier),"Fichier"); //--on enregistre la donn\xE9e au bon format --// out.writeObject(this); } catch (IOException e) { Added: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDFRT.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -0,0 +1,91 @@ +package main.java.org.fudaa.dodico.crue.dao; + +import java.awt.Point; +import java.util.List; + +import org.fudaa.ebli.geometrie.GrPoint; + +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDRSO.BrancheAbstract; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDRSO.NoeudNiveauContinu; +import main.java.org.fudaa.dodico.crue.dao.DaoStructuresFormatDRSO.NoeudNiveauContinuConverter; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefC; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefH; +import main.java.org.fudaa.dodico.crue.metier.emh.StriRefZ; + +import com.thoughtworks.xstream.XStream; + +/** + * Toutes les structures dao utilis\xE9es et les inits du parser xml pour le format DFRT. + * Toutes ces structures sont n\xE9cessaires pour bien formatter le contenu xml. + * Ici il n'y a pas besoin de d\xE9finir de sttructures suppl\xE9mentaires. + * @author Adrien Hadoux + * + */ +public class DaoStructuresFormatDFRT { + + + public void initXmlParserForDFRT(XStream xstream ){ + //-- creation des alias pour que ce soit + parlant dans le xml file --// + xstream.alias("DFRT", CrueDaoDFRT.class); + //-- liste des initialisations n\xE9cessaires pour le formattage des donn\xE9es--// + initXmlParserStriRef(xstream); + + + + + + } + + /** + * init parser pour les nodes et pouvoir mettre l'attribut Nom en d\xE9but de balise. + * @param xstream + */ + public void initXmlParserStriRef(XStream xstream ){ + //-- alias gestion pour les frottements --// + xstream.alias("StriRefC", StriRefCPersist.class); + xstream.alias("StriRefZ", StriRefZPersist.class); + xstream.alias("StriRefH", StriRefHPersist.class); + + //-- custom pour les points grpoint qui composent le fichier --// + xstream.alias("PointFF", Point.class); + + //-- il faut virer le type liste pour forcer a afficher les balises sans balises couvrantes --// + xstream.addImplicitCollection(CrueDaoDFRT.class, "listeFrottement"); + xstream.addImplicitCollection(StriRefPersist.class, "listePoints"); + + + } + + +public static abstract class StriRefPersist { + public String Nom; + public List<Point> listePoints; + public StriRefPersist(String nom){ + Nom=nom; + } + + } + + + + +public static class StriRefCPersist extends StriRefPersist{ + + public StriRefCPersist(String nom) { + super(nom); + // TODO Auto-generated constructor stub + }} +public static class StriRefZPersist extends StriRefPersist{ + + public StriRefZPersist(String nom) { + super(nom); + // TODO Auto-generated constructor stub + }} +public static class StriRefHPersist extends StriRefPersist{ + + public StriRefHPersist(String nom) { + super(nom); + // TODO Auto-generated constructor stub + }} + +} Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDRSO.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDRSO.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/dao/DaoStructuresFormatDRSO.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -62,48 +62,53 @@ xstream.alias("BrancheSeuilTransversal", BrancheSeuilTransversal.class); xstream.alias("BrancheBarrageFilEau", BrancheBarrageFilEau.class); xstream.alias("BranchePdc", BranchePdc.class); + xstream.alias("BrancheBarrageGenerique",BrancheBarrageGenerique.class); - //-- mettre attribut Nom comme attribut de la balise branche,noeud et section et son converter appropri\xE9 --// //-- mettre le nom de la branche dans la balise --// - xstream.useAttributeFor(BrancheSaintVenant.class, "Nom"); + xstream.useAttributeFor(BrancheAbstract.class, "Nom"); + + +// xstream.useAttributeFor(BrancheSaintVenant.class, "Nom"); xstream.registerConverter(new BrancheSaintVenantConverter()); - xstream.useAttributeFor(BrancheSeuilLateral.class, "Nom"); + // xstream.useAttributeFor(BrancheSeuilLateral.class, "Nom"); xstream.registerConverter(new BrancheSeuilLateralConverter()); - xstream.useAttributeFor(BrancheStrickler.class, "Nom"); + // xstream.useAttributeFor(BrancheStrickler.class, "Nom"); xstream.registerConverter(new BrancheStricklerConverter()); - xstream.useAttributeFor(BrancheOrifice.class, "Nom"); + //xstream.useAttributeFor(BrancheOrifice.class, "Nom"); xstream.registerConverter(new BrancheOrificeConverter()); - xstream.useAttributeFor(BrancheSeuilTransversal.class, "Nom"); + //xstream.useAttributeFor(BrancheSeuilTransversal.class, "Nom"); xstream.registerConverter(new BrancheSeuilTransversalConverter()); - xstream.useAttributeFor(BrancheBarrageFilEau.class, "Nom"); + // xstream.useAttributeFor(BrancheBarrageFilEau.class, "Nom"); xstream.registerConverter(new BrancheBarrageFilEauConverter()); - xstream.useAttributeFor(BranchePdc.class, "Nom"); + //xstream.useAttributeFor(BranchePdc.class, "Nom"); xstream.registerConverter(new BranchePdcConverter()); - xstream.useAttributeFor(BrancheBarrageGenerique.class, "Nom"); + //xstream.useAttributeFor(BrancheBarrageGenerique.class, "Nom"); xstream.registerConverter(new BrancheBarrageGeneriqueConverter()); - xstream.useAttributeFor(BrancheBarrageRhone.class, "Nom"); + // xstream.useAttributeFor(BrancheBarrageRhone.class, "Nom"); xstream.registerConverter(new BrancheBarrageRhoneConverter()); - xstream.useAttributeFor(BrancheEnchainement.class, "Nom"); + //xstream.useAttributeFor(BrancheEnchainement.class, "Nom"); xstream.registerConverter(new BrancheEnchainementConverter()); - xstream.useAttributeFor(BrancheNiveauxAssocies.class, "Nom"); + //xstream.useAttributeFor(BrancheNiveauxAssocies.class, "Nom"); xstream.registerConverter(new BrancheNiveauxAssociesConverter()); //-- gestion des noeuds des branches --// xstream.alias("NdAm", NdAm.class); xstream.alias("NdAv", NdAv.class); + + xstream.useAttributeFor(NdAm.class, "NomRef"); xstream.registerConverter(new NdAmConverter()); xstream.useAttributeFor(NdAv.class, "NomRef"); @@ -123,10 +128,11 @@ xstream.alias("Profil",ReferenceProfil.class); xstream.alias("Noeud", ReferenceNoeud.class); - xstream.useAttributeFor(CasierProfil.class, "Nom"); + xstream.useAttributeFor(CasierAbstract.class, "Nom"); + // xstream.useAttributeFor(CasierProfil.class, "Nom"); xstream.registerConverter(new CasierProfilConverter()); - xstream.useAttributeFor(CasierMNT.class, "Nom"); + //xstream.useAttributeFor(CasierMNT.class, "Nom"); xstream.registerConverter(new CasierMNTConverter()); xstream.useAttributeFor(ReferenceProfil.class, "NomRef"); @@ -144,28 +150,38 @@ * @param xstream */ public void initXmlParserSection(XStream xstream ){ - //-- gestion des sections --// + //-- gestion des sections --// xstream.alias("SectionIdem", SectionIdem.class); xstream.alias("SectionSansGeometrie", SectionSansGeometrie.class); xstream.alias("SectionProfil", SectionProfil.class); xstream.alias("SectionInterpolee", SectionInterpolee.class); xstream.alias("SectionPilote", SectionPilote.class); - xstream.useAttributeFor(SectionIdem.class, "NomRef"); + + xstream.useAttributeFor(SectionBrancheAbstract.class, "NomRef"); xstream.registerConverter(new SectionIdemConverter()); - - xstream.useAttributeFor(SectionSansGeometrie.class, "NomRef"); xstream.registerConverter(new SectionSansGeometrieConverter()); - - xstream.useAttributeFor(SectionProfil.class, "NomRef"); xstream.registerConverter(new SectionProfilConverter()); - - xstream.useAttributeFor(SectionInterpolee.class, "NomRef"); xstream.registerConverter(new SectionInterpoleeConverter()); + xstream.registerConverter(new SectionPiloteConverter()); + //-- gestion des REFERENCES sections --// + //NOTE ADRIEN: on est foutu si il existe plusieurs balises de meme nom + // il faut donc suffixer par des -ref - xstream.useAttributeFor(SectionPilote.class, "NomRef"); - xstream.registerConverter(new SectionPiloteConverter()); + xstream.alias("SectionIdem-ref", SectionRefIdem.class); + xstream.alias("SectionSansGeometrie-ref", SectionRefSansGeometrie.class); + xstream.alias("SectionProfil-ref", SectionRefProfil.class); + xstream.alias("SectionInterpolee-ref", SectionRefInterpolee.class); + xstream.alias("SectionPilote-ref", SectionRefPilote.class); + + + xstream.useAttributeFor(SectionAbstract.class, "NomRef"); + xstream.registerConverter(new SectionRefIdemConverter()); + xstream.registerConverter(new SectionRefSansGeometrieConverter()); + xstream.registerConverter(new SectionRefProfilConverter()); + xstream.registerConverter(new SectionRefInterpoleeConverter()); + xstream.registerConverter(new SectionRefPiloteConverter()); } @@ -189,7 +205,7 @@ return n; } public boolean canConvert(Class type) { - return type.equals(NoeudNiveauContinu.class); + return type.isInstance(NoeudNiveauContinu.class); } } @@ -203,8 +219,8 @@ public static class BrancheAbstract{ public String Nom; public boolean Active; - public ReferenceNoeud NdAm; - public ReferenceNoeud NdAv; + public NdAm NdAm; + public NdAv NdAv; List Sections; } @@ -314,18 +330,15 @@ } - public static class NdAm extends ReferenceNoeud{ - - public NdAm(String nomRef) { - super(nomRef); - // TODO Auto-generated constructor stub + public static class NdAm { + public String NomRef; + public NdAm(String nomRef) { + NomRef=nomRef;}} + public static class NdAv { + public String NomRef; + public NdAv(String nomRef) { + NomRef=nomRef; }} - public static class NdAv extends ReferenceNoeud{ - - public NdAv(String nomRef) { - super(nomRef); - // TODO Auto-generated constructor stub - }} public class ReferenceNoeudConverter implements SingleValueConverter { public String toString(Object obj) { @@ -338,16 +351,16 @@ public boolean canConvert(Class type) { return type.isInstance(ReferenceNoeud.class); } } - public class NdAmConverter extends ReferenceNoeudConverter{ - public Object fromString(String name) { - NdAm n=new NdAm(name); - - return n; }} - public class NdAvConverter extends ReferenceNoeudConverter{ - public Object fromString(String name) { - NdAv n=new NdAv(name); - - return n; }} + public class NdAmConverter implements SingleValueConverter { + public Object fromString(String name) { return new NdAm(name); } + public String toString(Object obj) { return ((NdAm) obj).NomRef;} + public boolean canConvert(Class type) { return type.isInstance(NdAm.class); } + } + + public class NdAvConverter implements SingleValueConverter { + public Object fromString(String name) {return new NdAv(name);} + public String toString(Object obj) { return ((NdAv) obj).NomRef;} + public boolean canConvert(Class type) { return type.isInstance(NdAv.class); }} //-- gestion des sections --// /** * Elementsection qui se trouve dans branche, @@ -464,11 +477,59 @@ return casier; } } - //*************************GESTION DES SECTIONS ************************* + //*************************GESTION DES SECTIONS REFERENCES************************* public class ReferenceSection { public String Nom; } + public static class SectionAbstract{ + public String NomRef; + + } + public static class SectionRefIdem extends SectionAbstract{} + public static class SectionRefInterpolee extends SectionAbstract{} + public static class SectionRefProfil extends SectionAbstract{} + public static class SectionRefSansGeometrie extends SectionAbstract{} + public static class SectionRefPilote extends SectionAbstract{} + public abstract class SectionRefConverter implements SingleValueConverter { + public String toString(Object obj) { + return ((SectionAbstract) obj).NomRef; + } + public abstract Object fromString(String name); + public boolean canConvert(Class type) { + return type.isInstance(SectionAbstract.class); + }} + public class SectionRefIdemConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefIdem section=new SectionRefIdem(); + section.NomRef=name; + return section;}} + + public class SectionRefInterpoleeConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefInterpolee section=new SectionRefInterpolee(); + section.NomRef=name; + return section;}} + + public class SectionRefProfilConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefProfil section=new SectionRefProfil(); + section.NomRef=name; + return section;}} + + public class SectionRefSansGeometrieConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefSansGeometrie section=new SectionRefSansGeometrie(); + section.NomRef=name; + return section;}} + + public class SectionRefPiloteConverter extends SectionRefConverter{ + public Object fromString(String name) { + SectionRefPilote section=new SectionRefPilote(); + section.NomRef=name; + return section;}} + + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHBranche.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -23,11 +23,16 @@ * */ public class CatEMHBranche extends EMH{ + private boolean isActive_; private List<CatEMHSection> listeSections_; private CatEMHNoeud noeudAmont_; private CatEMHNoeud noeudAval_; - private String nom; + + public CatEMHBranche(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } @@ -63,12 +68,5 @@ this.noeudAval_ = noeudAval; } - public String getNom() { - return nom; - } - - public void setNom(String nom) { - this.nom = nom; - } } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHCasier.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -5,19 +5,18 @@ * */ public abstract class CatEMHCasier extends EMH{ + + private boolean isActive_; private CatEMHNoeud noeud_; -private String nom_; - -public String getNom() { - return nom_; +public CatEMHCasier(String nom) { + super(nom); + // TODO Auto-generated constructor stub } -public void setNom(String nom) { - this.nom_ = nom; -} + public boolean isActive() { return isActive_; } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHNoeud.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -1,19 +1,40 @@ package main.java.org.fudaa.dodico.crue.metier.emh; +import java.util.List; + /** * * @author Adrien Hadoux * */ public class CatEMHNoeud extends EMH{ - String nom_; + - public String getNom() { - return nom_; + + + + public CatEMHNoeud(String nom) { + super(nom); + } - public void setNom(String nom) { - this.nom_ = nom; + /** + * Recherche le noeud par rapport \xE0 la r\xE9f\xE9rence fournie. + * @param listeMetier + * @return + */ + public static CatEMHNoeud findByReference(String reference,List<EMH> listeMetier){ + for(EMH emh:listeMetier){ + if(emh instanceof CatEMHNoeud){ + CatEMHNoeud noeud=(CatEMHNoeud) emh; + if(noeud.nom_.equals(reference)) + return noeud; + } + } + return null; + + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHSection.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHSection.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/CatEMHSection.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -1,22 +1,25 @@ package main.java.org.fudaa.dodico.crue.metier.emh; +import java.util.List; + /** * la classe section. * @author Adrien Hadoux * */ public class CatEMHSection extends EMH{ + String position; double xp; - String nom; - - public String getNom() { - return nom; + String reference; + + public CatEMHSection(String nom) { + super(nom); + // TODO Auto-generated constructor stub } - public void setNom(String nom) { - this.nom = nom; - } + + public String getPosition() { return position; } @@ -29,4 +32,35 @@ public void setXp(double xp) { this.xp = xp; } + + + + /** + * Recherche le noeud par rapport \xE0 la r\xE9f\xE9rence fournie. + * @param listeMetier + * @return + */ + public static CatEMHSection findByReferenceFromBrancheOrSectionEMH(String reference,List<EMH> listeMetier){ + for(EMH emh:listeMetier){ + if(emh instanceof CatEMHSection){ + CatEMHSection section=(CatEMHSection) emh; + if(reference.equals(section.getNom())){ + return section; + } + }else if(emh instanceof CatEMHBranche){ + CatEMHBranche branche=(CatEMHBranche) emh; + if(branche.getListeSections()!=null){ + for(CatEMHSection section:branche.getListeSections() ){ + if(reference.equals(section.getNom())){ + return section; + } + } + } + } + } + return null; + + + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/DonFrt.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -1,10 +1,58 @@ package main.java.org.fudaa.dodico.crue.metier.emh; +import java.awt.Point; +import java.util.ArrayList; +import java.util.List; + +import org.fudaa.ebli.geometrie.GrPoint; + /** * * @author Adrien Hadoux * */ -public interface DonFrt { +public abstract class DonFrt { + protected List<Point> point_; + /** + * reference. + */ + protected String nom_; + + public DonFrt(String nom){ + nom_=nom; + point_=new ArrayList<Point>(); + } + + public String getNom() { + return nom_; + } + public void setNom(String nom) { + this.nom_ = nom; + } + + public Point getPoint(int i) { + return point_.get(i); + } + + public GrPoint getGrPoint(int i) { + GrPoint val=new GrPoint(point_.get(i).x,point_.get(i).y,0); + return val; + } + + public void setPoint(Point point,int i) { + this.point_.set(i, point); + } + + + public boolean addPoint(Point p){ + return point_.add(p); + } + + public List<Point> getListePoints(){ + return point_; + } + public void setListePoints( List<Point> liste){ + point_=liste; + } } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMH.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -11,9 +11,27 @@ * @author Adrien Hadoux * */ -public class EMH { +public abstract class EMH { /** + * Reference nom de l'objet EMH. + * Tr\xE9s important, il sera manipul\xE9 par les donn\xE9es. + */ + protected String nom_; + + public String getNom() { + return nom_; + } + + public void setNom(String nom) { + this.nom_ = nom; + } + + public EMH(String nom){ + nom_=nom; + } + + /** * CONTRAINTE : deux \xE9l\xE9ments nomm\xE9s (EMH, profils, frottements...) ne peuvent pas porter le m\xEAme nom. */ private List<InfosEMH> listeInfosEMH_; Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageFilEau.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageFilEau.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageFilEau.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -12,4 +12,9 @@ */ public class EMHBrancheBarrageFilEau extends CatEMHBranche{ + public EMHBrancheBarrageFilEau(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageGenerique.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageGenerique.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageGenerique.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -7,4 +7,9 @@ */ public class EMHBrancheBarrageGenerique extends CatEMHBranche{ + public EMHBrancheBarrageGenerique(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageRhone.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageRhone.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheBarrageRhone.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -6,4 +6,9 @@ */ public class EMHBrancheBarrageRhone extends CatEMHBranche{ + public EMHBrancheBarrageRhone(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheEnchainement.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheEnchainement.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheEnchainement.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -11,4 +11,9 @@ */ public class EMHBrancheEnchainement extends CatEMHBranche{ + public EMHBrancheEnchainement(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheNiveauxAssocies.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheNiveauxAssocies.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheNiveauxAssocies.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -7,4 +7,9 @@ */ public class EMHBrancheNiveauxAssocies extends CatEMHBranche{ + public EMHBrancheNiveauxAssocies(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheOrifice.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheOrifice.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheOrifice.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -8,4 +8,9 @@ */ public class EMHBrancheOrifice extends CatEMHBranche { + public EMHBrancheOrifice(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBranchePdc.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBranchePdc.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBranchePdc.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -6,4 +6,9 @@ */ public class EMHBranchePdc extends CatEMHBranche { + public EMHBranchePdc(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSaintVenant.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSaintVenant.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSaintVenant.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -9,4 +9,9 @@ */ public class EMHBrancheSaintVenant extends CatEMHBranche{ + public EMHBrancheSaintVenant(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSeuilLongitudinale.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSeuilLongitudinale.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSeuilLongitudinale.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -7,4 +7,9 @@ */ public class EMHBrancheSeuilLongitudinale extends CatEMHBranche{ + public EMHBrancheSeuilLongitudinale(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSeuilTransversal.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSeuilTransversal.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheSeuilTransversal.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -7,4 +7,9 @@ */ public class EMHBrancheSeuilTransversal extends CatEMHBranche { + public EMHBrancheSeuilTransversal(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheStrickler.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheStrickler.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHBrancheStrickler.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -7,4 +7,9 @@ */ public class EMHBrancheStrickler extends CatEMHBranche{ + public EMHBrancheStrickler(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHCasierMNT.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHCasierMNT.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHCasierMNT.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -2,43 +2,39 @@ /** - *Casier dont la g\xE9om\xE9trie est d\xE9finie - *par des points de MNT et une fronti\xE8re + * Casier dont la g\xE9om\xE9trie est d\xE9finie + * par des points de MNT et une fronti\xE8re * @author Adrien Hadoux * */ public class EMHCasierMNT extends CatEMHCasier { private int id_; - private String nom_; private double cotelInitiale_; private int numero_; - - - - + + + public EMHCasierMNT(String nom){ + super(nom); + } + public EMHCasierMNT(int id, String nom, double cotelInitiale, int numero) { - super(); + super(nom); this.id_ = id; - this.nom_ = nom; + this.cotelInitiale_ = cotelInitiale; this.numero_ = numero; } - + public int getId() { return id_; } - + public void setId(int id) { this.id_ = id; } - public String getNom() { - return nom_; - } - public void setNom(String nom) { - this.nom_ = nom; - } + public double getCotelInitiale() { return cotelInitiale_; } @@ -51,6 +47,6 @@ public void setNumero(int numero) { this.numero_ = numero; } - - + + } Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHCasierProfil.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHCasierProfil.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHCasierProfil.java 2009-03-03 19:21:31 UTC (rev 4506) @@ -8,6 +8,11 @@ */ public class EMHCasierProfil extends CatEMHCasier{ + public EMHCasierProfil(String nom) { + super(nom); + // TODO Auto-generated constructor stub + } + String nomProfil_; public String getNomProfil() { Modified: branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHNoeudNiveauContinu.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHNoeudNiveauContinu.java 2009-02-27 20:10:26 UTC (rev 4505) +++ branches/Prepro-0.92-SNAPSHOT/Fudaa-crue/src/main/java/org/fudaa/dodico/crue/metier/emh/EMHNoeudNiveauCon... [truncated message content] |