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: <cla...@us...> - 2008-10-12 15:39:50
|
Revision: 4054 http://fudaa.svn.sourceforge.net/fudaa/?rev=4054&view=rev Author: clavreul Date: 2008-10-12 14:20:03 +0000 (Sun, 12 Oct 2008) Log Message: ----------- erreur Removed Paths: ------------- trunk/ctulu/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-10 17:14:43
|
Revision: 4053 http://fudaa.svn.sourceforge.net/fudaa/?rev=4053&view=rev Author: hadouxad Date: 2008-10-10 17:14:30 +0000 (Fri, 10 Oct 2008) Log Message: ----------- - Gestion de la persistance des graphes Termin?\195?\169! - les courbes - la classe du type de model (spatial, temporelle ou n'importe quoi d autre, g?\195?\169r?\195?\169) - les import scope marchent aussi - Les propri?\195?\169t?\195?\169s graphiques - les axes - les groupes - le r?\195?\169ajustement des zooms - Gestion plus elaboree des id de widget: -cr?\195?\169ation d une classe CtuluLibGenerator fournisseur officielle de l'?\195?\169quipe de layout qui -emp?\195?\170che les doublons, ce qui pourrait etre problematique - Le g?\195?\169n?\195?\169rateur utilise une loi de congruence lin?\195?\169aire avec des methodes sympa (gestion de blckliste, eviter des doublons...), ca pourra etre utilis?\195?\169 pour fudaa. - Gestion des groupes: reconstruction des groupes auto - Les widget persistantes ont un attribut idgroup (relation 1:N) - Les widgets groupes sont serializes a la fin du fichier layout; traitement particulier: on a pas besoin de les rejouer, seulement de leur propri?\195?\169t?\195?\169s (nm du groupe, location, dimensions) - Le syst?\195?\168me sera conserve pour les fusions de calques - Refactorisation des Gestion des groupes et bordures - Methodes simplifi?\195?\169e dans ebliwidget pour mieux g?\195?\169rer le tout. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.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/TrPostCourbeTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroup.java Added: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGenerator.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -0,0 +1,147 @@ +package org.fudaa.ctulu; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Random; + +import com.memoire.fu.FuLog; + +/** + * Generateur d'Id uniques en singleton. + * Gere des contraintes (id ajout\xE9s, retir\xE9s) + * afin d'\xE9viter des doublons. + * + * Gen\xE8re des nombres comprise entre 0 et MAX-1. + * + * @author Adrien Hadoux + * + */ +public class CtuluLibGenerator { + + private static CtuluLibGenerator generator_; + + /** + * Tous les nombres seront inf\xE9rieurs a Max-1 + */ + private static long MAX=65535; + + /** + * Pour avoir toujours la meme sequence, il suffit de mettre le mode debug a true, + * cela initialisera toujours la seed de la mme facon. + * Pratique pour tester + */ + private boolean modeDebug=false; + + //Random randomizer_; + + /** + * Blacklist des elements a ne pas generer. + */ + List<Long> constraints_; + + /** + * Le dernier nombre g\xE9n\xE9r\xE9 r\xE9inject\xE9 dans la formule + */ + long old; + + /** + * a-1 doit \xEAtre un multiple de p, pour tout p nombre premier diviseur de MAX + */ + long a_=25; + + /** + * c et MAX doivent \xEAtre premiers entre eux + * + */ + long c_=16; + + private CtuluLibGenerator(){ + constraints_=new ArrayList<Long>(); + //getPseudoAleatoire(); + old=initSeed(); + } + + /** + * Initialise la graine avec l'heure actuelle. + * @return + */ + private long initSeed(){ + if(modeDebug) + return 0; + return Calendar.getInstance().getTimeInMillis(); + } + +// private Random getPseudoAleatoire(){ +// if(randomizer_==null) +// randomizer_=new Random(initSeed()); +// return randomizer_; +// } + + + public long useCongruenceLineaireGenerateur(){ + old= (a_*old + c_)% MAX; + return old; + } + + /** + * Accesseur du singleton. + * @return + */ + public static CtuluLibGenerator getInstance(){ + if(generator_==null) + generator_=new CtuluLibGenerator(); + return generator_; + } + + + /** + * Donne un id unique + * @return + */ + public long deliverUniqueId(){ + Long id; + do{ + id=new Long(useCongruenceLineaireGenerateur()); + } + while(constraints_.contains(id)); + addConstraint(id); + FuLog.warning("Generation ID="+id); + return id; + } + + /** + * version string + * @return + */ + public String deliverUniqueStringId(){ + + return ""+deliverUniqueId(); + } + /** + * Clear la liste des contraintes + */ + public void clear(){ + constraints_=new ArrayList<Long>(); + } + + + public void addConstraint(long val){ + constraints_.add(val); + } + public void addConstraint(String value){ + long val=Long.parseLong(value); + constraints_.add(val); + } + public void addConstraint(List<Long> list){ + constraints_.addAll(list); + } + + public void removeConstraint(long val){ + constraints_.remove(new Long(val)); + } + public void removeConstraint(String value){ + long val=Long.parseLong(value); + constraints_.remove(new Long(val)); + } +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -1,20 +1,57 @@ package org.fudaa.ebli.courbe; +import java.awt.Color; +import java.awt.Font; +import org.fudaa.ebli.trace.TraceLigne; + + /** * Classe persistante des axe horizontaux * @author Adrien Hadoux * */ public class EGAxeHorizontalPersist { - + String titre; + boolean titreVisible = true; + String unite; + boolean visible; + Font font; + boolean graduations; + TraceLigne grille; + boolean isIteratorUptodate; + Color lineColor; + public EGAxeHorizontalPersist(EGAxeHorizontal axeX) { // TODO Auto-generated constructor stub fillInfoWith(axeX); } private void fillInfoWith(EGAxeHorizontal axeX ){ + this.titre = axeX.titre_; + this.titreVisible = axeX.titreVisible_; + this.unite = axeX.unite_; + this.visible = axeX.visible_; + this.font = axeX.font_; + this.graduations = axeX.graduations_; + this.grille = axeX.grille_; + this.isIteratorUptodate = axeX.isIteratorUptodate_; + this.lineColor = axeX.lineColor_; } + + public EGAxeHorizontal generateAxe(){ + EGAxeHorizontal axeX=new EGAxeHorizontal(); + axeX.titre_ = this.titre; + axeX.titreVisible_ = this.titreVisible; + axeX.unite_ = this.unite; + axeX.visible_ = this.visible; + axeX.font_ = this.font; + axeX.graduations_ = this.graduations; + axeX.grille_ = this.grille; + axeX.isIteratorUptodate_ = this.isIteratorUptodate; + axeX.lineColor_ = this.lineColor; + return axeX; + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -1,20 +1,69 @@ package org.fudaa.ebli.courbe; +import java.awt.Color; +import java.awt.Font; +import org.fudaa.ebli.trace.TraceLigne; + + /** * Classe persistante des axe verticaux * @author Adrien Hadoux * */ public class EGAxeVerticalPersist { + boolean droite; + boolean titreVertical; + boolean titreVerticalDroite; + String titre; + boolean titreVisible = true; + String unite; + boolean visible; + Font font; + boolean graduations; + TraceLigne grille; + boolean isIteratorUptodate; + Color lineColor; + + public EGAxeVerticalPersist(EGAxeVertical axeY) { // TODO Auto-generated constructor stub fillInfoWith(axeY); } private void fillInfoWith(EGAxeVertical axeY ){ - + this.droite = axeY.droite_; + this.titreVertical = axeY.titreVertical_; + this.titreVerticalDroite = axeY.titreVerticalDroite_; + this.titre = axeY.titre_; + this.titreVisible = axeY.titreVisible_; + this.unite = axeY.unite_; + this.visible = axeY.visible_; + this.font = axeY.font_; + this.graduations = axeY.graduations_; + this.grille = axeY.grille_; + this.isIteratorUptodate = axeY.isIteratorUptodate_; + this.lineColor = axeY.lineColor_; } + + + public EGAxeVertical generateAxe(){ + EGAxeVertical axeY=new EGAxeVertical(); + axeY.droite_ = this.droite; + axeY.titreVertical_ = this.titreVertical; + axeY.titreVerticalDroite_ = this.titreVerticalDroite; + axeY.titre_ = this.titre; + axeY.titreVisible_ = this.titreVisible; + axeY.unite_ = this.unite; + axeY.visible_ = this.visible; + axeY.font_ = this.font; + axeY.graduations_ = this.graduations; + axeY.grille_ = this.grille; + axeY.isIteratorUptodate_ = this.isIteratorUptodate; + axeY.lineColor_ = this.lineColor; + return axeY; + } + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbe.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -860,6 +860,14 @@ public String toString() { return getTitle(); } + +public TraceBox getTbox_() { + return tbox_; +} + +public void setTbox_(TraceBox tbox_) { + this.tbox_ = tbox_; +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbeChild.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -122,4 +122,8 @@ return duplic; } +public EGGroup getParent_() { + return parent_; +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -1,5 +1,8 @@ package org.fudaa.ebli.courbe; +import org.fudaa.ebli.trace.TraceBox; +import org.fudaa.ebli.trace.TraceLigneModel; + /** * Classe persistante de la courbe * @author Adrien Hadoux @@ -9,40 +12,81 @@ String title_; int Idgroup; - - public EGCourbePersist(EGCourbe courbe, int IdGroup) { - + ///-- les min et max sont purement informatifs --// + double Xmin; + double Xmax; + double Ymin; + double Ymax; + + double[] abscisses; + double[] ordonnees; + + //-- proprietes graphiques --// + TraceBox tracebox; + TraceLigneModel lineModel_; + TraceLigneModel tLigneMarqueur_; + + public EGCourbePersist(EGCourbeChild courbe, int IdGroup) { fillInfoWith(courbe,IdGroup); } - - - private void fillInfoWith(EGCourbe courbe,int idgroupe){ + private void fillInfoWith(EGCourbeChild courbe,int idgroupe){ this.Idgroup=idgroupe; title_=courbe.getTitle(); + Xmin = courbe.getModel().getXMin(); + Xmax = courbe.getModel().getXMax(); + Ymin = courbe.getModel().getYMin(); + Ymax = courbe.getModel().getYMax(); + this.abscisses = new double[courbe.getModel().getNbValues()]; + this.ordonnees = new double[courbe.getModel().getNbValues()]; + for(int i=0;i<courbe.getModel().getNbValues();i++){ + this.abscisses[i]=courbe.getModel().getX(i); + this.ordonnees[i]=courbe.getModel().getY(i); + } + //graphiques + if(courbe.getTbox_()!=null) + tracebox=courbe.getTbox_(); + if(courbe.getLigneModel()!=null) + lineModel_=courbe.getLigneModel(); + if(courbe.getMarkLigneModel()!=null) + tLigneMarqueur_=courbe.getMarkLigneModel(); + + } + /** + * Generate the proper curve in the appropriate group. + * @param groupe + * @return + */ +public EGCourbeChild generateCourbe(EGGroup groupe){ + EGModel model=new EGCourbeModelDefault(abscisses,ordonnees); + EGCourbeChild courbe=new EGCourbeChild(groupe,model); + courbe.setTitle(title_); + + //graphiques + if(tracebox!=null) + courbe.setTbox_(tracebox); + if(lineModel_!=null) + courbe.setLigneType(lineModel_); + if(tLigneMarqueur_!=null) + courbe.setLigneMark(tLigneMarqueur_); + + return courbe; +} + public String getTitle_() { return title_; } - - - public void setTitle_(String title_) { this.title_ = title_; } - - - public int getIdgroup() { return Idgroup; } - - - public void setIdgroup(int idgroup) { Idgroup = idgroup; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -1,9 +1,13 @@ package org.fudaa.ebli.courbe; import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; +import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -29,23 +33,20 @@ */ String directoryPath_; - EGGraphe grapheTopersist; + private XStream parser_; private static String MAINFILE="descriptorGraphe.xml"; private static String COURBEDIRECTORY="courbes"; - public EGGraphePersist(String directoryPath_, EGGraphe grapheTopersist,Map parameters) throws IOException { - super(); + + public EGGraphePersist(String directoryPath_, Map parameters) throws IOException { this.directoryPath_ = directoryPath_; - this.grapheTopersist = grapheTopersist; + } - savePersitGrapheXml(parameters); - } - /** * Recupere le parser adequat. * @return @@ -71,67 +72,174 @@ return xstream; } + /** + * Retour,e le repertoire qui contient les courbes + * @return + */ + private File getDirectoryCurves(){ + return new File(directoryPath_+File.separator+COURBEDIRECTORY); + } + + /** + * Retourne le path vers le fiochier principal des courbes + * @return + */ + private String getMainFilePath(){ + return directoryPath_+File.separator+MAINFILE; + } /** + * Retourne la liste persistante des fichiers + * @return + */ + List<EGCourbePersist> getPersitantCurvesList(){ + return new XmlArrayList( new FileStreamStrategy(getDirectoryCurves())); + } + + /** * Enrtegistre le graphe au format persistant xml. * @param parameters des parametres supplementaires utiles. * @throws IOException */ - private void savePersitGrapheXml(Map parameters) throws IOException{ - - String mainfile=directoryPath_+File.separator+MAINFILE; + public void savePersitGrapheXml(EGGraphe grapheTopersist) throws IOException{ + String mainfile=getMainFilePath(); //-- outputstream du xstream pour enregistrement des diff\xE9rents groupes--// ObjectOutputStream out = getParser().createObjectOutputStream(new FileWriter(mainfile)); //-- enregistrement des courbes --// // strategy pour la liste xml: aun fichier par courbe. - File fichierCourbes=new File(directoryPath_+File.separator+COURBEDIRECTORY); + File fichierCourbes=getDirectoryCurves(); if(fichierCourbes.mkdir()){ StreamStrategy strategy = new FileStreamStrategy(fichierCourbes); // creates the list of curves: - List<EGCourbePersist> list = new XmlArrayList(strategy); - - + List<EGCourbePersist> list = getPersitantCurvesList(); + List<EGGroupPersist> listeGroupePersistance=new ArrayList<EGGroupPersist>(grapheTopersist.getModel().getNbEGObject()); + for(int i=0;i<grapheTopersist.getModel().getNbEGObject();i++){ - EGObject objet=grapheTopersist.getModel().getEGObject(i); - if(objet instanceof EGGroup){ EGGroup groupe=(EGGroup) objet; - out.writeObject(new EGGroupPersist(groupe)); - + listeGroupePersistance.add(new EGGroupPersist(groupe)); for(int k=0;k<groupe.getEGChilds().length;k++){ - if(groupe.getEGChilds()[k] instanceof EGCourbe){ + if(groupe.getEGChilds()[k] instanceof EGCourbeChild){ //-- ajout de la courbe persitante dans un fichier avec pour groupee le i eme - list.add(new EGCourbePersist((EGCourbe) groupe.getEGChilds()[k],i)); + list.add(new EGCourbePersist((EGCourbeChild) groupe.getEGChilds()[k],i)); } } }else - if(objet instanceof EGCourbe){ + if(objet instanceof EGCourbeChild){ //le groupe d appartenance est -1 - list.add(new EGCourbePersist((EGCourbe) objet,-1)); + list.add(new EGCourbePersist((EGCourbeChild) objet,-1)); } } + + //--on enregistre des infos bidons pour l'utilisateur --// + String nbCurves="Nombre courbes: "+grapheTopersist.getModel().getCourbes().length; + out.writeObject(nbCurves); + String minMAx="MinX: "+grapheTopersist.getXMin()+" MaxX: "+grapheTopersist.getXMax(); + out.writeObject(minMAx); + //-- FIN BIDON --// + + //--on enregistre l'axe des x --// + out.writeObject(new EGAxeHorizontalPersist(grapheTopersist.getModel().getAxeX())); + + //-- on enregistre le type de model du graphe --// + String model=grapheTopersist.getModel().getClass().toString(); + out.writeObject(model); + //--on ecrit le nombre de groupes --// + int nbGroups=listeGroupePersistance.size(); + out.writeInt(nbGroups); + //-- on ecrit la liste des groupes --// + for(EGGroupPersist gp:listeGroupePersistance){ + out.writeObject(gp); + } } out.close(); - } - public String getDirectoryPath_() { - return directoryPath_; + /** + * Genere une instance de model par rapport au model serializ\xE9. + * Renvoie forc\xE9ment une class implements EGGrapheTreeModel sinon null + * @param className + * @return + * @throws ClassNotFoundException + * @throws InstantiationException + * @throws IllegalAccessException + */ + public EGGrapheTreeModel generateModelInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException{ + if(className.startsWith("class ")); + className=className.substring("class ".length()); + Class myclass =Class.forName(className, true, Thread.currentThread(). + getContextClassLoader()); + Object myModel=myclass.newInstance(); + if(myModel instanceof EGGrapheTreeModel) + return (EGGrapheTreeModel)myModel; + return null; + } - - public void setDirectoryPath_(String directoryPath_) { - this.directoryPath_ = directoryPath_; + + + /** + * Methode qui genere le eggraphe a partir des donn\xE9es persistantes. + * @return + * @throws IOException + * @throws FileNotFoundException + * @throws ClassNotFoundException + * @throws IllegalAccessException + * @throws InstantiationException + */ + public EGGraphe loadPersitGrapheXml() throws FileNotFoundException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException{ + EGGraphe graphe=null; + String mainfile=getMainFilePath(); + File fichierCourbes=getDirectoryCurves(); + if(fichierCourbes.isDirectory()){ + //-- outputstream du xstream pour chargement des diff\xE9rents groupes--// + ObjectInputStream in = getParser().createObjectInputStream(new FileReader(mainfile)); + //--lecture biddon --// + in.readObject(); + in.readObject(); + + //- Etape 1: lecture de l'axe --// + EGAxeHorizontal axeX= ((EGAxeHorizontalPersist)in.readObject()).generateAxe(); + + //- Etape 2: lecture du modele --// + String modelName=(String) in.readObject(); + EGGrapheTreeModel model= generateModelInstance(modelName); + model.setAxeX(axeX); + + //-- Etape 3: on ajoute tous nos amis les groupes --// + int nbGroups=in.readInt(); + for(int i=0;i<nbGroups;i++){ + //-- lecture du groupe --// + EGGroup newGroup=((EGGroupPersist)in.readObject()).generateGroupe(); + //ajout du groupe + model.add(newGroup); + } + //-- Etape 4: lecture des courbes --// + // get the persitant list of curves: + List<EGCourbePersist> listeCourbesPersistantes = getPersitantCurvesList(); + for(EGCourbePersist cbPersist:listeCourbesPersistantes){ + EGGroup container=model.getGroup(cbPersist.Idgroup); + EGCourbeChild newCurve=cbPersist.generateCourbe(container); + container.addEGComponent(newCurve); + } + + in.close(); + + //-- Etape finale: creation du graphe --// + graphe=new EGGraphe(model); + graphe.transformer_.setXAxe(axeX); + //ajustement des courbes en fonction du groupe 0 + for(int t=0;t<nbGroups;t++) + graphe.setZoomAdaptedFor(model.getGroup(t)); + //mise a jour des b\xE9b\xE9s + model.fireStructureChanged(); + } + return graphe; } + + + - public EGGraphe getGrapheTopersist() { - return grapheTopersist; - } - public void setGrapheTopersist(EGGraphe grapheTopersist) { - this.grapheTopersist = grapheTopersist; - } - - } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGrapheTreeModel.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -206,9 +206,9 @@ } } - static class GrapheTreeNode implements Icon, EGParent.TreeNodes { + public static class GrapheTreeNode implements Icon, EGParent.TreeNodes { - List components_ = new ArrayList(); + public List components_ = new ArrayList(); EGParent.Tree dispatcher_; public GrapheTreeNode() { @@ -223,7 +223,7 @@ return dispatcher_; } - protected EGGroup getGroup(final int _i) { + public EGGroup getGroup(final int _i) { return (EGGroup) components_.get(_i); } @@ -1116,4 +1116,12 @@ return duplic; } +public TreeSelectionModel getSelectionModel_() { + return selectionModel_; +} + +public void setSelectionModel_(TreeSelectionModel selectionModel_) { + this.selectionModel_ = selectionModel_; +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -9,11 +9,11 @@ */ public class EGGroupPersist { - String title_; - EGAxeHorizontalPersist axeX; + String title; + EGAxeVerticalPersist axeY; + boolean isVisible; - public EGGroupPersist(EGGroup group) { super(); fillInfoWith(group); @@ -21,11 +21,23 @@ } private void fillInfoWith(EGGroup groupe){ - title_=groupe.getTitle(); - axeX=new EGAxeHorizontalPersist(groupe.getAxeX()); + title=groupe.getTitle(); + axeY=new EGAxeVerticalPersist(groupe.getAxeY()); + isVisible=groupe.isVisible_; +} + +public EGGroup generateGroupe(){ + EGGroup groupe=new EGGroup(); + EGAxeVertical axe=axeY.generateAxe(); + groupe.setAxeY(axe); + //on ajuste l'axe par rapport au groupe pour que ce soit joli tout plein! + //axe.ajusteFor(groupe); + groupe.setTitle(title); + groupe.isVisible_=isVisible; + return groupe; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliScene.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -11,6 +11,7 @@ import java.util.Set; import org.fudaa.ctulu.CtuluCommandManager; +import org.fudaa.ctulu.CtuluLibGenerator; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.image.CtuluImageProducer; import org.fudaa.ctulu.image.CtuluLibImage; @@ -31,7 +32,8 @@ int idx_ = 0; protected String generateId() { - return CtuluLibString.getString(idx_++); + // return CtuluLibString.getString(idx_++); + return CtuluLibGenerator.getInstance().deliverUniqueStringId(); } public EbliWidget findById(final String _id) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -243,6 +243,8 @@ */}; } + + public EbliWidgetController getController() { return controller_; } @@ -266,9 +268,12 @@ } /** + * Retourne systematiquement l id de la widget qui contient les infos. + * La bordure redirige son id, il n'est pas necessaire de retnir l id pour cette widget sans importance. * @return the idst */ public String getId() { + return id_; } @@ -491,12 +496,33 @@ useBorder_ = _useBorder; } -public String getId_() { - return id_; -} + public void setId_(String id_) { this.id_ = id_; } + +/** + * Methode qui retourne vrai si la widget est group\xE9e. + * @return + */ +public boolean isGrouped(){ + + if(this.getParentBordure().getParentWidget() instanceof EbliWidgetGroup) + return true; + return false; +} + +/** + * Renvoie l'id du group ou l'id NOGROUP si la widget ne fais pas partie d un groupe. + * @return + */ +public String getIdOfGroup(){ + if(isGrouped()) + return ((EbliWidget)this.getParentBordure().getParentWidget()).getId(); + else return EbliWidgetGroup.NOGROUP; +} + + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -35,6 +35,13 @@ return getIntern().getAnimatedInterface(); } + public String getId() { + + return intern_.getId(); + } + public void setId_(String id_) { + intern_.setId_(id_); + } public EbliWidget getParentBordure(){ return this; Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroup.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroup.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroup.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -0,0 +1,18 @@ +package org.fudaa.ebli.visuallibrary; + + +/** + * Widget qui a pour but de grouper plusieurs sous widget. + * @author Adrien Hadoux + * + */ +public class EbliWidgetGroup extends EbliWidget{ + + public final static String NOGROUP="N/A"; + + public EbliWidgetGroup(EbliScene scene) { + super(scene); + // TODO Auto-generated constructor stub + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -23,6 +23,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerForGroup; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetGroupCreator; import org.fudaa.ebli.visuallibrary.layout.GroupLayout; import org.netbeans.api.visual.widget.Widget; @@ -42,7 +43,18 @@ public void actionPerformed(ActionEvent e) { final Set selectedObjects = new HashSet(scene_.getSelectedObjects()); if (!selectedObjects.isEmpty()) { - final EbliNode n = groupWidgets(selectedObjects); + performGroup(selectedObjects); + } + + } + + /** + * Methode qui realise le groupage des ebliNodes. + * @param _selectedObjects + * @return + */ + public EbliNode performGroup(final Set _selectedObjects){ + final EbliNode n = groupWidgets(_selectedObjects); getScene().getCmdMng().addCmd(new CtuluCommand() { public void undo() { @@ -51,15 +63,14 @@ } public void redo() { - groupWidgets(selectedObjects); + groupWidgets(_selectedObjects); } }); - } - + return n; } private EbliNode groupWidgets(final Set _selectedObjects) { - EbliWidget parent = new EbliWidget(scene_); + EbliWidgetGroup parent = new EbliWidgetGroup(scene_); // parent.setController(new EbliWidgetControllerMenuOnly(parent)); parent.setLayout(new GroupLayout()); Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -97,7 +97,7 @@ try { String path=(String)parameters.get("path"); if(path !=null){ - File contenu=new File(path+File.separator+"contenu"+(Idcontenu++)+".html"); + File contenu=new File(path+File.separator+"contenu"+parameters.get("nodeName")+getWidget().getId()+".html"); writer = new FileWriter(contenu); writer.write(editorPane_.getDocumentText()); writer.close(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -2,6 +2,7 @@ import java.awt.Point; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.Map; @@ -21,6 +22,9 @@ import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; +import com.hexidec.ekit.FudaaAlignAction; +import com.memoire.fu.FuLib; + /** * interface qui permet de creer un widget * @@ -113,13 +117,13 @@ public Object getPersistData(Map parameters) { // TODO Auto-generated method stub //-- generation d'un identifiant unique pour le repertoire du graphe --// - String pathUnique=parameters.get("path")+File.separator+"Graph"+res.getIntern().getId(); + String pathUnique=parameters.get("pathGraphes")+File.separator+FuLib.clean(File.separator+parameters.get("nodeName"))+res.getIntern().getId(); //- sauvegarde du contenu de l eggraphe dans un repertoire a part --// try { File createRep=new File(pathUnique); if( createRep.mkdir()) - new EGGraphePersist(pathUnique,getGraphe(),parameters); + new EGGraphePersist(pathUnique,parameters).savePersitGrapheXml(getGraphe()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -134,9 +138,29 @@ EGGrapheModel modele; if(data==null) modele=new EGGrapheTreeModel(); - else - modele=(EGGrapheModel) data; - pn_=new EGFillePanel(new EGGraphe(modele)); + else{ + String pathGraphe=(String) data; + + try { + pn_=new EGFillePanel(new EGGraphePersist(pathGraphe,parameters).loadPersitGrapheXml()); + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InstantiationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -4,7 +4,12 @@ import java.awt.Dimension; import java.awt.Point; +import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCalqueLegende; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetFusionCalques; import com.sun.j3d.loaders.vrml97.impl.Background; @@ -40,7 +45,7 @@ private void fillInfoWith(EbliScene scene,String title,Dimension dimensionFrame,Point location){ this.title=title; this.background=(Color) scene.getBackground(); - this.nbFrames=scene.getObjects().size(); + this.nbFrames=countFrameToSave(scene); if(scene.getView() !=null){ this.width=dimensionFrame.width; this.height=dimensionFrame.height; @@ -49,6 +54,16 @@ } } +private int countFrameToSave(EbliScene scene){ + int cpt=0; + for(Object node:scene.getObjects()){ + if(node instanceof EbliNode){ + if(!(((EbliNode)node).getWidget() instanceof EbliWidgetGroup) && !(((EbliNode)node).getWidget() instanceof EbliWidgetFusionCalques)) + cpt++; + } + } +return cpt; +} /** * Methode qui configurer la scene avec les infos r\xE9cup\xE9r\xE9es Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -8,12 +8,14 @@ import javax.swing.UIManager; +import org.fudaa.ctulu.CtuluLibGenerator; import org.fudaa.ebli.trace.TraceLigneModel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorClassLoader; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape; @@ -27,6 +29,8 @@ */ public class EbliWidgetSerializeXml { + + /** * Important: l'id de la widget pour avoir des references . */ @@ -64,6 +68,11 @@ boolean isSelected; + /** + * L'id de la widget groupe si il y a lieu. + */ + String IdGroup=EbliWidgetGroup.NOGROUP; + //-- datas : objet g\xE9r\xE9 par le creator, inconnu pour cette classe --// Object data; @@ -87,17 +96,17 @@ this.Id=widget.getId(); this.title = node.getTitle(); this.type = node.getCreator().getClass().toString(); - if(widget.getColorFond() !=null) - this.bacckground = node.getWidget().getColorFond(); - if(widget.getColorContour() !=null) - this.foreground = widget.getColorContour(); - if(widget.getFormeFont() !=null) - this.font = widget.getFormeFont(); - this.rotation = widget.getRotation(); - if(widget.getTraceLigneModel()!=null){ - this.epaisseurTrait = widget.getTraceLigneModel().getEpaisseur(); - this.typeTrait = widget.getTraceLigneModel().getTypeTrait(); - this.colorModel=widget.getTraceLigneModel().getCouleur(); + if(widget.getParentBordure().getColorFond() !=null) + this.bacckground = node.getWidget().getParentBordure().getColorFond(); + if(widget.getParentBordure().getColorContour() !=null) + this.foreground = widget.getParentBordure().getColorContour(); + if(widget.getParentBordure().getFormeFont() !=null) + this.font = widget.getParentBordure().getFormeFont(); + this.rotation = widget.getParentBordure().getRotation(); + if(widget.getParentBordure().getTraceLigneModel()!=null){ + this.epaisseurTrait = widget.getParentBordure().getTraceLigneModel().getEpaisseur(); + this.typeTrait = widget.getParentBordure().getTraceLigneModel().getTypeTrait(); + this.colorModel=widget.getParentBordure().getTraceLigneModel().getCouleur(); } @@ -121,9 +130,11 @@ this.isVisible=widget.getParentBordure().isVisible(); this.isSelected=widget.getEbliScene().getSelectedObjects().contains(node); + this.IdGroup=widget.getIdOfGroup(); + - //-- datas --// + parameters.put("nodeName", node.getTitle()); this.data=node.getCreator().getPersistData(parameters); } @@ -157,9 +168,14 @@ //-- ajout du node dans la scene --// scene.addNode(newNode); + + //-- recuperation du precedent Id, tres important poru les references --// + CtuluLibGenerator.getInstance().removeConstraint(newNode.getWidget().getId()); newNode.getWidget().setId_(this.Id); + CtuluLibGenerator.getInstance().addConstraint(this.Id); + //--remplissage des proprietes graphiques --// newNode.getWidget().setColorFond(bacckground); newNode.getWidget().setFormeFont(font); @@ -317,6 +333,14 @@ Id = id; } + public String getIdGroup() { + return IdGroup; + } + public void setIdGroup(String idGroup) { + IdGroup = idGroup; + } + + } 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 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -43,15 +43,19 @@ import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheDuplicator; +import org.fudaa.ebli.courbe.EGGrapheModel; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGObject; +import org.fudaa.ebli.courbe.EGGrapheTreeModel.GrapheTreeNode; import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; +import org.fudaa.fudaa.tr.post.TrPostCourbeTreeModel; import com.memoire.bu.BuLib; import com.memoire.bu.BuResource; @@ -72,7 +76,7 @@ final EfLineIntersectionsCorrectionTester tester_; - public final MvProfileTarget target_; + public MvProfileTarget target_; public MvProfileTreeModel(final MvProfileTarget _target, final EfLineIntersectionsCorrectionTester _tester) { super(); @@ -87,7 +91,16 @@ tester_ = _model.tester_; target_ = _model.target_; } + + /** + * ACHTUNG! Constructuer uniquement utilis\xE9 pour la serialization des graphes!! + * Il faut imp\xE9rativement initialiser la variable target_ avec un ProfilDapter apres coup avec le trpostsource qui convient */ + public MvProfileTreeModel(){ + tester_=new MvProfileCoteTester(); + + } + public void setNodesResults(final EfLineIntersectionsResultsMng _resNode, EfLineIntersectionsResultsBuilder _builderNode) { resNode_ = _resNode; @@ -636,9 +649,34 @@ } +public EGGrapheModel duplicate(EGGrapheDuplicator _duplicator) { + MvProfileTreeModel duplic = new MvProfileTreeModel(); + duplic.setAxeX(this.getAxeX().duplicate()); + + duplic.getSelectionModel().setSelectionMode(this.getSelectionModel().getSelectionMode()); + + GrapheTreeNode root=this.getGrapheTreeNode(); + GrapheTreeNode rootDuplique=duplic.getGrapheTreeNode(); + + for (int i = 0; i < root.components_.size(); i++) { + + // -- ajout du groupe duplique --// + duplic.add(root.getGroup(i).duplicate(_duplicator)); + + } + + + return duplic; + } + + @Override public boolean isSpatial() { // TODO Auto-generated method stub return true; } + +public void setTarget_(MvProfileTarget target_) { + this.target_ = target_; } +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -36,8 +36,10 @@ import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; import org.fudaa.ebli.courbe.EGGrapheDuplicator; +import org.fudaa.ebli.courbe.EGGrapheModel; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; +import org.fudaa.ebli.courbe.EGGrapheTreeModel.GrapheTreeNode; import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; @@ -873,5 +875,25 @@ fireCourbeContentChanged(null); // } } + + public EGGrapheModel duplicate(EGGrapheDuplicator _duplicator) { + TrPostCourbeTreeModel duplic = new TrPostCourbeTreeModel(); + duplic.setAxeX(this.getAxeX().duplicate()); + + duplic.getSelectionModel().setSelectionMode(this.getSelectionModel().getSelectionMode()); + + GrapheTreeNode root=this.getGrapheTreeNode(); + GrapheTreeNode rootDuplique=duplic.getGrapheTreeNode(); + + for (int i = 0; i < root.components_.size(); i++) { + // -- ajout du groupe duplique --// + duplic.add(root.getGroup(i).duplicate(_duplicator)); + + } + + + return duplic; + } + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -582,6 +582,7 @@ } //-- ajout de l'importation dans les courbes de l'action --// + //if( creator.getGraphe().getModel() instanceof Target) listeActions.add( new TrPostWizardImportScope.ImportAction(projet_,(Target) creator.getGraphe().getModel())); //--ajout des actions import export format scope --// Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-10 16:14:32 UTC (rev 4052) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-10 17:14:30 UTC (rev 4053) @@ -27,7 +27,9 @@ import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidgetGroup; +import org.fudaa.ebli.visuallibrary.actions.EbliWidgetGroupAction; import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; import org.fudaa.ebli.visuallibrary.persist.EbliSceneSerializeXml; import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml; @@ -43,6 +45,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.memoire.fu.FuLog; import com.sun.org.apache.xml.internal.serialize.OutputFormat; import com.sun.org.apache.xml.internal.serialize.XMLSerializer; import com.thoughtworks.xstream.XStream; @@ -336,23 +339,43 @@ * @return */ public boolean saveProject() { + HashMap<String, Object> parametres=new HashMap<String, Object>(); try { progression("Cr\xE9ation du r\xE9pertoire", 10); // -- etape 1 creation du repertoire global --// if (savePersistDirectory()) { + + File file; - // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts + // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts progression("Cr\xE9ation du fichier descripteur de sources", 15); file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSOURCE); saveSource(file); - + //-- etape 2.5: creation du repertoire des graphe et calques --// + String pathGraphes=projet_.getAbsolutePath() + File.separator +"Graphes"; + try{ + new File(pathGraphes).mkdir(); + }catch(Exception e){ + //pas grave on continue + FuLog.debug("Le repertoire des graphes existe deja"); + } + String pathCalques=projet_.getAbsolutePath() + File.separator +"Calques"; + try{ + new File(pathCalques).mkdir(); + }catch(Exception e){ + //pas grave on continue + FuLog.debug("Le repertoire des calques existe deja"); + } + // -- etape 3 sauvegarde des ebliscene unitairement --// progression("Cr\xE9ation des fichiers layout", 20); + //-- creation des params pour les datas --// - HashMap<String, Object> parametres=new HashMap<String, Object>(); parametres.put("path", projet_.getAbsolutePath()); - + parametres.put("pathGraphes",pathGraphes); + parametres.put("pathCalques",pathCalques); + int cpt = 1; List<TrPostLayoutFille> listFilles=trprojet_.impl_.getAllLayoutFille(); for(TrPostLayoutFille fille:listFilles){ @@ -496,15 +519,40 @@ //-- g\xE9n\xE9ration du xml pour les eblinode/widgets --// //-- ACHTUNG!!! IL FAUT RECUPERER LES OBJETS VIA CHILDREN POUR PRESERVER L ORDRE DE SUPERPOSITION!!! --// Iterator<Widget> it= scene.getLayerVisu().getChildren().iterator(); + + //-- creation d une liste particuliere pour les groupes--// + List<EbliWidgetSerializeXml> listeGroupes=new ArrayList<EbliWidgetSerializeXml>(); + while(it.hasNext()){ Widget widget=it.next(); + EbliNode nodeGroupe=(EbliNode) scene.findObject(widget); + //ecriture de l objet + if(nodeGroupe !=null) + listeGroupes.add(new EbliWidgetSerializeXml(nodeGroupe,parametres)); + + if(widget instanceof EbliWidgetGroup){ + //-- cas widget group, il faut recuper ses child car on se fout du groupe --// + for(Widget child:widget.getChildren()) { + EbliNode node=(EbliNode) scene.findObject(child); + //ecriture de l objet + if(node !=null) + out.writeObject(new EbliWidgetSerializeXml(node,parametres)); + } + + }else{ EbliNode node=(EbliNode) scene.findObject(widget); //ecriture de l objet if(node !=null) out.writeObject(new EbliWidgetSerializeXml(node,parametres)); + } + } + //-- ecriture des groupes --// + out.writeInt(listeGroupes.size()); + for(EbliWidgetSerializeXml serializeGroupe:listeGroupes){ + out.writeObject(serializeGroupe); } - + out.close(); @@ -523,9 +571,7 @@ * @throws InstantiationException */ private void loadPersitSceneXml(File file, TrPostLayoutFille fille, Map parametres) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException{ -// //-- creation des params pour les datas --// -// HashMap<String, Object> parametres=new HashMap<String, Object>(); -// parametres.put("path", file.getAbsolutePath()); + EbliScene scenToUpdate=fille.getScene(); parametres.put("scene",scenToUpdate); @@ -546,22 +592,67 @@ //-- preparation de la liste de selection des frames dans le layout --// final Set<Object> listeNodeSelect = new HashSet<Object>(); + //-- preparation d'une structure interm\xE9diaire pour optimiser --// + //-- la complexit\xE9 de calcul des groupes (passer en complexit\xE9 lin\xE9aire) --// + HashMap<String, HashSet<Object>> listeGroupToPerform=new HashMap<String, HashSet<Object>>(); + //-- r\xE9cup\xE9ration via xml des eblinode/widgets --// for(int i=0;i<sceneXml.getNbFrames();i++){ - + //lecture xml de l objet EbliWidgetSerializeXml widgetXml = (EbliWidgetSerializeXml)in.readObject(); //generation de la widget dans la scene EbliNode node=widgetXml.generateWidgetInScene(parametres, scenToUpdate); + //ajout des noeuds a ajouter dans la selection if(widgetXml.isSelected()) listeNodeSelect.add(node); + + //ajout de la creation d'un groupe + if(!widgetXml.getIdGroup().equals(EbliWidgetGroup.NOGROUP)){ + //il y a un group a prendre en compte d'id + String idGroup=widgetXml.getIdGroup(); + if(listeGroupToPerform.get(idGroup)==null){ + //on init + listeGroupToPerform.put(idGroup, new HashSet<Object>()); + } + //on ajoute l'objet node pour la widget + listeGroupToPerform.get(idGroup).add(node); + } + + } + + //-- lecture des groupes --// + //-- ecriture des groupes --// + int nbGroups=in.readInt(); + HashMap<String,EbliWidgetSerializeXml> listeGroupes=new HashMap<String,EbliWidgetSerializeXml>(); + + for( int i=0;i<nbGroups;i++){ + EbliWidgetSerializeXml group=(EbliWidgetSerializeXml) in.readObject(); + listeGroupes.put(group.getId(),group); } - + + in.close(); - + scenToUpdate.refresh(); + //-- on s'occupe de grouper l'ensemble des widgets --// + for(String idGroup:listeGroupToPerform.keySet()){ + //--l'idGroup est jetable, on ne le sauvegarde pas --// + HashSet<Object> listeToGroup=listeGroupToPerform.get(idGroup); + EbliNode nodeGroup=new EbliWidgetGroupAction(scenToUpdate).performGroup(listeToGroup); + + //-- on met a jour le ebliNode avec les infos du groupe sauv\xE9 --// + EbliWidgetSerializeXml infoGroup=listeGroupes.get(idGroup); + if(infoGroup!=null){ + nodeGroup.setTitle(infoGroup.getTitle()); + nodeGroup.getWidget().setPreferredLocation(new Point(infoGroup.getX(),infoGroup.getY())); + nodeGroup.getWidget().setPreferredSize(new Dimension(infoGroup.getWidth(),infoGroup.getHeight())); + + + } + } //-- on ajoute les noeuds selectionnes a ebliScene --// scenToUpdate.setSelectedObjects(listeNodeSelect); // mise a jour de la scene This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fa...@us...> - 2008-10-10 10:26:24
|
Revision: 4050 http://fudaa.svn.sourceforge.net/fudaa/?rev=4050&view=rev Author: fargeix Date: 2008-10-10 09:20:41 +0000 (Fri, 10 Oct 2008) Log Message: ----------- Modifications mineures ; version de distribution de Sinavi3 Modified Paths: -------------- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3DessinerPortFrame.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3DessinerPortFrame.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3DessinerPortFrame.java 2008-10-09 17:33:43 UTC (rev 4049) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3DessinerPortFrame.java 2008-10-10 09:20:41 UTC (rev 4050) @@ -36,7 +36,7 @@ import org.fudaa.fudaa.ressource.FudaaResource; import org.jdesktop.swingx.ScrollPaneSelector; -import sun.text.Normalizer.QuickCheckResult; +//import sun.text.Normalizer.QuickCheckResult; import com.memoire.bu.BuButton; import com.memoire.bu.BuDialogMessage; Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java 2008-10-09 17:33:43 UTC (rev 4049) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java 2008-10-10 09:20:41 UTC (rev 4050) @@ -707,8 +707,8 @@ .getIcon("crystal_graphe"), false); r5.addMenuItem("Attentes par trajet", "ATTENTESPECIALISEE", FudaaResource.FUDAA.getIcon("crystal_graphe"), false); r.addSubMenu(r5, false); - r.addMenuItem("Croisements dans les biefs", "CROISEMENTSCHENAUXTABLEAU", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); - r.addMenuItem("Tr\xE9matages dans les biefs", "TREMATAGESCHENAUXTABLEAU", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); + // r.addMenuItem("Croisements dans les biefs", "CROISEMENTSCHENAUXTABLEAU", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); + // r.addMenuItem("Tr\xE9matages dans les biefs", "TREMATAGESCHENAUXTABLEAU", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); @@ -1977,8 +1977,7 @@ if (this.donnees_.params_.ResultatsCompletsSimulation.ResultatsGenerationNavires == null) { // le fichier de donn\xE9es de la simulation a \xE9t\xE9 supprim\xE9 ou alors les donn\xE9es n'ont pas \xE9t\xE9 lues new BuDialogError(donnees_.application_.getApp(), donnees_.application_.getInformationsSoftware(), - "Erreur!!\n Relancez la simulation dabord," + " \n les r\xE9sultats de la simulation ne sont pas charg\xE9s" - + "\n (pour relancer la simulation, aller dans" + "\n l'onglet Simulation et cliquer sur \"Calculer\")") + "La simulation doit \xEAtre ex\xE9cut\xE9e afin de permettre l'exploitation des\nr\xE9sultats.\nVous pouvez ex\xE9cuter la simulation via la menu \"Simulation\".") .activate(); return; @@ -1991,8 +1990,7 @@ if (this.donnees_.listeResultatsSimu_ == null) { // le fichier de donn\xE9es de la simulation a \xE9t\xE9 supprim\xE9 ou alors les donn\xE9es n'ont pas \xE9t\xE9 lues new BuDialogError(donnees_.application_.getApp(), donnees_.application_.getInformationsSoftware(), - "Erreur!!\n Relancez la simulation dabord," + " \n les r\xE9sultats de la simulation ne sont pas charg\xE9s" - + "\n (pour relancer la simulation, aller dans" + "\n l'onglet Simulation et cliquer sur \"Calculer\")") + "La simulation doit \xEAtre ex\xE9cut\xE9e afin de permettre l'exploitation des\nr\xE9sultats.\nVous pouvez ex\xE9cuter la simulation via la menu \"Simulation\".") .activate(); return; @@ -2005,8 +2003,7 @@ if (this.donnees_.params_.ResultatsCompletsSimulation.TOUTEDureesParoucrs == null) { // le fichier de donn\xE9es de la simulation a \xE9t\xE9 supprim\xE9 ou alors les donn\xE9es n'ont pas \xE9t\xE9 lues new BuDialogError(donnees_.application_.getApp(), donnees_.application_.getInformationsSoftware(), - "Erreur!!\n Relancez la simulation dabord," + " \n les r\xE9sultats de la simulation ne sont pas charg\xE9s" - + "\n (pour relancer la simulation, aller dans" + "\n l'onglet Simulation et cliquer sur \"Calculer\")") + "La simulation doit \xEAtre ex\xE9cut\xE9e afin de permettre l'exploitation des\nr\xE9sultats.\nVous pouvez ex\xE9cuter la simulation via la menu \"Simulation\".") .activate(); return; @@ -2018,8 +2015,7 @@ if (this.donnees_.listeResultatsSimu_ == null) { // le fichier de donn\xE9es de la simulation a \xE9t\xE9 supprim\xE9 ou alors les donn\xE9es n'ont pas \xE9t\xE9 lues new BuDialogError(donnees_.application_.getApp(), donnees_.application_.getInformationsSoftware(), - "Erreur!!\n Relancez la simulation dabord," + " \n les r\xE9sultats de la simulation ne sont pas charg\xE9s" - + "\n (pour relancer la simulation, aller dans" + "\n l'onglet Simulation et cliquer sur \"Calculer\")") + "La simulation doit \xEAtre ex\xE9cut\xE9e afin de permettre l'exploitation des\nr\xE9sultats.\nVous pouvez ex\xE9cuter la simulation via la menu \"Simulation\".") .activate(); return; @@ -2031,8 +2027,7 @@ if (this.donnees_.listeResultatsSimu_ == null) { // le fichier de donn\xE9es de la simulation a \xE9t\xE9 supprim\xE9 ou alors les donn\xE9es n'ont pas \xE9t\xE9 lues new BuDialogError(donnees_.application_.getApp(), donnees_.application_.getInformationsSoftware(), - "Erreur!!\n Relancez la simulation dabord," + " \n les r\xE9sultats de la simulation ne sont pas charg\xE9s" - + "\n (pour relancer la simulation, aller dans" + "\n l'onglet Simulation et cliquer sur \"Calculer\")") + "La simulation doit \xEAtre ex\xE9cut\xE9e afin de permettre l'exploitation des\nr\xE9sultats.\nVous pouvez ex\xE9cuter la simulation via la menu \"Simulation\".") .activate(); return; @@ -2045,8 +2040,7 @@ if (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories == null) { // le fichier de donn\xE9es de la simulation a \xE9t\xE9 supprim\xE9 ou alors les donn\xE9es n'ont pas \xE9t\xE9 lues new BuDialogError(donnees_.application_.getApp(), donnees_.application_.getInformationsSoftware(), - "Erreur!!\n Relancez la simulation dabord," + " \n les r\xE9sultats de la simulation ne sont pas charg\xE9s" - + "\n (pour relancer la simulation, aller dans" + "\n l'onglet Simulation et cliquer sur \"Calculer\")") + "La simulation doit \xEAtre ex\xE9cut\xE9e afin de permettre l'exploitation des\nr\xE9sultats.\nVous pouvez ex\xE9cuter la simulation via la menu \"Simulation\".") .activate(); return; @@ -2058,8 +2052,7 @@ if (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories == null) { // le fichier de donn\xE9es de la simulation a \xE9t\xE9 supprim\xE9 ou alors les donn\xE9es n'ont pas \xE9t\xE9 lues new BuDialogError(donnees_.application_.getApp(), donnees_.application_.getInformationsSoftware(), - "Erreur!!\n Relancez la simulation dabord," + " \n les r\xE9sultats de la simulation ne sont pas charg\xE9s" - + "\n (pour relancer la simulation, aller dans" + "\n l'onglet Simulation et cliquer sur \"Calculer\")") + "La simulation doit \xEAtre ex\xE9cut\xE9e afin de permettre l'exploitation des\nr\xE9sultats.\nVous pouvez ex\xE9cuter la simulation via la menu \"Simulation\".") .activate(); return; @@ -2071,8 +2064,7 @@ if (this.donnees_.params_.ResultatsCompletsSimulation.TOUTESAttenteTrajet == null) { // le fichier de donn\xE9es de la simulation a \xE9t\xE9 supprim\xE9 ou alors les donn\xE9es n'ont pas \xE9t\xE9 lues new BuDialogError(donnees_.application_.getApp(), donnees_.application_.getInformationsSoftware(), - "Erreur!!\n Relancez la simulation dabord," + " \n les r\xE9sultats de la simulation ne sont pas charg\xE9s" - + "\n (pour relancer la simulation, aller dans" + "\n l'onglet Simulation et cliquer sur \"Calculer\")") + "La simulation doit \xEAtre ex\xE9cut\xE9e afin de permettre l'exploitation des\nr\xE9sultats.\nVous pouvez ex\xE9cuter la simulation via la menu \"Simulation\".") .activate(); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-09 17:33:57
|
Revision: 4049 http://fudaa.svn.sourceforge.net/fudaa/?rev=4049&view=rev Author: hadouxad Date: 2008-10-09 17:33:43 +0000 (Thu, 09 Oct 2008) Log Message: ----------- - gestion annuler/ajouter projet au projet actuel - Prise en compte des positions et des tailles - des widget - de la trpostlayoutfille - Gestion des objets shape: propri?\195?\169t?\195?\169s sauvegard?\195?\169es correctement - Sauvegarde du caract?\195?\168re visible ou non de la widget - Sauvegarde du caract?\195?\168re s?\195?\169lectionn?\195?\169 ou non de la widget - Sauvegarde de la superposition des widgets dans le layout - Sauvegarde des objets persistants correpsondant au graphe dans un repertoire - conception atomique (EggroupPersit,EgcourbePersit, egAxePersist) - Un fichier de sauvegarde par courbe - Un complet qui contient tous les groupes - Gestion des relations 1:N groupe:courbe (l'id du groupe est stock?\195?\169 dans le fichier courbe) Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,20 @@ +package org.fudaa.ebli.courbe; + + +/** + * Classe persistante des axe horizontaux + * @author Adrien Hadoux + * + */ +public class EGAxeHorizontalPersist { + + public EGAxeHorizontalPersist(EGAxeHorizontal axeX) { + // TODO Auto-generated constructor stub + fillInfoWith(axeX); + } + + private void fillInfoWith(EGAxeHorizontal axeX ){ + + } + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,20 @@ +package org.fudaa.ebli.courbe; + + +/** + * Classe persistante des axe verticaux + * @author Adrien Hadoux + * + */ +public class EGAxeVerticalPersist { + + public EGAxeVerticalPersist(EGAxeVertical axeY) { + // TODO Auto-generated constructor stub + fillInfoWith(axeY); + } + + private void fillInfoWith(EGAxeVertical axeY ){ + + } + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGCourbePersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,49 @@ +package org.fudaa.ebli.courbe; + +/** + * Classe persistante de la courbe + * @author Adrien Hadoux + * + */ +public class EGCourbePersist { + + String title_; + int Idgroup; + + public EGCourbePersist(EGCourbe courbe, int IdGroup) { + + fillInfoWith(courbe,IdGroup); + } + + + + private void fillInfoWith(EGCourbe courbe,int idgroupe){ + this.Idgroup=idgroupe; + title_=courbe.getTitle(); + + } + + + + public String getTitle_() { + return title_; + } + + + + public void setTitle_(String title_) { + this.title_ = title_; + } + + + + public int getIdgroup() { + return Idgroup; + } + + + + public void setIdgroup(int idgroup) { + Idgroup = idgroup; + } +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGraphePersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,137 @@ +package org.fudaa.ebli.courbe; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.util.List; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.persist.EbliSceneSerializeXml; +import org.fudaa.ebli.visuallibrary.persist.EbliWidgetSerializeXml; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; +import com.thoughtworks.xstream.persistence.FileStreamStrategy; +import com.thoughtworks.xstream.persistence.StreamStrategy; +import com.thoughtworks.xstream.persistence.XmlArrayList; + +/** + * Classe qui se charge de rendre persistant les donn\xE9es des graphes en xml. + * @author Adrien Hadoux + * + */ +public class EGGraphePersist { + + /** + * Path du repertoire dans lequel seront enregistr\xE9 toute les courbes, groupes et + * model... + */ + String directoryPath_; + + EGGraphe grapheTopersist; + + private XStream parser_; + + private static String MAINFILE="descriptorGraphe.xml"; + private static String COURBEDIRECTORY="courbes"; + + public EGGraphePersist(String directoryPath_, EGGraphe grapheTopersist,Map parameters) throws IOException { + super(); + this.directoryPath_ = directoryPath_; + this.grapheTopersist = grapheTopersist; + + savePersitGrapheXml(parameters); + } + + + + /** + * Recupere le parser adequat. + * @return + */ + private XStream getParser(){ + if(parser_==null) + parser_=initXmlParser(); + return parser_; + } + + /** + * Init le parser avec les alias adequats. + * @return + */ + private XStream initXmlParser(){ + XStream xstream = new XStream(new DomDriver()); + //-- creation des alias pour que ce soit + parlant dans le xml file --// + xstream.alias("Groupe", EGGroupPersist.class); + xstream.alias("AxeX", EGAxeHorizontalPersist.class); + xstream.alias("AxeY", EGAxeVerticalPersist.class); + xstream.alias("Courbe", EGCourbePersist.class); + + return xstream; + } + + + /** + * Enrtegistre le graphe au format persistant xml. + * @param parameters des parametres supplementaires utiles. + * @throws IOException + */ + private void savePersitGrapheXml(Map parameters) throws IOException{ + + String mainfile=directoryPath_+File.separator+MAINFILE; + //-- outputstream du xstream pour enregistrement des diff\xE9rents groupes--// + ObjectOutputStream out = getParser().createObjectOutputStream(new FileWriter(mainfile)); + //-- enregistrement des courbes --// + // strategy pour la liste xml: aun fichier par courbe. + File fichierCourbes=new File(directoryPath_+File.separator+COURBEDIRECTORY); + if(fichierCourbes.mkdir()){ + StreamStrategy strategy = new FileStreamStrategy(fichierCourbes); + // creates the list of curves: + List<EGCourbePersist> list = new XmlArrayList(strategy); + + + for(int i=0;i<grapheTopersist.getModel().getNbEGObject();i++){ + + EGObject objet=grapheTopersist.getModel().getEGObject(i); + + if(objet instanceof EGGroup){ + EGGroup groupe=(EGGroup) objet; + out.writeObject(new EGGroupPersist(groupe)); + + for(int k=0;k<groupe.getEGChilds().length;k++){ + if(groupe.getEGChilds()[k] instanceof EGCourbe){ + //-- ajout de la courbe persitante dans un fichier avec pour groupee le i eme + list.add(new EGCourbePersist((EGCourbe) groupe.getEGChilds()[k],i)); + } + } + }else + if(objet instanceof EGCourbe){ + //le groupe d appartenance est -1 + list.add(new EGCourbePersist((EGCourbe) objet,-1)); + } + } + } + out.close(); + + } + + public String getDirectoryPath_() { + return directoryPath_; + } + + public void setDirectoryPath_(String directoryPath_) { + this.directoryPath_ = directoryPath_; + } + + public EGGraphe getGrapheTopersist() { + return grapheTopersist; + } + + public void setGrapheTopersist(EGGraphe grapheTopersist) { + this.grapheTopersist = grapheTopersist; + } + + + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGGroupPersist.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -0,0 +1,32 @@ +package org.fudaa.ebli.courbe; + +import java.util.ArrayList; + +/** + * Classe persistante xml du eggroup + * @author Adrien Hadoux + * + */ +public class EGGroupPersist { + + String title_; + EGAxeHorizontalPersist axeX; + EGAxeVerticalPersist axeY; + + +public EGGroupPersist(EGGroup group) { + super(); + fillInfoWith(group); + +} + +private void fillInfoWith(EGGroup groupe){ + title_=groupe.getTitle(); + axeX=new EGAxeHorizontalPersist(groupe.getAxeX()); + axeY=new EGAxeVerticalPersist(groupe.getAxeY()); + + +} + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -50,7 +50,7 @@ /** * L'identifiant unique du widget */ - private final String id_; + private String id_; boolean isGroup; boolean isInEditMode_ = false; @@ -491,4 +491,12 @@ useBorder_ = _useBorder; } +public String getId_() { + return id_; +} + +public void setId_(String id_) { + this.id_ = id_; +} + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/CalqueLegendeWidgetAdapter.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -217,12 +217,12 @@ * * @return EbliNode cree ajoute a la scene. */ - public EbliNode createLegende(Point _location, EbliScene _scene) { + public EbliNode createLegende(Point _location, EbliScene _scene,String id) { setScene(_scene); EbliNodeDefault def = new EbliNodeDefault(); def.setPreferedLocation(_location); // def.setPreferedSize(new Dimension(150, 250)); - def.setCreator(new EbliWidgetCreatorLegende(legendePanel_)); + def.setCreator(new EbliWidgetCreatorLegende(legendePanel_,id)); def.setTitle("L\xE9gende calque"); // TODO non stable _scene.addNode(def); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetControllerCalque.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -162,7 +162,7 @@ if (widget_.getBounds() != null && widget_.getPreferredLocation() != null) { positionLegende.x = widget_.getPreferredLocation().x + widget_.getBounds().width + 20; positionLegende.y = widget_.getPreferredLocation().y; - setNodeLegende(legendeWidget_.createLegende(positionLegende, widget_.getEbliScene())); + setNodeLegende(legendeWidget_.createLegende(positionLegende, widget_.getEbliScene(),widget_.getId())); } widget_.getEbliScene().refresh(); } else if (getNodeLegende().hasWidget()) Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -12,6 +12,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; +import org.netbeans.api.visual.widget.Widget; import org.w3c.dom.Element; /** @@ -23,14 +24,18 @@ BCalqueLegendePanel g; // EbliWidget res; - + /** + * L'id de la widget qui a declench\xE9 la legende + */ + private String IdPossessor_; EbliWidgetWithBordure res; // BArbreCalqueModel modelTreeCalque_; - public EbliWidgetCreatorLegende(BCalqueLegendePanel g/* , BArbreCalqueModel model */) { + public EbliWidgetCreatorLegende(BCalqueLegendePanel g,String id/* , BArbreCalqueModel model */) { super(); this.g = g; + IdPossessor_=id; // modelTreeCalque_ = model; } @@ -70,7 +75,8 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + //-- pour le moment on se contente juste de rejouer la legende --// + return IdPossessor_; } @Override @@ -78,8 +84,27 @@ // TODO Auto-generated method stub if(data==null) g=new BCalqueLegendePanel(new BCalqueLegende(),"empty"); - else - g=(BCalqueLegendePanel) data; + else{ + String idCalque=(String) data; + + EbliScene scene=(EbliScene) parameters.get("scene"); + //-- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --// + for(Widget widget: scene.getLayerVisu().getChildren()){ + EbliWidget candidat=null; + if(widget instanceof EbliWidgetBordureSingle) + candidat=((EbliWidgetBordureSingle) widget).getIntern(); + else + candidat=(EbliWidget) widget; + + if(candidat.getId().equals(idCalque)){ + //--on a le bon, on rejoue la legende --// + ((EbliWidgetControllerCalque)candidat.getController()).ajoutLegende(); + return; + } + } + } + + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -48,7 +48,7 @@ positionLegende.x = _dest.getLocation().x + _dest.getIntern().getPreferredSize().width + 5; positionLegende.y = _dest.getPreferredLocation().y; EbliWidgetVueCalque vue = (EbliWidgetVueCalque) _dest.getIntern(); - vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene()); + vue.nodeLegende = _legende.createLegende(positionLegende, _legende.getScene(),getBordure().getIntern().getId()); ((EbliWidgetControllerCalque) vue.getController()).setLegendeWidget(_legende); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -86,7 +86,7 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + return typeObject_; } @Override @@ -94,6 +94,9 @@ // TODO Auto-generated method stub if(data==null) typeObject_=new ShapeCreatorCircle(); + else{ + typeObject_=(ShapeCreator) data; + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -63,14 +63,13 @@ return duplique; } - public EbliWidgetWithBordure getBordure() { - return res; + public EbliWidgetWithBordure getBordure() { return res; } @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + return label_; } @Override @@ -78,6 +77,7 @@ // TODO Auto-generated method stub if(data==null) label_=""; + label_=(String) data; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetControllerGraphe.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -34,6 +34,7 @@ import org.fudaa.ebli.visuallibrary.actions.CommandMasquer; import org.fudaa.ebli.visuallibrary.actions.CommandSupprimer; import org.fudaa.ebli.visuallibrary.actions.EbliActionEditorOneClick; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import com.memoire.bu.BuMenuBar; import com.memoire.bu.BuPanel; @@ -223,9 +224,10 @@ // -- non de la legende --// widgetGraphe_.getNodeLegende().setTitle("L\xE9gende " + (indiceLegende++)); - - widgetGraphe_.getNodeLegende().setCreator( - new EbliWidgetCreatorLegende(((EbliWidgetGraphe) widget_).getGraphe())); + + EbliWidgetCreatorLegende creator= new EbliWidgetCreatorLegende(((EbliWidgetGraphe) widget_).getGraphe(),widget_.getId()); + + widgetGraphe_.getNodeLegende().setCreator( creator ); widgetGraphe_.getNodeLegende().setPreferedLocation(positionLegende); widget_.getEbliScene().addNode(widgetGraphe_.getNodeLegende()); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -1,12 +1,15 @@ package org.fudaa.ebli.visuallibrary.graphe; import java.awt.Point; +import java.io.File; +import java.io.IOException; import java.util.Map; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheModel; +import org.fudaa.ebli.courbe.EGGraphePersist; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -109,8 +112,21 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + //-- generation d'un identifiant unique pour le repertoire du graphe --// + String pathUnique=parameters.get("path")+File.separator+"Graph"+res.getIntern().getId(); + + //- sauvegarde du contenu de l eggraphe dans un repertoire a part --// + try { + File createRep=new File(pathUnique); + if( createRep.mkdir()) + new EGGraphePersist(pathUnique,getGraphe(),parameters); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } + + return pathUnique; + } @Override public void setPersistData(Object data, Map parameters) { Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -2,6 +2,8 @@ import java.util.Map; +import org.fudaa.ebli.calque.BCalqueLegende; +import org.fudaa.ebli.calque.BCalqueLegendePanel; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -9,7 +11,9 @@ import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetControllerCalque; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; +import org.netbeans.api.visual.widget.Widget; import org.w3c.dom.Element; public class EbliWidgetCreatorLegende implements EbliWidgetCreator { @@ -17,9 +21,11 @@ EGGraphe g; // EbliWidget res; EbliWidgetWithBordure res; - public EbliWidgetCreatorLegende(EGGraphe g) { + private String IdPossessor_; + public EbliWidgetCreatorLegende(EGGraphe g,String id) { super(); this.g = g; + IdPossessor_=id; } public EbliWidgetCreatorLegende(){ @@ -55,14 +61,35 @@ @Override public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - return null; + return IdPossessor_; } - @Override + public void setPersistData(Object data, Map parameters) { - // TODO Auto-generated method stub - if(data==null) - g=new EGGraphe(new EGGrapheTreeModel()); - } + // TODO Auto-generated method stub + if(data==null) + g=new EGGraphe(new EGGrapheTreeModel()); + else{ + String idGraphe=(String) data; + + EbliScene scene=(EbliScene) parameters.get("scene"); + //-- recherche de la widget qui contient l'id et rejouer l'action ajouter legende --// + for(Widget widget: scene.getLayerVisu().getChildren()){ + EbliWidget candidat=null; + if(widget instanceof EbliWidgetBordureSingle) + candidat=((EbliWidgetBordureSingle) widget).getIntern(); + else + candidat=(EbliWidget) widget; + + if(candidat.getId().equals(idGraphe)){ + //--on a le bon, on rejoue la legende --// + ((EbliWidgetControllerGraphe)candidat.getController()).ajoutLegende(); + return; + } + } + } + + + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -2,12 +2,14 @@ import java.awt.Color; import java.awt.Dimension; +import java.awt.Point; import org.fudaa.ebli.visuallibrary.EbliScene; import com.sun.j3d.loaders.vrml97.impl.Background; + /** * Classe utilis\xE9e par d\xE9faut pour la serialization xml avec xstream * @author Adrien Hadoux @@ -18,23 +20,32 @@ String title; Color background; int nbFrames; + +//dimensiosn de la frame int width; int height; -public EbliSceneSerializeXml(EbliScene scene,String title){ +//position de la frame ou autre +int x; +int y; + + +public EbliSceneSerializeXml(EbliScene scene,String title,Dimension dimensionFrame,Point location){ - fillInfoWith(scene,title); + fillInfoWith(scene,title,dimensionFrame,location); } -private void fillInfoWith(EbliScene scene,String title){ +private void fillInfoWith(EbliScene scene,String title,Dimension dimensionFrame,Point location){ this.title=title; this.background=(Color) scene.getBackground(); this.nbFrames=scene.getObjects().size(); if(scene.getView() !=null){ - this.width=scene.getView().getSize().width; - this.height=scene.getView().getSize().height; + this.width=dimensionFrame.width; + this.height=dimensionFrame.height; + this.x=location.x; + this.y=location.y; } } @@ -109,5 +120,25 @@ } +public int getX() { + return x; +} + +public void setX(int x) { + this.x = x; } + + +public int getY() { + return y; +} + + +public void setY(int y) { + this.y = y; +} + + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -17,6 +17,7 @@ import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorClassLoader; import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorShape; +import org.netbeans.api.visual.widget.Widget; import org.w3c.dom.Element; /** @@ -26,6 +27,11 @@ */ public class EbliWidgetSerializeXml { + /** + * Important: l'id de la widget pour avoir des references . + */ + String Id; + String title; /** * L'instance de la classe creator @@ -54,10 +60,13 @@ boolean bordure; - - //-- datas : objet g\xE9r\xE9 par le creator, inconnu poru cette classe --// + boolean isVisible; + + boolean isSelected; + + //-- datas : objet g\xE9r\xE9 par le creator, inconnu pour cette classe --// Object data; - + public EbliWidgetSerializeXml(EbliNode node,Map parameters) { fillInfoWith(node,parameters); @@ -66,46 +75,60 @@ } private void fillInfoWith(EbliNode node,Map parameters){ - EbliWidget widget_; + EbliWidget widget; if(node.getWidget() instanceof EbliWidgetBordureSingle){ - widget_ = (EbliWidget) node.getWidget().getChildren().get(0); + widget = (EbliWidget) node.getWidget().getChildren().get(0); this.bordure=true; } else{ - widget_ = node.getWidget(); + widget = node.getWidget(); this.bordure=false; } - + this.Id=widget.getId(); this.title = node.getTitle(); this.type = node.getCreator().getClass().toString(); - if(widget_.getColorFond() !=null) + if(widget.getColorFond() !=null) this.bacckground = node.getWidget().getColorFond(); - if(widget_.getColorContour() !=null) - this.foreground = widget_.getColorContour(); - if(widget_.getFormeFont() !=null) - this.font = widget_.getFormeFont(); - this.rotation = widget_.getRotation(); - if(widget_.getTraceLigneModel()!=null){ - this.epaisseurTrait = widget_.getTraceLigneModel().getEpaisseur(); - this.typeTrait = widget_.getTraceLigneModel().getTypeTrait(); - this.colorModel=widget_.getTraceLigneModel().getCouleur(); + if(widget.getColorContour() !=null) + this.foreground = widget.getColorContour(); + if(widget.getFormeFont() !=null) + this.font = widget.getFormeFont(); + this.rotation = widget.getRotation(); + if(widget.getTraceLigneModel()!=null){ + this.epaisseurTrait = widget.getTraceLigneModel().getEpaisseur(); + this.typeTrait = widget.getTraceLigneModel().getTypeTrait(); + this.colorModel=widget.getTraceLigneModel().getCouleur(); } - if(widget_.getBounds() !=null){ - this.width = widget_.getBounds().width; - this.height = widget_.getBounds().height; + + + //--cas particulier, si widget non visible les dimension bonnes sont celles du parent preferredbounds--// + if(!widget.getParentBordure().isVisible()){ + if(widget.getParentBordure().getPreferredBounds() !=null){ + this.width = widget.getParentBordure().getPreferredBounds().width; + this.height = widget.getParentBordure().getPreferredBounds().height; + } + }else + if(widget.getParentBordure().getBounds() !=null){ + this.width = widget.getParentBordure().getBounds().width; + this.height = widget.getParentBordure().getBounds().height; + } + + if( widget.getParentBordure().getPreferredLocation()!=null){ + this.x =widget.getParentBordure().getPreferredLocation().x; + this.y = widget.getParentBordure().getPreferredLocation().y; } - if(widget_.getLocation() !=null){ - this.x =widget_.getLocation().x; - this.y = widget_.getLocation().y; - } - + + this.isVisible=widget.getParentBordure().isVisible(); + this.isSelected=widget.getEbliScene().getSelectedObjects().contains(node); + + //-- datas --// this.data=node.getCreator().getPersistData(parameters); } - + /** * Genere la widget, le creator et le node correspondant * ajoute le tout dans la scene et regle les parametres graphiques. @@ -118,19 +141,24 @@ EbliNode newNode=new EbliNodeDefault(); newNode.setTitle(title); newNode.setPreferedLocation(new Point(x,y)); - newNode.setPreferedSize(new Dimension(width,height)); - + if(width>0 && height>0) + newNode.setPreferedSize(new Dimension(width,height)); + else + newNode.setPreferedSize(new Dimension(200,200)); //-- creation du creator specicalis\xE9 --// //EbliWidgetCreator creator= (EbliWidgetCreator) EbliWidgetCreatorShape.class.forName(type).newInstance(); EbliWidgetCreator creator= EbliWidgetCreatorClassLoader.forName(type); - + //-- creation des datas --// creator.setPersistData(data, parameters); - + newNode.setCreator(creator); - + //-- ajout du node dans la scene --// scene.addNode(newNode); + + //-- recuperation du precedent Id, tres important poru les references --// + newNode.getWidget().setId_(this.Id); //--remplissage des proprietes graphiques --// newNode.getWidget().setColorFond(bacckground); @@ -139,11 +167,12 @@ newNode.getWidget().setRotation(rotation); TraceLigneModel model=new TraceLigneModel(typeTrait,epaisseurTrait,colorModel); newNode.getWidget().setTraceLigneModel(model); - - + newNode.getWidget().getParentBordure().setVisible(isVisible); + + return newNode; } - + public String getTitle() { return title; } @@ -256,6 +285,38 @@ this.data = data; } + public Color getColorModel() { + return colorModel; + } + public void setColorModel(Color colorModel) { + this.colorModel = colorModel; + } + public boolean isVisible() { + return isVisible; + } + + public void setVisible(boolean isVisible) { + this.isVisible = isVisible; + } + + public boolean isSelected() { + return isSelected; + } + + public void setSelected(boolean isSelected) { + this.isSelected = isSelected; + } + + public String getId() { + return Id; + } + + public void setId(String id) { + Id = id; + } + + + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -192,7 +192,7 @@ // -- creation d un noeud legende --// EbliNodeDefault nodeLegende = new EbliNodeDefault(); nodeLegende.setTitle("Legende"); - nodeLegende.setCreator(new EbliWidgetCreatorLegende(g)); + nodeLegende.setCreator(new EbliWidgetCreatorLegende(g,"")); nodeLegende.setPreferedSize(new Dimension(100, 100)); nodeLegende.setPreferedLocation(new Point(4, 270)); scene.addNode(nodeLegende); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -157,6 +157,9 @@ if ("OUVRIR".equals(com)) { // -- ouverture d un nouveau projet --// int reponse=JOptionPane.showConfirmDialog(this.getParentComponent(), TrResource.getS("Voulez vous fermer le projet courant?\n Cliquez non si vous voulez ajouter le nouveau projet au projet existant.")); + if(reponse==JOptionPane.CANCEL_OPTION){ + return; + } if(reponse==JOptionPane.OK_OPTION){ c_.getManager().clearProject(); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -23,6 +23,7 @@ import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGFillePanel; +import org.fudaa.ebli.ressource.EbliResource; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidgetController; @@ -117,6 +118,7 @@ public TrPostLayoutFille(final TrPostProjet _projet) { super(); setTitle(TrResource.getS("vue 2D")); + setFrameIcon(EbliResource.EBLI.getToolIcon("lissage")); previousTitleFrame = getTitle(); projet_ = _projet; // creation de la scene EBLI Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -250,7 +250,7 @@ // -- ajout du rectangle --// final EbliNodeDefault nodeLegende = new EbliNodeDefault(); nodeLegende.setTitle("Legende calque"); - nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0))); + nodeLegende.setCreator(new EbliWidgetCreatorLegende(legende.getLegendePanel(0),"x")); nodeLegende.setPreferedSize(new Dimension(200, 100)); nodeLegende.setPreferedLocation(new Point(350, 125)); // ajout du node au layout Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -7,6 +7,7 @@ */ package org.fudaa.fudaa.tr.post; +import java.awt.Component; import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; @@ -359,7 +360,8 @@ } public TrPostProjet(final TrPostSource _src, final TrPostCommonImplementation _impl) { - if (_src != null) ajouterSource(_src); + if (_src != null) + ajouterSource(_src); // -- creation de la frame de gestion multi projet --// filleProjetctManager_ = new TrPostProjetsManagerFille(this); @@ -379,7 +381,8 @@ listeSrc_.add(_src); // -- ajout du menu correspondant uniquement a partir de la 2eme --// - if (listeSrc_.size() > 1) construitMenuPostSpecifiqueSource(_src); + // if (listeSrc_.size()>1 || (menuPost_!=null &&)) + construitMenuPostSpecifiqueSource(_src); } else { // -- messqge d erreur: le fichier est deja ouvert --// @@ -389,6 +392,7 @@ } + /** * retourne la source dans la liste des sources correspondant au fichier. retourne null sinon. * @@ -440,7 +444,7 @@ listeSrc_.remove(src); // --recuperation du menu simul --// - final BuMenu menuSimul = listeMenuProjets_.get(n); + final BuMenu menuSimul = getlisteMenuProjets_().get(n); // --on retire les menus correspondants --// // for (int i = 0; i < listeSousMenuProjets_.get(n).size(); i++) { @@ -453,8 +457,8 @@ // -- on retire de la liste des menus le menusimul et la liste des sous // menus --// - listeMenuProjets_.remove(n); - listeSousMenuProjets_.remove(n); + getlisteMenuProjets_().remove(n); + getlisteSousMenuProjets_().remove(n); // -- mise a jour de la barre des menus --// impl_.getMainMenuBar().revalidate(); @@ -522,11 +526,11 @@ + (listeSrc_.size())); // -- ajout du menu au menu post --// - menuPost_.add(menuSimul); + getMenuPost().add(menuSimul); // -- sauvegarde d une trace du menu dans la liste pour une suppression // ulterieure --// - listeMenuProjets_.add(menuSimul); + getlisteMenuProjets_().add(menuSimul); final ArrayList<BuMenuItem> listSousMenus = new ArrayList<BuMenuItem>(); @@ -563,7 +567,7 @@ _src.addSpecificItemInMainMenu(menuSimul, getImpl()); // -- ajout de la sous liste de menus pour la garder en memoire --// - listeSousMenuProjets_.add(listSousMenus); + getlisteSousMenuProjets_().add(listSousMenus); } } @@ -599,27 +603,39 @@ // menubar.add(menuLayout_, 2); // // } + + public BuMenu getMenuPost(){ + if(menuPost_==null) + menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); + return menuPost_; + } + /** * Creation par defaut du menu post de l interface. Cette methdoe est appelee une seule dfois au moment de la creation * de l impl. */ public void setMenuPost() { final BuMenuBar menubar = impl_.getMainMenuBar(); + + Component comp=null; + if(getMenuPost().getMenuComponentCount()>0){ + comp= getMenuPost().getMenuComponent(0); + //getMenuPost().remove(0); + } + + getMenuPost().setIcon(null); + getMenuPost().setName("mnPost"); - menuPost_ = new BuMenu(TrResource.getS("Post"), "POST"); - menuPost_.setIcon(null); - menuPost_.setName("mnPost"); + menubar.add(getMenuPost(), 2); - menubar.add(menuPost_, 2); - - menuPost_.addSeparator(TrResource.getS("Layout")); + getMenuPost().addSeparator(TrResource.getS("Layout")); // -- ajout de l action de creation du calque --// - // menuPost_.add(new TrPostActionChooseAndCreateCalque(this)); - menuPost_.addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); - menuPost_.addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", CtuluResource.CTULU + // getMenuPost().add(new TrPostActionChooseAndCreateCalque(this)); + getMenuPost().addMenuItem(TrResource.getS("Vue 2D"), "VIEW_2D", BuResource.BU.getIcon("aucun"), TrPostProjet.this); + getMenuPost().addMenuItem(TrResource.getS(("Ajouter une nouvelle fen\xEAtre")), "AJOUTFRAME", CtuluResource.CTULU .getIcon("crystal_ajouter"), new ActionListener() { public void actionPerformed(final ActionEvent _e) { @@ -628,7 +644,7 @@ } }); - menuPost_.addSeparator(TrResource.getS("Gestion")); + getMenuPost().addSeparator(TrResource.getS("Gestion")); // -- ajout de l action de gestion des simus dans post --// final BuMenuItem item = new BuMenuItem(TrResource.getS("Gestion Multi-Fichiers r\xE9sultats")); item.addActionListener(new ActionListener() { @@ -646,17 +662,33 @@ } }); - menuPost_.add(item); - menuPost_.addSeparator("Liste des Fichiers r\xE9sultats"); + getMenuPost().add(item); + getMenuPost().addSeparator("Liste des Fichiers r\xE9sultats"); // -- init de la liste des menus --// - listeMenuProjets_ = new ArrayList<BuMenu>(); + - listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); + // -- construction par defaut du premier menu de simulation --// - construitMenuPostSpecifiqueSource(getSource(0)); + // construitMenuPostSpecifiqueSource(getSource(0)); + if(comp!=null){ + getMenuPost().add(comp); + } + } + + public List<BuMenu> getlisteMenuProjets_(){ + if(listeMenuProjets_==null) + listeMenuProjets_ = new ArrayList<BuMenu>(); + return listeMenuProjets_; + } + + public List<ArrayList<BuMenuItem>> getlisteSousMenuProjets_(){ + if(listeSousMenuProjets_==null) + listeSousMenuProjets_ = new ArrayList<ArrayList<BuMenuItem>>(); + return listeSousMenuProjets_; + } /** * calcul les extrema en fonction de la source proposee * @@ -943,10 +975,10 @@ // return; // } else { // i indique le numero de la simulation - for (int i = 0; i < listeSousMenuProjets_.size(); i++) { + for (int i = 0; i < getlisteSousMenuProjets_().size(); i++) { // --recuperation de la liste des sousmenu de la simulation i --// - final ArrayList<BuMenuItem> listeSousMenus = listeSousMenuProjets_.get(i); + final ArrayList<BuMenuItem> listeSousMenus = getlisteSousMenuProjets_().get(i); final TrPostSource source = getSource(i); // -- on recherche si l action provient d un des fils --// for (int j = 0; j < listeSousMenus.size(); j++) { @@ -1292,7 +1324,7 @@ final TrPostLayoutFille newLayoutFille = new TrPostLayoutFille(this); newLayoutFille.setTitle(newLayoutFille.getTitle() + " N\xB0 " + (++idx)); - newLayoutFille.setFrameIcon(EbliResource.EBLI.getToolIcon("lissage")); + // addFillesLayout(newLayoutFille); impl_.addInternalFrame(newLayoutFille); } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -394,6 +394,9 @@ public TrPostSource getSource() { return source_; } + + + /** * @return the suiviPanel Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-08 17:44:48 UTC (rev 4048) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-09 17:33:43 UTC (rev 4049) @@ -1,5 +1,7 @@ package org.fudaa.fudaa.tr.post.persist; +import java.awt.Dimension; +import java.awt.Point; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; @@ -9,9 +11,11 @@ import java.io.ObjectOutputStream; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; import javax.swing.JFileChooser; import javax.swing.JInternalFrame; @@ -30,10 +34,12 @@ import org.fudaa.ebli.visuallibrary.persist.ManagerWidgetPersist; import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; +import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; import org.fudaa.fudaa.tr.post.TrPostLayoutFille; import org.fudaa.fudaa.tr.post.TrPostMultiSourceActivator; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostSource; +import org.netbeans.api.visual.widget.Widget; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -94,7 +100,7 @@ ProgressionInterface prog_; File projet_; - CtuluUI ui_; + TrPostCommonImplementation ui_; public TrPostPersistenceManager(TrPostProjet projet) { @@ -139,12 +145,17 @@ if (reponse == JFileChooser.APPROVE_OPTION) { File conteneurProjet = fileChooser.getSelectedFile(); - if(projet_==null || projet_!=conteneurProjet) - projet_ = new File(conteneurProjet.getAbsoluteFile() + EXTENSION); + if(projet_==null || !projet_.equals(conteneurProjet)) + projet_ = new File(GetExtensionName(conteneurProjet.getAbsolutePath())); // creation du repertoire global contenant toutes les donn\xE9es if (projet_.mkdir()) { return true; - } else { + } else + + if(projet_.isDirectory()){ + return true; + }else + { ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le r\xE9pertoire")); return false; } @@ -153,6 +164,19 @@ } else return false; } + + /** + * Retourne un nom avec extension + * @param name + * @return + */ + public String GetExtensionName(String name){ + + if(name.contains(EXTENSION)){ + return name; + }else + return name+EXTENSION; + } /** * Charge le repertoire contenant tous les fichiers @@ -276,9 +300,10 @@ }else{ File f = new File(path); // -- tentative de chargement du source dans le multi-projet --// + multiProjectActivator.active(f, trprojet_.impl_); // -- notify aux observers --// - trprojet_.notifyObservers(); + //trprojet_.notifyObservers(); } @@ -337,6 +362,8 @@ progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listFilles.size()); file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); //-- sauvegarde du persitant --// + parametres.put("dimensions", fille.getSize()); + parametres.put("location", fille.getLocation()); savePersitSceneXml(scene,title,file,parametres); cpt++; @@ -397,9 +424,8 @@ TrPostLayoutFille postFrame=new TrPostLayoutFille(trprojet_); //-- sauvegarde du persitant --// try { + trprojet_.getImpl().addInternalFrame(postFrame); loadPersitSceneXml(file,postFrame,parametres); - - trprojet_.getImpl().addInternalFrame(postFrame); } catch (InstantiationException e) { // TODO Auto-generated catch block ui_.error(TrResource.getS("Erreur dans le chargement du layout. Chargement annul\xE9 pour le fichier ")+fichier); @@ -413,6 +439,9 @@ progression("", 100); ui_.message(TrResource.getS("Chargement termin\xE9"), TrResource.getS("Chargement termin\xE9 avec succ\xE8s"), false); + + + return true; } @@ -461,16 +490,18 @@ //-- g\xE9n\xE9ration du xml pour la scene --// - out.writeObject(new EbliSceneSerializeXml(scene,title)); + out.writeObject(new EbliSceneSerializeXml(scene,title,(Dimension) parametres.get("dimensions"),(Point) parametres.get("location"))); //-- g\xE9n\xE9ration du xml pour les eblinode/widgets --// - - Iterator<EbliNode> it=(Iterator<EbliNode>) scene.getObjects().iterator(); + //-- ACHTUNG!!! IL FAUT RECUPERER LES OBJETS VIA CHILDREN POUR PRESERVER L ORDRE DE SUPERPOSITION!!! --// + Iterator<Widget> it= scene.getLayerVisu().getChildren().iterator(); while(it.hasNext()){ - EbliNode node=it.next(); + Widget widget=it.next(); + EbliNode node=(EbliNode) scene.findObject(widget); //ecriture de l objet - out.writeObject(new EbliWidgetSerializeXml(node,parametres)); + if(node !=null) + out.writeObject(new EbliWidgetSerializeXml(node,parametres)); } @@ -496,6 +527,7 @@ // HashMap<String, Object> parametres=new HashMap<String, Object>(); // parametres.put("path", file.getAbsolutePath()); EbliScene scenToUpdate=fille.getScene(); + parametres.put("scene",scenToUpdate); //-- inputstream du xstream --// ObjectInputStream in = getParser().createObjectInputStream(new FileReader(file)); @@ -509,9 +541,11 @@ if(sceneXml.getWidth()>0 && sceneXml.getHeight()>0) fille.setSize(sceneXml.getWidth(),sceneXml.getHeight()); fille.setTitle(sceneXml.getTitle()); + fille.setLocation(sceneXml.getX(),sceneXml.getY()); + //-- preparation de la liste de selection des frames dans le layout --// + final Set<Object> listeNodeSelect = new HashSet<Object>(); - //-- r\xE9cup\xE9ration via xml des eblinode/widgets --// for(int i=0;i<sceneXml.getNbFrames();i++){ @@ -519,14 +553,21 @@ EbliWidgetSerializeXml widgetXml = (EbliWidgetSerializeXml)in.readObject(); //generation de la widget dans la scene - widgetXml.generateWidgetInScene(parametres, scenToUpdate); + EbliNode node=widgetXml.generateWidgetInScene(parametres, scenToUpdate); + + if(widgetXml.isSelected()) + listeNodeSelect.add(node); } in.close(); + + //-- on ajoute les noeuds selectionnes a ebliScene --// + scenToUpdate.setSelectedObjects(listeNodeSelect); + // mise a jour de la scene + scenToUpdate.refresh(); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-08 17:44:57
|
Revision: 4048 http://fudaa.svn.sourceforge.net/fudaa/?rev=4048&view=rev Author: hadouxad Date: 2008-10-08 17:44:48 +0000 (Wed, 08 Oct 2008) Log Message: ----------- Gestion des chargement/sauvegarde serialization xml des ebliWidgets!!! Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestVisualLibrary.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetSerializeXml.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNode.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -4,6 +4,8 @@ import java.awt.Point; import java.util.Map; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; + public interface EbliNode { String getTitle(); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliNodeDefault.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -4,6 +4,8 @@ import java.awt.Point; import java.util.Map; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; + public class EbliNodeDefault implements EbliNode { EbliWidgetCreator creator; Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,32 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.util.Map; - -import org.w3c.dom.Element; - - -public interface EbliWidgetCreator { - - EbliWidget create(EbliScene _scene); - - - /** - * Duplication de l ebliNode en fonction de son creator. - */ - EbliNode duplicate(EbliNode _nodeAdupliquer); - - //FIXME pas de reference vers la widget creer: un creator peut etre utiliser pour plusieurs widget ! -// EbliWidgetWithBordure getBordure(); - - - /** - * Methode qui permet d'injecter les datas dans le creator pour la persistence - */ - void setData(Object data); - - /** - * Methode qui permet de recuperer les datas et de les inserer dans l'element. - */ - void PersistData(Element elt, Map parameters); - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,74 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.util.Map; - -import org.w3c.dom.Element; - -public class EbliWidgetCreatorDblFleche implements EbliWidgetCreator { - - - int orientation; - - EbliWidgetDBLFleche res; - - public EbliWidgetCreatorDblFleche(int orientation) { - super(); - this.orientation = orientation; - - } - - public int getG() { - return orientation; - } - - public void setG(int orientation) { - this.orientation = orientation; - } - - public EbliWidget create(EbliScene _scene) { - res= new EbliWidgetDBLFleche(_scene, orientation); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorDblFleche(getG())); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - public EbliWidgetWithBordure getBordure() { - return null; - } - - @Override - public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - - } - - @Override - public void setData(Object data) { - // TODO Auto-generated method stub - - } - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,74 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.util.Map; - -import org.w3c.dom.Element; - -public class EbliWidgetCreatorFleche implements EbliWidgetCreator { - - int orientation; - - EbliWidgetFleche res; - - public EbliWidgetCreatorFleche(int orientation) { - super(); - this.orientation = orientation; - - } - - public int getG() { - return orientation; - } - - public void setG(int orientation) { - this.orientation = orientation; - } - - public EbliWidget create(EbliScene _scene) { - res= new EbliWidgetFleche(_scene, orientation); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorFleche(orientation)); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - public EbliWidgetWithBordure getBordure() { - return null; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} - - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,82 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Image; -import java.awt.Point; -import java.util.Map; - -import org.w3c.dom.Element; - -/** - * Creator de la widget image. - * - * @author Adrien Hadoux - * - */ -public class EbliWidgetCreatorImage implements EbliWidgetCreator { - - Image image_; - String pathImage_; - // EbliWidgetImage res; - EbliWidgetWithBordure res; - - - public EbliWidgetCreatorImage(Image g, String path) { - super(); - pathImage_=path; - this.image_ = g; - } - - public Image getG() { - return image_; - } - - public void setG(Image g) { - this.image_ = g; - } - - public EbliWidget create(EbliScene _scene) { - - res = new EbliWidgetBordureSingle(new EbliWidgetImage(_scene, getG())); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorImage(getG(),pathImage_)); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - public EbliWidgetWithBordure getBordure() { - return res; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - elt.setAttribute("CONTENT", pathImage_); -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,94 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.util.Map; - -import org.fudaa.ebli.visuallibrary.creator.ShapeCreator; -import org.w3c.dom.Element; - -/** - * Creator pour les objets graphiques de type shape. - * @author Adrien Hadoux - * - */ -public class EbliWidgetCreatorShape implements EbliWidgetCreator { - - - EbliWidgetShape res; - - /** - * Le type de l objet a creer. - */ - ShapeCreator typeObject_; - - public ShapeCreator getTypeObject_() { - return typeObject_; - } - - - - public void setTypeObject_(ShapeCreator typeObject_) { - this.typeObject_ = typeObject_; - } - - - - public EbliWidgetCreatorShape(ShapeCreator _typeObject ) { - super(); - - typeObject_=_typeObject; - } - - - - public EbliWidget create(EbliScene _scene) { - res= new EbliWidgetShape(_scene,typeObject_ ,null); - - return res; - } - - public EbliWidget getWidget() { - return res; - } - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorShape(getTypeObject_())); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - - - public EbliWidgetWithBordure getBordure() { - return null; - } - - - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} - - - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} - - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,100 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Map; - -import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; -import org.w3c.dom.Element; - -/** - * creator Editeur de texte widget. - * - * @author Adrien Hadoux - * - */ -public class EbliWidgetCreatorTextEditor implements EbliWidgetCreator { - - CtuluHtmlEditorPanel editorPane_; - // EbliWidgetTextEditor res; - EbliWidgetWithBordure res; - - static int Idcontenu=1; - - public EbliWidgetCreatorTextEditor(CtuluHtmlEditorPanel g) { - super(); - this.editorPane_ = g; - } - - public CtuluHtmlEditorPanel getG() { - return editorPane_; - } - - public void setG(CtuluHtmlEditorPanel g) { - this.editorPane_ = g; - } - - public EbliWidget create(EbliScene _scene) { - - res = new EbliWidgetBordureSingle(new EbliWidgetTextEditor(_scene, getG())); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - CtuluHtmlEditorPanel editor=new CtuluHtmlEditorPanel(); - editor.setDocumentText(getG().getDocumentText()); - duplique.setCreator(new EbliWidgetCreatorTextEditor(editor)); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - - public EbliWidgetWithBordure getBordure() { - return res; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - //ecriture du contenu html dans ce fichier - FileWriter writer; - try { - - File contenu=new File((String)parameters.get("path")+File.separator+"contenu"+(Idcontenu++)); - writer = new FileWriter(contenu); - - writer.write(editorPane_.getDocumentText()); - writer.close(); - elt.setAttribute("CONTENT", contenu.getAbsolutePath()); - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,74 +0,0 @@ -package org.fudaa.ebli.visuallibrary; - -import java.awt.Point; -import java.util.Map; - -import org.w3c.dom.Element; - - - -public class EbliWidgetCreatorTextLabel implements EbliWidgetCreator { - - String label_; - // EbliWidgetRectangle res; - EbliWidgetWithBordure res; - public EbliWidgetCreatorTextLabel(String g) { - super(); - this.label_ = g; - } - - public String getG() { - return label_; - } - - public void setG(String g) { - this.label_ = g; - } - - public EbliWidget create(EbliScene _scene) { - res = new EbliWidgetBordureSingle(new EbliWidgetTextLabel(_scene, getG())); - - return res; - } - - public EbliWidget getWidget() { - // TODO Auto-generated method stub - return res; - } - - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - - EbliNode duplique = new EbliNodeDefault(); - - duplique.setCreator(new EbliWidgetCreatorTextLabel(getG())); - - duplique.setTitle(_nodeAdupliquer.getTitle()); - // recopie des tailles - duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); - // -- calcul nouvelle position - Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() - .getClientArea().height)); - duplique.setPreferedLocation(nouvellePosition); - - return duplique; - } - - public EbliWidgetWithBordure getBordure() { - return res; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} - - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,62 +0,0 @@ -/** - * Licence GPL - * Copyright Genesis - */ -package org.fudaa.ebli.visuallibrary; - -import java.util.Map; - -import org.netbeans.api.visual.widget.Widget; -import org.w3c.dom.Element; - -/** - * Creator permettant de cr\xE9er un groupe de widget simple. - * - * @author deniger - */ -public class EbliWidgetGroupCreator implements EbliWidgetCreator { - - EbliWidget w; - - public EbliWidget create(EbliScene _scene) { - return w; - } - - public EbliNode duplicate(EbliNode _nodeAdupliquer) { - return null; - } - - public EbliWidgetWithBordure getBordure() { - return null; - } - - /** - * @return the w - */ - public Widget getW() { - return w; - } - - public EbliWidget getWidget() { - return w; - } - - /** - * @param w the w to set - */ - public void setW(EbliWidget w) { - this.w = w; - } - -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} - -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} -} \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -9,7 +9,7 @@ import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorImage; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorImage; import com.memoire.bu.BuFileChooser; import com.memoire.bu.BuResource; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActiontextEditor.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -8,7 +8,7 @@ import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorTextEditor; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreatorTextEditor; import com.memoire.bu.BuResource; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetGroupAction.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -23,7 +23,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerForGroup; import org.fudaa.ebli.visuallibrary.EbliWidgetControllerMenuOnly; -import org.fudaa.ebli.visuallibrary.EbliWidgetGroupCreator; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetGroupCreator; import org.fudaa.ebli.visuallibrary.layout.GroupLayout; import org.netbeans.api.visual.widget.Widget; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -3,13 +3,15 @@ import java.awt.Font; import java.util.Map; +import org.fudaa.ebli.calque.BCalqueAffichage; +import org.fudaa.ebli.calque.BCalqueLegende; import org.fudaa.ebli.calque.BCalqueLegendePanel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; /** @@ -32,6 +34,10 @@ // modelTreeCalque_ = model; } + public EbliWidgetCreatorLegende(){ + + } + public BCalqueLegendePanel getG() { return g; } @@ -62,15 +68,20 @@ } @Override -public void PersistData(Element elt, Map parameters) { +public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - + return null; } @Override -public void setData(Object data) { +public void setPersistData(Object data, Map parameters) { // TODO Auto-generated method stub - + if(data==null) + g=new BCalqueLegendePanel(new BCalqueLegende(),"empty"); + else + g=(BCalqueLegendePanel) data; } + + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -12,8 +12,8 @@ import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; public class EbliWidgetCreatorVueCalque implements EbliWidgetCreator { @@ -29,7 +29,9 @@ public EbliWidgetCreatorVueCalque(ZEbliCalquesPanel calque) { this(calque, null); } - + public EbliWidgetCreatorVueCalque(){ + + } public EbliWidgetCreatorVueCalque(ZEbliCalquesPanel calque, GrBoite _initZoom) { super(); this.calque_ = calque; @@ -111,15 +113,18 @@ } @Override -public void PersistData(Element elt, Map parameters) { +public Object getPersistData(Map parameters) { // TODO Auto-generated method stub - + return null; } @Override -public void setData(Object data) { +public void setPersistData(Object data, Map parameters) { // TODO Auto-generated method stub - + if(data==null) + calque_=new ZEbliCalquesPanel(null); } + + } Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,37 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.w3c.dom.Element; + + +public interface EbliWidgetCreator { + + + + EbliWidget create(EbliScene _scene); + + + /** + * Duplication de l ebliNode en fonction de son creator. + */ + EbliNode duplicate(EbliNode _nodeAdupliquer); + + //FIXME pas de reference vers la widget creer: un creator peut etre utiliser pour plusieurs widget ! +// EbliWidgetWithBordure getBordure(); + + + /** + * Methode qui permet d'injecter les datas dans le creator pour la persistence + */ + public void setPersistData(Object data,Map parameters); + + /** + * Methode qui permet de recuperer les datas specifiques du creator + */ + public Object getPersistData(Map parameters); + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorClassLoader.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,39 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import javax.swing.LookAndFeel; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + + +/** + * Classe qui se charge de de loader la bonne classes en fonction du string passer en param + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorClassLoader { + + + /** + * Retourne une classe qui implemente EbliWidgetCreator + * sinon retourne null + * @param className + * @return + * @throws ClassNotFoundException + * @throws InstantiationException + * @throws IllegalAccessException + */ + public static EbliWidgetCreator forName(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException{ + EbliWidgetCreator creator=null; + if(className.startsWith("class ")); + className=className.substring("class ".length()); + Class myclass =Class.forName(className, true, Thread.currentThread(). + getContextClassLoader()); + Object myCreator=myclass.newInstance(); + + + if(myCreator instanceof EbliWidgetCreator) + return (EbliWidgetCreator)myCreator; + else return null; + } + +} Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,86 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetDBLFleche; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +public class EbliWidgetCreatorDblFleche implements EbliWidgetCreator { + + + int orientation; + + EbliWidgetDBLFleche res; + + public EbliWidgetCreatorDblFleche(int orientation) { + super(); + this.orientation = orientation; + + } + + public EbliWidgetCreatorDblFleche(){ + + } + + public int getG() { + return orientation; + } + + public void setG(int orientation) { + this.orientation = orientation; + } + + public EbliWidget create(EbliScene _scene) { + res= new EbliWidgetDBLFleche(_scene, orientation); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorDblFleche(getG())); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + public EbliWidgetWithBordure getBordure() { + return null; + } + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + + } + + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorDblFleche.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,82 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetFleche; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +public class EbliWidgetCreatorFleche implements EbliWidgetCreator { + + int orientation; + + EbliWidgetFleche res; + + public EbliWidgetCreatorFleche(int orientation) { + super(); + this.orientation = orientation; + + } + public EbliWidgetCreatorFleche(){ + + } + public int getG() { + return orientation; + } + + public void setG(int orientation) { + this.orientation = orientation; + } + + public EbliWidget create(EbliScene _scene) { + res= new EbliWidgetFleche(_scene, orientation); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorFleche(orientation)); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + public EbliWidgetWithBordure getBordure() { + return null; + } + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + + } + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFleche.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,106 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Image; +import java.awt.Point; +import java.awt.Toolkit; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.fudaa.ebli.visuallibrary.EbliWidgetImage; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +import sun.awt.image.ToolkitImage; + +/** + * Creator de la widget image. + * + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorImage implements EbliWidgetCreator { + + Image image_; + String pathImage_; + // EbliWidgetImage res; + EbliWidgetWithBordure res; + + + public EbliWidgetCreatorImage(Image g, String path) { + super(); + pathImage_=path; + this.image_ = g; + } + + + public EbliWidgetCreatorImage(){ + + } + + public Image getG() { + return image_; + } + + public void setG(Image g) { + this.image_ = g; + } + + public EbliWidget create(EbliScene _scene) { + + res = new EbliWidgetBordureSingle(new EbliWidgetImage(_scene, getG())); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorImage(getG(),pathImage_)); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + public EbliWidgetWithBordure getBordure() { + return res; + } + + + +@Override +public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return pathImage_; +} + +@Override +public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + if(data==null) + return; + pathImage_=(String)data; + + //chargement de l'image + if(pathImage_!=null){ + image_=Toolkit.getDefaultToolkit().getImage(pathImage_); + } +} + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorImage.java ___________________________________________________________________ Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,100 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetShape; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +/** + * Creator pour les objets graphiques de type shape. + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorShape implements EbliWidgetCreator { + + + EbliWidgetShape res; + + /** + * Le type de l objet a creer. + */ + ShapeCreator typeObject_; + + public ShapeCreator getTypeObject_() { + return typeObject_; + } + + + + public void setTypeObject_(ShapeCreator typeObject_) { + this.typeObject_ = typeObject_; + } + + + + public EbliWidgetCreatorShape(ShapeCreator _typeObject ) { + super(); + + typeObject_=_typeObject; + } + + public EbliWidgetCreatorShape() { + + } + + public EbliWidget create(EbliScene _scene) { + res= new EbliWidgetShape(_scene,typeObject_ ,null); + + return res; + } + + public EbliWidget getWidget() { + return res; + } + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorShape(getTypeObject_())); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + + + public EbliWidgetWithBordure getBordure() { + return null; + } + + + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + if(data==null) + typeObject_=new ShapeCreatorCircle(); + } + + +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorShape.java ___________________________________________________________________ Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,139 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Map; + +import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.fudaa.ebli.visuallibrary.EbliWidgetTextEditor; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + +/** + * creator Editeur de texte widget. + * + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorTextEditor implements EbliWidgetCreator { + + CtuluHtmlEditorPanel editorPane_; + // EbliWidgetTextEditor res; + EbliWidgetWithBordure res; + + static int Idcontenu=1; + + public EbliWidgetCreatorTextEditor(CtuluHtmlEditorPanel g) { + super(); + this.editorPane_ = g; + } + + public EbliWidgetCreatorTextEditor(){ + + } + + public CtuluHtmlEditorPanel getG() { + return editorPane_; + } + + public void setG(CtuluHtmlEditorPanel g) { + this.editorPane_ = g; + } + + public EbliWidget create(EbliScene _scene) { + + res = new EbliWidgetBordureSingle(new EbliWidgetTextEditor(_scene, getG())); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + CtuluHtmlEditorPanel editor=new CtuluHtmlEditorPanel(); + editor.setDocumentText(getG().getDocumentText()); + duplique.setCreator(new EbliWidgetCreatorTextEditor(editor)); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + + public EbliWidgetWithBordure getBordure() { + return res; + } + + + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + //ecriture du contenu html dans ce fichier + FileWriter writer; + try { + String path=(String)parameters.get("path"); + if(path !=null){ + File contenu=new File(path+File.separator+"contenu"+(Idcontenu++)+".html"); + writer = new FileWriter(contenu); + writer.write(editorPane_.getDocumentText()); + writer.close(); + return contenu.getAbsolutePath(); + } + return null; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + } + + @Override + public void setPersistData(Object data, Map parameters) { + editorPane_=new CtuluHtmlEditorPanel(); + + if(data==null) + return; + // TODO Auto-generated method stub + + try { + File contenu=new File((String)data); + InputStream ips=new FileInputStream(contenu); + InputStreamReader ipsr=new InputStreamReader(ips); + BufferedReader br=new BufferedReader(ipsr); + StringBuffer contentHTML=new StringBuffer(""); + String ligne; + while ((ligne=br.readLine())!=null) + contentHTML.append(ligne); + br.close(); + editorPane_.setDocumentText(contentHTML.toString()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } + } +} Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextEditor.java ___________________________________________________________________ Added: svn:mergeinfo + Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorTextLabel.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,84 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.fudaa.ebli.visuallibrary.EbliWidgetTextLabel; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; + + + +public class EbliWidgetCreatorTextLabel implements EbliWidgetCreator { + + String label_; + // EbliWidgetRectangle res; + EbliWidgetWithBordure res; + public EbliWidgetCreatorTextLabel(String g) { + super(); + this.label_ = g; + } + public EbliWidgetCreatorTextLabel(){ + + } + public String getG() { + return label_; + } + + public void setG(String g) { + this.label_ = g; + } + + public EbliWidget create(EbliScene _scene) { + res = new EbliWidgetBordureSingle(new EbliWidgetTextLabel(_scene, getG())); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + + EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorTextLabel(getG())); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + Point nouvellePosition = new Point(getWidget().getLocation().x, (int) (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + public EbliWidgetWithBordure getBordure() { + return res; + } + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + if(data==null) + label_=""; + } + + +} Copied: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java (from rev 4045, branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,66 @@ +/** + * Licence GPL + * Copyright Genesis + */ +package org.fudaa.ebli.visuallibrary.creator; + +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.netbeans.api.visual.widget.Widget; +import org.w3c.dom.Element; + +/** + * Creator permettant de cr\xE9er un groupe de widget simple. + * + * @author deniger + */ +public class EbliWidgetGroupCreator implements EbliWidgetCreator { + + EbliWidget w; + + public EbliWidget create(EbliScene _scene) { + return w; + } + + public EbliNode duplicate(EbliNode _nodeAdupliquer) { + return null; + } + + public EbliWidgetWithBordure getBordure() { + return null; + } + + /** + * @return the w + */ + public Widget getW() { + return w; + } + + public EbliWidget getWidget() { + return w; + } + + /** + * @param w the w to set + */ + public void setW(EbliWidget w) { + this.w = w; + } + + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + + } +} \ No newline at end of file Property changes on: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetGroupCreator.java ___________________________________________________________________ Added: svn:mergeinfo + Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -6,13 +6,16 @@ import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheModel; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; +import org.fudaa.ebli.courbe.EGModel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; /** @@ -55,6 +58,10 @@ } + public EbliWidgetCreatorGraphe(){ + + } + public EbliWidgetCreatorGraphe(EGFillePanel _pn) { super(); this.pn_ = _pn; @@ -99,16 +106,21 @@ return res; } -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } -@Override -public void setData(Object data) { - // TODO Auto-generated method stub - -} + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + EGGrapheModel modele; + if(data==null) + modele=new EGGrapheTreeModel(); + else + modele=(EGGrapheModel) data; + pn_=new EGFillePanel(new EGGraphe(modele)); + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -3,12 +3,13 @@ import java.util.Map; import org.fudaa.ebli.courbe.EGGraphe; +import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidget; import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.fudaa.ebli.visuallibrary.creator.EbliWidgetCreator; import org.w3c.dom.Element; public class EbliWidgetCreatorLegende implements EbliWidgetCreator { @@ -21,6 +22,10 @@ this.g = g; } + public EbliWidgetCreatorLegende(){ + + } + public EGGraphe getG() { return g; } @@ -47,16 +52,17 @@ return res; } -@Override -public void PersistData(Element elt, Map parameters) { - // TODO Auto-generated method stub - -} + @Override + public Object getPersistData(Map parameters) { + // TODO Auto-generated method stub + return null; + } -@Override -public void setData(Object data) { - // TODO Auto-generated method stub + @Override + public void setPersistData(Object data, Map parameters) { + // TODO Auto-generated method stub + if(data==null) + g=new EGGraphe(new EGGrapheTreeModel()); + } } - -} Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-08 14:12:33 UTC (rev 4047) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -1,94 +0,0 @@ -package org.fudaa.ebli.visuallibrary.persist; - -import java.awt.Paint; -import java.util.Iterator; - -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.ebli.ressource.EbliResource; -import org.fudaa.ebli.visuallibrary.EbliNode; -import org.fudaa.ebli.visuallibrary.EbliScene; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import com.anotherbigidea.flash.structs.Color; - -/** - * Classe qui se charge de sauvegarder le contenu de la ebliScene. - * - * @author Adrien Hadoux - * - */ -public class EbliScenePersist { - - - public final static String PROPERTIES = "PROPERTIES"; - public final static String TITLE="TITLE"; - public final static String BACKGROUND="BACKGROUND"; - - - /** - * Scene dont le contenu est a sauvegarder - */ - EbliScene scene_; - - /** - * titre associ\xE9 a la scene. Peut etre le titre de la frame qui affiche le - * layout par exemple - */ - String title_; - - - - public EbliScenePersist(EbliScene _scene, String _title) { - super(); - scene_ = _scene; - title_ = _title; - } - - /** - * genere le document qui contient le contenu de la scene. - * - * @return - */ - public Document createDescriptorScene(ProgressionInterface prog,String baliseLayout,String path) { - // creation du document - Document document = ManagerWidgetPersist.createDocument(); - if (document == null) - return null; - - // creation du root avec pour id le titre la frame - Element rootEle = document.createElement(baliseLayout); - document.appendChild(rootEle); - - rootEle.setAttribute(TITLE, title_); - - - // -- creation des proprietes graphiques de la scene --// - Element propertiesEle = document.createElement(PROPERTIES); - - - propertiesEle.setAttribute(BACKGROUND, ((java.awt.Color)scene_.getBackground()).toString()); - - - rootEle.appendChild(propertiesEle); - - - // -- liste des widgets On cree des objets sans contenus qui decrivent les - // widgets - Iterator<EbliNode> it = (Iterator<EbliNode>) scene_.getObjects().iterator(); - - while (it.hasNext()) { - EbliNode node = it.next(); - // mise a jour infos - prog.setDesc(EbliResource.EBLI.getString("Insertion de la frame ") + node.getTitle()); - - Element widgetEle = new EbliWidgetpersist(node).createDescriptorWidget(document, prog,path); - rootEle.appendChild(widgetEle); - } - return document; - } - - - - -} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliSceneSerializeXml.java 2008-10-08 17:44:48 UTC (rev 4048) @@ -0,0 +1,113 @@ +package org.fudaa.ebli.visuallibrary.persist; + +import java.awt.Color; +import java.awt.Dimension; + +import org.fudaa.ebli.visuallibrary.EbliScene; + +import com.sun.j3d.loaders.vrml97.impl.Background; + + +/** + * Classe utilis\xE9e par d\xE9faut pour la serialization xml avec xstream + * @author Adrien Hadoux + * + */ +public class EbliSceneSerializeXml { + +String title; +Color background; +int nbFrames; +int width; +int height; + +public EbliSceneSerializeXml(EbliScene scene,String title){ + + fillInfoWith(scene,title); + +} + + +private void fillInfoWith(EbliScene scene,String title){ + this.title=title; + this.background=(Color) scene.getBackground(); + this.nbFrames=scene.getObjects().size(); + if(scene.getView() !=null){ + this.width=scene.getView().getSize().width; + this.height=scene.getView().getSize().height; + } +} + + +/**... [truncated message content] |
From: <emm...@us...> - 2008-10-08 14:12:46
|
Revision: 4047 http://fudaa.svn.sourceforge.net/fudaa/?rev=4047&view=rev Author: emmanuel_martin Date: 2008-10-08 14:12:33 +0000 (Wed, 08 Oct 2008) Log Message: ----------- bug fixed : L'affichage des propri?\195?\169t?\195?\169s lors de selections multiples est maintenant correct. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java 2008-10-08 13:36:53 UTC (rev 4046) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java 2008-10-08 14:12:33 UTC (rev 4047) @@ -85,7 +85,9 @@ final String[] extendedChoices = new String[elements.length + 1]; extendedChoices[elements.length] = "< " + CtuluLib.getS("Ind\xE9fini") + " >"; System.arraycopy(elements, 0, extendedChoices, 0, elements.length); - return new BuComboBox(extendedChoices); + BuComboBox bu = new BuComboBox(extendedChoices); + bu.setSelectedIndex(elements.length); + return bu; } public JComponent createEditorComponent() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-10-08 13:37:10
|
Revision: 4046 http://fudaa.svn.sourceforge.net/fudaa/?rev=4046&view=rev Author: emmanuel_martin Date: 2008-10-08 13:36:53 +0000 (Wed, 08 Oct 2008) Log Message: ----------- modification du wizard d'import pour permettre de choisir l'ETAT_GEOM de chaque fichier import?\195?\169. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.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/FSigFileLoadResult.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderCsv.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGIS.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGrid.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderI.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderInp.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderPanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadBER.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadPRO.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadSEM.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRefluxRefondeResult.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarCox.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarInx.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderRubarSem.java 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/FSigFileLoaderSerafin.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderSinusX.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardFileMng.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardFileModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImport.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportStepDestination.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrGisProjectEditor.java Added Paths: ----------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISDataModelAttributAdapter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestGISDataModelAttributAdapter.java Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISDataModelAttributAdapter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISDataModelAttributAdapter.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISDataModelAttributAdapter.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -0,0 +1,226 @@ +/* + * @creation 7 oct. 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.ctulu.gis; + +import java.util.ArrayList; +import java.util.List; + +import org.fudaa.ctulu.CtuluLibArray; +import org.fudaa.ctulu.ProgressionInterface; + +import com.vividsolutions.jts.geom.Envelope; +import com.vividsolutions.jts.geom.Geometry; + +/** + * Cet Adapter permet d'ajouter d'attributs globaux au DataModel. + * @author Emmanuel MARTIN + * @version $Id:$ + */ +public class GISDataModelAttributAdapter implements GISDataModel{ + + // Le model adapt\xE9 + private GISDataModel dataModel_; + // Les nouveaux attributs + private List<GISAttributeInterface> newAttr_; + private List<Object[]> newValues_; + + public GISDataModelAttributAdapter(GISDataModel _dataModel){ + dataModel_ = _dataModel; + newAttr_ = new ArrayList<GISAttributeInterface>(1); + newValues_ = new ArrayList<Object[]>(1); + } + + /** + * Ajout un attribut pour tout les \xE9l\xE9ments si cet attribut n'existe pas d\xE9j\xE0. + * L'atomicit\xE9 (ou la globalit\xE9) de l'attribut est respect\xE9. + * @param _attr l'attribut a ajouter + * @param _value une valeur unique qui sera dupliquer pour toutes les g\xE9om\xE9tries + * @return 0 si l'attribut existe d\xE9j\xE0 (il n'est pas remplac\xE9) + * -2 si _attr ou _value sont null + */ + public int addAttribut(GISAttributeInterface _attr, Object _value){ + if(_attr==null||_value==null) + return -2; + if (dataModel_.getIndiceOf(_attr)==-1 && !newAttr_.contains(_attr)) { + newAttr_.add(_attr); + // Attribut atomique + if (_attr.isAtomicValue()) { + Object[] tmp=new Object[dataModel_.getNumGeometries()]; + for (int i=0; i<tmp.length; i++) + tmp[i]=_attr.createDataForGeom(_value, dataModel_.getGeometry(i).getNumPoints()); + newValues_.add(tmp); + } + // Attribut global + else { + Object[] tmp=new Object[dataModel_.getNumGeometries()]; + for (int i=0; i<tmp.length; i++) + tmp[i]=_value; + newValues_.add(tmp); + } + return 1; + } + else + return 0; + } + + /** + * Ajout un attribut pour tout les \xE9l\xE9ments si cet attribut n'existe pas d\xE9j\xE0. + * si _attr est un attribut atomique, chaque valeur sera dupliqu\xE9 pour + * chaque sommet de la g\xE9om\xE9trie. + * @param _attr l'attribut a ajouter + * @param _values une valeur pour chaque g\xE9om\xE9trie. + * @return 0 si l'attribut existe d\xE9j\xE0 (il n'est pas remplac\xE9) + * -1 en cas de tableau _values de mauvaise taille + * -2 si _attr ou _values sont null + */ + public int addAttribut(GISAttributeInterface _attr, Object[] _values){ + if(_attr==null||_values==null) + return -2; + if(dataModel_.getIndiceOf(_attr) == -1 && !newAttr_.contains(_attr)){ + if(_values.length != dataModel_.getNumGeometries()) + return -1; + // Attribut atomique + if (_attr.isAtomicValue()) { + Object[] tmp=new Object[dataModel_.getNumGeometries()]; + for (int i=0; i<tmp.length; i++) + tmp[i]=_attr.createDataForGeom(_values[i], dataModel_.getGeometry(i).getNumPoints()); + newAttr_.add(_attr); + newValues_.add(tmp); + } + // Attribut global + else { + newAttr_.add(_attr); + newValues_.add(_values); + } + return 1; + } + else + return 0; + } + + /** + * Ajout un attribut pour tout les \xE9l\xE9ments si cet attribut n'existe pas d\xE9j\xE0. + * Cette m\xE9thode n'est d\xE9finie que pour les attributs atomiques. + * @param _attr l'attribut a ajouter + * @param _values une valeur pour chaque sommet de chaque g\xE9om\xE9trie. + * @return 0 si l'attribut existe d\xE9j\xE0 (il n'est pas remplac\xE9) + * -1 en cas de tableau _values de mauvaise taille + * -2 si _attr ou _values sont null + * -3 si l'attribut n'est pas atomique + */ + public int addAttribut(GISAttributeInterface _attr, Object[][] _values){ + if(_attr==null||_values==null) + return -2; + if (_attr.isAtomicValue()) + if (dataModel_.getIndiceOf(_attr)==-1 && !newAttr_.contains(_attr)) { + if (_values.length!=dataModel_.getNumGeometries()) + return -1; + // Attribut atomique + Object[] tmp=new Object[dataModel_.getNumGeometries()]; + for (int i=0; i<tmp.length; i++){ + if(_values[i].length != dataModel_.getGeometry(i).getNumPoints()) + return -1; + tmp[i]=_attr.createDataForGeom(_values[i], _values[i].length); + } + newAttr_.add(_attr); + newValues_.add(tmp); + return 1; + } + else + return 0; + else + return -3; + } + + /* (non-Javadoc) + * @see org.fudaa.ctulu.gis.GISDataModel#getAttribute(int) + */ + public GISAttributeInterface getAttribute(int att) { + if(att<0) + return null; + if (dataModel_.getNbAttributes() > att) + return dataModel_.getAttribute(att); + else if(newAttr_.size() > att - dataModel_.getNbAttributes()) + return newAttr_.get(att - dataModel_.getNbAttributes()); + else return null; + } + + /* (non-Javadoc) + * @see org.fudaa.ctulu.gis.GISDataModel#getDoubleValue(int, int) + */ + public double getDoubleValue(int att, int geom) { + if(att>=0&&geom>=0){ + if (dataModel_.getNbAttributes() > att) + return dataModel_.getDoubleValue(att, geom); + else if(newAttr_.size() > att - dataModel_.getNbAttributes()) + return (Double)newValues_.get(att)[geom]; + else return 0; + } + return 0; + } + + /* (non-Javadoc) + * @see org.fudaa.ctulu.gis.GISDataModel#getEnvelopeInternal() + */ + public Envelope getEnvelopeInternal() { + return dataModel_.getEnvelopeInternal(); + } + + /* (non-Javadoc) + * @see org.fudaa.ctulu.gis.GISDataModel#getGeometry(int) + */ + public Geometry getGeometry(int geom) { + if(geom<0||geom>=getNumGeometries()) + return null; + return dataModel_.getGeometry(geom); + } + + /* (non-Javadoc) + * @see org.fudaa.ctulu.gis.GISDataModel#getIndiceOf(org.fudaa.ctulu.gis.GISAttributeInterface) + */ + public int getIndiceOf(GISAttributeInterface _att) { + if(dataModel_.getIndiceOf(_att) != -1) + return dataModel_.getIndiceOf(_att); + else if(CtuluLibArray.findObjectEgalEgal(newAttr_, _att)!=-1) + return dataModel_.getNbAttributes()+CtuluLibArray.findObjectEgalEgal(newAttr_, _att); + else return -1; + } + + /* (non-Javadoc) + * @see org.fudaa.ctulu.gis.GISDataModel#getNbAttributes() + */ + public int getNbAttributes() { + return dataModel_.getNbAttributes()+newAttr_.size(); + } + + /* (non-Javadoc) + * @see org.fudaa.ctulu.gis.GISDataModel#getNumGeometries() + */ + public int getNumGeometries() { + return dataModel_.getNumGeometries(); + } + + /* (non-Javadoc) + * @see org.fudaa.ctulu.gis.GISDataModel#getValue(int, int) + */ + public Object getValue(int att, int geom) { + if(att<0||geom<0) return null; + if (dataModel_.getNbAttributes() > att && geom < dataModel_.getNumGeometries()) + return dataModel_.getValue(att, geom); + else if(newAttr_.size() > att - dataModel_.getNbAttributes() && geom < dataModel_.getNumGeometries()) + return newValues_.get(att - dataModel_.getNbAttributes())[geom]; + return null; + } + + /* (non-Javadoc) + * @see org.fudaa.ctulu.gis.GISDataModel#preload(org.fudaa.ctulu.gis.GISAttributeInterface[], org.fudaa.ctulu.ProgressionInterface) + */ + public void preload(GISAttributeInterface[] _att, ProgressionInterface _prog) { + dataModel_.preload(_att, _prog); + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISDataModelAttributAdapter.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISLib.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -650,6 +650,9 @@ if (GISAttributeConstants.TITRE.getID().equals(_name)) { return GISAttributeConstants.TITRE; } + else if (GISAttributeConstants.ETAT_GEOM.getID().equals(_name)) { + return GISAttributeConstants.ETAT_GEOM; + } return new GISAttributeString(_name); } else if (!Geometry.class.isAssignableFrom(_c)) { return new GISAttribute(CtuluValueEditorDefaults.STRING_EDITOR, _name); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -333,8 +333,9 @@ public int getIndiceOf(final GISAttributeInterface _att) { if (attListHasChanged_) { att2Idx_.clear(); - for (int i=0; i<attr_.length; i++) - att2Idx_.put(attr_[i].getAttribute(),new Integer(i)); + if(attr_!=null) + for (int i=0; i<attr_.length; i++) + att2Idx_.put(attr_[i].getAttribute(),new Integer(i)); attListHasChanged_=false; } Integer idx=att2Idx_.get(_att); Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestGISDataModelAttributAdapter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestGISDataModelAttributAdapter.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestGISDataModelAttributAdapter.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -0,0 +1,303 @@ +/* + * @creation 8 oct. 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.ctulu.gis; + +import junit.framework.TestCase; + +import org.fudaa.ctulu.gui.CtuluValueEditorDouble; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.Point; + +/** + * Test de la classe GISDataModelAttributAdapter. + * @author Emmanuel MARTIN + * @version $Id:$ + */ +public class TestGISDataModelAttributAdapter extends TestCase { + + private GISZoneCollection zoneEmpty_; + private GISZoneCollection zoneNoEmpty_; + private GISAttributeInterface[] attr_; + private Geometry[] geometries_; + private GISDataModelAttributAdapter adapterInitialised_; + + /** + * @param name + */ + public TestGISDataModelAttributAdapter(String name) { + super(name); + } + + public void testAddAttribut_1(){ + // TEST SUR LA ZONE NON VIDE \\ + // Test de la valeur de retour Sur un attribut global + assertEquals(1, adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI)); + assertEquals(0, adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI)); + // Test de de la valeur de retour sur un attribut atomique + GISAttribute attr = new GISAttribute(new CtuluValueEditorDouble(), "MyAttributAtomique", true); + assertEquals(1, adapterInitialised_.addAttribut(attr, new Double(2))); + assertEquals(0, adapterInitialised_.addAttribut(attr, new Double(12))); + // Test de coh\xE9rence des attributs + assertEquals(GISAttributeConstants.ETAT_GEOM, adapterInitialised_.getAttribute(attr_.length)); + assertEquals(attr, adapterInitialised_.getAttribute(attr_.length+1)); + // Test de coh\xE9rence des valeurs d'attribut + assertEquals(GISAttributeConstants.ATT_VAL_ETAT_MODI, adapterInitialised_.getValue(adapterInitialised_.getNbAttributes()-2, 0)); + assertEquals(GISAttributeConstants.ATT_VAL_ETAT_MODI, adapterInitialised_.getValue(adapterInitialised_.getNbAttributes()-2, adapterInitialised_.getNumGeometries()-1)); + Object result = adapterInitialised_.getValue(adapterInitialised_.getNbAttributes()-1, 0); + assertTrue(result instanceof GISAttributeModelObjectArray); + assertNotNull(result); + GISAttributeModelObjectArray expected = (GISAttributeModelObjectArray)attr.createDataForGeom(new Double(2), zoneNoEmpty_.getGeometry(0).getNumPoints()); + assertEquals(expected.getSize(), ((GISAttributeModelObjectArray)result).getSize()); + for(int i=0;i<expected.getSize();i++) + assertEquals(expected.getValue(i), ((GISAttributeModelObjectArray)result).getValue(i)); + + // TEST SUR LA ZONE VIDE \\ + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(zoneEmpty_); + // Test de la valeur de retour Sur un attribut global + assertEquals(1, adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI)); + assertEquals(0, adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI)); + // Test de de la valeur de retour sur un attribut atomique + assertEquals(1, adapter.addAttribut(attr, new Double(2))); + assertEquals(0, adapter.addAttribut(attr, new Double(12))); + // Test de coh\xE9rence des attributs + assertEquals(GISAttributeConstants.ETAT_GEOM, adapter.getAttribute(0)); + assertEquals(attr, adapter.getAttribute(1)); + + // TEST AVEC VALEURS NULL \\ + assertEquals(-2, adapterInitialised_.addAttribut(null, new Double(2))); + assertEquals(-2, adapterInitialised_.addAttribut(GISAttributeConstants.VISIBILITE, null)); + assertEquals(-2, adapterInitialised_.addAttribut(null, null)); + } + + public void testAddAttribut_2(){ + // TEST SUR LA ZONE NON VIDE \\ + // Test de la valeur de retour Sur un attribut global + Object[] valuesEtatGeom = new Object[geometries_.length]; + for(int i=0;i<geometries_.length;i++) + if(i>0 && valuesEtatGeom[i-1]==GISAttributeConstants.ATT_VAL_ETAT_ORIG) + valuesEtatGeom[i]=GISAttributeConstants.ATT_VAL_ETAT_MODI; + else + valuesEtatGeom[i]=GISAttributeConstants.ATT_VAL_ETAT_ORIG; + assertEquals(-1, adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, new Object[0])); + assertEquals(1, adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, valuesEtatGeom)); + assertEquals(0, adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, valuesEtatGeom)); + // Test de de la valeur de retour sur un attribut atomique + Object[] valuesMyAttr = new Object[geometries_.length]; + for(int i=0;i<geometries_.length;i++) + valuesMyAttr[i]=new Double(i); + GISAttribute attr = new GISAttribute(new CtuluValueEditorDouble(), "MyAttributAtomique", true); + assertEquals(1, adapterInitialised_.addAttribut(attr, valuesMyAttr)); + assertEquals(0, adapterInitialised_.addAttribut(attr, valuesMyAttr)); + // Test de coh\xE9rence des attributs + assertEquals(GISAttributeConstants.ETAT_GEOM, adapterInitialised_.getAttribute(attr_.length)); + assertEquals(attr, adapterInitialised_.getAttribute(attr_.length+1)); + // Test de coh\xE9rence des valeurs d'attribut + assertEquals(valuesEtatGeom[0], adapterInitialised_.getValue(adapterInitialised_.getNbAttributes()-2, 0)); + assertEquals(valuesEtatGeom[adapterInitialised_.getNumGeometries()-1], adapterInitialised_.getValue(adapterInitialised_.getNbAttributes()-2, adapterInitialised_.getNumGeometries()-1)); + Object result = adapterInitialised_.getValue(adapterInitialised_.getNbAttributes()-1, 0); + assertTrue(result instanceof GISAttributeModelObjectArray); + assertNotNull(result); + GISAttributeModelObjectArray expected = (GISAttributeModelObjectArray)attr.createDataForGeom(valuesMyAttr[0], zoneNoEmpty_.getGeometry(0).getNumPoints()); + assertEquals(expected.getSize(), ((GISAttributeModelObjectArray)result).getSize()); + for(int i=0;i<expected.getSize();i++) + assertEquals(expected.getValue(i), ((GISAttributeModelObjectArray)result).getValue(i)); + + // TEST SUR LA ZONE VIDE \\ + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(zoneEmpty_); + // Test de la valeur de retour Sur un attribut global + assertEquals(-1, adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, valuesEtatGeom)); + assertEquals(1, adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, new Object[0])); + assertEquals(0, adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, new Object[0])); + // Test de de la valeur de retour sur un attribut atomique + assertEquals(-1, adapter.addAttribut(attr, valuesMyAttr)); + assertEquals(1, adapter.addAttribut(attr, new Object[0])); + assertEquals(0, adapter.addAttribut(attr, new Object[0])); + // Test de coh\xE9rence des attributs + assertEquals(GISAttributeConstants.ETAT_GEOM, adapter.getAttribute(0)); + assertEquals(attr, adapter.getAttribute(1)); + + // TEST AVEC VALEURS NULL \\ + assertEquals(-2, adapterInitialised_.addAttribut(null, new Double[geometries_.length])); + } + + public void testAddAttribut_3(){ + // TEST SUR LA ZONE NON VIDE \\ + // Test de la valeur de retour Sur un attribut global + assertEquals(-3, adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, new Object[0][0])); + // Test de de la valeur de retour sur un attribut atomique + Object[][] valuesMyAttr = new Object[geometries_.length][]; + for(int i=0;i<geometries_.length;i++){ + valuesMyAttr[i] = new Object[geometries_[i].getNumPoints()]; + for(int j=0;j<valuesMyAttr[i].length;j++) + valuesMyAttr[i][j] = new Double(i+j); + } + GISAttribute attr = new GISAttribute(new CtuluValueEditorDouble(), "MyAttributAtomique", true); + assertEquals(-1, adapterInitialised_.addAttribut(attr, new Object[0][0])); + assertEquals(-1, adapterInitialised_.addAttribut(attr, new Object[geometries_.length][0])); + assertEquals(1, adapterInitialised_.addAttribut(attr, valuesMyAttr)); + assertEquals(0, adapterInitialised_.addAttribut(attr, valuesMyAttr)); + // Test de coh\xE9rence des attributs + assertEquals(attr, adapterInitialised_.getAttribute(attr_.length)); + // Test de coh\xE9rence des valeurs d'attribut + Object result = adapterInitialised_.getValue(adapterInitialised_.getNbAttributes()-1, 0); + assertTrue(result instanceof GISAttributeModelObjectArray); + assertNotNull(result); + GISAttributeModelObjectArray expected = (GISAttributeModelObjectArray)attr.createDataForGeom(valuesMyAttr[0], zoneNoEmpty_.getGeometry(0).getNumPoints()); + assertEquals(expected.getSize(), ((GISAttributeModelObjectArray)result).getSize()); + for(int i=0;i<expected.getSize();i++) + assertEquals(expected.getValue(i), ((GISAttributeModelObjectArray)result).getValue(i)); + + + // TEST SUR LA ZONE VIDE \\ + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(zoneEmpty_); + // Test de la valeur de retour Sur un attribut global + assertEquals(-3, adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, new Object[0][0])); + // Test de de la valeur de retour sur un attribut atomique + assertEquals(-1, adapter.addAttribut(attr, valuesMyAttr)); + assertEquals(1, adapter.addAttribut(attr, new Object[0][])); + assertEquals(0, adapter.addAttribut(attr, new Object[0][])); + // Test de coh\xE9rence des attributs + assertEquals(attr, adapter.getAttribute(0)); + + // TEST AVEC VALEURS NULL \\ + assertEquals(-2, adapterInitialised_.addAttribut(null, new Double[geometries_.length][])); + assertEquals(-2, adapterInitialised_.addAttribut(null, new Double[geometries_.length][0])); + } + + public void testGetAttribut(){ + adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI); + assertEquals(attr_[0], adapterInitialised_.getAttribute(0)); + assertEquals(GISAttributeConstants.ETAT_GEOM, adapterInitialised_.getAttribute(attr_.length)); + assertNull(adapterInitialised_.getAttribute(-1)); + assertNull(adapterInitialised_.getAttribute(attr_.length+1)); + } + + public void testGetDoubleValue(){ + adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI); + assertEquals((Double)GISAttributeConstants.BATHY.getDefaultValue(), adapterInitialised_.getDoubleValue(0, 0), 0.00001); + assertEquals(0.0, adapterInitialised_.getDoubleValue(-1, 0), 0.00001); + assertEquals(0.0, adapterInitialised_.getDoubleValue(0, -1), 0.00001); + assertEquals(0.0, adapterInitialised_.getDoubleValue(-1, -1), 0.00001); + } + + public void testGetEnvelopeInternal(){ + adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI); + assertEquals(zoneNoEmpty_.getEnvelopeInternal(), adapterInitialised_.getEnvelopeInternal()); + } + + public void testGetGeometry(){ + adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI); + assertEquals(geometries_[0], adapterInitialised_.getGeometry(0)); + assertEquals(geometries_[attr_.length-1], adapterInitialised_.getGeometry(attr_.length-1)); + assertNull(adapterInitialised_.getGeometry(-1)); + assertNull(adapterInitialised_.getGeometry(attr_.length)); + } + + public void testGetIndiceOf(){ + adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI); + assertEquals(0, adapterInitialised_.getIndiceOf(attr_[0])); + assertEquals(attr_.length-1, adapterInitialised_.getIndiceOf(attr_[attr_.length-1])); + assertEquals(attr_.length, adapterInitialised_.getIndiceOf(GISAttributeConstants.ETAT_GEOM)); + assertEquals(-1, adapterInitialised_.getIndiceOf(GISAttributeConstants.VISIBILITE)); + assertEquals(-1, adapterInitialised_.getIndiceOf(null)); + } + + public void testGetNbAttributes(){ + assertEquals(attr_.length, adapterInitialised_.getNbAttributes()); + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(zoneEmpty_); + assertEquals(0, adapter.getNbAttributes()); + adapterInitialised_.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI); + assertEquals(attr_.length+1, adapterInitialised_.getNbAttributes()); + adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.ATT_VAL_ETAT_MODI); + assertEquals(1, adapter.getNbAttributes()); + } + + public void testGetNumGeometries(){ + assertEquals(geometries_.length, adapterInitialised_.getNumGeometries()); + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(zoneEmpty_); + assertEquals(0, adapter.getNumGeometries()); + } + + public void testGetValue(){ + GISAttributeModelDoubleArray reel = (GISAttributeModelDoubleArray) GISAttributeConstants.BATHY.createDataForGeom(GISAttributeConstants.BATHY.getDefaultValue(), geometries_[0].getNumGeometries()); + Object actual = adapterInitialised_.getValue(0, 0); + assertTrue(actual instanceof GISAttributeModelDoubleArray); + assertNotNull(actual); + assertTrue(reel.getSize()==((GISAttributeModelDoubleArray)actual).getSize()); + for(int i=0;i<reel.getSize();i++) + assertEquals((Double)reel.getValue(i),(Double) ((GISAttributeModelDoubleArray)actual).getValue(i), 0.00001); + + Object result = GISAttributeConstants.NATURE.createDataForGeom(GISAttributeConstants.NATURE.getDefaultValue(), geometries_[0].getNumGeometries()); + assertEquals(result, (String)adapterInitialised_.getValue(1, 0)); + + GISAttributeModelObjectArray reel2 = (GISAttributeModelObjectArray) attr_[2].createDataForGeom(attr_[2].getDefaultValue(), geometries_[0].getNumGeometries()); + actual = adapterInitialised_.getValue(2, 0); + assertTrue(actual instanceof GISAttributeModelObjectArray); + assertNotNull(actual); + assertTrue(reel2.getSize()==((GISAttributeModelObjectArray)actual).getSize()); + for(int i=0;i<reel2.getSize();i++) + assertEquals(reel2.getValue(i),((GISAttributeModelObjectArray)actual).getValue(i)); + + reel2 = (GISAttributeModelObjectArray) attr_[2].createDataForGeom(attr_[2].getDefaultValue(), geometries_[1].getNumGeometries()); + actual = adapterInitialised_.getValue(2, 1); + assertTrue(actual instanceof GISAttributeModelObjectArray); + assertNotNull(actual); + assertTrue(reel2.getSize()==((GISAttributeModelObjectArray)actual).getSize()); + for(int i=0;i<reel2.getSize();i++) + assertEquals(reel2.getValue(i),((GISAttributeModelObjectArray)actual).getValue(i)); + + assertNull(adapterInitialised_.getValue(-1, 0)); + assertNull(adapterInitialised_.getValue(0, -1)); + assertNull(adapterInitialised_.getValue(-1, -1)); + assertNull(adapterInitialised_.getValue(attr_.length, 0)); + assertNull(adapterInitialised_.getValue(0, geometries_.length)); + assertNull(adapterInitialised_.getValue(attr_.length, geometries_.length)); + } + + /* (non-Javadoc) + * @see junit.framework.TestCase#setUp() + */ + protected void setUp() throws Exception { + super.setUp(); + zoneEmpty_ = new GISZoneCollectionGeometry(); + zoneNoEmpty_ = new GISZoneCollectionGeometry(); + // Ajout d'attributs \\ + attr_ = new GISAttributeInterface[]{ + GISAttributeConstants.BATHY, + GISAttributeConstants.NATURE, + new GISAttribute(new CtuluValueEditorDouble(), "MyAttribut", true) + }; + zoneNoEmpty_.setAttributes(attr_, null); + // Ajout de g\xE9om\xE9tries \\ + geometries_ = new Geometry[]{ + GISGeometryFactory.INSTANCE.createPoint(0, 0, 0), + GISGeometryFactory.INSTANCE.createMultiPoint(new Point[]{GISGeometryFactory.INSTANCE.createPoint(1, 2, 3), GISGeometryFactory.INSTANCE.createPoint(4, 5, 6)}), + GISGeometryFactory.INSTANCE.createLinearRing(new Coordinate[]{new Coordinate(7, 8), new Coordinate(4, 10), new Coordinate(9, 10), new Coordinate(7, 8)}) + }; + for (int j=0; j<geometries_.length; j++) { + Object[] attrModel=new Object[attr_.length]; + for (int i=0; i<attr_.length; i++) + attrModel[i] =attr_[i].createDataForGeom(attr_[i].getDefaultValue(), geometries_[j].getNumPoints()); + zoneNoEmpty_.addGeometry(geometries_[j], attrModel, null); + } + adapterInitialised_ = new GISDataModelAttributAdapter(zoneNoEmpty_); + } + + /* (non-Javadoc) + * @see junit.framework.TestCase#tearDown() + */ + protected void tearDown() throws Exception { + super.tearDown(); + zoneEmpty_=null; + zoneNoEmpty_=null; + attr_=null; + } + +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/gis/TestGISDataModelAttributAdapter.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -758,9 +758,9 @@ if (geometries_ == null) { return false; } - geometries_.removeGeometries(_idx, _cmd); for(int i=0 ; i<_idx.length;i++) setGeomModif(_idx[i], _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie + geometries_.removeGeometries(_idx, _cmd); return true; } 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 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlEditionManager.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -8,50 +8,39 @@ package org.fudaa.fudaa.modeleur; import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import javax.swing.filechooser.FileFilter; - import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.CtuluRunnable; -import org.fudaa.ctulu.CtuluTaskDelegate; import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.ctulu.gis.factory.GISExportDataStoreFactory; import org.fudaa.ctulu.gui.CtuluDialogPanel; -import org.fudaa.ctulu.gui.CtuluFileChooser; -import org.fudaa.ctulu.gui.CtuluFileChooserTestWritable; import org.fudaa.ctulu.gui.CtuluLibSwing; -import org.fudaa.dodico.rubar.io.RubarStCnFileFormat; -import org.fudaa.dodico.telemac.io.SinusxFileFormat; import org.fudaa.ebli.calque.BCalque; +import org.fudaa.ebli.calque.BGroupeCalque; +import org.fudaa.ebli.calque.ZCalqueAffichageDonnees; import org.fudaa.ebli.calque.action.SceneSplitAction; import org.fudaa.ebli.calque.edition.ZCalqueEditable; import org.fudaa.ebli.commun.EbliActionAbstract; import org.fudaa.ebli.commun.EbliActionInterface; import org.fudaa.fudaa.commun.FudaaLib; -import org.fudaa.fudaa.commun.impl.FudaaGuiLib; -import org.fudaa.fudaa.commun.save.FudaaSaveLib; -import org.fudaa.fudaa.commun.save.FudaaSaveZipLoader; +import org.fudaa.fudaa.modeleur.action.CalqueNewCalqueAction; import org.fudaa.fudaa.modeleur.action.SceneDecimationAction; import org.fudaa.fudaa.modeleur.action.SceneInterpolationAction; import org.fudaa.fudaa.modeleur.action.SceneMoveInLayerAction; import org.fudaa.fudaa.modeleur.action.SceneProjectionAction; import org.fudaa.fudaa.modeleur.action.SceneRefinementAction; +import org.fudaa.fudaa.modeleur.layer.MdlLayerFactory; +import org.fudaa.fudaa.modeleur.layer.MdlLayerInterface; +import org.fudaa.fudaa.ressource.FudaaResource; import org.fudaa.fudaa.sig.layer.FSigEditor; import org.fudaa.fudaa.sig.layer.FSigLayerExporter; import org.fudaa.fudaa.sig.layer.FSigLayerFilter; +import org.fudaa.fudaa.sig.layer.FSigLayerGroup; import org.fudaa.fudaa.sig.layer.FSigVisuPanel; -import org.geotools.data.FileDataStoreFactorySpi; -import com.memoire.bu.BuFileFilter; import com.memoire.bu.BuWizardDialog; -import com.memoire.fu.FuLog; /** * Un manager pour l'\xE9dition des calques SIG. @@ -93,7 +82,21 @@ */ public void importSelectedLayer() { final ZCalqueEditable ed = super.getTarget(); - final MdlWizardImport importWizard = new MdlWizardImport(getEnglobPolygone(), ed, + + BGroupeCalque dest = null; + BCalque parent = null; + if (ed == null) { + parent = super.getPanel().getArbreCalqueModel().getSelectedCalque(); + } else { + parent = (BCalque) ((BCalque) ed).getParent(); + } + if (parent instanceof BGroupeCalque) { + dest = (BGroupeCalque) parent; + } else { + return; + } + + final MdlWizardImport importWizard = new MdlWizardImport(dest, this, getEnglobPolygone(), ed, ((FSigVisuPanel) getPanel()).getImpl(),((FSigVisuPanel) getPanel()).getCmdMng()); final BuWizardDialog dialog = new BuWizardDialog(CtuluLibSwing.getFrameAncestorHelper(super.getPanel()), importWizard); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlWizardImport.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -7,6 +7,15 @@ */ package org.fudaa.fudaa.modeleur; +import java.awt.Dimension; +import java.util.Map; + +import javax.swing.JComponent; +import javax.swing.event.ListDataEvent; +import javax.swing.event.ListDataListener; +import javax.swing.event.TableModelEvent; +import javax.swing.event.TableModelListener; + import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.CtuluCommandComposite; import org.fudaa.ctulu.CtuluCommandManager; @@ -19,18 +28,29 @@ import org.fudaa.ctulu.gis.GISDataModel; import org.fudaa.ctulu.gis.GISDataModelFilterAdapter; import org.fudaa.ctulu.gis.GISDataModelPointMultiPointAdapter; +import org.fudaa.ctulu.gis.GISDataModelPointPolyAdapter; import org.fudaa.ctulu.gis.GISPolygone; import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee; import org.fudaa.ctulu.gis.GISZoneCollectionMultiPoint; +import org.fudaa.ctulu.gis.GISZoneCollectionPoint; +import org.fudaa.ebli.calque.BGroupeCalque; +import org.fudaa.ebli.calque.ZCalqueAffichageDonnees; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.calque.edition.ZCalqueEditable; +import org.fudaa.ebli.calque.edition.ZCalqueEditionGroup; import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.modeleur.layer.MdlLayer2dLine; import org.fudaa.fudaa.modeleur.layer.MdlLayer2dMultiPoint; +import org.fudaa.fudaa.modeleur.layer.MdlLayerFactory; +import org.fudaa.fudaa.modeleur.layer.MdlLayerInterface; import org.fudaa.fudaa.modeleur.layer.MdlModel2dLine; import org.fudaa.fudaa.modeleur.layer.MdlModel2dMultiPoint; +import org.fudaa.fudaa.sig.FSigExportImportAttributesMapper; import org.fudaa.fudaa.sig.FSigLib; +import org.fudaa.fudaa.sig.layer.FSigEditor; +import org.fudaa.fudaa.sig.wizard.FSigFileLoaderPanel; import org.fudaa.fudaa.sig.wizard.FSigWizardImport; +import org.fudaa.fudaa.sig.wizard.FSigWizardImportStepDestination; /** * Un wizard d'import de donn\xE9es dans le calque cible. Il est limit\xE9 \xE0 1 etape. @@ -40,17 +60,75 @@ public class MdlWizardImport extends FSigWizardImport { CtuluCommandManager mng_; + private BGroupeCalque mdlDest_; + private FSigEditor mdlEditor_; + + + /** * @param _previewZone * @param _selectedLayer * @param _impl */ - public MdlWizardImport(GISPolygone[] _previewZone, ZCalqueEditable _selectedLayer, CtuluUI _impl, CtuluCommandManager _mng) { + public MdlWizardImport(BGroupeCalque _dest, FSigEditor _editor, GISPolygone[] _previewZone, ZCalqueEditable _selectedLayer, CtuluUI _impl, CtuluCommandManager _mng) { super(null, _previewZone, _selectedLayer, _impl); mng_=_mng; + mdlDest_=_dest; + mdlEditor_=_editor; + + // Exemple de cr\xE9ation d'un sous calque pour un BGroupeCalque + /* + int cqType_ = MdlLayerFactory.LAYER2D_CLOUD; + ZCalqueAffichageDonnees cq=MdlLayerFactory.getInstance().createLayer(cqType_, editor_); + cq.setName(BGroupeCalque.findUniqueChildName(parent_, ((MdlLayerInterface)cq).getExtName())); + parent_.enDernier(cq); + */ } + + public JComponent getStepComponent() { + if (current_ == 0) { + if (fileLoader_ == null) { + srcAtt_.addListDataListener(new ListDataListener() { - @Override + public void contentsChanged(final ListDataEvent _e) { + rebuildAtt(); + } + + public void intervalAdded(final ListDataEvent _e) { + rebuildAtt(); + } + + public void intervalRemoved(final ListDataEvent _e) { + rebuildAtt(); + } + }); + fileLoader_ = new FSigFileLoaderPanel(srcAtt_, impl_, previewZone_); + fileLoader_.setPreferredSize(new Dimension(450, 400)); + fileLoader_.setAttributeRequired(false); + fileLoader_.getFileMng().getModel().addTableModelListener(new TableModelListener() { + + public void tableChanged(final TableModelEvent _e) { + data_ = null; + } + }); + } + return fileLoader_; + } else if (current_ == 1) { + if (mapper_ == null) { + if (dest_!=null && dest_.getAttributes()!=null) + mapper_ = new FSigExportImportAttributesMapper(src_, dest_.getAttributes(), false); + } + if (pnDest_==null) pnDest_=new FSigWizardImportStepDestination(mdlDest_); + pnDest_.setMapper(mapper_); + pnDest_.setSrc(data_); + pnDest_.setSelectedLayer(selectedLayer_); + pnDest_.update(); + return pnDest_; + } + return null; + } + + public void doTask() { CtuluAnalyze analyze=new CtuluAnalyze(); if (data_==null) data_ = fileLoader_.loadAll(null, analyze); @@ -124,12 +202,84 @@ } if (mng_!=null) mng_.addCmd(cmp.getSimplify()); } + + /*protected void importData(final ProgressionInterface _prog) { + if (data_ == null || mapper_ == null) { + return; + } + final Map r = mapper_.getDestReadMap(); + final GISAttributeInterface[] dest = dest_.getAttributes(); + final GISAttributeInterface[] attChosen = new GISAttributeInterface[dest == null ? 0 : dest.length]; + boolean doPost = true; + for (int i = attChosen.length - 1; i >= 0; i--) { + // dest n'est pas null ici + attChosen[i] = (GISAttributeInterface) r.get(dest[i]); + if (dest[i] == GISAttributeConstants.BATHY && attChosen[i] != null) { + doPost = false; + } + } + data_.preload(attChosen, _prog); + final CtuluCommandComposite cmp = new CtuluCommandComposite(); + if (pnDest_.importPoint_.isOk() && data_.getNbPoints() > 0) { + // creation du calque de dest. + final GISZoneCollectionPoint pt = createPointLayer(cmp); + final GISDataModel[] pts = data_.getPoints(); + final int nb = pts.length; + for (int i = 0; i < nb; i++) { + final GISDataModel model = GISDataModelFilterAdapter.buildPointAdapter(pts[i], attChosen); + pt.addAll(model, cmp, false); + } + } + if (pnDest_.importLignes_.isOk()) { + GISZoneCollectionLigneBrisee line = null; + if (data_.getNbPolygones() > 0 || data_.getNbPolylignes() > 0) { + // creation du calque de dest. + line = createLineLayer(cmp); + GISDataModel[] lines = data_.getPolylignes(); + if (line != null) { + final int nb = lines.length; + for (int i = 0; i < nb; i++) { + final GISDataModel model = GISDataModelFilterAdapter.buildLigneAdapter(lines[i], attChosen); + line.addAll(model, cmp, doPost); + } + } + lines = data_.getPolygones(); + if (lines != null && line != null) { + final int nb = lines.length; + for (int i = 0; i < nb; i++) { + final GISDataModel model = GISDataModelFilterAdapter.buildLigneAdapter(lines[i], attChosen); + line.addAll(model, cmp, doPost); + } + } + } + if (pnDest_.cbImportLignesFromPt_.isSelected() && data_.getNbPoints() > 0) { + final GISDataModel[] pts = data_.getPoints(); + final int nb = pts.length; + final GISDataModelPointPolyAdapter.PolyOption option = new GISDataModelPointPolyAdapter.PolyOption(); + if (pnDest_.cmbImpLinesFromPt_.getSelectedIndex() == 1) { + option.setPoly(); + } else if (pnDest_.cmbImpLinesFromPt_.getSelectedIndex() == 2) { + option.setCheck(); + } + for (int i = 0; i < nb; i++) { + if (pts[i].getNumGeometries() > 2) { + if (line == null) { + line = createLineLayer(cmp); + } + line.addAll(new GISDataModelPointPolyAdapter(pts[i], attChosen, option), cmp, doPost); + } + } + } + } + + dest_.getCmdMng().addCmd(cmp.getSimplify()); + }*/ + @Override public int getStepCount() { return 1; } - } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoadResult.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoadResult.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoadResult.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -35,8 +35,8 @@ private boolean first_ = true; - public Set allAttribute_ = new HashSet(); - public Set attribute_ = new HashSet(); + public Set<GISAttributeInterface> allAttribute_ = new HashSet<GISAttributeInterface>(); + public Set<GISAttributeInterface> attribute_ = new HashSet<GISAttributeInterface>(); /** La somme des points contenus dans tous les mod\xE8les de points */ public int nbPoint_; @@ -47,11 +47,11 @@ /** La somme des poylignes contenus dans tous les mod\xE8les de polylignes */ public int nbPolylignes_; /** La liste des mod\xE8les {@link GISDataModel} de polylignes */ - public List ligneModel_ = new ArrayList(); + public List<GISDataModel> ligneModel_ = new ArrayList<GISDataModel>(); /** La liste des mod\xE8les {@link GISDataModel} de points */ - public List pointModel_ = new ArrayList(); + public List<GISDataModel> pointModel_ = new ArrayList<GISDataModel>(); /** La liste des mod\xE8les {@link GISDataModel} de polygones */ - public List polygoneModel_ = new ArrayList(); + public List<GISDataModel> polygoneModel_ = new ArrayList<GISDataModel>(); /** La liste des mod\xE8les {@link GISDataModel} de multipoints */ public void addUsedAttributes(final GISAttributeInterface[] _att) { @@ -112,7 +112,7 @@ } private GISAttributeInterface findAttributes(final String _name, final Class _clazz, final boolean _isAtomic) { - for (final Iterator it = allAttribute_.iterator(); it.hasNext();) { + for (final Iterator<GISAttributeInterface> it = allAttribute_.iterator(); it.hasNext();) { final GISAttributeInterface att = (GISAttributeInterface) it.next(); if (att.isAtomicValue() == _isAtomic && att.getName().equals(_name) && att.getDataClass().equals(_clazz)) { return att; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderCsv.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderCsv.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderCsv.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -13,23 +13,23 @@ import java.util.List; import java.util.Map; -import com.memoire.bu.BuFileFilter; - import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.CtuluDoubleParser; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeInterface; +import org.fudaa.ctulu.gis.GISDataModelAttributAdapter; import org.fudaa.ctulu.gis.GISDataModelListPtAdapter; import org.fudaa.ctulu.gis.GISPoint; - import org.fudaa.dodico.mesure.DodicoCsvReader; - import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.sig.FSigLib; +import com.memoire.bu.BuFileFilter; + /** * @author Fred Deniger * @version $Id: FSigFileLoaderCsv.java,v 1.2 2007-05-04 14:00:26 deniger Exp $ @@ -134,7 +134,7 @@ return ft_; } - public void setInResult(final FSigFileLoadResult _r, final File _f, final ProgressionInterface _prog, + public void setInResult(final FSigFileLoadResult _r, final File _f, String _fileOrigine, final ProgressionInterface _prog, final CtuluAnalyze _analyze) { final XYCsvReader reader = new XYCsvReader(); final CtuluDoubleParser parser = new CtuluDoubleParser(); @@ -158,7 +158,7 @@ double[][] attValues = null; final String[] name = reader.getName(); GISAttributeInterface[] att = null; - if (values.length > 2) { + if (values.length > 2) { // On ne prend pas le x et le y att = new GISAttributeInterface[values.length - 2]; attValues = new double[att.length][]; for (int i = att.length - 1; i >= 0; i--) { @@ -171,7 +171,12 @@ } _r.nbPoint_ += pt.length; _r.nbPointTotal_ += pt.length; - _r.pointModel_.add(new GISDataModelListPtAdapter(pt, att, attValues)); + // Ajout de l'attribut ETAT_GEOM + _r.findOrCreateAttribute(GISAttributeConstants.ETAT_GEOM.getID(), String.class, false); + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(new GISDataModelListPtAdapter(pt, att, attValues)); + adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, _fileOrigine); + // + _r.pointModel_.add(adapter); } } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGIS.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGIS.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGIS.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -23,6 +23,9 @@ import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISDataModelAttributAdapter; +import org.fudaa.ctulu.gis.GISDataModelListPtAdapter; import org.fudaa.ctulu.gis.GISGeometry; import org.fudaa.ctulu.gis.GISVisitorDefault; @@ -96,7 +99,7 @@ } - public void setInResult(final FSigFileLoadResult _r, final File _f, final ProgressionInterface _prog, + public void setInResult(final FSigFileLoadResult _r, final File _f, String _fileOrigine, final ProgressionInterface _prog, final CtuluAnalyze _analyze) { if (src_ == null) { try { @@ -120,15 +123,20 @@ if (src_ != null && src_.getNumGeometries() > 0) { src_.atts_ = null; src_.buildAttributes(_r); + // Ajout de l'attribut ETAT_GEOM + _r.findOrCreateAttribute(GISAttributeConstants.ETAT_GEOM.getID(), String.class, false); + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(src_); + adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, _fileOrigine); + // _r.addUsedAttributes(src_.atts_); if (nbPoint_ > 0) { - _r.pointModel_.add(src_); + _r.pointModel_.add(adapter); } if (nbPolygone_ > 0) { - _r.polygoneModel_.add(src_); + _r.polygoneModel_.add(adapter); } if (nbPolyligne_ > 0) { - _r.ligneModel_.add(src_); + _r.ligneModel_.add(adapter); } _r.nbPoint_ += nbPoint_; _r.nbPointTotal_ += nbPointTotal_; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGrid.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGrid.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderGrid.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -16,6 +16,7 @@ import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeInterface; +import org.fudaa.ctulu.gis.GISDataModelAttributAdapter; import org.fudaa.dodico.ef.EfGridInterface; import org.fudaa.dodico.ef.EfGridSource; @@ -51,7 +52,7 @@ EfGridGisAdapter adapter_; - public void setInResult(final FSigFileLoadResult _r, final File _f, final ProgressionInterface _prog, + public void setInResult(final FSigFileLoadResult _r, final File _f, String _fileOrigine, final ProgressionInterface _prog, final CtuluAnalyze _analyze) { if (adapter_ == null) { final CtuluIOOperationSynthese op = version_.readGrid(_f, _prog); @@ -72,7 +73,12 @@ if (adapter_ != null) { _r.addUsedAttributes(new GISAttributeInterface[] { GISAttributeConstants.BATHY }); _r.allAttribute_.add(GISAttributeConstants.BATHY); - _r.pointModel_.add(adapter_); + // Ajout de l'attribut ETAT_GEOM + _r.findOrCreateAttribute(GISAttributeConstants.ETAT_GEOM.getID(), String.class, false); + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(adapter_); + adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, _fileOrigine); + // + _r.pointModel_.add(adapter); _r.nbPoint_ += adapter_.getNumGeometries(); _r.nbPointTotal_ += adapter_.getNumGeometries(); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderI.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderI.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderI.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -34,10 +34,11 @@ * \xEAtre produites et g\xE9r\xE9es par _analyse. * @param _r le conteneur de resultat * @param _f le fichier a lire si necessaire + * @param _fileOrigine un string indiquant \xE0 la valeur \xE0 mettre dans l'attribut ETAT_GEOM * @param _prog la barre de progression * @param _analyze L'analyseur d'informations. */ - void setInResult(FSigFileLoadResult _r, File _f, ProgressionInterface _prog, CtuluAnalyze _analyze); + void setInResult(FSigFileLoadResult _r, File _f, String _fileOrigine, ProgressionInterface _prog, CtuluAnalyze _analyze); /** * Le filtre pour les fichiers accept\xE9s par ce lecteur. Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderInp.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderInp.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderInp.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -20,8 +20,10 @@ import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeInterface; import org.fudaa.ctulu.gis.GISDataModel; +import org.fudaa.ctulu.gis.GISDataModelAttributAdapter; import org.fudaa.ctulu.gis.GISPoint; import org.fudaa.dodico.ef.EfGridInterface; @@ -133,7 +135,7 @@ return ft_; } - public void setInResult(final FSigFileLoadResult _r, final File _f, final ProgressionInterface _prog, + public void setInResult(final FSigFileLoadResult _r, final File _f, String _fileOrigine, final ProgressionInterface _prog, final CtuluAnalyze _analyze) { if (inp_ == null) { final CtuluIOOperationSynthese op = INPFileFormat.getInstance().getLastINPVersionImpl().read(_f, _prog); @@ -159,7 +161,12 @@ } _r.nbPoint_ += inp_.getGrid().getEltNb(); _r.nbPointTotal_ += inp_.getGrid().getEltNb(); - _r.pointModel_.add(new INPAdapter(att)); + // Ajout de l'attribut ETAT_GEOM + _r.findOrCreateAttribute(GISAttributeConstants.ETAT_GEOM.getID(), String.class, false); + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(new INPAdapter(att)); + adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, _fileOrigine); + // + _r.pointModel_.add(adapter); _r.addUsedAttributes(att); } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderPanel.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderPanel.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -147,6 +147,8 @@ pnFiles_.setValueListCellRenderer(new FileListCellRenderer()); pnFiles_.getTableColumnModel().getColumn(2).setCellEditor(fileMng_.getFmtRowEditor()); pnFiles_.getTableColumnModel().getColumn(2).setCellRenderer(fileMng_.getFmtRowRenderer()); + pnFiles_.getTableColumnModel().getColumn(3).setCellEditor(fileMng_.getFmtRowOrigineEditor()); + pnFiles_.getTableColumnModel().getColumn(3).setCellRenderer(fileMng_.getFmtRowOrigineRenderer()); final BuButton btPreview = new BuButton(FSigLib.getS("Pr\xE9visualiser")); btPreview.addActionListener(new ActionListener() { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadBER.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadBER.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadBER.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -12,6 +12,8 @@ import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISDataModelAttributAdapter; import org.fudaa.ctulu.gis.GISLib; import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee; import org.fudaa.dodico.reflux.io.ReflucadBERFileFormat; @@ -55,7 +57,7 @@ } /* @override */ - public void setInResult(final FSigFileLoadResult _r, final File _f, final ProgressionInterface _prog, + public void setInResult(final FSigFileLoadResult _r, final File _f, String _fileOrigine, final ProgressionInterface _prog, final CtuluAnalyze _analyze) { final CtuluIOOperationSynthese op=ReflucadBERFileFormat.getInstance().read(_f, _prog); // En cas d'erreur, fin d'import. @@ -67,8 +69,12 @@ lines_=(GISZoneCollectionLigneBrisee)op.getSource(); _r.nbPointTotal_+=lines_.getNumPoints(); _r.nbPolylignes_+=lines_.getNumGeometries(); - - _r.ligneModel_.add(lines_); + // Ajout de l'attribut ETAT_GEOM + _r.findOrCreateAttribute(GISAttributeConstants.ETAT_GEOM.getID(), String.class, false); + GISDataModelAttributAdapter adapter = new GISDataModelAttributAdapter(lines_); + adapter.addAttribut(GISAttributeConstants.ETAT_GEOM, _fileOrigine); + // + _r.ligneModel_.add(adapter); _r.addUsedAttributes(GISLib.getAttributeFrom(lines_)); } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadPRO.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadPRO.java 2008-10-07 17:53:30 UTC (rev 4045) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigFileLoaderReflucadPRO.java 2008-10-08 13:36:53 UTC (rev 4046) @@ -12,6 +12,8 @@ import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISDataModelAttributAdapter; import org.fudaa.ctulu.gis.GISLib; import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee; import org.fudaa.dodico.reflux.io.ReflucadPROFileFormat; @@ -55,7 +57,7 @@ } /* @override */ - public void setInResult(final FSigFileLoadResult _r, final File _f, final ProgressionInterface _prog, + public void setInResult(final FSigFileLoadResult _r, final File _f, String _fileOrigine, final ProgressionInterface _prog, final CtuluAnalyze _analyze) { final CtuluIOOperationSynthese op=ReflucadPROFileFormat.getInstance().read(_f, ... [truncated message content] |
From: <had...@us...> - 2008-10-07 17:53:38
|
Revision: 4045 http://fudaa.svn.sourceforge.net/fudaa/?rev=4045&view=rev Author: hadouxad Date: 2008-10-07 17:53:30 +0000 (Tue, 07 Oct 2008) Log Message: ----------- Finalisation import scopeGene - Cr?\195?\169er le m?\195?\170me syst?\195?\168me de target pour le mvprofileTreeModel: g?\195?\168re l'import scope pour la variable SANS - Gestion ?\195?\169galement de la cr?\195?\169ation de widget graphe et ajout du panel de choix (cr?\195?\169ation graphe ou importer dans graphe existant) dans le wizard. Refactorisation de code - ranger les actions trpost dans un package action - ranger les actions persist dans un package persist - ranger les classe fenetre,dialog et wizard specifiques au trpost dans un package dialogSpec Gestion des sauvegardes - gestion des propri?\195?\169t?\195?\169s graphiques - mise en place de la persistance des datas via les creator (creation de methode persist et setData pour la serail/deserial des donn?\195?\169es) - Sauvegarde correcte de tous les fichiers dans le repertoire - mise en place dans le post de la fonctionnalit?\195?\169 pour la sauvegarde Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFillePanel.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/common/TrPostActionLigneCourants.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayer.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostInterpolatePoint.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjet.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProjetsManagerFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostScene.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVisuPanel.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/lib/xpp3_min-1.1.4c.jar branches/Prepro-0.92-SNAPSHOT/ctulu/lib/xstream-1.3.jar branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrIsoLineAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionAddPointFromWidgetCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionAddPointFromWidgetCalque2.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionChangeSceneForWidget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionChooseAndCreateCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionDuplicate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionCalques.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionFusionGraphes.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionOpenSrc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostActionRemoveSrc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostCourbeAddPointsAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostProfileAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/actions/TrPostVolumeAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostDialogBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostDialogCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostDialogLigneCourants.java 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/TrPostWizardCreateScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardProfilSpatial.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque2.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChangeSceneForWidget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionChooseAndCreateCalque.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionDuplicate.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionCalques.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionFusionGraphes.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionOpenSrc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionRemoveSrc.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddPointsAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogBilan.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCubature.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostProfileAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostVolumeAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardProfilSpatial.java Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/xpp3_min-1.1.4c.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/xstream-1.3.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -32,7 +32,7 @@ */ public class EbliWidget extends Widget implements BSelecteurTargetInterface, EbliWidgetInterface<EbliWidgetController> { - public final static String TYPEWIDGET = "CLASSIQUE"; + public final static String COLORCONTOUR = "ColorContour"; public final static String COLORFOND = "colorFond"; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreator.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,21 +1,32 @@ package org.fudaa.ebli.visuallibrary; +import java.util.Map; +import org.w3c.dom.Element; + + public interface EbliWidgetCreator { EbliWidget create(EbliScene _scene); - // FIXME a mettre dans le EbliNode - // EbliWidget getWidget(); + /** - * Duplication de l ebliNode en fonction de son creator. - * - * @param options - * @return - */ + * Duplication de l ebliNode en fonction de son creator. + */ EbliNode duplicate(EbliNode _nodeAdupliquer); //FIXME pas de reference vers la widget creer: un creator peut etre utiliser pour plusieurs widget ! // EbliWidgetWithBordure getBordure(); + + /** + * Methode qui permet d'injecter les datas dans le creator pour la persistence + */ + void setData(Object data); + + /** + * Methode qui permet de recuperer les datas et de les inserer dans l'element. + */ + void PersistData(Element elt, Map parameters); + } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorDblFleche.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,7 +1,10 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.util.Map; +import org.w3c.dom.Element; + public class EbliWidgetCreatorDblFleche implements EbliWidgetCreator { @@ -55,5 +58,17 @@ public EbliWidgetWithBordure getBordure() { return null; } + + @Override + public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + + } + + @Override + public void setData(Object data) { + // TODO Auto-generated method stub + + } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorFleche.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,7 +1,10 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.util.Map; +import org.w3c.dom.Element; + public class EbliWidgetCreatorFleche implements EbliWidgetCreator { int orientation; @@ -54,6 +57,18 @@ public EbliWidgetWithBordure getBordure() { return null; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub +} + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorImage.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -2,7 +2,10 @@ import java.awt.Image; import java.awt.Point; +import java.util.Map; +import org.w3c.dom.Element; + /** * Creator de la widget image. * @@ -12,12 +15,14 @@ public class EbliWidgetCreatorImage implements EbliWidgetCreator { Image image_; + String pathImage_; // EbliWidgetImage res; EbliWidgetWithBordure res; - public EbliWidgetCreatorImage(Image g) { + public EbliWidgetCreatorImage(Image g, String path) { super(); + pathImage_=path; this.image_ = g; } @@ -45,7 +50,7 @@ EbliNode duplique = new EbliNodeDefault(); - duplique.setCreator(new EbliWidgetCreatorImage(getG())); + duplique.setCreator(new EbliWidgetCreatorImage(getG(),pathImage_)); duplique.setTitle(_nodeAdupliquer.getTitle()); // recopie des tailles @@ -61,5 +66,17 @@ public EbliWidgetWithBordure getBordure() { return res; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + elt.setAttribute("CONTENT", pathImage_); +} + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorShape.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,8 +1,10 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.util.Map; import org.fudaa.ebli.visuallibrary.creator.ShapeCreator; +import org.w3c.dom.Element; /** * Creator pour les objets graphiques de type shape. @@ -71,6 +73,22 @@ public EbliWidgetWithBordure getBordure() { return null; } + + + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub +} + + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextEditor.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,8 +1,13 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Map; import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; +import org.w3c.dom.Element; /** * creator Editeur de texte widget. @@ -16,6 +21,7 @@ // EbliWidgetTextEditor res; EbliWidgetWithBordure res; + static int Idcontenu=1; public EbliWidgetCreatorTextEditor(CtuluHtmlEditorPanel g) { super(); @@ -64,4 +70,31 @@ public EbliWidgetWithBordure getBordure() { return res; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + //ecriture du contenu html dans ce fichier + FileWriter writer; + try { + + File contenu=new File((String)parameters.get("path")+File.separator+"contenu"+(Idcontenu++)); + writer = new FileWriter(contenu); + + writer.write(editorPane_.getDocumentText()); + writer.close(); + elt.setAttribute("CONTENT", contenu.getAbsolutePath()); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetCreatorTextLabel.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,9 +1,12 @@ package org.fudaa.ebli.visuallibrary; import java.awt.Point; +import java.util.Map; +import org.w3c.dom.Element; + public class EbliWidgetCreatorTextLabel implements EbliWidgetCreator { String label_; @@ -54,6 +57,18 @@ public EbliWidgetWithBordure getBordure() { return res; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub +} +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetGroupCreator.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -4,7 +4,10 @@ */ package org.fudaa.ebli.visuallibrary; +import java.util.Map; + import org.netbeans.api.visual.widget.Widget; +import org.w3c.dom.Element; /** * Creator permettant de cr\xE9er un groupe de widget simple. @@ -44,4 +47,16 @@ public void setW(EbliWidget w) { this.w = w; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + +} + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionImageChooser.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -38,7 +38,7 @@ // -- creation de la widget et ajout dans la scene --// EbliNodeDefault nodeImage = new EbliNodeDefault(); nodeImage.setTitle(" " + chooser.getSelectedFile()); - nodeImage.setCreator(new EbliWidgetCreatorImage(img)); + nodeImage.setCreator(new EbliWidgetCreatorImage(img,chooser.getSelectedFile().getAbsolutePath())); nodeImage.setPreferedSize(new Dimension(200, 200)); nodeImage.setPreferedLocation(new Point(270, 225)); scene_.addNode(nodeImage); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorLegende.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,6 +1,7 @@ package org.fudaa.ebli.visuallibrary.calque; import java.awt.Font; +import java.util.Map; import org.fudaa.ebli.calque.BCalqueLegendePanel; import org.fudaa.ebli.visuallibrary.EbliNode; @@ -9,6 +10,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; /** * Creator pour les legendes des calques @@ -59,4 +61,16 @@ return res; } +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/calque/EbliWidgetCreatorVueCalque.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -14,6 +14,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; public class EbliWidgetCreatorVueCalque implements EbliWidgetCreator { @@ -109,4 +110,16 @@ this.calque_ = calque; } +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorGraphe.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,6 +1,7 @@ package org.fudaa.ebli.visuallibrary.graphe; import java.awt.Point; +import java.util.Map; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.courbe.EGFillePanel; @@ -12,6 +13,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; /** * interface qui permet de creer un widget @@ -97,4 +99,16 @@ return res; } +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub + } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/graphe/EbliWidgetCreatorLegende.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,5 +1,7 @@ package org.fudaa.ebli.visuallibrary.graphe; +import java.util.Map; + import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliScene; @@ -7,6 +9,7 @@ import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; import org.fudaa.ebli.visuallibrary.EbliWidgetCreator; import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; +import org.w3c.dom.Element; public class EbliWidgetCreatorLegende implements EbliWidgetCreator { @@ -43,5 +46,17 @@ public EbliWidgetWithBordure getBordure() { return res; } + +@Override +public void PersistData(Element elt, Map parameters) { + // TODO Auto-generated method stub } + +@Override +public void setData(Object data) { + // TODO Auto-generated method stub + +} + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,5 +1,6 @@ package org.fudaa.ebli.visuallibrary.persist; +import java.awt.Paint; import java.util.Iterator; import org.fudaa.ctulu.ProgressionInterface; @@ -9,6 +10,8 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.anotherbigidea.flash.structs.Color; + /** * Classe qui se charge de sauvegarder le contenu de la ebliScene. * @@ -18,9 +21,11 @@ public class EbliScenePersist { - public final static String PROPERTIES = "Properties"; + public final static String PROPERTIES = "PROPERTIES"; + public final static String TITLE="TITLE"; + public final static String BACKGROUND="BACKGROUND"; + - /** * Scene dont le contenu est a sauvegarder */ @@ -45,21 +50,26 @@ * * @return */ - public Document createDescriptorScene(ProgressionInterface prog) { + public Document createDescriptorScene(ProgressionInterface prog,String baliseLayout,String path) { // creation du document Document document = ManagerWidgetPersist.createDocument(); if (document == null) return null; // creation du root avec pour id le titre la frame - Element rootEle = document.createElement(title_); + Element rootEle = document.createElement(baliseLayout); document.appendChild(rootEle); + rootEle.setAttribute(TITLE, title_); + + // -- creation des proprietes graphiques de la scene --// Element propertiesEle = document.createElement(PROPERTIES); - // TODO properties.... a faire + propertiesEle.setAttribute(BACKGROUND, ((java.awt.Color)scene_.getBackground()).toString()); + + rootEle.appendChild(propertiesEle); @@ -72,7 +82,7 @@ // mise a jour infos prog.setDesc(EbliResource.EBLI.getString("Insertion de la frame ") + node.getTitle()); - Element widgetEle = new EbliWidgetpersist(node).createDescriptorWidget(document, prog); + Element widgetEle = new EbliWidgetpersist(node).createDescriptorWidget(document, prog,path); rootEle.appendChild(widgetEle); } return document; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,5 +1,7 @@ package org.fudaa.ebli.visuallibrary.persist; +import java.util.HashMap; + import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliWidget; @@ -7,6 +9,9 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; + /** * Classe qui g\xE8re la sauvegarde des widgets. * @@ -15,10 +20,23 @@ */ public class EbliWidgetpersist { - public final static String BALISEPROPERTIES = "Properties"; + public final static String BALISEPROPERTIES = "PROPERTIES"; public final static String BALISEWIDGET = "FRAME"; - public final static String TYPE = "Type"; + public final static String TYPE = "TYPE"; + public final static String TITLE="TITLE"; + public final static String BACKGROUND="BACKGROUND"; + public final static String FOREGROUND="BACKGROUND"; + public final static String ROTATION="BACKGROUND"; + public final static String FONT="BACKGROUND"; + public final static String LIGNEMODEL="LIGNEMODEL"; + public final static String HEIGHT="HEIGHT"; + public final static String WIDTH="WIDTH"; + public final static String X="X"; + public final static String Y="Y"; + + public final static String BALISEDATA="DATA"; + // widget construire/sauvegarder EbliWidget widget_; @@ -52,22 +70,49 @@ * @param prog * @return */ - public Element createDescriptorWidget(Document document, ProgressionInterface prog) { + public Element createDescriptorWidget(Document document, ProgressionInterface prog, String path) { // element plus haut niveau balise Element rootEle = document.createElement(BALISEWIDGET); // -- creation du type de widget --// - rootEle.setAttribute(TYPE, widget_.TYPEWIDGET); + rootEle.setAttribute("TITLE", node_.getTitle()); + rootEle.setAttribute(TYPE, node_.getCreator().getClass().toString()); + //-- creation des proprietes graphiques --// Element propertiesEle = document.createElement(BALISEPROPERTIES); // TODO proprietes graphiques + if(widget_.getColorFond() !=null) + propertiesEle.setAttribute(BACKGROUND, widget_.getColorFond().toString()); + if(widget_.getColorContour() !=null) + propertiesEle.setAttribute(FOREGROUND, widget_.getColorContour().toString()); + if(widget_.getFormeFont() !=null) + propertiesEle.setAttribute(FONT, widget_.getFormeFont().toString()); + + propertiesEle.setAttribute(ROTATION, ""+widget_.getRotation()); + if(widget_.getTraceLigneModel()!=null) + propertiesEle.setAttribute(LIGNEMODEL, widget_.getTraceLigneModel().toString()); + if(widget_.getBounds() !=null){ + propertiesEle.setAttribute(WIDTH, ""+widget_.getBounds().width); + propertiesEle.setAttribute(HEIGHT, ""+widget_.getBounds().height); + } + if(widget_.getLocation() !=null){ + propertiesEle.setAttribute(X, ""+widget_.getLocation().x); + propertiesEle.setAttribute(Y, ""+widget_.getLocation().y); + } rootEle.appendChild(propertiesEle); + //-- creation des datas associ\xE9es --// + HashMap<String, Object> parametres=new HashMap<String, Object>(); + parametres.put("path", path); + Element dataEle = document.createElement(BALISEDATA); + node_.getCreator().PersistData(dataEle,parametres); + + rootEle.appendChild(dataEle); return rootEle; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -3,6 +3,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -33,97 +34,18 @@ * */ public class ManagerWidgetPersist { + - /** - * Utilis\xE9 pour l'extension de tous les fichiers, repertoire et ficheirs - * inclus. - */ - public final static String DEFAULT_EXTENSION = ".POST"; + + - /** - * Peut etre modifi\xE9 par l'appli appelabt si l'on veut une extension - * diff\xE9rente - */ - public static String EXTENSION = DEFAULT_EXTENSION; - - /** - * Fichier qui d\xE9crit tous les contenu layout sauvegard\xE9s Et noms des balises - * importantes - */ - public final static String INFOSCENE = "InfoLayout" + EXTENSION; - public final static String BALISESCENES = "Layout list"; - - /** - * Fichier qui d\xE9crit int\xE9gralement le contenu d'une scene - */ - public final static String DESCRIPTORSCENE = "DescriptorLayout"; - - /** - * Fichier qui d\xE9crit tous les fichiers sources(m\xE9tiers) sauvegard\xE9s - */ - public final static String DESCRIPTORSOURCE = "descriptorSources" + EXTENSION; - public final static String BALISESOURCES = "Sources list"; - - /** - * Nom du projet. Creation du projet sous un repertoire nomProjet.EXTENSION - */ - String nomProjet_; - - ProgressionInterface prog_; - File projet_; - - CtuluUI ui_; - - /** - * La liste des fichiers ouverts dans le projet. Si ils existent. - */ - List<File> listeFichiersProjets; - - /** - * La liste des coules (layouts, string) a sauvegarder. Le string peut etre el - * titre de la frame qui contient le ebli par exemple. - */ - Map<String, EbliScene> listeLayout_; - - public ManagerWidgetPersist(List<File> _listeFichiersProjets, String _nomProjet, CtuluUI ui) { + public ManagerWidgetPersist() { super(); - listeFichiersProjets = _listeFichiersProjets; - nomProjet_ = _nomProjet; - ui_ = ui; - prog_ = ui_.getMainProgression(); + } - /** - * Cr\xE9\xE9 le repertoire contenant tous les fichiers de donn\xE9es. Base pour la - * cr\xE9ation des donn\xE9es. - */ - public boolean createPersistDirectory() { - // -- creation d un chooser --// - final CtuluFileChooser fileChooser = new CtuluFileChooser(true); - fileChooser.setDialogTitle(EbliResource.EBLI.getString("S\xE9lectionnez l'emplacement de votre r\xE9pertoire") + " " - + nomProjet_ + EXTENSION); - fileChooser.setAcceptAllFileFilterUsed(false); - int reponse = fileChooser.showOpenDialog(CtuluLibSwing.getFrameAncestor(ui_.getParentComponent())); - if (reponse == JFileChooser.APPROVE_OPTION) { - File conteneurProjet = fileChooser.getSelectedFile(); - if (conteneurProjet.isDirectory()) { - projet_ = new File(conteneurProjet.getAbsoluteFile() + nomProjet_ + EXTENSION); - // creation du repertoire global contenant toutes les donn\xE9es - if (projet_.mkdir()) { - return true; - } else { - ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le r\xE9pertoire")); - return false; - } + - } else { - ui_.error(EbliResource.EBLI.getString("La cible doit \xEAtre un r\xE9pertoire")); - return false; - } - } else - return false; - } - /** * Fichier qui cree le fichier qui indique les diff\xE9rents fichiers layout a * lire. Cela permettra pour la lecture de proposer de charger ou non certains @@ -131,145 +53,34 @@ * * @return */ - public Document createDescriptorScenes() { - // creation du document - Document document = createDocument(); - if (document == null) - return null; - + public static Document createDescriptorScenes(Document document, ArrayList<String> titles,String path, String baliseScene, String descriptorScene,String extension, String attribute) { + // creation du root - Element rootEle = document.createElement(BALISESCENES); + Element rootEle = document.createElement(baliseScene); document.appendChild(rootEle); // On cree des objets sans contenus qui decrivent simplement les fichiers // scenes - Iterator<String> it = listeLayout_.keySet().iterator(); + Iterator<String> it = titles.iterator(); int cpt = 1; while (it.hasNext()) { it.next(); // contient le path absolu vers le fichier qui decrit le layout - Element sceneEle = document.createElement(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt - + EXTENSION); - rootEle.appendChild(sceneEle); + rootEle.setAttribute(attribute+cpt, path + File.separator + descriptorScene + (cpt++) + + extension); +// Element sceneEle = document.createElement(path + File.separator + descriptorScene + cpt +// + extension); +// rootEle.appendChild(sceneEle); } return document; } - /** - * Methode qui tente de sauvegarder tous les fichier en s\xE9maphore: Soit tout - * les fichiers li\xE9s entre eux sont sauvegard\xE9s, soit les fichier li\xE9s ne le - * sont pas(destruction si n\xE9cessaire) - * - * @return - */ - public boolean saveProject() { - try { - progression("Cr\xE9ation du r\xE9pertoire", 10); - // -- etape 1 creation du repertoire global --// - if (createPersistDirectory()) { - OutputFormat format; - File file; - XMLSerializer serializer; - Document docXml; + - // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts - progression("Cr\xE9ation du fichier descripteur de sources", 15); - file = new File(projet_.getAbsolutePath() + File.separator + INFOSCENE); - docXml = createDescriptorSource(); - if (docXml == null) { - ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de sources")); - return false; - } - format = new OutputFormat(docXml); - format.setIndenting(true); - serializer = new XMLSerializer(new FileOutputStream(file), format); - serializer.serialize(docXml); + - // -- etape 3 sauvegarde des ebliscene unitairement --// - progression("Cr\xE9ation des fichiers layout", 20); - Iterator<String> it = listeLayout_.keySet().iterator(); - int cpt = 1; - while (it.hasNext()) { - String title = it.next(); - EbliScene scene = listeLayout_.get(title); - progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listeLayout_.size()); - file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); - docXml = (new EbliScenePersist(scene, title)).createDescriptorScene(prog_); - if (docXml == null) { - ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de layout " + cpt)); - } else { - format = new OutputFormat(docXml); - format.setIndenting(true); - serializer = new XMLSerializer(new FileOutputStream(file), format); - serializer.serialize(docXml); - cpt++; - } + - } - - // -- etape finale: Si tout s'est bien pass\xE9, sauvegarde du fichier de - // descriptions des - // layout - progression("Cr\xE9ation du descripteur de layout", 90); - file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSOURCE); - docXml = createDescriptorScenes(); - if (docXml == null) { - ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de layout")); - return false; - } - format = new OutputFormat(docXml); - format.setIndenting(true); - serializer = new XMLSerializer(new FileOutputStream(file), format); - serializer.serialize(docXml); - - progression("", 100); - return true; - - } - return false; - } catch (IOException ie) { - ie.printStackTrace(); - return false; - } - - } - /** - * Methode qui g\xE9n\xE8re le fichier contenant toutes les sources ouverts. - * - * @return - */ - public Document createDescriptorSource() { - // creation du document - Document document = createDocument(); - if (document == null) - return null; - // creation du root - Element rootEle = document.createElement(BALISESOURCES); - document.appendChild(rootEle); - // On cree des objets sans contenus qui decrivent simplement les fichiers - // scenes - Iterator<File> it = listeFichiersProjets.iterator(); - while (it.hasNext()) { - File f = it.next(); - Element sceneEle = document.createElement(f.getAbsolutePath()); - rootEle.appendChild(sceneEle); - } - return document; - } - - public void progression(String title, int progression) { - if (prog_ == null || title == null || progression > 100) - return; - if (progression == 100) { - prog_.setProgression(0); - prog_.setDesc(""); - return; - } - prog_.setDesc(EbliResource.EBLI.getString(title)); - prog_.setProgression(progression); - } - - /** * Genere un document type dom * * @return Document Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -116,7 +116,7 @@ public FudaaCourbeWizardImportScope(FudaaCommonImplementation impl,FudaaCourbeImporter.Target target) { super(); - + target_=target; impl_=impl; } @@ -136,9 +136,9 @@ return new JLabel(TrResource.getS("Erreur. Veuillez choisir un fichier valide")); } - if(panelParametres_==null) - panelParametres_=buildPanelParametresImportation(); - return panelParametres_; +// if(panelParametres_==null) +// panelParametres_=buildPanelParametresImportation(); + return buildPanelParametresImportation(); } } @@ -153,7 +153,18 @@ @Override public String getStepText() { - return null; + String r = null; + + switch (current_) { + case 0: + + break; + case 1: + + break; + + } + return r; } ScopeStructure.SorT dataST(){ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFillePanel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFillePanel.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileFillePanel.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -51,6 +51,7 @@ import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.ressource.FudaaResource; +import org.fudaa.fudaa.tr.common.TrLib; /** * @author fred deniger @@ -281,6 +282,10 @@ final MvProfileCourbeGroup gri = new MvProfileCourbeGroup(_var); final EGAxeVertical yi = new EGAxeVertical(); yi.setTitre(_var.toString()); + if (_var == H2dVariableType.SANS) { + yi.setTitre(TrLib.getString("Import")); + } + yi.setUnite(_var.getCommonUnit()); gri.setAxeY(yi); return gri; 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 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileTreeModel.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -37,6 +37,8 @@ import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsI; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsMng; import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.dodico.mesure.EvolutionReguliere; +import org.fudaa.dodico.mesure.EvolutionReguliereInterface; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; @@ -44,7 +46,10 @@ import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGObject; + +import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; import org.fudaa.fudaa.commun.courbe.FudaaCourbeTimeListModel; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.export.MvExportChooseVarAndTime; @@ -58,7 +63,7 @@ * @version $Id: MvProfileTreeModel.java,v 1.12 2007-06-13 14:46:13 deniger Exp * $ */ -public class MvProfileTreeModel extends EGGrapheTreeModel { +public class MvProfileTreeModel extends EGGrapheTreeModel implements Target { FudaaCourbeTimeListModel timeModel_; EfLineIntersectionsResultsMng resNode_; EfLineIntersectionsResultsBuilder builderNode_; @@ -606,4 +611,34 @@ protected void setPaletteGrid(final MvProfileGridPalette _paletteGrid) { paletteGrid_ = _paletteGrid; } + +@Override +public void importCourbes(EvolutionReguliereInterface[] _crb, + CtuluCommandManager _mng, ProgressionInterface _prog) { + // TODO Auto-generated method stub + + if (_crb == null) return; + EGGroup gr = getGroup(H2dVariableType.SANS,true); + List<EGCourbeChild> childs = new ArrayList<EGCourbeChild>(_crb.length); + for (int i = 0; i < _crb.length; i++) { + EGCourbeChild child = new EGCourbeChild(gr, new FudaaCourbeModel(new EvolutionReguliere(_crb[i]))); + childs.add(child); + gr.addEGComponent(child); + } + + if (_mng != null) { + _mng.addCmd(new CommandAddCourbesMulti((EGCourbeChild[]) childs.toArray(new EGCourbeChild[childs.size()]), + new EGGroup[] { gr })); + } + fireStructureChanged(); + + + } + +@Override +public boolean isSpatial() { + // TODO Auto-generated method stub + return true; +} +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -6,8 +6,8 @@ import org.fudaa.fudaa.meshviewer.MvResource; import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; -import org.fudaa.fudaa.tr.post.TrPostDialogBilan; -import org.fudaa.fudaa.tr.post.TrPostDialogLigneCourants; +import org.fudaa.fudaa.tr.post.dialogSpec.*; + import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayer.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayer.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -47,7 +47,7 @@ timeUpdated(); } - protected TrIsoModel getIsoModel() { + public TrIsoModel getIsoModel() { return (TrIsoModel) modele_; } Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLineAction.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,42 +0,0 @@ -/* - * @creation 18 avr. 07 - * @modification $Date: 2007-04-30 14:22:38 $ - * @license GNU General Public License 2 - * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail de...@fu... - */ -package org.fudaa.fudaa.tr.post; - -import java.awt.event.ActionEvent; - -import com.memoire.bu.BuWizardDialog; - -import org.fudaa.ebli.commun.EbliActionSimple; - -import org.fudaa.fudaa.tr.common.TrResource; - -/** - * temporaire pour tester. - * - * @author fred deniger - * @version $Id: TrIsoLineAction.java,v 1.2 2007-04-30 14:22:38 deniger Exp $ - */ -public class TrIsoLineAction extends EbliActionSimple { - - final TrPostVisuPanel dest_; - final TrPostProjet project_; - - public TrIsoLineAction(final TrPostVisuPanel _dest) { - super(TrResource.getS("Rechercher les isolignes"), null, "FIND_ISOS"); - dest_ = _dest; - project_ = dest_.projet_; - } - - public void actionPerformed(final ActionEvent _e) { - final BuWizardDialog dialog = new BuWizardDialog(dest_.getImpl().getFrame(), new TrIsoLineWizard(dest_)); - dialog.pack(); - dialog.setModal(true); - dialog.setLocationRelativeTo(dest_.getImpl().getFrame()); - dialog.show(); - } -} Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java 2008-10-07 16:36:46 UTC (rev 4044) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostActionAddPointFromWidgetCalque.java 2008-10-07 17:53:30 UTC (rev 4045) @@ -1,440 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.DefaultListModel; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; - -import org.fudaa.ctulu.CtuluCommandContainer; -import org.fudaa.ctulu.CtuluResource; -import org.fudaa.ctulu.image.CtuluLibImage; -import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; -import org.fudaa.ebli.courbe.EGGraphe; -import org.fudaa.ebli.courbe.EGGrapheModel; -import org.fudaa.ebli.ressource.EbliResource; -import org.fudaa.ebli.visuallibrary.EbliNode; -import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionSimple; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; -import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; -import org.fudaa.ebli.visuallibrary.graphe.GrapheCellRenderer; -import org.fudaa.fudaa.meshviewer.profile.MvProfileBuilderFromTree; -import org.fudaa.fudaa.meshviewer.profile.MvProfileCoteTester; -import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; -import org.fudaa.fudaa.tr.common.TrResource; - -import com.memoire.bu.BuDialogError; - -/** - * Action qui: - recupere la liste des calques potentiels - recupere la liste des graphes potentiels - propose a l - * utilisateur une interface combo pour choisir le calque cible - propose a l utilisateur une interface jlist pour - * choisir le(s) graphe(s) cible(s) realise la moulinette - * - * @author Adrien Hadoux - */ -@SuppressWarnings("serial") -public abstract class TrPostActionAddPointFromWidgetCalque extends EbliWidgetActionSimple { - - /** - * Action specialisee pour les courbes temporelles. NE propose que les widget graphes qui respectent les donnees - * temporelles - * - * @author Adrien Hadoux - */ - public static class Temporel extends TrPostActionAddPointFromWidgetCalque { - - public Temporel(EbliScene _scene, TrPostCommonImplementation _impl) { - super(_scene, _impl); - } - - @Override - public void setTitleForFrame() { - frame_.setTitle(TrResource.TR.getString("Ajout des points du calques dans les \xE9volutions temporels")); - } - - @Override - public boolean isCorrectGraph(EGGrapheModel _model) { - // -- ATTENTION ICI ON AJOUTE JUSTE POUR LES COUURBE TEMPORELLE --// - return (_model instanceof TrPostCourbeTreeModel); - - } - - @Override - public void executeAction(TrPostCommonImplementation _impl, EGGraphe _graphe, TrPostVisuPanel _calque) { - (new TrPostCourbeAddPointsAction(impl_, _graphe, _calque)).actionPerformed(new ActionEvent(_calque, 0, - "ADDPOINTWIDGET")); - } - - @Override - protected void createNewGraphe(TrPostVisuPanel _calqueChoisi) { - - // -- creation auto d un nouveau graphe widget avec courbe temporelle - _calqueChoisi.addEvolutionFor(); - } - - @Override - public void setToolTip() { - this.setDefaultToolTip(TrResource.getS("Ajoute aux graphes selectionn\xE9s les points s\xE9lectionn\xE9es du calque")); - } - - } - - /** - * Action specialisee pour les courbes spatiales. NE propose que les widget graphes qui respectent les donnees - * patiales - * - * @author Adrien Hadoux - */ - public static class Spatial extends TrPostActionAddPointFromWidgetCalque { - - public Spatial(EbliScene _scene, TrPostCommonImplementation _impl) { - super(_scene, _impl); - } - - @Override - public void setTitleForFrame() { - frame_.setTitle(TrResource.TR.getString("Ajout des points du calques dans les courbes spatiales")); - } - - @Override - public boolean isCorrectGraph(EGGrapheModel _model) { - // -- ATTENTION ICI ON AJOUTE JUSTE POUR LES COURBE TEMPORELLE --// - return (_model instanceof MvProfileTreeModel); - - } - - @Override - public void executeAction(TrPostCommonImplementation _impl, EGGraphe _graphe, TrPostVisuPanel _calque) { - - /** - * @see TrPostWizardProfilSpatiaux.java pour savoir comment fusionenr une courbe spatiale dans un graphe existant. - * methode doTask() - */ - - } - - @Override - protected void createNewGraphe(TrPostVisuPanel _calqueChoisi) { - - // creation automatique d un graphe avec les spatiales poru le calque - // vhoisi - - new MvProfileBuilderFromTree(TrPostProfileAction.createProfileAdapter(_calqueChoisi), impl_, - ((ZCalqueAffichageDonneesInterface) _calqueChoisi.getArbreCalqueModel().getSelectedCalque()) - .getSelectedLine(), _calqueChoisi, new MvProfileCoteTester()).start(); - - } - - String[] formattageDonnees(TrPostProjet _projet) { - - String[] listeSimul = new String[_projet.listeSrc_.size()]; - int cpt = 0; - for (Iterator<TrPostSource> it = _projet.listeSrc_.iterator(); it.hasNext();) { - - TrPostSource src = it.next(); - - // --ajout dans la liste des titres --// - listeSimul[cpt++] = _projet.formatInfoSource(src); - } - - return listeSimul; - } - - @Override - public void setToolTip() { - this.setDefaultToolTip(TrResource.getS("Ajoute aux graphes selectionn\xE9s les courbes s\xE9lectionn\xE9es du calque ")); - } - - } - - CtuluCommandContainer cmd_; - TrPostCommonImplementation impl_; - - JComboBox boxCalques_; - JList jlisteGraphesChoix; - JList jlisteGraphesSelections; - - JButton validation, select, unselect, creationNewGraphe, quitter; - JDialog frame_; - DefaultListModel modelGraphesPossibles; - DefaultListModel modelGraphesChoisis; - ArrayList<TrPostVisuPanel> listeCalquesPossibles; - ArrayList<EGGraphe> listeGraphesPossibles; - ArrayList<EGGraphe> listeGraphesChoisis; - ArrayList<JLabel> listeObjetsCalques; - - public TrPostActionAddPointFromWidgetCalque(EbliScene _scene, TrPostCommonImplementation _impl) { - super(_scene, TrResource.getS("Ajout des points du calque"), CtuluResource.CTULU.getIcon("cible"), "ADDPOINTWIDGET"); - - cmd_ = _scene.getCmdMng(); - impl_ = _impl; - putValue(NAME, "Arri\xE8re plan"); - - setToolTip(); - - } - - public abstract void setToolTip(); - - public void actionPerformed(ActionEvent e) { - - if (e.getSource() == select) { - if (jlisteGraphesChoix.getSelectedIndex() != -1) { - int indice = jlisteGraphesChoix.getSelectedIndex(); - EGGraphe graphe = listeGraphesPossibles.get(indice); - JLabel title = (JLabel) modelGraphesPossibles.getElementAt(indice); - modelGraphesChoisis.addElement(title); - listeGraphesChoisis.add(graphe); - modelGraphesPossibles.removeElementAt(indice); - listeGraphesPossibles.remove(indice); - } - } else if (e.getSource() == unselect) { - if (jlisteGraphesSelections.getSelectedIndex() != -1) { - int indice = jlisteGraphesSelections.getSelectedIndex(); - EGGraphe graphe = listeGraphesChoisis.get(indice); - JLabel title = (JLabel) modelGraphesChoisis.getElementAt(indice); - modelGraphesPossibles.addElement(title); - listeGraphesPossibles.add(graphe); - modelGraphesChoisis.removeElementAt(indice); - listeGraphesChoisis.remove(indice); - } - } else if (e.getSource() == validation) { - // validation de l action - if (listeGraphesChoisis.size() == 0) { - new BuDialogError(impl_.getApp(), impl_.getInformationsSoftware(), TrResource - .getS("Il doit y avoir au moins un graphe s\xE9lectionn\xE9.")).activate(); - return; - } - - TrPostVisuPanel calqueChoisi = (TrPostVisuPanel) listeCalquesPossibles.get(boxCalques_.getSelectedIndex()); - - // -- on applique l'action \xE0 chaque widget graphe --// - for (int i = 0; i < listeGraphesChoisis.size(); i++) { - EGGraphe graphe = listeGraphesChoisis.get(i); - - // -- execution de l action pour le graphe selectionne --// - executeAction(impl_, graphe, calqueChoisi); - - } - scene_.refresh(); - - } else if (e.getSource() == quitter) { - frame_.dispose(); - - } else if (e.getSource() == creationNewGraphe) { - - // -- creation d un nouveau graphe --// - if (boxCalques_ != null) { - TrPostVisuPanel calqueChoisi = (TrPostVisuPanel) listeCalquesPossibles.get(boxCalques_.getSelectedIndex()); - - // -- methode appelee qui doit creer un graphe avec la selection --// - createNewGraphe(calqueChoisi); - } else { - createNewGraphe(listeCalquesPossibles.get(0)); - } - // -- on doit remettre a jour les infos --// - // frame_.dispose(); - // rechercheGrapheAndCalque(); - - } else { - rechercheGrapheAndCalque(); - - // -- affichage de al dialog --// - constructDialog().setVisible(true); - } - - } - - protected abstract void createNewGraphe(TrPostVisuPanel _calqueChoisi); - - public abstract void executeAction(TrPostCommonImplementation _impl, EGGraphe _graphe, TrPostVisuPanel _calque); - - private void rechercheGrapheAndCalque() { - Map params = new HashMap(); - CtuluLibImage.setCompatibleImageAsked(params); - // -- recuperation de la liste des nodes de la scene --// - Set<EbliNode> listeNode = (Set<EbliNode>) scene_.getObjects(); - modelGraphesP... [truncated message content] |
From: <bma...@us...> - 2008-10-07 16:36:49
|
Revision: 4044 http://fudaa.svn.sourceforge.net/fudaa/?rev=4044&view=rev Author: bmarchan Date: 2008-10-07 16:36:46 +0000 (Tue, 07 Oct 2008) Log Message: ----------- Pour homogeneiser les attributs possibles. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigAttibuteTypeManager.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigAttibuteTypeManager.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigAttibuteTypeManager.java 2008-10-07 14:16:16 UTC (rev 4043) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigAttibuteTypeManager.java 2008-10-07 16:36:46 UTC (rev 4044) @@ -95,8 +95,9 @@ */ public FSigAttibuteTypeManager() { super(); - atts_.put("name", GISAttributeConstants.TITRE); - atts_.put("Z", GISAttributeConstants.BATHY); + for (GISAttributeInterface att: GISAttributeConstants.getDefaults()) { + atts_.put(att.getName(), att); + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-10-07 14:17:20
|
Revision: 4043 http://fudaa.svn.sourceforge.net/fudaa/?rev=4043&view=rev Author: bmarchan Date: 2008-10-07 14:16:16 +0000 (Tue, 07 Oct 2008) Log Message: ----------- Am?\195?\169lioration sur attribut VISIBILITY Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.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/layer/MdlModel2dLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java Property Changed: ---------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.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/layer/MdlModel2dLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -1,6 +1,6 @@ /* * @creation 7 avr. 2005 - * @modification $Date: 2008-03-28 14:58:56 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -8,6 +8,7 @@ package org.fudaa.ctulu.gis; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.fudaa.ctulu.CtuluLibString; @@ -18,12 +19,14 @@ import com.memoire.fu.FuLib; /** - * Des constantes pour les attributs associables \xE0 des objets GIS. Les attributs constants sont en - * principe des attributs programme (non construits par l'utilisateur). Dans ce cas, leur ID est - * ind\xE9pendant de la langue pour \xEAtre correctement sauv\xE9 dans les fichiers GML. + * Une classe pour d\xE9finir des attributs syst\xE8mes associables \xE0 des objets GIS. Les attributs syst\xE8mes + * sont en principe des attributs programme (non construits par l'utilisateur). Le systeme connait + * ces attributs sp\xE9cifiques, et peut r\xE9agir en cons\xE9quence.<p> + * L'ID de chacun de ces attributs est ind\xE9pendant de la langue pour \xEAtre correctement sauv\xE9 dans + * les fichiers GML. * * @author Fred Deniger - * @version $Id: GISAttributeConstants.java,v 1.14.8.3 2008-03-28 14:58:56 bmarchan Exp $ + * @version $Id$ */ public final class GISAttributeConstants { @@ -31,84 +34,11 @@ public final static String ATT_VAL_ETAT_MODI="MODI"; /** Etat geom origine */ public final static String ATT_VAL_ETAT_ORIG="ORIG"; + /** Une valeur d'attribut valant True */ + public final static String ATT_VAL_TRUE="T"; + /** Une valeur d'attribut valant False */ + public final static String ATT_VAL_FALSE="F"; - private GISAttributeConstants() { - - } - - public static String toString(final GISAttributeInterface _att) { - if (_att == TITRE || _att == BATHY || _att == NATURE || _att == ETAT_GEOM) { - return _att.getID(); - } - final String attributeSep = getAttributeSep(); - return _att.getDataClass().getName() + attributeSep + FuLib.replace(_att.getName(), attributeSep, "_") - + attributeSep + CtuluLibString.toString(_att.isAtomicValue()); - } - - private static String getAttributeSep() { - return "|"; - } - - public static GISAttributeInterface getConstantAttribute(final String _saveName) { - if (TITRE.getID().equals(_saveName)) { - return TITRE; - } - if (BATHY.getID().equals(_saveName)) { - return BATHY; - } - if (NATURE.getID().equals(_saveName)) { - return NATURE; - } - if (ETAT_GEOM.getID().equals(_saveName)) { - return ETAT_GEOM; - } - return null; - } - - public static GISAttributeInterface restoreFrom(final String _s) { - GISAttributeInterface res = getConstantAttribute(_s); - if (res != null) { - return res; - } - final String[] s = CtuluLibString.parseString(_s, getAttributeSep()); - if (s == null || s.length != 3) { - return null; - } - final String clazz = s[0]; - final String name = s[1]; - final boolean atomic = CtuluLibString.toBoolean(s[2]); - if (clazz.equals(Double.class.getName())) { - res = new GISAttributeDouble(name, atomic); - if (BATHY.isSameContent(res)) { - res = BATHY; - } - } else if (clazz.equals(Integer.class.getName())) { - res = new GISAttributeInteger(name, atomic); - } else { - res = new GISAttributeString(name, atomic); - if (TITRE.isSameContent(res)) { - res = TITRE; - } - else if (NATURE.isSameContent(res)) { - res = NATURE; - } - } - - return res; - } - - public static List<GISAttribute> getDefaults() { - final ArrayList<GISAttribute> l = new ArrayList<GISAttribute>(2); - l.add(BATHY); - l.add(TITRE); - l.add(NATURE); - return l; - } - - public static boolean isConstant(final GISAttributeInterface _att) { - return _att == TITRE || _att == BATHY || _att == NATURE; - } - /** * Un attribut nom, global. */ @@ -154,7 +84,9 @@ /** * Un attribut etat, global a la g\xE9om\xE9trie. */ - public final static GISAttributeString ETAT_GEOM=new GISAttributeString(new CtuluValueEditorChoice(new String[]{ATT_VAL_ETAT_ORIG, ATT_VAL_ETAT_MODI}, new String[]{CtuluLib.getS("Origine"), CtuluLib.getS("Modifi\xE9")}), CtuluLib.getS("Etat"), false) { + public final static GISAttributeString ETAT_GEOM= + new GISAttributeString(new CtuluValueEditorChoice(new String[]{ATT_VAL_ETAT_ORIG, ATT_VAL_ETAT_MODI}, + new String[]{CtuluLib.getS("Origine"), CtuluLib.getS("Modifi\xE9")}), CtuluLib.getS("Etat"), false) { public String getID() { return "ATTRIBUTE_ETAT_GEOM"; } @@ -171,7 +103,10 @@ /** * Un attribut visibilit\xE9, global a la g\xE9om\xE9trie. */ - public final static GISAttributeBoolean VISIBILITE = new GISAttributeBoolean(CtuluLib.getS("Visibilit\xE9")) { + public final static GISAttributeString VISIBILITE = + new GISAttributeString(new CtuluValueEditorChoice(new String[]{ATT_VAL_TRUE, ATT_VAL_FALSE}, + new String[]{CtuluLib.getS("Oui"), CtuluLib.getS("Non")}), CtuluLib.getS("Visibilit\xE9"), false) { + public String getID() { return "ATTRIBUTE_VISIBILITY"; } @@ -181,7 +116,7 @@ } public Object getDefaultValue() { - return Boolean.TRUE; + return ATT_VAL_TRUE; } }; @@ -193,7 +128,94 @@ public String getID() { return "ATTRIBUTE_Z"; } - }; + /** La liste des attributs syst\xE8mes. */ + protected final static List<GISAttribute> attrs_= + Arrays.asList(new GISAttribute[]{BATHY,TITRE,NATURE,VISIBILITE,ETAT_GEOM}); + + private GISAttributeConstants() {} + + public static String toString(final GISAttributeInterface _att) { + for (GISAttributeInterface att: attrs_) { + if (_att==att) return _att.getID(); + } + final String attributeSep = getAttributeSep(); + return _att.getDataClass().getName() + attributeSep + FuLib.replace(_att.getName(), attributeSep, "_") + + attributeSep + CtuluLibString.toString(_att.isAtomicValue()); + } + + private static String getAttributeSep() { + return "|"; + } + + /** + * Retourne l'attribut syst\xE8me a partir de son identifiant. + * @param _idName L'identifiant. + * @return L'attribut syst\xE8me, ou null si aucun ne correspond a l'identifiant. + */ + public static GISAttributeInterface getConstantAttribute(final String _idName) { + for (GISAttributeInterface att: attrs_) { + if (att.getID().equals(_idName)) return att; + } + return null; + } + + public static GISAttributeInterface restoreFrom(final String _s) { + GISAttributeInterface res = getConstantAttribute(_s); + if (res != null) { + return res; + } + final String[] s = CtuluLibString.parseString(_s, getAttributeSep()); + if (s == null || s.length != 3) { + return null; + } + final String clazz = s[0]; + final String name = s[1]; + final boolean atomic = CtuluLibString.toBoolean(s[2]); + if (clazz.equals(Double.class.getName())) { + res = new GISAttributeDouble(name, atomic); + if (BATHY.isSameContent(res)) { + res = BATHY; + } + } else if (clazz.equals(Integer.class.getName())) { + res = new GISAttributeInteger(name, atomic); + } else { + res = new GISAttributeString(name, atomic); + if (TITRE.isSameContent(res)) { + res = TITRE; + } + else if (NATURE.isSameContent(res)) { + res = NATURE; + } + else if (ETAT_GEOM.isSameContent(res)) { + res = ETAT_GEOM; + } + else if (VISIBILITE.isSameContent(res)) { + res = VISIBILITE; + } + } + + return res; + } + + /** + * Retourne la liste des attributs syst\xE8mes. + * @return La liste. + */ + public static List<GISAttribute> getDefaults() { + return new ArrayList<GISAttribute>(attrs_); // Une copie, pour eviter les modifications. + } + + /** + * L'attribut est-il un attribut syst\xE8me ? + * @param _att L'attribut a tester. + * @return True si l'attribut est systeme. + */ + public static boolean isConstant(final GISAttributeInterface _att) { + for (GISAttributeInterface att: attrs_) { + if (_att==att) return true; + } + return false; + } } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -293,7 +293,7 @@ int iattVisibility=pts_.getIndiceOf(GISAttributeConstants.VISIBILITE); if (iattVisibility==-1) return true; - return (Boolean)pts_.getValue(iattVisibility, _idxGeom); + return GISAttributeConstants.ATT_VAL_TRUE.equals(pts_.getValue(iattVisibility, _idxGeom)); } public boolean point(GrPoint _pt, int _idxGeom, int _pointIdx) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -1,6 +1,6 @@ /* * @creation 20 janv. 08 - * @modification $Date: 2008-05-13 12:10:42 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -19,7 +19,7 @@ * Un mod\xE8le de calque pour le calque 1D des traces de profils. Les traces sont des polylignes XY. * * @author Bertrand Marchand - * @version $Id: MdlModel2dProfile.java,v 1.1.2.6 2008-05-13 12:10:42 bmarchan Exp $ + * @version $Id$ */ public class MdlModel1dTrace extends MdlModel2dLine { @@ -32,7 +32,8 @@ GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.TITRE, GISAttributeConstants.ETAT_GEOM, - GISAttributeConstants.NATURE + GISAttributeConstants.NATURE, + GISAttributeConstants.VISIBILITE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel1dTrace.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -1,6 +1,6 @@ /* * @creation 20 janv. 08 - * @modification $Date: 2008/03/26 16:46:44 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -26,7 +26,7 @@ * Un mod\xE8le de calque pour le calque 2D des semis. Les semis sont des blocs de points X,Y,Z distincts. * * @author Bertrand Marchand - * @version $Id: MdlModel2dCloud.java,v 1.1.2.4 2008/03/26 16:46:44 bmarchan Exp $ + * @version $Id$ */ public class MdlModel2dCloud extends MdlModel2dMultiPoint { @@ -36,13 +36,13 @@ */ public MdlModel2dCloud(final GISZoneListener _listener, final CtuluCommandContainer _cmd) { super(_listener); -// GISAttribute attTry=new GISAttributeString("Nature",false); + GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.BATHY, GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, - GISAttributeConstants.NATURE -// attTry + GISAttributeConstants.NATURE, + GISAttributeConstants.VISIBILITE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dCloud.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -1,6 +1,6 @@ /* * @creation 20 janv. 08 - * @modification $Date: 2008-05-13 12:10:42 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -18,7 +18,7 @@ * ferm\xE9es. * * @author Bertrand Marchand - * @version $Id: MdlModel2dProfile.java,v 1.1.2.6 2008-05-13 12:10:42 bmarchan Exp $ + * @version $Id$ */ public class MdlModel2dConstraintLine extends MdlModel2dLine { @@ -32,7 +32,8 @@ GISAttributeConstants.BATHY, GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, - GISAttributeConstants.NATURE + GISAttributeConstants.NATURE, + GISAttributeConstants.VISIBILITE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dConstraintLine.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -1,6 +1,6 @@ /* * @creation 20 janv. 08 - * @modification $Date: 2008/02/21 19:41:56 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -17,7 +17,7 @@ * Un mod\xE8le de calque pour le calque 2D contour d'\xE9tudes. Les contours d'\xE9tude limitent les informations * transmiss lors de l'exportation. Un contour d'\xE9tude est en XY. * @author Bertrand Marchand - * @version $Id: MdlModel2dLevel.java,v 1.1.2.6 2008/02/21 19:41:56 bmarchan Exp $ + * @version $Id$ */ public class MdlModel2dContour extends MdlModel2dLine { @@ -31,7 +31,8 @@ GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.TITRE, GISAttributeConstants.ETAT_GEOM, - GISAttributeConstants.NATURE + GISAttributeConstants.NATURE, + GISAttributeConstants.VISIBILITE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dContour.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.java 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -1,6 +1,6 @@ /* * @creation 20 janv. 08 - * @modification $Date: 2008-05-13 12:10:42 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -20,7 +20,7 @@ * ferm\xE9es. * * @author Bertrand Marchand - * @version $Id: MdlModel2dProfile.java,v 1.1.2.6 2008-05-13 12:10:42 bmarchan Exp $ + * @version $Id$ */ public class MdlModel2dDirectionLine extends MdlModel2dLine { @@ -34,7 +34,8 @@ GISAttributeConstants.BATHY, GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, - GISAttributeConstants.NATURE + GISAttributeConstants.NATURE, + GISAttributeConstants.VISIBILITE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dDirectionLine.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id 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 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -1,6 +1,6 @@ /* * @creation 20 janv. 08 - * @modification $Date: 2008/02/21 19:41:56 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -21,7 +21,7 @@ * Un mod\xE8le de calque pour le calque 2D lignes de niveaux. Les lignes de niveau sont des lignes XY * avec une bathym\xE9trie constante. * @author Bertrand Marchand - * @version $Id: MdlModel2dLevel.java,v 1.1.2.6 2008/02/21 19:41:56 bmarchan Exp $ + * @version $Id$ */ public class MdlModel2dLevel extends MdlModel2dLine { @@ -37,7 +37,8 @@ zglob, GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, - GISAttributeConstants.NATURE + GISAttributeConstants.NATURE, + GISAttributeConstants.VISIBILITE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLevel.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -1,6 +1,6 @@ /* * @creation 20 janv. 08 - * @modification $Date: 2008-05-13 12:10:40 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -31,7 +31,7 @@ * Un mod\xE8le de calque pour un calque 2D contenant des lignes. * * @author Bertrand Marchand - * @version $Id: MdlModel2dLine.java,v 1.1.2.1 2008-05-13 12:10:40 bmarchan Exp $ + * @version $Id$ */ public class MdlModel2dLine extends ZModeleLigneBriseeEditable { @@ -67,7 +67,7 @@ coords[coords.length-1]=(Coordinate)_coords[1].clone(); GISPolyligne poly = (GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(coords); - int idx = geometries_.addGeometry(poly, null, _cmd); + int idx = getGeomData().addGeometry(poly, null, _cmd); if(idx!=-1) setGeomModif(idx, _cmd); return true; @@ -148,7 +148,7 @@ } // Methode par distance mini. else if (_meth==1) { - LineString geom=(LineString)geometries_.getGeometry(_idxGeom); + LineString geom=(LineString)getGeomData().getGeometry(_idxGeom); CoordinateSequence seq=geom.getCoordinateSequence(); double dst=0; for (int i=_idxdeb+1; i<=_idxfin-1; i++) { @@ -164,7 +164,7 @@ } CtuluListSelectionInterface ids = new CtuluListSelection(list.toNativeArray()); - geometries_.removeAtomics(_idxGeom, ids, null, _cmd); // L'UI est null, le cas ou moins de 2 points ne peut pas arriver. + getGeomData().removeAtomics(_idxGeom, ids, null, _cmd); // L'UI est null, le cas ou moins de 2 points ne peut pas arriver. setGeomModif(_idxGeom, _cmd); // Modification de l'etat de la g\xE9om\xE9trie return true; } @@ -183,7 +183,7 @@ * @return true si modif ok. */ public boolean refine(int _idxGeom, int _idxdeb,int _idxfin,int _meth,int _nbpts, double _dstmax, CtuluCommandContainer _cmd) { - LineString geom=(LineString)geometries_.getGeometry(_idxGeom); + LineString geom=(LineString)getGeomData().getGeometry(_idxGeom); CoordinateSequence seq=geom.getCoordinateSequence(); ArrayList coords=new ArrayList(seq.size()); @@ -225,7 +225,7 @@ } GISPolyligne newgeom=(GISPolyligne)GISGeometryFactory.INSTANCE.createLineString((Coordinate[])coords.toArray(new Coordinate[0])); - geometries_.setGeometry(_idxGeom, newgeom, _cmd); + getGeomData().setGeometry(_idxGeom, newgeom, _cmd); setGeomModif(_idxGeom, _cmd); // Modification de l'etat de la g\xE9om\xE9trie return true; } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java 2008-10-07 14:14:47 UTC (rev 4042) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java 2008-10-07 14:16:16 UTC (rev 4043) @@ -1,6 +1,6 @@ /* * @creation 20 janv. 08 - * @modification $Date: 2008/02/21 19:41:56 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -17,7 +17,7 @@ * Un mod\xE8le de calque pour le calque 2D de zones g\xE9om\xE9triques. Les zones permettent de sp\xE9cifier un strickler par la suite. * Une zone est en XY, ferm\xE9e. * @author Bertrand Marchand - * @version $Id: MdlModel2dLevel.java,v 1.1.2.6 2008/02/21 19:41:56 bmarchan Exp $ + * @version $Id$ */ public class MdlModel2dZone extends MdlModel2dLine { @@ -31,7 +31,8 @@ GISAttribute[] attrs=new GISAttribute[]{ GISAttributeConstants.TITRE, GISAttributeConstants.ETAT_GEOM, - GISAttributeConstants.NATURE + GISAttributeConstants.NATURE, + GISAttributeConstants.VISIBILITE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dZone.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-10-07 14:15:50
|
Revision: 4042 http://fudaa.svn.sourceforge.net/fudaa/?rev=4042&view=rev Author: bmarchan Date: 2008-10-07 14:14:47 +0000 (Tue, 07 Oct 2008) Log Message: ----------- MdlModelGeometry -> ZModeleGeometryDefault Modified Paths: -------------- 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/calque/edition/ZModeleGeometryDefault.java Removed Paths: ------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModelGeometry.java Added: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java (rev 0) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java 2008-10-07 14:14:47 UTC (rev 4042) @@ -0,0 +1,133 @@ +/* + * @creation 20 janv. 08 + * @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.ebli.calque.edition; + +import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface; +import org.fudaa.ctulu.gis.GISZoneCollection; +import org.fudaa.ctulu.gis.GISZoneCollectionGeometry; +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; +import org.fudaa.ebli.calque.ZModeleGeometry; +import org.fudaa.ebli.geometrie.GrBoite; +import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.ebli.palette.BPaletteInfo.InfoData; + +import com.memoire.bu.BuTable; +import com.memoire.fu.FuLog; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.Envelope; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.LineString; + +/** + * Une impl\xE9mentation par defaut d'un mod\xE8le contenant des g\xE9om\xE9tries de tous types. + * @author Bertrand Marchand + * @version $Id$ + */ +public class ZModeleGeometryDefault implements ZModeleGeometry { + protected GISZoneCollectionGeometry geometries_; + + /** + * Constructeur + */ + public ZModeleGeometryDefault() { + geometries_=new GISZoneCollectionGeometry(); + } + + public void getDomaineForGeometry(int _idxGeom, GrBoite _target) { + if (geometries_ == null || geometries_.getNumGeometries() == 0) { + return; + } + final Geometry g = geometries_.getGeometry(_idxGeom); + final Envelope e = g.getEnvelopeInternal(); + if (_target.o_ == null) { + _target.o_ = new GrPoint(); + } + if (_target.e_ == null) { + _target.e_ = new GrPoint(); + } + if (e != null && !e.isNull()) { + _target.o_.x_ = e.getMinX(); + _target.o_.y_ = e.getMinY(); + _target.e_.x_ = e.getMaxX(); + _target.e_.y_ = e.getMaxY(); + } + } + + public int getNbPointForGeometry(int _idxGeom) { + if (geometries_ == null) { + return 0; + } + final Geometry gi = geometries_.getGeometry(_idxGeom); + return gi.getNumPoints(); + } + + public final boolean isGeometryReliee(final int _idxGeom) { + Geometry g=getGeomData().getGeometry(_idxGeom); + return (g instanceof LineString); + } + + public final boolean isGeometryFermee(final int _idxGeom) { + Geometry g=getGeomData().getGeometry(_idxGeom); + return (g instanceof LineString && ((LineString)g).isClosed()); + } + + public boolean isGeometryVisible(int _idxGeom) { + int iattVisibility=geometries_.getIndiceOf(GISAttributeConstants.VISIBILITE); + if (iattVisibility==-1) return true; + + return GISAttributeConstants.ATT_VAL_TRUE.equals(geometries_.getValue(iattVisibility, _idxGeom)); + } + + public boolean point(GrPoint _pt, int _idxGeom, int _pointIdx) { + // Pour des multipoints, on s'appuie sur la m\xE9thode GISMultiPoint.getCoordinateSequence() cr\xE9\xE9e pour l'occasion et non + // GISMultiPoint.getCoordinates() pour r\xE9cuperer les coordonn\xE9es d'un point. En effet, recup\xE9rer le tableau des coordonn\xE9es + // s'av\xE8re terriblement penalisant pour l'affichage. + final CoordinateSequence g=((GISCoordinateSequenceContainerInterface)geometries_.getGeometry(_idxGeom)).getCoordinateSequence(); + _pt.x_ = g.getX(_pointIdx); + _pt.y_ = g.getY(_pointIdx); + return true; + } + + public GISZoneCollection getGeomData() { + return geometries_; + } + + public void prepareExport() { + geometries_.prepareExport(); + } + + public BuTable createValuesTable(ZCalqueAffichageDonneesInterface _layer) { + return null; + } + + public void fillWithInfo(InfoData _d, ZCalqueAffichageDonneesInterface _layer) {} + + public GrBoite getDomaine() { + if (geometries_ == null || geometries_.getNumGeometries() == 0) { + return null; + } + final Envelope e = geometries_.getEnvelopeInternal(); + if (e == null) { + return null; + } + return new GrBoite(new GrPoint(e.getMinX(), e.getMinY(), 0), new GrPoint(e.getMaxX(), e.getMaxY(), 0)); + } + + public final int getNombre() { + return geometries_ == null ? 0 : geometries_.getNumGeometries(); + } + + public final Object getObject(final int _ind) { + return geometries_ == null ? null : geometries_.getGeometry(_ind); + } + + public boolean isValuesTableAvailable() { + return false; + } +} Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Added: svn:eol-style + native 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 2008-10-07 14:12:32 UTC (rev 4041) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java 2008-10-07 14:14:47 UTC (rev 4042) @@ -29,6 +29,7 @@ import org.fudaa.ebli.calque.ZCalqueGeometry; import org.fudaa.ebli.calque.ZEbliCalquesPanel; import org.fudaa.ebli.calque.ZModeleGeometry; +import org.fudaa.ebli.calque.edition.ZModeleGeometryDefault; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.trace.TraceIcon; import org.fudaa.ebli.trace.TraceIconModel; @@ -36,7 +37,6 @@ import org.fudaa.ebli.trace.TraceLigneModel; import org.fudaa.ebli.trace.TraceSurface; import org.fudaa.ebli.trace.TraceSurfaceModel; -import org.fudaa.fudaa.modeleur.layer.MdlModelGeometry; import org.fudaa.fudaa.sig.FSigLib; import org.fudaa.fudaa.tr.common.TrResource; @@ -117,7 +117,7 @@ return; } - MdlModelGeometry mdl=new MdlModelGeometry(); + ZModeleGeometryDefault mdl=new ZModeleGeometryDefault(); support_=mdl.getGeomData(); for (int i=0; i<_geoms.length; i++) { Deleted: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModelGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModelGeometry.java 2008-10-07 14:12:32 UTC (rev 4041) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModelGeometry.java 2008-10-07 14:14:47 UTC (rev 4042) @@ -1,135 +0,0 @@ -/* - * @creation 20 janv. 08 - * @modification $Date: 2008/02/21 19:41:56 $ - * @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.ctulu.gis.GISAttributeDouble; -import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface; -import org.fudaa.ctulu.gis.GISMultiPoint; -import org.fudaa.ctulu.gis.GISZoneCollection; -import org.fudaa.ctulu.gis.GISZoneCollectionGeometry; -import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee; -import org.fudaa.ctulu.gis.GISZoneListener; -import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; -import org.fudaa.ebli.calque.ZModeleGeometry; -import org.fudaa.ebli.calque.edition.ZModeleLigneBriseeEditable; -import org.fudaa.ebli.geometrie.GrBoite; -import org.fudaa.ebli.geometrie.GrPoint; -import org.fudaa.ebli.palette.BPaletteInfo.InfoData; -import org.fudaa.fudaa.modeleur.MdlResource; -import org.fudaa.fudaa.sig.FSigResource; - -import com.memoire.bu.BuTable; -import com.vividsolutions.jts.geom.CoordinateSequence; -import com.vividsolutions.jts.geom.Envelope; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.LineString; - -/** - * Un mod\xE8le contenant des g\xE9om\xE9tries de tous types, pour repr\xE9sentation unique. - * @author Bertrand Marchand - * @version $Id: MdlModel2dLevel.java,v 1.1.2.6 2008/02/21 19:41:56 bmarchan Exp $ - */ -public class MdlModelGeometry implements ZModeleGeometry { - GISZoneCollectionGeometry geometries_; - - /** - * Constructeur - */ - public MdlModelGeometry() { - geometries_=new GISZoneCollectionGeometry(); - } - - public void getDomaineForGeometry(int _idxGeom, GrBoite _target) { - if (geometries_ == null || geometries_.getNumGeometries() == 0) { - return; - } - final Geometry g = geometries_.getGeometry(_idxGeom); - final Envelope e = g.getEnvelopeInternal(); - if (_target.o_ == null) { - _target.o_ = new GrPoint(); - } - if (_target.e_ == null) { - _target.e_ = new GrPoint(); - } - if (e != null && !e.isNull()) { - _target.o_.x_ = e.getMinX(); - _target.o_.y_ = e.getMinY(); - _target.e_.x_ = e.getMaxX(); - _target.e_.y_ = e.getMaxY(); - } - } - - public int getNbPointForGeometry(int _idxGeom) { - if (geometries_ == null) { - return 0; - } - final Geometry gi = geometries_.getGeometry(_idxGeom); - return gi.getNumPoints(); - } - - public final boolean isGeometryReliee(final int _idxGeom) { - Geometry g=getGeomData().getGeometry(_idxGeom); - return (g instanceof LineString); - } - - public final boolean isGeometryFermee(final int _idxGeom) { - Geometry g=getGeomData().getGeometry(_idxGeom); - return (g instanceof LineString && ((LineString)g).isClosed()); - } - - public boolean isGeometryVisible(int _idxGeom) { - return true; - } - - public boolean point(GrPoint _pt, int _idxGeom, int _pointIdx) { - final CoordinateSequence g=((GISCoordinateSequenceContainerInterface)geometries_.getGeometry(_idxGeom)).getCoordinateSequence(); - _pt.x_ = g.getX(_pointIdx); - _pt.y_ = g.getY(_pointIdx); - return true; - } - - public GISZoneCollection getGeomData() { - return geometries_; - } - - public void prepareExport() { - geometries_.prepareExport(); - } - - public BuTable createValuesTable(ZCalqueAffichageDonneesInterface _layer) { - return null; - } - - public void fillWithInfo(InfoData _d, ZCalqueAffichageDonneesInterface _layer) {} - - public GrBoite getDomaine() { - if (geometries_ == null || geometries_.getNumGeometries() == 0) { - return null; - } - final Envelope e = geometries_.getEnvelopeInternal(); - if (e == null) { - return null; - } - return new GrBoite(new GrPoint(e.getMinX(), e.getMinY(), 0), new GrPoint(e.getMaxX(), e.getMaxY(), 0)); - } - - public final int getNombre() { - return geometries_ == null ? 0 : geometries_.getNumGeometries(); - } - - public final Object getObject(final int _ind) { - return geometries_ == null ? null : geometries_.getGeometry(_ind); - } - - public boolean isValuesTableAvailable() { - return false; - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-10-07 14:15:14
|
Revision: 4041 http://fudaa.svn.sourceforge.net/fudaa/?rev=4041&view=rev Author: bmarchan Date: 2008-10-07 14:12:32 +0000 (Tue, 07 Oct 2008) Log Message: ----------- ZCalqueGeometry devient calque pere generique de ZCalqueMultiPoint Modified Paths: -------------- 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/calque/ZCalqueMultiPoint.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanLayer.java Property Changed: ---------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueMultiPoint.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanLayer.java 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 2008-10-07 13:59:38 UTC (rev 4040) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java 2008-10-07 14:12:32 UTC (rev 4041) @@ -136,7 +136,7 @@ surfModel_=new TraceSurfaceModel(TraceSurface.INVISIBLE, Color.BLACK,null); } - protected EbliListeSelectionMulti creeSelectionMutli() { + protected EbliListeSelectionMulti creeSelectionMulti() { return new EbliListeSelectionMulti(modeleDonnees().getNombre() / 2); } @@ -224,7 +224,7 @@ // Si la selection de modif est nulle, seule l'action de remplacement // est concernee. if (selectionMulti_ == null) { - selectionMulti_ = creeSelectionMutli(); + selectionMulti_ = creeSelectionMulti(); } boolean sentEvent = false; switch (_action) { @@ -329,15 +329,17 @@ final Envelope env = new Envelope(); if (isAtomicMode_) { final EbliListeSelectionMultiInterface multi = getLayerSelectionMulti(); + Coordinate c=new Coordinate(); final TIntObjectIterator it = multi.getIterator(); for (int i = multi.getNbListSelected(); i-- > 0;) { it.advance(); final CtuluListSelectionInterface atomSel = (CtuluListSelectionInterface) it.value(); - final Geometry g = (Geometry) modele_.getGeomData().getGeometry(it.key()); + final CoordinateSequence seq = modele_.getGeomData().getCoordinateSequence(it.key()); final int max = atomSel.getMaxIndex(); for (int j = atomSel.getMinIndex(); j <= max; j++) { if (atomSel.isSelected(j)) { - env.expandToInclude(g.getCoordinates()[j]); + seq.getCoordinate(j,c); + env.expandToInclude(c); } } } @@ -367,19 +369,26 @@ } public void inverseSelection() { - if (!isAtomicMode_) { - super.inverseSelection(); - return; - } if (isSelectionEmpty()) { return; } - for (int i = modele_.getNombre() - 1; i >= 0; i--) { - final CtuluListSelection s = selectionMulti_.get(i); - if (s != null) { - s.inverse(modele_.getNbPointForGeometry(i)); + if (!isAtomicMode_) { + initSelection(); + selection_.inverse(modeleDonnees().getNombre()); + for (int i=0; i<modele_.getNombre(); i++) { + if (!modele_.isGeometryVisible(i)) selection_.remove(i); } } + else { + for (int i=modele_.getNombre()-1; i>=0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + + final CtuluListSelection s=selectionMulti_.get(i); + if (s!=null) { + s.inverse(modele_.getNbPointForGeometry(i)); + } + } + } fireSelectionEvent(); } @@ -417,7 +426,7 @@ } } - public ZModeleDonnees modeleDonnees() { + public ZModeleGeometry modeleDonnees() { return modele_; } @@ -467,6 +476,9 @@ 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 @@ -497,6 +509,9 @@ 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 @@ -533,6 +548,10 @@ 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) { @@ -638,19 +657,26 @@ if (!isVisible()) return; if (!isAtomicMode_) { - super.selectAll(); - return; + initSelection(); + selection_.addInterval(0, modele_.getNombre() - 1); + for (int i=0; i<modele_.getNombre(); i++) { + if (!modele_.isGeometryVisible(i)) selection_.remove(i); + } } - if (selectionMulti_ == null) { - selectionMulti_ = creeSelectionMutli(); - } - for (int i = modele_.getNombre() - 1; i >= 0; i--) { - CtuluListSelection s = selectionMulti_.get(i); - if (s == null) { - s = new CtuluListSelection(modele_.getNbPointForGeometry(i)); - selectionMulti_.set(i, s); + else { + if (selectionMulti_==null) { + selectionMulti_=creeSelectionMulti(); } - s.setSelectionInterval(0, modele_.getNbPointForGeometry(i) - 1); + for (int i=modele_.getNombre()-1; i>=0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + + CtuluListSelection s=selectionMulti_.get(i); + if (s==null) { + s=new CtuluListSelection(modele_.getNbPointForGeometry(i)); + selectionMulti_.set(i, s); + } + s.setSelectionInterval(0, modele_.getNbPointForGeometry(i)-1); + } } fireSelectionEvent(); } @@ -671,6 +697,8 @@ final GrPoint pt=new GrPoint(); final GrBoite bPoly = new GrBoite(new GrPoint(), new GrPoint()); for (int i = modele_.getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + modele_.getDomaineForGeometry(i, bPoly); if (bPoly.contientXY(_pt)||bPoly.distanceXY(_pt)<distanceReel) { for (int j=modele_.getNbPointForGeometry(i)-1; j>=0; j--) { @@ -706,6 +734,8 @@ final GrPoint p = new GrPoint(); final GrBoite bPoly = new GrBoite(new GrPoint(), new GrPoint()); for (int i = modeleDonnees().getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + modele_.getDomaineForGeometry(i, bPoly); // si le poly est dans dans le poly de selection boolean selected = false; @@ -769,6 +799,8 @@ final GrPoint p = new GrPoint(); final GrBoite btLigne = new GrBoite(); for (int i = modele_.getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + modele_.getDomaineForGeometry(i, btLigne); if (btLigne.contientXY(_pt) || btLigne.distanceXY(_pt) < distanceReel) { for (int j = modele_.getNbPointForGeometry(i) - 1; j >= 0; j--) { @@ -797,11 +829,13 @@ if (!polyEnv.intersects(domaine)) { return null; } - final EbliListeSelectionMulti r = creeSelectionMutli(); + final EbliListeSelectionMulti r = creeSelectionMulti(); final GrPoint p = new GrPoint(); final SIRtreePointInRing tester = new SIRtreePointInRing(_poly); final Coordinate c = new Coordinate(); for (int i = modele_.getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + CtuluListSelection l = null; final int nbPt = modele_.getNbPointForGeometry(i); for (int j = nbPt - 1; j >= 0; j--) { @@ -841,11 +875,12 @@ } public boolean setSelection(final int[] _idx) { + // Aucun controle n'est fait sur la visibilit\xE9 ou non des objets d'indices pass\xE9s. if (!isAtomicMode_) { return super.setSelection(_idx); } // TODO : Traitement a faire si on est en mode atomique. - FuLog.warning("EBL:ZCalqueLigneBrisee.setSelection() can't be called in atomic mode"); + FuLog.warning("EBL:ZCalqueGeometry.setSelection() can't be called in atomic mode"); return false; } 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 2008-10-07 13:59:38 UTC (rev 4040) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java 2008-10-07 14:12:32 UTC (rev 4041) @@ -1,6 +1,6 @@ /* * @creation 31 mars 2005 - * @modification $Date: 2008-03-26 16:46:43 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -60,13 +60,13 @@ * {@link ZModeleLigneBrisee}. * * @author Fred Deniger - * @version $Id: ZCalqueLigneBrisee.java,v 1.29.6.4 2008-03-26 16:46:43 bmarchan Exp $ + * @version $Id$ */ public class ZCalqueLigneBrisee extends ZCalqueAffichageDonneesLineAbstract { /** * @author Fred Deniger - * @version $Id: ZCalqueLigneBrisee.java,v 1.29.6.4 2008-03-26 16:46:43 bmarchan Exp $ + * @version $Id$ */ private class VariableNonAtomicFindExpression extends CalqueFindExpression { @@ -930,7 +930,7 @@ } public boolean setSelection(final int[] _idx) { - // Pas de controle sur la visibilit\xE9 ou non des objets d'indices pass\xE9s. + // Aucun controle n'est fait sur la visibilit\xE9 ou non des objets d'indices pass\xE9s. if (!isAtomicMode_) { return super.setSelection(_idx); } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueMultiPoint.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueMultiPoint.java 2008-10-07 13:59:38 UTC (rev 4040) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueMultiPoint.java 2008-10-07 14:12:32 UTC (rev 4041) @@ -1,57 +1,16 @@ /* * @creation 31 mars 2005 - * @modification $Date: 2008-04-01 17:05:16 $ + * @modification $Date$ * @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 gnu.trove.TIntObjectIterator; -import gnu.trove.TObjectIntHashMap; - import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; -import org.nfunk.jep.Variable; - -import com.memoire.fu.FuLog; -import com.vividsolutions.jts.algorithm.SIRtreePointInRing; -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; - -import org.fudaa.ctulu.CtuluExpr; -import org.fudaa.ctulu.CtuluLib; -import org.fudaa.ctulu.CtuluLibArray; -import org.fudaa.ctulu.CtuluListSelection; -import org.fudaa.ctulu.CtuluListSelectionInterface; -import org.fudaa.ctulu.gis.GISAttributeInterface; -import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface; -import org.fudaa.ctulu.gis.GISGeometryFactory; -import org.fudaa.ctulu.gis.GISLib; -import org.fudaa.ctulu.gis.GISZoneCollection; - -import org.fudaa.ebli.calque.edition.ZModeleEditable; -import org.fudaa.ebli.calque.find.CalqueFindExpression; -import org.fudaa.ebli.commun.EbliLib; -import org.fudaa.ebli.commun.EbliListeSelectionMulti; -import org.fudaa.ebli.commun.EbliListeSelectionMultiInterface; -import org.fudaa.ebli.commun.EbliSelectionMode; -import org.fudaa.ebli.commun.EbliSelectionState; -import org.fudaa.ebli.commun.EbliUIProperties; -import org.fudaa.ebli.find.EbliFindExpressionContainerInterface; -import org.fudaa.ebli.geometrie.GrBoite; -import org.fudaa.ebli.geometrie.GrMorphisme; -import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.trace.TraceIcon; import org.fudaa.ebli.trace.TraceIconModel; -import org.fudaa.ebli.trace.TraceLigneModel; /** * Un calque g\xE9rant des multipoints, \xE0 un niveau global ou atomique.<p> @@ -59,747 +18,31 @@ * {@link ZModeleMultiPoint}. * * @author Bertrand Marchand - * @version $Id: ZCalqueMultiPoint.java,v 1.1.2.2 2008-04-01 17:05:16 bmarchan Exp $ + * @version $Id$ */ -public class ZCalqueMultiPoint extends ZCalqueAffichageDonneesLineAbstract { +public class ZCalqueMultiPoint extends ZCalqueGeometry { /** - * @author Fred Deniger - * @version $Id: ZCalqueMultiPoint.java,v 1.1.2.2 2008-04-01 17:05:16 bmarchan Exp $ - */ - private class VariableNonAtomicFindExpression extends CalqueFindExpression { - - TObjectIntHashMap varAtt_; - - public VariableNonAtomicFindExpression() { - super(ZCalqueMultiPoint.this.modeleDonnees()); - } - - public void initialiseExpr(final CtuluExpr _expr) { - super.initialiseExpr(_expr); - final GISZoneCollection coll = ((ZModeleEditable) super.data_).getGeomData(); - final int nb = coll.getNbAttributes(); - if (nb > 0) { - if (varAtt_ == null) { - varAtt_ = new TObjectIntHashMap(nb); - } else { - varAtt_.clear(); - } - for (int i = 0; i < nb; i++) { - final GISAttributeInterface att = coll.getAttribute(i); - if (!att.isAtomicValue() && Number.class.isAssignableFrom(att.getDataClass())) { - varAtt_.put(_expr.addVar(att.getName(), att.getLongName()), i); - } - } - } - - } - - public void majVariable(final int _idx, final Variable[] _varToUpdate) { - super.majVariable(_idx, _varToUpdate); - if (varAtt_ != null && !CtuluLibArray.isEmpty(_varToUpdate)) { - final GISZoneCollection coll = ((ZModeleEditable) super.data_).getGeomData(); - for (int i = _varToUpdate.length - 1; i >= 0; i--) { - if (varAtt_.containsKey(_varToUpdate[i])) { - _varToUpdate[i].setValue(CtuluLib.getDouble(((Number) coll.getDataModel(varAtt_.get(_varToUpdate[i])) - .getObjectValueAt(_idx)).doubleValue())); - } - } - } - } - - } - - /** true si edition de sommets */ - transient private boolean isAtomicMode_; - - protected ZModeleMultiPoint 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 seul constructeur, avec le mod\xE8le. * @param _modele le modele du calque */ public ZCalqueMultiPoint(final ZModeleMultiPoint _modele) { - modele_ = _modele; + super(_modele); iconModel_ = new TraceIconModel(TraceIcon.CARRE_PLEIN, 2, Color.BLACK); } - protected EbliListeSelectionMulti creeSelectionMutli() { - return new EbliListeSelectionMulti(modeleDonnees().getNombre() / 2); - } - - protected void initTrace(final TraceIconModel _icon, final int _idxPoly) { - _icon.updateData(getIconModel(0)); - if (isAttenue()) { - _icon.setCouleur(EbliLib.getAlphaColor(attenueCouleur(_icon.getCouleur()), alpha_)); - } else if (EbliLib.isAlphaChanged(alpha_)) { - _icon.setCouleur(EbliLib.getAlphaColor(_icon.getCouleur(), alpha_)); - } - } - - protected void paintSelectionMulti(final Graphics _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, - final GrBoite _clipReel) { - if ((isRapide()) || (isSelectionEmpty())) { - return; - } - final GrBoite clip = _clipReel; - if (!getDomaine().intersectXY(clip)) { - return; - } - Color cs = _trace.getColor(); - if (isAttenue()) { - cs = attenueCouleur(cs); - } - _g.setColor(cs); - final TraceIcon ic = _trace.getIconeInterne(); - final TIntObjectIterator it = selectionMulti_.getIterator(); - final GrPoint p = new GrPoint(); - final GrMorphisme versEcran = _versEcran; - for (int i = selectionMulti_.getNbListSelected(); i-- > 0;) { - it.advance(); - final CtuluListSelectionInterface s = (CtuluListSelectionInterface) it.value(); - if (!s.isEmpty()) { - final int idxPoly = it.key(); - final int min = s.getMinIndex(); - for (int j = s.getMaxIndex(); j >= min; j--) { - if (s.isSelected(j)) { - modele_.point(p, idxPoly, j); - if (clip.contientXY(p)) { - p.autoApplique(versEcran); - ic.paintIconCentre(this, _g, p.x_, p.y_); - } - } - } - } - } - } - - public boolean changeSelection(final GrPoint _pt, final int _tolerancePixel, final int _action) { - if (isAtomicMode_) { - final EbliListeSelectionMulti l = selectionMulti(_pt, _tolerancePixel); - changeSelectionMulti(l, _action); - if ((l == null) || (l.isEmpty())) { - return false; - } - return true; - } - return super.changeSelection(_pt, _tolerancePixel, _action); - } - - public boolean changeSelection(final LinearRing _poly, final int _action, final int _mode) { - if (isAtomicMode_) { - final EbliListeSelectionMulti l = selectionMulti(_poly); - changeSelectionMulti(l, _action); - if ((l == null) || (l.isEmpty())) { - return false; - } - return true; - } - return super.changeSelection(_poly, _action, _mode); - } - - private void changeSelectionMulti(final EbliListeSelectionMulti _s, final int _action) { - // Si la selection de modif est nulle, seule l'action de remplacement - // est concernee. - if (selectionMulti_ == null) { - selectionMulti_ = creeSelectionMutli(); - } - boolean sentEvent = false; - switch (_action) { - case EbliSelectionState.ACTION_ADD: - sentEvent = selectionMulti_.add(_s); - break; - case EbliSelectionState.ACTION_DEL: - sentEvent = selectionMulti_.remove(_s); - break; - case EbliSelectionState.ACTION_XOR: - sentEvent = selectionMulti_.xor(_s); - break; - case EbliSelectionState.ACTION_REPLACE: - selectionMulti_.setSelection(_s); - sentEvent = true; - break; - default: - break; - } - if (sentEvent) { - fireSelectionEvent(); - } - } - - public void clearSelection() { - // dans le mode edition de noeuds - if (isAtomicMode_) { - if (selectionMulti_ != null && !selectionMulti_.isEmpty()) { - - selectionMulti_.clear(); - fireSelectionEvent(); - } - } else { - super.clearSelection(); - } - } - - public EbliFindExpressionContainerInterface getExpressionContainer() { - if (isAtomicMode_) { - return new CalqueFindExpression(modele_); - } - return new VariableNonAtomicFindExpression(); - } - - public EbliListeSelectionMultiInterface getLayerSelectionMulti() { - return selectionMulti_; - } - - public int getNbSelected() { - if (isSelectionEmpty()) { - return 0; - } - if (isAtomicMode_) { - return selectionMulti_.getNbListSelected(); - } - return super.getNbSelected(); - } - - public int[] getSelectedIndex() { - if (isSelectionEmpty()) { - return null; - } - if (isAtomicMode_) { - return selectionMulti_.getIdxSelected(); - } - return super.getSelectedIndex(); - } - - public int[] getSelectedObjectInTable() { - if (isSelectionEmpty()) { - return null; - } - if (!isAtomicMode_) { - return super.getSelectedObjectInTable(); - } - final EbliListeSelectionMultiInterface multi = getLayerSelectionMulti(); - int nb = 0; - // 20 points par lignes - final TIntArrayList list = new TIntArrayList(modele_.getNombre() * 20); - final int nbLigne = modele_.getNombre(); - for (int i = 0; i < nbLigne; i++) { - final CtuluListSelectionInterface sel = multi.getSelection(i); - if (sel != null) { - final int max = sel.getMaxIndex(); - for (int j = sel.getMinIndex(); j <= max; j++) { - if (sel.isSelected(j)) { - list.add(nb + j); - } - } - - } - nb += modele_.getNbPointForGeometry(i); - } - - return list.toNativeArray(); - } - - public GrBoite getDomaineOnSelected() { - if (isSelectionEmpty()) { - return null; - } - final Envelope env = new Envelope(); - if (isAtomicMode_) { - final EbliListeSelectionMultiInterface multi = getLayerSelectionMulti(); - Coordinate c=new Coordinate(); - final TIntObjectIterator it = multi.getIterator(); - for (int i = multi.getNbListSelected(); i-- > 0;) { - it.advance(); - final CtuluListSelectionInterface atomSel = (CtuluListSelectionInterface) it.value(); - final CoordinateSequence seq = modele_.getGeomData().getCoordinateSequence(it.key()); - final int max = atomSel.getMaxIndex(); - for (int j = atomSel.getMinIndex(); j <= max; j++) { - if (atomSel.isSelected(j)) { - seq.getCoordinate(j,c); - env.expandToInclude(c); - } - } - } - - } else { - final CtuluListSelectionInterface sel = getLayerSelection(); - final int max = sel.getMaxIndex(); - for (int i = sel.getMinIndex(); i <= max; i++) { - if (sel.isSelected(i)) { - env.expandToInclude(modele_.getGeomData().getGeometry(i).getEnvelopeInternal()); - } - } - } - final GrBoite r = new GrBoite(); - r.ajuste(env.getMaxX(), env.getMaxY(), 0); - r.ajuste(env.getMinX(), env.getMinY(), 0); - return r; - } - - public void initFrom(final EbliUIProperties _p) { - if (_p != null) { - super.initFrom(_p); - if (_p.isDefined("calqueGIS.ligneModel")) { - setLineModel(0, (TraceLigneModel) _p.get("calqueGIS.ligneModel")); - } - } - } - - public void inverseSelection() { - if (!isAtomicMode_) { - super.inverseSelection(); - return; - } - if (isSelectionEmpty()) { - return; - } - for (int i = modele_.getNombre() - 1; i >= 0; i--) { - final CtuluListSelection s = selectionMulti_.get(i); - if (s != null) { - s.inverse(modele_.getNbPointForGeometry(i)); - } - } - fireSelectionEvent(); - } - /** - * @return true si on est dans le mode edition de noeuds - */ - public boolean isAtomicMode() { - return isAtomicMode_; - } - - public boolean isPaletteModifiable() { - return false; - } - - /** - * Indique si la s\xE9lection est vide. - * @return true Si aucun objet ni aucun point en mode atomique selectionn\xE9. - */ - public boolean isSelectionEmpty() { - return isAtomicMode_ ? selectionMulti_ == null ? true : selectionMulti_.isEmpty() : super.isSelectionEmpty(); - } - - public boolean isTitleModifiable() { - return true; - } - - /** * @param _modele Modele */ public void modele(final ZModeleMultiPoint _modele) { if (modele_ != _modele) { - final ZModeleMultiPoint vp = modele_; + final ZModeleMultiPoint vp = (ZModeleMultiPoint)modele_; modele_ = _modele; firePropertyChange("modele", vp, modele_); } } - public ZModeleDonnees modeleDonnees() { - return modele_; + public ZModeleMultiPoint modeleDonnees() { + return (ZModeleMultiPoint)modele_; } - - /** - * @param _g - */ - 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 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 GrBoite bPoly = new GrBoite(); - bPoly.o_ = new GrPoint(); - bPoly.e_ = new GrPoint(); - - // 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--) { - // il n'y a pas de points pour cette ligne - if (modele_.getNbPointForGeometry(i) <= 0) { - 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; - } - if (!isRapide()) 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); - if (!_clipReel.contientXY(ptDest)) { - continue; - } - ptDest.autoApplique(versEcran); - icone.paintIconCentre(this, _g, ptDest.x_, ptDest.y_); - } - } - } - } - - public void paintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, - final GrBoite _clipReel) { - if (isSelectionEmpty()) return; - - if (isAtomicMode_) { - if (traceAtomic_==null) { - Color cg=attenueCouleur(_trace.getColor()); - Color cs=_trace.getColor(); - traceAtomic_=new ZSelectionTrace(cg,cs); - } - CtuluListSelection containers=new CtuluListSelection(selectionMulti_.getIdxSelection()); - paintSelectionSimple(_g, traceAtomic_, _versEcran, _clipReel, containers); - paintSelectionMulti(_g, traceAtomic_, _versEcran, _clipReel); - } else { - paintSelectionSimple(_g, _trace, _versEcran, _clipReel, selection_); - } - } - - public void paintSelectionSimple(final Graphics _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, - final GrBoite _clipReel, CtuluListSelection _containers) { - 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 TraceIcon ic = _trace.getIcone(); - final int nb = Math.min(_containers.getMaxIndex(), modele_.getNombre() - 1); - - final GrBoite btgeom = new GrBoite(); - btgeom.e_ = new GrPoint(); - btgeom.o_ = new GrPoint(); - for (int i = nb; i >= 0; i--) { - if (!_containers.isSelected(i)) { - continue; - } - modele_.getDomaineForGeometry(i, 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 nbPoints = modele_.getNbPointForGeometry(i); - final GrPoint pt = new GrPoint(); - for (int j=0; j<nbPoints; j++) { - modele_.point(pt, i, j); - pt.autoApplique(versEcran); - ic.paintIconCentre(this, _g, pt.x_, pt.y_); - } - } - } - - public void selectAll() { - if (!isVisible()) return; - - if (!isAtomicMode_) { - super.selectAll(); - return; - } - if (selectionMulti_ == null) { - selectionMulti_ = creeSelectionMutli(); - } - for (int i = modele_.getNombre() - 1; i >= 0; i--) { - CtuluListSelection s = selectionMulti_.get(i); - if (s == null) { - s = new CtuluListSelection(modele_.getNbPointForGeometry(i)); - selectionMulti_.set(i, s); - } - s.setSelectionInterval(0, modele_.getNbPointForGeometry(i) - 1); - } - fireSelectionEvent(); - } - - 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 GrBoite bPoly = new GrBoite(new GrPoint(), new GrPoint()); - for (int i = modele_.getNombre() - 1; i >= 0; i--) { - modele_.getDomaineForGeometry(i, bPoly); - if (bPoly.contientXY(_pt)||bPoly.distanceXY(_pt)<distanceReel) { - for (int j=modele_.getNbPointForGeometry(i)-1; j>=0; j--) { - modele_.point(pt, i, j); - if (pt.distanceXY(_pt)<distanceReel) { - final CtuluListSelection r=new CtuluListSelection(1); - r.setSelectionInterval(i, i); - return r; - } - } - } - } - return null; - } - - public CtuluListSelection selection(final LinearRing _poly, final int _mode) { - if (modele_.getNombre() == 0 || !isVisible()) { - return null; - } - final Envelope polyEnv = _poly.getEnvelopeInternal(); - final GrBoite domaineBoite = getDomaine(); - final Envelope domaine = new Envelope(domaineBoite.e_.x_, domaineBoite.o_.x_, domaineBoite.e_.y_, - domaineBoite.o_.y_); - // si l'envelop du polygone n'intersect pas le domaine, il n'y a pas de - // selection - if (!polyEnv.intersects(domaine)) { - return null; - } - - final SIRtreePointInRing tester = new SIRtreePointInRing(_poly); - final Coordinate c = new Coordinate(); - final CtuluListSelection r = creeSelection(); - final GrPoint p = new GrPoint(); - final GrBoite bPoly = new GrBoite(new GrPoint(), new GrPoint()); - for (int i = modeleDonnees().getNombre() - 1; i >= 0; i--) { - modele_.getDomaineForGeometry(i, bPoly); - // si le poly est dans dans le poly de selection - boolean selected = false; - if (_mode == EbliSelectionMode.MODE_ALL) { - if (polyEnv.contains(bPoly.e_.x_, bPoly.e_.y_) && polyEnv.contains(bPoly.o_.x_, bPoly.o_.y_)) { - selected = true; - for (int j = modele_.getNbPointForGeometry(i) - 1; (j >= 0) && selected; j--) { - modele_.point(p, i, j); - c.x = p.x_; - c.y = p.y_; - if (!tester.isInside(c)) { - selected = false; - } - } - } - } else if (_mode == EbliSelectionMode.MODE_ONE) { - if (polyEnv.intersects(bPoly.getEnv())) { - for (int j = modele_.getNbPointForGeometry(i) - 1; (j >= 0) && !selected; j--) { - modele_.point(p, i, j); - c.x = p.x_; - c.y = p.y_; - if (GISLib.isSelectedEnv(c, _poly, polyEnv, tester)) { - selected = true; - } - } - } - - } else if (_mode == EbliSelectionMode.MODE_CENTER) { - final CoordinateSequence coordinateSequence = modele_.getGeomData().getCoordinateSequence(i); - c.x = GISLib.getMoyX(coordinateSequence); - c.y = GISLib.getMoyY(coordinateSequence); - selected = GISLib.isSelectedEnv(c, _poly, polyEnv, tester); - - } - if (selected) { - r.add(i); - } - } - if (r.isEmpty()) { - return null; - } - return r; - } - - /** - * Renvoie la liste des objets selectionnees pour le point <code>_pt</code> avec pour tolerance - * <code>_tolerance</code>. - * - * @param _pt - * @param _tolerance - * @return la liste des indexs selectionnes (ou null si aucune selection) - */ - public EbliListeSelectionMulti selectionMulti(final GrPoint _pt, final int _tolerance) { - final GrMorphisme versReel = getVersReel(); - GrBoite bClip = getDomaine(); - if (bClip == null || (!bClip.contientXY(_pt)) && (bClip.distanceXY(_pt) > _tolerance)) { - return null; - } - final double distanceReel = GrMorphisme.convertDistanceXY(versReel, _tolerance); - bClip = getClipReel(getGraphics()); - final GrPoint p = new GrPoint(); - final GrBoite btLigne = new GrBoite(); - for (int i = modele_.getNombre() - 1; i >= 0; i--) { - modele_.getDomaineForGeometry(i, btLigne); - if (btLigne.contientXY(_pt) || btLigne.distanceXY(_pt) < distanceReel) { - for (int j = modele_.getNbPointForGeometry(i) - 1; j >= 0; j--) { - modele_.point(p, i, j); - if (bClip.contientXY(p) && (p.distanceXY(_pt) < distanceReel)) { - final EbliListeSelectionMulti r = new EbliListeSelectionMulti(1); - r.set(i, j); - return r; - } - } - } - } - return null; - } - - public EbliListeSelectionMulti selectionMulti(final LinearRing _poly) { - if (modele_.getNombre() == 0 || !isVisible()) { - return null; - } - final Envelope polyEnv = _poly.getEnvelopeInternal(); - final GrBoite domaineBoite = getDomaine(); - final Envelope domaine = new Envelope(domaineBoite.e_.x_, domaineBoite.o_.x_, domaineBoite.e_.y_, - domaineBoite.o_.y_); - // si l'envelop du polygone n'intersect pas le domaine, il n'y a pas de - // selection - if (!polyEnv.intersects(domaine)) { - return null; - } - final EbliListeSelectionMulti r = creeSelectionMutli(); - final GrPoint p = new GrPoint(); - final SIRtreePointInRing tester = new SIRtreePointInRing(_poly); - final Coordinate c = new Coordinate(); - for (int i = modele_.getNombre() - 1; i >= 0; i--) { - CtuluListSelection l = null; - final int nbPt = modele_.getNbPointForGeometry(i); - for (int j = nbPt - 1; j >= 0; j--) { - modele_.point(p, i, j); - c.x = p.x_; - c.y = p.y_; - if ((polyEnv.contains(c)) && (tester.isInside(c))) { - if (l == null) { - l = new CtuluListSelection(nbPt); - } - l.add(j); - } - } - if (l != null) { - r.set(i, l); - } - } - if (r.isEmpty()) { - return null; - } - return r; - } - - /** - * D\xE9finit que les modifications d'objets auront lieu en mode atomique. - * @param _new true : Modifications en mode atomique. - * @return true si l'appel a produit un changement de mode. - */ - public boolean setAtomicMode(final boolean _new) { - if (_new != isAtomicMode_) { - isAtomicMode_ = _new; - firePropertyChange("mode", !isAtomicMode_, isAtomicMode_); - clearSelection(); - return true; - } - return false; - } - - public boolean setSelection(final int[] _idx) { - if (!isAtomicMode_) { - return super.setSelection(_idx); - } - // TODO : Traitement a faire si on est en mode atomique. - FuLog.warning("EBL:ZCalqueLigneBrisee.setSelection() can't be called in atomic mode"); - return false; - } - - public boolean setTitle(final String _title) { - final boolean r = super.setTitle(_title); - if (r && modele_ != null && modele_.getGeomData() != null) { - modele_.getGeomData().setTitle(_title, null); - } - return r; - } - - private LineString createLineFromSelection(final int _i, final CtuluListSelectionInterface _selection, final int _nbSelected) { - final LineString geom = (LineString) modele_.getGeomData().getGeometry(_i); - final Coordinate[] cs = new Coordinate[_nbSelected]; - final int[] idx = _selection.getSelectedIndex(); - for (int j = 0; j < _nbSelected; j++) { - cs[j] = geom.getCoordinateN(idx[j]); - } - return GISGeometryFactory.INSTANCE.createLineString(cs); - } - - public LineString getSelectedLine() { - if (isSelectionEmpty()) { - return null; - } - // en mode normal (pas de vertex selectionne), on renvoie la ligne s\xE9lectionn\xE9e - if (!isAtomicMode()) { -// return getLayerSelection().getNbSelectedIndex() == 1 ? (LineString) modele_.getGeomData().getGeometry( -// getLayerSelection().getMaxIndex()) : null; - throw new UnsupportedOperationException("Can't create line from vertices"); - } - // mode vertex - final EbliListeSelectionMultiInterface select = getLayerSelectionMulti(); - // mode vertex - // la selection se situe dans la meme ligne - if (select.getNbListSelected() == 1) { - final int i = select.getIdxSelected()[0]; - final CtuluListSelectionInterface selection = select.getSelection(i); - final int nbSelected = selection.getNbSelectedIndex(); - // deux sommets s\xE9lectionn\xE9s: on choisit la ligne en les 2 sommets - if (nbSelected == 2) { - return createLineFromSelection(i, selection, nbSelected); - - } else if (nbSelected >= 2) { - final int nbPointForLigne = modele_.getNbPointForGeometry(i); - final int[] res = CtuluListSelection.isSelectionContiguous(select.getSelection(i), nbPointForLigne); - if (res == null) { - return null; - } - // selection normale - if (res[0] < res[1]) { - return createLineFromSelection(i, selection, nbSelected); - } - } - } else if (select.getNbListSelected() == 2) { - final int[] idx = select.getIdxSelected(); - final CtuluListSelectionInterface selection1 = select.getSelection(idx[0]); - final CtuluListSelectionInterface selection2 = select.getSelection(idx[1]); - if (selection1.getNbSelectedIndex() == 1 && selection2.getNbSelectedIndex() == 1) { - final Coordinate[] cs = new Coordinate[2]; - cs[0] = ((Geometry)modele_.getGeomData().getGeometry(idx[0])).getCoordinates()[selection1.getMaxIndex()]; - cs[1] = ((Geometry)modele_.getGeomData().getGeometry(idx[1])).getCoordinates()[selection2.getMaxIndex()]; - return GISGeometryFactory.INSTANCE.createLineString(cs); - } - } - return null; - } - } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueMultiPoint.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java 2008-10-07 13:59:38 UTC (rev 4040) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java 2008-10-07 14:12:32 UTC (rev 4041) @@ -1,6 +1,6 @@ /* * @creation 4 avr. 2005 - * @modification $Date: 2008-05-13 12:10:33 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -14,52 +14,48 @@ import javax.swing.table.AbstractTableModel; -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; - -import com.memoire.bu.BuTable; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.collection.CtuluCollection; -import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeInterface; import org.fudaa.ctulu.gis.GISAttributeModel; import org.fudaa.ctulu.gis.GISLib; import org.fudaa.ctulu.gis.GISZoneCollection; +import org.fudaa.ctulu.gis.GISZoneCollectionGeometry; import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee; import org.fudaa.ctulu.gui.CtuluTable; - import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.calque.ZCalqueLigneBrisee; import org.fudaa.ebli.calque.ZModeleLigneBrisee; import org.fudaa.ebli.commun.EbliLib; -import org.fudaa.ebli.geometrie.GrBoite; -import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; +import com.memoire.bu.BuTable; +import com.memoire.fu.FuLog; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.LinearRing; + /** * @author Fred Deniger - * @version $Id: ZModeleLigneBriseeDefault.java,v 1.20.6.3 2008-05-13 12:10:33 bmarchan Exp $ + * @version $Id$ */ -public class ZModeleLigneBriseeDefault implements ZModeleLigneBrisee, ZModeleEditable { +public class ZModeleLigneBriseeDefault extends ZModeleGeometryDefault + implements ZModeleLigneBrisee, ZModeleEditable { /** * @author Fred Deniger - * @version $Id: ZModeleLigneBriseeDefault.java,v 1.20.6.3 2008-05-13 12:10:33 bmarchan Exp $ + * @version $Id$ */ public static class AtomesTableModel extends AbstractTableModel { GISAttributeInterface[] att_; - final GISZoneCollectionLigneBrisee ligne_; + final GISZoneCollectionGeometry ligne_; final int[] nbLineAtoms_; @@ -67,7 +63,7 @@ final int nb_; - public AtomesTableModel(final GISZoneCollectionLigneBrisee _ligne) { + public AtomesTableModel(final GISZoneCollectionGeometry _ligne) { ligne_ = _ligne; nbLineAtoms_ = new int[_ligne.getNumGeometries()]; lineClosed_ = new boolean[_ligne.getNumGeometries()]; @@ -163,7 +159,7 @@ /** * @author Fred Deniger - * @version $Id: ZModeleLigneBriseeDefault.java,v 1.20.6.3 2008-05-13 12:10:33 bmarchan Exp $ + * @version $Id$ */ public static class LignesTableModel extends AbstractTableModel { @@ -237,8 +233,6 @@ } } - protected GISZoneCollectionLigneBrisee geometries_; - public ZModeleLigneBriseeDefault() {} /** @@ -250,15 +244,15 @@ } public final boolean containsPolygone() { - return geometries_ == null ? false : geometries_.containsPolygone(); + return geometries_ == null ? false : getGeomData().containsPolygone(); } public BuTable createValuesTable(final ZCalqueAffichageDonneesInterface _layer) { final BuTable r = new CtuluTable(); if (((ZCalqueLigneBrisee) _layer).isAtomicMode()) { - r.setModel(new AtomesTableModel(geometries_)); + r.setModel(new AtomesTableModel(getGeomData())); } else { - r.setModel(new LignesTableModel(true, geometries_)); + r.setModel(new LignesTableModel(true, getGeomData())); } return r; } @@ -335,48 +329,10 @@ } } - /** - * @return la collection a la base du modele. - */ - public final GISZoneCollectionLigneBrisee getCollection() { - return geometries_; + public final GISZoneCollectionLigneBrisee getGeomData() { + return (GISZoneCollectionLigneBrisee)geometries_; } - public final GrBoite getDomaine() { - if (geometries_ == null || geometries_.getNumGeometries() == 0) { - return null; - } - final Envelope e = geometries_.getEnvelopeInternal(); - if (e == null) { - return null; - } - return new GrBoite(new GrPoint(e.getMinX(), e.getMinY(), 0), new GrPoint(e.getMaxX(), e.getMaxY(), 0)); - } - - public final void getDomaineForGeometry(final int _idxLigne, final GrBoite _target) { - if (geometries_ == null || geometries_.getNumGeometries() == 0) { - return; - } - final Geometry g = geometries_.getGeometry(_idxLigne); - final Envelope e = g.getEnvelopeInternal(); - if (_target.o_ == null) { - _target.o_ = new GrPoint(); - } - if (_target.e_ == null) { - _target.e_ = new GrPoint(); - } - if (e != null && !e.isNull()) { - _target.o_.x_ = e.getMinX(); - _target.o_.y_ = e.getMinY(); - _target.e_.x_ = e.getMaxX(); - _target.e_.y_ = e.getMaxY(); - } - } - - public final GISZoneCollection getGeomData() { - return geometries_; - } - public final int getNbPolyligne() { return getNombre()-getNbPolygone(); } @@ -404,48 +360,14 @@ return GISLib.getNbGeomOf(LinearRing.class, geometries_); } - public final int getNombre() { - return geometries_ == null ? 0 : geometries_.getNumGeometries(); - } - - public final Object getObject(final int _ind) { - return geometries_ == null ? null : geometries_.getGeometry(_ind); - } - public boolean isCoordinateValid(final CoordinateSequence _seq, final CtuluAnalyze _analyze) { return false; } - public final boolean isGeometryFermee(final int _idxLigne) { - return geometries_ == null ? false : ((LineString) geometries_.getGeometry(_idxLigne)).isClosed(); - } - - public final boolean isGeometryReliee(final int _idxLigne) { - return true; - } - - public final boolean isGeometryVisible(final int _idxGeom) { - int iattVisibility=geometries_.getIndiceOf(GISAttributeConstants.VISIBILITE); - if (iattVisibility==-1) return true; - - return (Boolean)geometries_.getValue(iattVisibility, _idxGeom); - } - public boolean isValuesTableAvailable() { return true; } - public final boolean point(final GrPoint _pt, final int _ligneIdx, final int _pointIdx) { - final CoordinateSequence g = ((LineString) geometries_.getGeometry(_ligneIdx)).getCoordinateSequence(); - _pt.x_ = g.getX(_pointIdx); - _pt.y_ = g.getY(_pointIdx); - return true; - } - - public void prepareExport() { - geometries_.prepareExport(); - } - protected void fillWithAtomicInfo(final int _idxLigne, final int _idxPt, final InfoData _d) { final GISZoneCollection model = getGeomData(); final int nbAtt = model.getNbAttributes(); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-07 13:59:38 UTC (rev 4040) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-07 14:12:32 UTC (rev 4041) @@ -1,6 +1,6 @@ /* * @creation 4 avr. 2005 - * @modification $Date: 2008-05-13 12:10:33 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -39,7 +39,7 @@ /** * @author Fred Deniger - * @version $Id: ZModeleLigneBriseeEditable.java,v 1.11.6.7 2008-05-13 12:10:33 bmarchan Exp $ + * @version $Id$ */ public class ZModeleLigneBriseeEditable extends ZModeleLigneBriseeDefault{ @@ -202,7 +202,7 @@ return false; } if (r) { - geometries_.addPolygone(poly, data, _cmd); + getGeomData().addPolygone(poly, data, _cmd); } return r; } @@ -246,7 +246,7 @@ return false; } if (r) { - geometries_.addPolyligne(poly, data, _cmd); + getGeomData().addPolyligne(poly, data, _cmd); } return r; } @@ -334,8 +334,8 @@ // Remplacement dans la collection. geometries_.removeGeometries(new int[]{_ligneIdx}, cmp); - geometries_.addPolyligne((GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(cline1), dataline1, cmp); - geometries_.addPolyligne((GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(cline2), dataline2, cmp); + getGeomData().addPolyligne((GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(cline1), dataline1, cmp); + getGeomData().addPolyligne((GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(cline2), dataline2, cmp); if (_cmd != null) { _cmd.addCmd(cmp.getSimplify()); @@ -431,7 +431,7 @@ } // Remplacement dans la collection. - geometries_.addPolyligne((GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(cline), dataline, cmp); + getGeomData().addPolyligne((GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(cline), dataline, cmp); geometries_.removeGeometries(_ligneIdx, cmp); if (_cmd != null) { Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2008-10-07 13:59:38 UTC (rev 4040) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2008-10-07 14:12:32 UTC (rev 4041) @@ -1,6 +1,6 @@ /* * @creation 4 avr. 2005 - * @modification $Date: 2008-05-13 12:10:22 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -14,14 +14,6 @@ import javax.swing.table.AbstractTableModel; -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.memoire.bu.BuTable; -import com.memoire.fu.FuLog; - import org.fudaa.ctulu.CtuluAnalyze; import org.fudaa.ctulu.CtuluCommandComposite; import org.fudaa.ctulu.CtuluCommandContainer; @@ -40,26 +32,29 @@ import org.fudaa.ctulu.gis.GISZoneCollection; import org.fudaa.ctulu.gis.GISZoneCollectionMultiPoint; import org.fudaa.ctulu.gui.CtuluTable; - import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.calque.ZCalqueMultiPoint; import org.fudaa.ebli.calque.ZModeleMultiPoint; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.commun.EbliListeSelectionMultiInterface; -import org.fudaa.ebli.geometrie.GrBoite; -import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.palette.BPaletteInfo.InfoData; +import com.memoire.bu.BuTable; +import com.memoire.fu.FuLog; +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.Geometry; + /** * Une implementation par defaut d'un mod\xE8le \xE9ditable pour des multipoints. * @author Bertrand Marchand - * @version $Id: ZModeleMultiPointEditable.java,v 1.1.2.4 2008-05-13 12:10:22 bmarchan Exp $ + * @version $Id$ */ -public class ZModeleMultiPointEditable implements ZModeleMultiPoint, ZModeleEditable { +public class ZModeleMultiPointEditable extends ZModeleGeometryDefault implements ZModeleMultiPoint, ZModeleEditable { /** * @author Bertrand Marchand - * @version $Id: ZModeleMultiPointEditable.java,v 1.1.2.4 2008-05-13 12:10:22 bmarchan Exp $ + * @version $Id$ */ public static class AtomesTableModel extends AbstractTableModel { @@ -164,7 +159,7 @@ /** * @author Fred Deniger - * @version $Id: ZModeleMultiPointEditable.java,v 1.1.2.4 2008-05-13 12:10:22 bmarchan Exp $ + * @version $Id$ */ public static class LignesTableModel extends AbstractTableModel { @@ -223,8 +218,6 @@ } } - protected GISZoneCollectionMultiPoint geometries_; - /** * @param _zone la zone: non copiee */ @@ -236,9 +229,9 @@ public BuTable createValuesTable(final ZCalqueAffichageDonneesInterface _layer) { final BuTable r = new CtuluTable(); if (((ZCalqueMultiPoint) _layer).isAtomicMode()) { - r.setModel(new AtomesTableModel(geometries_)); + r.setModel(new AtomesTableModel(getGeomData())); } else { - r.setModel(new LignesTableModel(geometries_)); + r.setModel(new LignesTableModel(getGeomData())); } return r; } @@ -298,41 +291,13 @@ } } - public final GrBoite getDomaine() { - if (geometries_ == null || geometries_.getNumGeometries() == 0) { - return null; - } - final Envelope e = geometries_.getEnvelopeInternal(); - if (e == null) { - return null; - } - return new GrBoite(new GrPoint(e.getMinX(), e.getMinY(), 0), new GrPoint(e.getMaxX(), e.getMaxY(), 0)); + public final GISZoneCollectionMultiPoint getGeomData() { + return (GISZoneCollectionMultiPoint)geometries_; } - public final void getDomaineForGeometry(final int _idxLigne, final GrBoite _target) { - if (geometries_ == null || geometries_.getNumGeometries() == 0) { - return; - } - final Geometry g = geometries_.getGeometry(_idxLigne); - final Envelope e = g.getEnvelopeInternal(); - if (_target.o_ == null) { - _target.o_ = new GrPoint(); - } - if (_target.e_ == null) { - _target.e_ = new GrPoint(); - } - if (e != null && !e.isNull()) { - _target.o_.x_ = e.getMinX(); - _target.o_.y_ = e.getMinY(); - _target.e_.x_ = e.getMaxX(); - _target.e_.y_ = e.getMaxY(); - } - } - - public final GISZoneCollection getGeomData() { - return geometries_; - } - + /* + * Surcharge pour acceleration des traitements. + */ public final int getNbPointForGeometry(final int _idxLigne) { if (geometries_ == null) { return 0; @@ -342,14 +307,6 @@ // return gi.getNumPoints(); } - public final int getNombre() { - return geometries_ == null ? 0 : geometries_.getNumGeometries(); - } - - public final Object getObject(final int _ind) { - return geometries_ == null ? null : geometries_.getGeometry(_ind); - } - public boolean isCoordinateValid(final CoordinateSequence _seq, final CtuluAnalyze _analyze) { if (_seq == null || _seq.size()<=0) { _analyze.addFatalError(EbliLib.getS("Pas de coordonn\xE9es")); @@ -361,21 +318,7 @@ public boolean isValuesTableAvailable() { return true; } - - public final boolean point(final GrPoint _pt, final int _ligneIdx, final int _pointIdx) { - // On s'appuie sur la m\xE9thode GISMultiPoint.getCoordinateSequence() cr\xE9\xE9e pour l'occasion et non GISMultiPoint.getCoordinates() - // pour r\xE9cuperer les coordonn\xE9es d'un point. En effet, recup\xE9rer le tableau des coordonn\xE9es s'av\xE8re terriblement - // penalisant pour l'affichage. - final CoordinateSequence g = ((GISMultiPoint) geometries_.getGeometry(_ligneIdx)).getCoordinateSequence(); - _pt.x_ = g.getX(_pointIdx); - _pt.y_ = g.getY(_pointIdx); - return true; - } - public void prepareExport() { - geometries_.prepareExport(); - } - protected void fillWithAtomicInfo(final int _idxLigne, final int _idxPt, final InfoData _d) { final GISZoneCollection model = getGeomData(); final int nbAtt = model.getNbAttributes(); @@ -858,18 +801,6 @@ if (_cmd!=null) _cmd.addCmd(cmp.getSimplify()); return true; } - - public boolean isGeometryFermee(int _idxGeom) { - return false; - } - - public boolean isGeometryReliee(int _idxGeom) { - return false; - } - - public final boolean isGeometryVisible(final int _idxLigne) { - return true; - } /** * Fait passer la g\xE9om\xE9trie en Modifier Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanLayer.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanLayer.java 2008-10-07 13:59:38 UTC (rev 4040) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanLayer.java 2008-10-07 14:12:32 UTC (rev 4041) @@ -1,6 +1,6 @@ /* * @creation 14 avr. 2005 - * @modification $Date: 2007-01-19 13:14:09 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -18,7 +18,7 @@ /** * @author Fred Deniger - * @version $Id: TrSiPlanLayer.java,v 1.25 2007-01-19 13:14:09 deniger Exp $ + * @version $Id$ */ public class TrSiPlanLayer extends FSigLayerLine { @@ -50,7 +50,7 @@ } public TrSiProfilModel.Zone getZone() { - return (TrSiProfilModel.Zone) ((ZModeleLigneBriseeDefault) getModele()).getCollection(); + return (TrSiProfilModel.Zone) ((ZModeleLigneBriseeDefault) getModele()).getGeomData(); } } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanLayer.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-10-07 14:04:00
|
Revision: 4040 http://fudaa.svn.sourceforge.net/fudaa/?rev=4040&view=rev Author: bmarchan Date: 2008-10-07 13:59:38 +0000 (Tue, 07 Oct 2008) Log Message: ----------- Correction pour JUnit fonctionnel Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/TestJCtuluLib.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/TestJCtuluLib.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/TestJCtuluLib.java 2008-10-07 08:04:46 UTC (rev 4039) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/test/org/fudaa/ctulu/TestJCtuluLib.java 2008-10-07 13:59:38 UTC (rev 4040) @@ -192,9 +192,9 @@ } public void testToString(){ - File fzip=new File("/tmp/toto.zip"); + File fzip=new File("toto.zip"); File fgz=CtuluLibFile.changeExtension(fzip,"gz"); - assertEquals("/tmp/toto.gz",fgz.getAbsolutePath()); + assertEquals("toto.gz",fgz.getName()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2008-10-07 08:04:48
|
Revision: 4039 http://fudaa.svn.sourceforge.net/fudaa/?rev=4039&view=rev Author: emmanuel_martin Date: 2008-10-07 08:04:46 +0000 (Tue, 07 Oct 2008) Log Message: ----------- bug fix : verification de l'existance de l'attribut ETAT_GEOM avant de le modifier. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.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/layer/MdlModel2dLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dMultiPoint.java Removed Paths: ------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorStringRestricted.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java 2008-10-06 19:31:22 UTC (rev 4038) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java 2008-10-07 08:04:46 UTC (rev 4039) @@ -101,7 +101,13 @@ } }; } - return new DefaultCellEditor(cb); + else { + return new DefaultCellEditor(cb) { + public Object getCellEditorValue() { + return reelChoices_[cb.getSelectedIndex()]; + } + }; + } } public int getSelectedIdx(final Component _c) { Deleted: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorStringRestricted.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorStringRestricted.java 2008-10-06 19:31:22 UTC (rev 4038) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorStringRestricted.java 2008-10-07 08:04:46 UTC (rev 4039) @@ -1,196 +0,0 @@ -/* - * @creation 2 oct. 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.ctulu.gui; - -import java.awt.Component; -import java.util.Enumeration; -import java.util.EventObject; -import java.util.Iterator; -import java.util.Vector; - -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.JTable; -import javax.swing.event.CellEditorListener; -import javax.swing.event.ChangeEvent; -import javax.swing.table.TableCellEditor; - -import org.fudaa.ctulu.CtuluLibString; - -/** - * Cette classe permet de sp\xE9cifier un ensemble de valeur que peut prendre la - * chaine. Ainsi si on a un attribut ne pouvant prendre que 'Oui' et 'Non' comme - * valeur, l'editeur ne donnera le choix qu'entre ces deux l\xE0 lors de la - * modification. Les valeurs possibles ne peuvent \xEAtre que des string. - * - * @author Emmanuel MARTIN - * @version $Id:$ - */ -public class CtuluValueEditorStringRestricted implements CtuluValueEditorI { - - protected class TableCellEditorWithComboBox implements TableCellEditor { - - private JComboBox co_; - private Vector<CellEditorListener> listeners_; - - public TableCellEditorWithComboBox(JComboBox _co) { - if (_co==null) - throw new IllegalArgumentException("Parameter mustn't be null."); - co_=_co; - listeners_=new Vector<CellEditorListener>(); - } - - public Component getTableCellEditorComponent(JTable _table, Object _value, boolean _selected, int _row, int _column) { - return co_; - } - - public void cancelCellEditing() { - ChangeEvent evt=new ChangeEvent(this); - for (Enumeration<CellEditorListener> e=listeners_.elements(); e.hasMoreElements();) - ((CellEditorListener)e.nextElement()).editingCanceled(evt); - } - - public Object getCellEditorValue() { - return co_.getSelectedObjects(); - } - - public boolean isCellEditable(EventObject _evt) { - return true; - } - - public boolean shouldSelectCell(EventObject _evt) { - return true; - } - - public boolean stopCellEditing() { - ChangeEvent evt=new ChangeEvent(this); - for (Enumeration<CellEditorListener> e=listeners_.elements(); e.hasMoreElements();) - ((CellEditorListener)e.nextElement()).editingStopped(evt); - return false; - } - - public void addCellEditorListener(CellEditorListener _l) { - if (!listeners_.contains(_l)) - listeners_.addElement(_l); - } - - public void removeCellEditorListener(CellEditorListener _l) { - listeners_.removeElement(_l); - } - } - - private String[] values_; - private String[] rawValues_; - - /** - * The '_values' parameter can by null. In the case the '_rawValues' will be - * displayed. - * - * @param _rawValues - * Values use by the application - * @param _values - * Values display by the widget - */ - public CtuluValueEditorStringRestricted(String[] _rawValues, String[] _values) { - rawValues_ = _rawValues; - values_=_values; - if(values_!=null && rawValues_.length!=values_.length) - throw new IllegalArgumentException("rawValues and values don't have the same size."); - } - - public CtuluValueEditorStringRestricted(Iterable<String> _rawValues, Iterable<String> _values) { - Vector<String> tmpValues=new Vector<String>(); - // rawValues - Iterator<String> it=_rawValues.iterator(); - for (; it.hasNext();) - tmpValues.add(it.next()); - rawValues_=(String[])tmpValues.toArray(); - // values - if(_values !=null){ - it=_values.iterator(); - for (; it.hasNext();) - tmpValues.add(it.next()); - values_=(String[])tmpValues.toArray(); - } - } - - public Class<String> getDataClass() { - return String.class; - } - - public String getValidationMessage() { - return null; - } - - public boolean isValueValidFromComponent(final Component _comp) { - return isValid(((String)(((JComboBox)_comp).getSelectedItem())).trim()); - } - - public boolean isEmpty(final Component _c) { - final String txt=(String)((JComboBox)_c).getSelectedItem(); - return txt==null||txt.trim().length()==0; - } - - public boolean isEditable() { - return true; - } - - public boolean isValid(final String _s) { - return true; - } - - public Object getValue(final Component _comp) { - return getStringValue(_comp); - } - - public boolean isValid(final Object _o) { - return isValid(_o.toString()); - } - - public JComponent createCommonEditorComponent() { - return createEditorComponent(); - } - - public String[] getAllowedValues() { - return values_.clone(); - } - - public int getNbAllowedValues() { - return values_.length; - } - - public void setValue(final Object _s, final Component _comp) { - if (_s instanceof String){ - boolean found=false; - int i=-1; - while(!found && ++i<rawValues_.length) - found=rawValues_[i].equals(_s); - if(found) - ((JComboBox)_comp).setSelectedIndex(i); - } - } - - public String toString(final Object _o) { - return _o==null ? CtuluLibString.EMPTY_STRING:_o.toString(); - } - - public String getStringValue(final Component _comp) { - return rawValues_[((JComboBox)_comp).getSelectedIndex()]; - } - - public TableCellEditor createTableEditorComponent() { - return new TableCellEditorWithComboBox((JComboBox)createEditorComponent()); - } - - public JComponent createEditorComponent() { - if(values_!=null) - return new JComboBox(values_); - else - return new JComboBox(rawValues_); - } -} Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-06 19:31:22 UTC (rev 4038) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-07 08:04:46 UTC (rev 4039) @@ -803,7 +803,8 @@ * @param _cmd : */ public void setGeomModif(int _idx, CtuluCommandContainer _cmd) { - getGeomData().getDataModel(getGeomData().getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(_idx, - GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); + int idxAttr = getGeomData().getIndiceOf(GISAttributeConstants.ETAT_GEOM); + if(idxAttr >= 0) + getGeomData().getDataModel(idxAttr).setObject(_idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2008-10-06 19:31:22 UTC (rev 4038) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2008-10-07 08:04:46 UTC (rev 4039) @@ -877,7 +877,8 @@ * @param _cmd : */ public void setGeomModif(int _idx, CtuluCommandContainer _cmd) { - getGeomData().getDataModel(getGeomData().getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(_idx, - GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); + int idxAttr = getGeomData().getIndiceOf(GISAttributeConstants.ETAT_GEOM); + if(idxAttr >= 0) + getGeomData().getDataModel(idxAttr).setObject(_idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2008-10-06 19:31:22 UTC (rev 4038) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2008-10-07 08:04:46 UTC (rev 4039) @@ -308,7 +308,8 @@ * @param _cmd : */ public void setGeomModif(int _idx, CtuluCommandContainer _cmd) { - getGeomData().getDataModel(getGeomData().getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(_idx, - GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); + int idxAttr = getGeomData().getIndiceOf(GISAttributeConstants.ETAT_GEOM); + if(idxAttr >= 0) + getGeomData().getDataModel(idxAttr).setObject(_idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); } } 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 2008-10-06 19:31:22 UTC (rev 4038) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlSceneEditor.java 2008-10-07 08:04:46 UTC (rev 4039) @@ -11,6 +11,7 @@ import java.util.List; import org.fudaa.ctulu.CtuluCommandComposite; +import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluListSelection; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.gis.GISAttributeConstants; @@ -321,8 +322,10 @@ if (zatt!=-1) col.setAttributValue(zatt, idx, vals, cmp); // Changement de l'attribut ETAT_GEOM en modifi\xE9 - col.getDataModel(col.getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, null); - } + int idxAttr = col.getIndiceOf(GISAttributeConstants.ETAT_GEOM); + if(idxAttr >= 0) + col.getDataModel(idxAttr).setObject(idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, null); + } if (mng_ != null) { mng_.addCmd(cmp.getSimplify()); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java 2008-10-06 19:31:22 UTC (rev 4038) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java 2008-10-07 08:04:46 UTC (rev 4039) @@ -69,7 +69,7 @@ GISPolyligne poly = (GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(coords); int idx = geometries_.addGeometry(poly, null, _cmd); if(idx!=-1) - getGeomData().getDataModel(geometries_.getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); + setGeomModif(idx, _cmd); return true; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dMultiPoint.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dMultiPoint.java 2008-10-06 19:31:22 UTC (rev 4038) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dMultiPoint.java 2008-10-07 08:04:46 UTC (rev 4039) @@ -61,7 +61,7 @@ int idx = geometries_.addGeometry(poly, null, _cmd); // Modification de l'etat de la g\xE9ometrie en modifi\xE9e if(idx != -1) - getGeomData().getDataModel(geometries_.getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); + setGeomModif(idx, _cmd); return true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-06 19:32:24
|
Revision: 4038 http://fudaa.svn.sourceforge.net/fudaa/?rev=4038&view=rev Author: hadouxad Date: 2008-10-06 19:31:22 +0000 (Mon, 06 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/.classpath.defaults branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java branches/Prepro-0.92-SNAPSHOT/ebli/.project.defaults branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeListener.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/.classpath.defaults =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/.classpath.defaults 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/.classpath.defaults 2008-10-06 19:31:22 UTC (rev 4038) @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> + <classpathentry excluding="**/EditorJext.java|com/memoire/vacvs/" kind="src" path="src"/> <classpathentry kind="src" path="test"/> <classpathentry exported="true" kind="lib" path="lib/calendarbean.jar"/> Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -110,18 +110,18 @@ else if (lnfname.equals("ASPECT_GTK")) lnfclass = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; else if (lnfname.equals("ASPECT_KUNSTSTOFF")) lnfclass = "com.incors.plaf.kunststoff.KunststoffLookAndFeel"; else if (lnfname.equals("ASPECT_LIQUID")) lnfclass = "com.birosoft.liquid.LiquidLookAndFeel"; -// else if (lnfname.equals("ASPECT_SUBSTANCE")){ -// lnfclass = "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"; -// -// try { -// UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"); -// forced = false; -// } catch (Exception ex) { -// FuLog.error("BPR: could not set substance theme", ex); -// } -// -// -// } + // else if (lnfname.equals("ASPECT_SUBSTANCE")) { + // lnfclass = "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"; + // + // try { + // UIManager.setLookAndFeel( + // "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"); + // forced = false; + // } catch (Exception ex) { + // FuLog.error("BPR: could not set substance theme", ex); + // } + // + // } else if (lnfname.equals("ASPECT_MAC")) { FuLib.setSystemProperty("os.name", "Mac OS"); Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfComputeVolumeSeuil.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -10,10 +10,7 @@ import org.fudaa.ctulu.CtuluVariable; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; -import org.fudaa.dodico.all.SeuilClient; import org.fudaa.dodico.commun.DodicoLib; -import org.fudaa.dodico.ef.EfComputeVolume.ForMeshData; -import org.fudaa.dodico.ef.EfComputeVolume.ForNodeData; import com.memoire.fu.FuLog; @@ -68,7 +65,7 @@ for (int k = 0; k < list.size(); k++) { s += _grid.getAire(list.getQuick(k)); } - double d = s * (_h.getValue(ipt) - seuil_) / 3D; + double d = s * (_h.getValue(ipt)) / 3D - seuil_;// TODO a verifier if (d >= 0) resi.zonePlus_ += d; else resi.zoneMoins_ -= d; } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfDataIntegrale.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -46,9 +46,9 @@ for (int i = 0; i < Math.min(lx.length, ly.length)-1; i++) { double x = lx[i]; - double x2=lx[i+1]; + double x2= lx[i+1]; double y = ly[i]; - double y2 = ly[i+1]; + double y2= ly[i+1]; double ySeuil1=a*x+b; double ySeuil2=a*x2+b; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/.project.defaults =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/.project.defaults 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/.project.defaults 2008-10-06 19:31:22 UTC (rev 4038) @@ -5,6 +5,7 @@ <projects> <project>ctulu</project> </projects> + <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeInteraction.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -46,9 +46,9 @@ listeners_.remove(_l); } - public void notifySondeListener(final MouseEvent _e) { + public void notifySondeListener(final GrPoint pt) { for (ZCalqueSondeListener l : listeners_) - l.notifySondeMoved(this, _e); + l.notifySondeMoved(this, pt); } @@ -62,11 +62,12 @@ public void mouseDragged(final MouseEvent _e){ if (target_ != null && !isGele()){ final GrPoint pt=new GrPoint(_e.getX(),_e.getY(),0); + // final GrPoint clone = new GrPoint(pt); pt.autoApplique(((BCalque)target_).getVersReel()); target_.changeSonde(pt); // -- notify aux sondeListener --// - notifySondeListener(_e); + notifySondeListener(pt); } } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeListener.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeListener.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeListener.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -1,6 +1,6 @@ package org.fudaa.ebli.calque; -import java.awt.event.MouseEvent; +import org.fudaa.ebli.geometrie.GrPoint; /** * Interface pour les listener sur les calqueSondeInteraction. En particulier @@ -13,7 +13,7 @@ public interface ZCalqueSondeListener { - public void notifySondeMoved(final ZCalqueSondeInteraction activator, final MouseEvent _e); + public void notifySondeMoved(final ZCalqueSondeInteraction activator, final GrPoint _e); } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalqueSondeSynchroniserFusion.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -2,7 +2,6 @@ import java.awt.BorderLayout; import java.awt.Frame; -import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; @@ -31,6 +30,8 @@ import org.jdesktop.swingx.treetable.DefaultMutableTreeTableNode; import org.jdesktop.swingx.treetable.DefaultTreeTableModel; +import com.memoire.fu.FuLog; + /** * Manager sp\xE9ciale fusion. Elle contient plusieurs sonde ( de tous les calques * de la fusion). Lors de sa mise a jour, met a jour les sonde de tous les @@ -96,7 +97,7 @@ * lorsque c'est appel\xE9, met a jour les sondes pour tous les autre * zcalquesondeInteraction. */ - public void notifySondeMoved(ZCalqueSondeInteraction _activator, MouseEvent _e) { + public void notifySondeMoved(ZCalqueSondeInteraction _activator, GrPoint _e) { if (structureModel_ == null) structureModel_ = constructStructureModel(); @@ -106,8 +107,11 @@ ZCalqueSondeInteraction sondeInteraction=listeSondeInteractions_.get(i); if (/* sondeInteraction != _activator && */sondeInteraction.getTarget() != null) { // -- on recupere le point et on met a jour les sondes --// - final GrPoint pt = new GrPoint(_e.getX(), _e.getY(), 0); - pt.autoApplique(((BCalque) sondeInteraction.getTarget()).getVersReel()); + final GrPoint pt = new GrPoint(_e);// new GrPoint(_e.getX(), _e.getY(), + // 0); + FuLog.debug("Le point du notify synchroniser est " + pt); + // pt.autoApplique(((BCalque) + // sondeInteraction.getTarget()).getVersReel()); // -- on replace la sonde des autres calques --// ZCalqueSondeInterface objet = sondeInteraction.getTarget(); objet.setSondeEnable(true); Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidget.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -13,7 +13,6 @@ import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ebli.animation.EbliAnimatedInterface; -import org.fudaa.ebli.animation.EbliAnimationAdapterInterface; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BConfigurableComposite; import org.fudaa.ebli.controle.BConfigurableInterface; @@ -23,7 +22,6 @@ import org.fudaa.ebli.visuallibrary.actions.CommandeUndoRedoGraphicalProperties; import org.fudaa.ebli.visuallibrary.actions.WidgetConfigure; import org.fudaa.ebli.visuallibrary.animation.EbliWidgetAnimatedItem; -import org.netbeans.api.visual.border.Border; import org.netbeans.api.visual.model.ObjectState; import org.netbeans.api.visual.widget.Widget; @@ -34,6 +32,7 @@ */ public class EbliWidget extends Widget implements BSelecteurTargetInterface, EbliWidgetInterface<EbliWidgetController> { + public final static String TYPEWIDGET = "CLASSIQUE"; public final static String COLORCONTOUR = "ColorContour"; public final static String COLORFOND = "colorFond"; Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliScenePersist.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -0,0 +1,84 @@ +package org.fudaa.ebli.visuallibrary.persist; + +import java.util.Iterator; + +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Classe qui se charge de sauvegarder le contenu de la ebliScene. + * + * @author Adrien Hadoux + * + */ +public class EbliScenePersist { + + + public final static String PROPERTIES = "Properties"; + + + /** + * Scene dont le contenu est a sauvegarder + */ + EbliScene scene_; + + /** + * titre associ\xE9 a la scene. Peut etre le titre de la frame qui affiche le + * layout par exemple + */ + String title_; + + + + public EbliScenePersist(EbliScene _scene, String _title) { + super(); + scene_ = _scene; + title_ = _title; + } + + /** + * genere le document qui contient le contenu de la scene. + * + * @return + */ + public Document createDescriptorScene(ProgressionInterface prog) { + // creation du document + Document document = ManagerWidgetPersist.createDocument(); + if (document == null) + return null; + + // creation du root avec pour id le titre la frame + Element rootEle = document.createElement(title_); + document.appendChild(rootEle); + + // -- creation des proprietes graphiques de la scene --// + Element propertiesEle = document.createElement(PROPERTIES); + + + // TODO properties.... a faire + rootEle.appendChild(propertiesEle); + + + // -- liste des widgets On cree des objets sans contenus qui decrivent les + // widgets + Iterator<EbliNode> it = (Iterator<EbliNode>) scene_.getObjects().iterator(); + + while (it.hasNext()) { + EbliNode node = it.next(); + // mise a jour infos + prog.setDesc(EbliResource.EBLI.getString("Insertion de la frame ") + node.getTitle()); + + Element widgetEle = new EbliWidgetpersist(node).createDescriptorWidget(document, prog); + rootEle.appendChild(widgetEle); + } + return document; + } + + + + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/EbliWidgetpersist.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -0,0 +1,74 @@ +package org.fudaa.ebli.visuallibrary.persist; + +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetBordureSingle; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Classe qui g\xE8re la sauvegarde des widgets. + * + * @author Adrien Hadoux + * + */ +public class EbliWidgetpersist { + + public final static String BALISEPROPERTIES = "Properties"; + public final static String BALISEWIDGET = "FRAME"; + public final static String TYPE = "Type"; + + // widget construire/sauvegarder + EbliWidget widget_; + + // node correspondant + EbliNode node_; + + /** + * true si le widget a une bordure EbliWidgetBordure. + */ + boolean hasBordure_ = false; + + + + + public EbliWidgetpersist(EbliNode _node) { + super(); + node_ = _node; + + if(_node.getWidget() instanceof EbliWidgetBordureSingle){ + widget_ = (EbliWidget) _node.getWidget().getChildren().get(0); + hasBordure_=true; + } + else + widget_ = _node.getWidget(); + } + + /** + * Genere un element + * + * @param document + * @param prog + * @return + */ + public Element createDescriptorWidget(Document document, ProgressionInterface prog) { + + // element plus haut niveau balise + Element rootEle = document.createElement(BALISEWIDGET); + + // -- creation du type de widget --// + rootEle.setAttribute(TYPE, widget_.TYPEWIDGET); + + //-- creation des proprietes graphiques --// + Element propertiesEle = document.createElement(BALISEPROPERTIES); + // TODO proprietes graphiques + rootEle.appendChild(propertiesEle); + + + + + return rootEle; + } + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/persist/ManagerWidgetPersist.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -0,0 +1,292 @@ +package org.fudaa.ebli.visuallibrary.persist; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.swing.JFileChooser; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gui.CtuluFileChooser; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import com.memoire.fu.FuLog; +import com.sun.org.apache.xml.internal.serialize.OutputFormat; +import com.sun.org.apache.xml.internal.serialize.XMLSerializer; + +/** + * Manager qui g\xE8re la sauvegarde de plusieurs layout au sein d'un fichier xml. + * Gere le repertoire contenant l'ensemble des donn\xE9es. + * + * @author Adrien Hadoux + * + */ +public class ManagerWidgetPersist { + + /** + * Utilis\xE9 pour l'extension de tous les fichiers, repertoire et ficheirs + * inclus. + */ + public final static String DEFAULT_EXTENSION = ".POST"; + + /** + * Peut etre modifi\xE9 par l'appli appelabt si l'on veut une extension + * diff\xE9rente + */ + public static String EXTENSION = DEFAULT_EXTENSION; + + /** + * Fichier qui d\xE9crit tous les contenu layout sauvegard\xE9s Et noms des balises + * importantes + */ + public final static String INFOSCENE = "InfoLayout" + EXTENSION; + public final static String BALISESCENES = "Layout list"; + + /** + * Fichier qui d\xE9crit int\xE9gralement le contenu d'une scene + */ + public final static String DESCRIPTORSCENE = "DescriptorLayout"; + + /** + * Fichier qui d\xE9crit tous les fichiers sources(m\xE9tiers) sauvegard\xE9s + */ + public final static String DESCRIPTORSOURCE = "descriptorSources" + EXTENSION; + public final static String BALISESOURCES = "Sources list"; + + /** + * Nom du projet. Creation du projet sous un repertoire nomProjet.EXTENSION + */ + String nomProjet_; + + ProgressionInterface prog_; + File projet_; + + CtuluUI ui_; + + /** + * La liste des fichiers ouverts dans le projet. Si ils existent. + */ + List<File> listeFichiersProjets; + + /** + * La liste des coules (layouts, string) a sauvegarder. Le string peut etre el + * titre de la frame qui contient le ebli par exemple. + */ + Map<String, EbliScene> listeLayout_; + + public ManagerWidgetPersist(List<File> _listeFichiersProjets, String _nomProjet, CtuluUI ui) { + super(); + listeFichiersProjets = _listeFichiersProjets; + nomProjet_ = _nomProjet; + ui_ = ui; + prog_ = ui_.getMainProgression(); + } + + /** + * Cr\xE9\xE9 le repertoire contenant tous les fichiers de donn\xE9es. Base pour la + * cr\xE9ation des donn\xE9es. + */ + public boolean createPersistDirectory() { + // -- creation d un chooser --// + final CtuluFileChooser fileChooser = new CtuluFileChooser(true); + fileChooser.setDialogTitle(EbliResource.EBLI.getString("S\xE9lectionnez l'emplacement de votre r\xE9pertoire") + " " + + nomProjet_ + EXTENSION); + fileChooser.setAcceptAllFileFilterUsed(false); + int reponse = fileChooser.showOpenDialog(CtuluLibSwing.getFrameAncestor(ui_.getParentComponent())); + if (reponse == JFileChooser.APPROVE_OPTION) { + File conteneurProjet = fileChooser.getSelectedFile(); + if (conteneurProjet.isDirectory()) { + projet_ = new File(conteneurProjet.getAbsoluteFile() + nomProjet_ + EXTENSION); + // creation du repertoire global contenant toutes les donn\xE9es + if (projet_.mkdir()) { + return true; + } else { + ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le r\xE9pertoire")); + return false; + } + + } else { + ui_.error(EbliResource.EBLI.getString("La cible doit \xEAtre un r\xE9pertoire")); + return false; + } + } else + return false; + } + + /** + * Fichier qui cree le fichier qui indique les diff\xE9rents fichiers layout a + * lire. Cela permettra pour la lecture de proposer de charger ou non certains + * layout + * + * @return + */ + public Document createDescriptorScenes() { + // creation du document + Document document = createDocument(); + if (document == null) + return null; + + // creation du root + Element rootEle = document.createElement(BALISESCENES); + document.appendChild(rootEle); + // On cree des objets sans contenus qui decrivent simplement les fichiers + // scenes + Iterator<String> it = listeLayout_.keySet().iterator(); + int cpt = 1; + while (it.hasNext()) { + it.next(); + // contient le path absolu vers le fichier qui decrit le layout + Element sceneEle = document.createElement(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + + EXTENSION); + rootEle.appendChild(sceneEle); + } + return document; + } + + /** + * Methode qui tente de sauvegarder tous les fichier en s\xE9maphore: Soit tout + * les fichiers li\xE9s entre eux sont sauvegard\xE9s, soit les fichier li\xE9s ne le + * sont pas(destruction si n\xE9cessaire) + * + * @return + */ + public boolean saveProject() { + try { + progression("Cr\xE9ation du r\xE9pertoire", 10); + // -- etape 1 creation du repertoire global --// + if (createPersistDirectory()) { + OutputFormat format; + File file; + XMLSerializer serializer; + Document docXml; + + // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts + progression("Cr\xE9ation du fichier descripteur de sources", 15); + file = new File(projet_.getAbsolutePath() + File.separator + INFOSCENE); + docXml = createDescriptorSource(); + if (docXml == null) { + ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de sources")); + return false; + } + format = new OutputFormat(docXml); + format.setIndenting(true); + serializer = new XMLSerializer(new FileOutputStream(file), format); + serializer.serialize(docXml); + + // -- etape 3 sauvegarde des ebliscene unitairement --// + progression("Cr\xE9ation des fichiers layout", 20); + Iterator<String> it = listeLayout_.keySet().iterator(); + int cpt = 1; + while (it.hasNext()) { + String title = it.next(); + EbliScene scene = listeLayout_.get(title); + progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listeLayout_.size()); + file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); + docXml = (new EbliScenePersist(scene, title)).createDescriptorScene(prog_); + if (docXml == null) { + ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de layout " + cpt)); + } else { + format = new OutputFormat(docXml); + format.setIndenting(true); + serializer = new XMLSerializer(new FileOutputStream(file), format); + serializer.serialize(docXml); + cpt++; + } + + } + + // -- etape finale: Si tout s'est bien pass\xE9, sauvegarde du fichier de + // descriptions des + // layout + progression("Cr\xE9ation du descripteur de layout", 90); + file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSOURCE); + docXml = createDescriptorScenes(); + if (docXml == null) { + ui_.error(EbliResource.EBLI.getString("Impossible de cr\xE9er le descripteur de layout")); + return false; + } + format = new OutputFormat(docXml); + format.setIndenting(true); + serializer = new XMLSerializer(new FileOutputStream(file), format); + serializer.serialize(docXml); + + progression("", 100); + return true; + + } + return false; + } catch (IOException ie) { + ie.printStackTrace(); + return false; + } + + } + + /** + * Methode qui g\xE9n\xE8re le fichier contenant toutes les sources ouverts. + * + * @return + */ + public Document createDescriptorSource() { + // creation du document + Document document = createDocument(); + if (document == null) + return null; + // creation du root + Element rootEle = document.createElement(BALISESOURCES); + document.appendChild(rootEle); + // On cree des objets sans contenus qui decrivent simplement les fichiers + // scenes + Iterator<File> it = listeFichiersProjets.iterator(); + while (it.hasNext()) { + File f = it.next(); + Element sceneEle = document.createElement(f.getAbsolutePath()); + rootEle.appendChild(sceneEle); + } + return document; + } + + public void progression(String title, int progression) { + if (prog_ == null || title == null || progression > 100) + return; + if (progression == 100) { + prog_.setProgression(0); + prog_.setDesc(""); + return; + } + prog_.setDesc(EbliResource.EBLI.getString(title)); + prog_.setProgression(progression); + } + + /** + * Genere un document type dom + * + * @return Document + */ + public static Document createDocument() { + // get an instance of factory + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + try { + // get an instance of builder + DocumentBuilder db = dbf.newDocumentBuilder(); + // create an instance of DOM + Document dom = db.newDocument(); + return dom; + } catch (ParserConfigurationException pce) { + FuLog.debug("Error while trying to instantiate DocumentBuilder " + pce); + return null; + } + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -3,16 +3,16 @@ import gnu.trove.TIntHashSet; import gnu.trove.TIntIterator; -import java.awt.Point; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.fudaa.ctulu.CtuluActivity; import org.fudaa.ctulu.CtuluVariable; import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gis.GISGeometryFactory; import org.fudaa.dodico.ef.EfData; import org.fudaa.dodico.ef.EfElement; -import org.fudaa.dodico.ef.EfGridData; import org.fudaa.dodico.ef.EfGridInterface; import org.fudaa.dodico.ef.EfNeighborMesh; import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; @@ -24,14 +24,11 @@ import org.fudaa.dodico.ef.operation.EfLineIntersectionParent; import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsMng; import org.fudaa.dodico.ef.operation.EfLineIntersectorActivity; -import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.ebli.geometrie.GrPoint; -import org.fudaa.ebli.geometrie.GrPolygone; import org.fudaa.fudaa.tr.common.TrResource; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.PrecisionModel; /** * Algorithme de Calcul les lignes de courants TODO mettre la classe dans EF il y a la classe qui est charge de faire le @@ -39,7 +36,7 @@ * * @author Adrien Hadoux */ -public class TrComputeLigneCourantTrajectoire implements EfLineIntersectionParent { +public class TrComputeLigneCourantTrajectoire implements EfLineIntersectionParent, CtuluActivity { /** * data @@ -199,7 +196,20 @@ if (elementCourant != -1) { TIntHashSet elementsAdjacent=new TIntHashSet(); - while (!termine && tempsTotal <= dureeIntegration) {//FIXME faux comparaison d'une duree et d'un temps. En fait la duree initiale (tempsTotal) vaut zero + while (!termine && Math.abs(tempsTotal) <= Math.abs(dureeIntegration)) {// FIXME + // faux + // comparaison + // d'une + // duree et + // d'un + // temps. En + // fait la + // duree + // initiale + // ( + // tempsTotal + // ) vaut + // zero //il faut faire attention: si la dureeIntegration est negative. Il faut comparer les valeurs absolues oldTempsTotal = tempsTotal; @@ -261,30 +271,60 @@ //y=y1+vy*(delta t) et meme chose pour x //le reste est faux: on calcule une trajectoire et donc il faut se deplacer selon vx et vy et ne pas prendre le noeud du voisinage le plus loin ! - if (listeEltVoisins != null && listeEltVoisins.length > 0) voisinChoisi = listeEltVoisins[0];// pourquoi le - // premier ? - for (int i = 0; i < listeEltVoisins.length; i++) { - int eltVoisin = listeEltVoisins[i]; + if (listeEltVoisins != null && listeEltVoisins.length > 0) + voisinChoisi = listeEltVoisins[0];// pourquoi le + // premier ? + for (int i = 0; i < listeEltVoisins.length; i++) { + int eltVoisin = listeEltVoisins[i]; + + // coordonn\xE9es de l'\xE9l\xE9ment voisin +// double x = 123456789;//getCoordonnees(eltVoisin).x_;//FAUX +// double y = 123456789;//getCoordonnees(eltVoisin).y_;//FAUX +// double distance = Math.sqrt((pointCourant.x - x) * (pointCourant.x - +// x) + (pointCourant.y - y) +// * (pointCourant.y - y)); +// if (distanceMaxEntrePoints > distance) { +// // candidat potentiel +// +// // ACHTUNG!! VERIFIER QUE LE t+ deltaT<dureeIntegration si on choisit +// // cette distance +// if (vitesseY != 0 +// && (Math.abs(tempsTotal) + distance / Math.sqrt(vitesseY * vitesseY + vitesseX * vitesseX) <= +// Math +// .abs(dureeIntegration))) {// FIXME pourquoi seulement la +// // vitesse y. Il faut +// //faire sqrt(vx*vx+vy*vy) +// distanceMaxEntrePoints = distance; +// voisinChoisi = eltVoisin; +// } +// } +// } +// +// +// +// // on calcul le nouveau temps total +// if (vitesseY != 0) tempsTotal += distanceMaxEntrePoints / vitesseY;//FIXME pour calcul le - // coordonn\xE9es de l'\xE9l\xE9ment voisin - double x = 123456789;//getCoordonnees(eltVoisin).x_;//FAUX - double y = 123456789;//getCoordonnees(eltVoisin).y_;//FAUX - double distance = Math.sqrt((pointCourant.x - x) * (pointCourant.x - x) + (pointCourant.y - y) - * (pointCourant.y - y)); - if (distanceMaxEntrePoints > distance) { - // candidat potentiel - - // ACHTUNG!! VERIFIER QUE LE t+ deltaT<dureeIntegration si on choisit cette distance - if (vitesseY != 0 && (tempsTotal + distance / vitesseY <= dureeIntegration)) {//FIXME pourquoi seulement la vitesse y. Il faut faire sqrt(vx*vx+vy*vy) - distanceMaxEntrePoints = distance; - voisinChoisi = eltVoisin; - } - } - } - - // on calcul le nouveau temps total - if (vitesseY != 0) tempsTotal += distanceMaxEntrePoints / vitesseY;//FIXME pour calcul le - + + + //-- calcul du temps pass\xE9 pour aller jusqu'a distance max --// + + + double deltaT=0; + if(Math.sqrt(vitesseY * vitesseY + vitesseX * vitesseX)!=0) + deltaT= distanceMaxEntrePoints/Math.sqrt(vitesseY * vitesseY + vitesseX * vitesseX); + + //-- on ajoute si cela ne fait pas depasser --// + if(Math.abs(tempsTotal+deltaT)<=(Math.abs(dureeIntegration))) + tempsTotal+=deltaT; + else{ + + //FIXME que fait-on si le temps total d\xE9passe? Tu parlais de diviser les intervalles, je n'ai pas bien compris mais je tente quand meme + + + + } + // on verifie que l'on n'est pas inactif: pas necessaire if (oldTempsTotal == tempsTotal) { termine = true; @@ -294,13 +334,18 @@ GrPoint pointchoisi = new GrPoint(data_.getGrid().getCoor(voisinChoisi).x, data_.getGrid().getCoor( voisinChoisi).y, 0); - // recherche des intersection entre les points - Coordinate[] listeCoor = new Coordinate[2]; - listeCoor[0] = new Coordinate(pointCourant.x, pointCourant.y);//FIXME non on recherche le point le plus eloigne pour savoir sur combien de temps on doit bouge + // FIXME non on recherche le point le plus eloigne pour savoir sur + // combien de temps on doit bouge // listeCoor[1] = new Coordinate(pointchoisi.x, pointchoisi.y); - LineString ligne = new LineString(listeCoor, new PrecisionModel(), 0);//utilse GISGeometryFactory.createSegment + // LineString ligne = new LineString(listeCoor, new + // PrecisionModel(),0); + + // utilse GISGeometryFactory.createSegment + LineString ligne = GISGeometryFactory.INSTANCE.createSegment(pointCourant.x, pointCourant.y, + pointchoisi.x_, + pointchoisi.y_); progression("Recherche des intersections", 50); EfLineIntersectionsResultsMng res = lineIntersect_.computeForMeshes(ligne, prog_); @@ -308,16 +353,24 @@ // particules est sortie du maillage, le calcul s'arrete termine = true; } else { + + + + } // recuperationde la nouvelle intersection aui devien courante - intersectionCourante = res.getFoundIntersect(0);//Je crois qu'il faut prendre l'intersection 1 car la 0 est le point de d\xE9part + intersectionCourante = res.getFoundIntersect(1);// Je crois qu'il + // faut prendre + // l'intersection 1 + // car la 0 est le + // point de d\xE9part // cette intersection sera automatiquement ajout\xE9e a la liste solution a la prochaine it\xE9ration (premiere // instruction du while) - } + } - + } }// fin du while } @@ -374,4 +427,11 @@ return voisinage_; } + + /** + * fonction appel\xE9e en cas de stop de thread + */ + public void stop() { + } + } 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 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -64,6 +64,7 @@ } protected void updateY() { + createY(); for (int i = 0; i < y_.length; i++) { final EfData data = source_.getData(var_, i); if (data == null) { @@ -102,6 +103,7 @@ } protected void updateY() { + createY(); for (int i = 0; i < y_.length; i++) { // final EfData data = source_.getData(var_, i); // if (data == null) { @@ -221,4 +223,10 @@ return true; } + protected void createY() { + if (y_ == null || y_.length != this.source_.getNbTimeStep()) { + y_ = new double[source_.getNbTimeStep()]; + } + } + } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-06 14:38:56 UTC (rev 4037) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-06 19:31:22 UTC (rev 4038) @@ -120,9 +120,10 @@ objIdx_ = FuEmptyArrays.INT0; intepolPt_ = new HashSet(); varSupported_ = new HashSet(Arrays.asList(_vars)); + projet_ = _projet; impl_ = projet_.getImpl(); isAllTimeStep_ = true;// tidx_.length == _src.getNbTimeStep(); - projet_ = _projet; + } public TrPostCourbeTreeModel(final int[] _objIdx, final H2dVariableType[] _vars, TrPostProjet _projet) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fa...@us...> - 2008-10-06 14:41:36
|
Revision: 4037 http://fudaa.svn.sourceforge.net/fudaa/?rev=4037&view=rev Author: fargeix Date: 2008-10-06 14:38:56 +0000 (Mon, 06 Oct 2008) Log Message: ----------- Fichiers n?\195?\169cessaires ?\195?\160 la compilation d'une distribution de Sinavi3 Added Paths: ----------- trunk/fudaa_devel/fudaa-distrib/sinavi3/ trunk/fudaa_devel/fudaa-distrib/sinavi3/Licence.txt trunk/fudaa_devel/fudaa-distrib/sinavi3/build.xml trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/ trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/Unix_shortcutSpec.xml trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/izpack_fudaa_sinavi3.xml trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/shortcutSpec.xml trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/standalone-compiler.jar trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.PNG trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.bat trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.ico trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.jpg Added: trunk/fudaa_devel/fudaa-distrib/sinavi3/Licence.txt =================================================================== --- trunk/fudaa_devel/fudaa-distrib/sinavi3/Licence.txt (rev 0) +++ trunk/fudaa_devel/fudaa-distrib/sinavi3/Licence.txt 2008-10-06 14:38:56 UTC (rev 4037) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. Copied: trunk/fudaa_devel/fudaa-distrib/sinavi3/build.xml (from rev 3772, trunk/fudaa_devel/fudaa-distrib/lido/build.xml) =================================================================== --- trunk/fudaa_devel/fudaa-distrib/sinavi3/build.xml (rev 0) +++ trunk/fudaa_devel/fudaa-distrib/sinavi3/build.xml 2008-10-06 14:38:56 UTC (rev 4037) @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- +! @creation 2008-08-18 +! @modification $Date$ +! @license GNU General Public License 2 +! @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne +! @version $Id$ +! @author Mederic Fargeix +! +! build permettant de construire le jar +--> + +<project name="sinavi3" default="deploy" basedir="."> + <import file="../ant-deploy.xml" /> + <taskdef name="izpack" classpath="izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask" /> + <property name="this.main.class" value="Sinavi3" /> + <target name="createJar" depends=".testCheminGenJar" description="cree fudaa_sinavi3.jar"> + <mkdir dir="${this.jar.dir}" /> + <delete file="${this.jar.file}" /> + <genjar jarfile="${this.jar.file}"> + <manifest> + <attribute name="Main-Class" value="org.fudaa.fudaa.sinavi3.Sinavi3" /> + </manifest> + <classpath path="${fudaaDist.classpath}" /> + <class name="org.fudaa.fudaa.sinavi3.Sinavi3" /> + <library jar="${ctulu.lib.dir}/liquidlnf.jar" /> + <library jar="${ctulu.lib.dir}/jcommon.jar" /> + <library jar="${ctulu.lib.dir}/jfreechart.jar" /> + <class> + <fileset dir="${fudaa.dist.classes.dir}"> + <include name="org/fudaa/dodico/**/*.class" /> + <include name="org/fudaa/fudaa/sinavi3/**/*.class" /> + </fileset> + </class> + <classfilter> + <exclude name="org.fudaa.dodico.corba." /> + <exclude name="org.fudaa.dodico." /> + <include name="org.fudaa.dodico.corba.base." /> + <include name="org.fudaa.dodico.corba.calcul." /> + <include name="org.fudaa.dodico.calcul." /> + <include name="org.fudaa.dodico.corba.evenement." /> + <include name="org.fudaa.dodico.evenement." /> + <include name="org.fudaa.dodico.corba.association." /> + <include name="org.fudaa.dodico.association." /> + <include name="org.fudaa.dodico.boony." /> + <include name="org.fudaa.dodico.corba.usine." /> + <include name="org.fudaa.dodico.usine." /> + <include name="org.fudaa.dodico.corba.objet." /> + <include name="org.fudaa.dodico.objet." /> + <include name="org.fudaa.dodico.fortran." /> + <include name="org.fudaa.dodico.commun." /> + <include name="org.fudaa.dodico.corba.lido." /> + <include name="org.fudaa.dodico.lido." /> + <include name="org.fudaa.dodico.corba.hydraulique1d." /> + <include name="org.fudaa.dodico.hydraulique1d." /> + <include name="org.fudaa.dodico.corba.sinavi3." /> + <include name="org.fudaa.dodico.sinavi3." /> + </classfilter> + <resource> + <fileset dir="${fudaa.dist.classes.dir}"> + <patternset refid="ressources.fic" /> + <include name="com/memoire/bu/" /> + <include name="com/memoire/dnd/" /> + <include name="com/memoire/dja/" /> + <include name="org/fudaa/dodico/vag/" /> + <include name="org/fudaa/dodico/usine/" /> + <include name="org/fudaa/dodico/boony/" /> + <include name="org/fudaa/dodico/commun/" /> + <include name="org/fudaa/dodico/hydraulique1d/" /> + <include name="org/fudaa/dodico/sinavi3/" /> + <include name="org/fudaa/ebli/ressource/" /> + <include name="org/fudaa/fudaa/commun/" /> + <include name="org/fudaa/fudaa/ressource/" /> + <include name="org/fudaa/fudaa/hydraulique1d/" /> + <include name="org/fudaa/fudaa/sinavi3/" /> + <include name="ghm/followgui/" /> + <include name="com/hexidec/ekit/" /> + </fileset> + </resource> + </genjar> + <jar destfile="${this.jar.dir}/serveurs.jar" basedir="../../fudaa" includes="serveurs/Fudaa-Sinavi/**" /> + <izpack input="izpack/izpack_fudaa_sinavi3.xml" output="${this.jar.dir}/Fudaa_Sinavi3_Install.jar" basedir="." /> + </target> +</project> \ No newline at end of file Property changes on: trunk/fudaa_devel/fudaa-distrib/sinavi3/build.xml ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/Unix_shortcutSpec.xml =================================================================== --- trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/Unix_shortcutSpec.xml (rev 0) +++ trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/Unix_shortcutSpec.xml 2008-10-06 14:38:56 UTC (rev 4037) @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<shortcuts> + <programGroup defaultName="Applications Fudaa\Sinavi 3" location="applications"/> + <shortcut + name="Lancer Sinavi 3" + programGroup="yes" + desktop="yes" + applications="no" + startMenu="no" + startup="no" + target="$JAVA_HOME/bin/java" + commandLine="-DFUDAA_SERVEUR=$INSTALL_PATH/serveurs/Fudaa-Sinavi -cp $INSTALL_PATH/fudaa-sinavi3.jar:$INSTALL_PATH/jcommon.jar:$INSTALL_PATH/jfreechart.jar:$INSTALL_PATH/liquidlnf.jar org.fudaa.fudaa.sinavi3.Sinavi3" + workingDirectory="$INSTALL_PATH" + type="Application" + iconFile="$INSTALL_PATH/sinavi3.png" + initialState="noShow" + description="Lance le logiciel Sinavi 3"> + <createForPack name="Sinavi 3"/> + </shortcut> + + <shortcut + name="Supprimer Sinavi 3" + programGroup="yes" + desktop="yes" + applications="no" + startMenu="no" + startup="no" + target="$JAVA_HOME/bin/java" + commandLine="-jar "$INSTALL_PATH/Uninstaller/uninstaller.jar"" + initialState="noShow" + iconFile="trashcan_full" + iconIndex="0" + workingDirectory="" + type="Application" + encoding="UTF-8" + description="Supprime le logiciel Sinavi 3"> + <createForPack name="Sinavi 3"/> + </shortcut> + +</shortcuts> \ No newline at end of file Added: trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/izpack_fudaa_sinavi3.xml =================================================================== --- trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/izpack_fudaa_sinavi3.xml (rev 0) +++ trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/izpack_fudaa_sinavi3.xml 2008-10-06 14:38:56 UTC (rev 4037) @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> + +<!-- + A sample installation file. + Use it as a base for your own installers :-) + + To compile it : + - go in the bin directory where you installed IzPack + - call "compile ../sample/install.xml -b ../sample" +--> + +<installation version="1.0"> + + <!-- + The info section. + The meaning of the tags should be natural ... + --> + <info> + <appname>Sinavi</appname> + <appversion>3</appversion> + <authors> + <author name="Adrien HADOUX" email="de...@fu..."/> + <author name="Mederic FARGEIX" email="de...@fu..."/> + </authors> + <url>http://www.cetmef.developpement-durable.gouv.fr/</url> + </info> + + <!-- + The gui preferences indication. + Sets the installer window to 640x480. It will not be able to change the size. + --> + <guiprefs width="800" height="520" resizable="no"/> + + <variables> + <variable name="$DesktopShortcutCheckboxEnabled" value="true"/> + </variables> + + <!-- + The locale section. + Asks here to include the English and French langpacks. + --> + <locale> + <langpack iso3="fra"/> + </locale> + + <!-- + The resources section. + The ids must be these ones if you want to use the LicencePanel and/or the InfoPanel. + --> + <resources> + <res id="LicencePanel.licence" src="Licence.txt"/> + <res id="shortcutSpec.xml" src="izpack/shortcutSpec.xml"/> + <res id="Unix_shortcutSpec.xml" src="izpack/Unix_shortcutSpec.xml"/> + <res src="sinavi3.jpg" id="Installer.image.0"/> + </resources> + + <!-- + The panels section. + We indicate here which panels we want to use. The order will be respected. + --> + <panels> + <panel classname="HelloPanel" id="hellopanel"/> + <panel classname="LicencePanel" id="licensepanel"/> + <panel classname="TargetPanel" id="targetpanel"/> + <panel classname="PacksPanel" id="packspanel"/> + <panel classname="InstallPanel" id="installpanel"/> + <panel classname="ShortcutPanel" id="shortcutpanel"/> + <panel classname="FinishPanel" id="finishpanel"/> + </panels> + + <!-- + The packs section. + We specify here our packs. + --> + + <packs> + <pack name="Sinavi 3" required="yes"> + <description>Installe tous les composants du logiciel Sinavi 3</description> + <file src="Licence.txt" targetdir="$INSTALL_PATH"/> + <file src="sinavi3.bat" targetdir="$INSTALL_PATH"/> + <file src="sinavi3.ico" targetdir="$INSTALL_PATH"/> + <file src="sinavi3.png" targetdir="$INSTALL_PATH"/> + <file src="../../../distrib/build/jar/sinavi3/fudaa-sinavi3.jar" targetdir="$INSTALL_PATH"/> + <file src="../../fudaa/serveurs/Fudaa-Sinavi" targetdir="$INSTALL_PATH/serveurs"/> + <executable targetfile="$INSTALL_PATH/serveurs/Fudaa-Sinavi/bin/linux/sinavi_linux.x" stage="never"/> + <executable targetfile="$INSTALL_PATH/serveurs/Fudaa-Sinavi/bin/linux/sinaviGenarr_linux.x" stage="never"/> + </pack> + </packs> + + <native type="izpack" name="ShellLink.dll"/> + +</installation> Added: trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/shortcutSpec.xml =================================================================== --- trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/shortcutSpec.xml (rev 0) +++ trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/shortcutSpec.xml 2008-10-06 14:38:56 UTC (rev 4037) @@ -0,0 +1,36 @@ +<shortcuts> + <skipIfNotSupported/> + <programGroup defaultName="Applications Fudaa\Sinavi 3" location="applications"/> + <shortcut + name="Lancer Sinavi 3" + programGroup="yes" + desktop="yes" + applications="no" + startMenu="no" + startup="no" + target="$INSTALL_PATH\sinavi3.bat" + commandLine="" + workingDirectory="$INSTALL_PATH" + iconFile="$INSTALL_PATH\sinavi3.ico" + initialState="noShow" + description="Lance le logiciel Sinavi 3"> + <createForPack name="Sinavi 3"/> + </shortcut> + + <shortcut + name="Supprimer Sinavi 3" + programGroup="yes" + desktop="no" + applications="no" + startMenu="no" + startup="no" + target="$INSTALL_PATH\Uninstaller\uninstaller.jar" + commandLine="" + iconFile="%SystemRoot%\system32\SHELL32.dll" + iconIndex="31" + description="Supprime le logiciel Sinavi 3"> + + <createForPack name="Sinavi 3"/> + </shortcut> + +</shortcuts> Property changes on: trunk/fudaa_devel/fudaa-distrib/sinavi3/izpack/standalone-compiler.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.PNG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.bat =================================================================== --- trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.bat (rev 0) +++ trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.bat 2008-10-06 14:38:56 UTC (rev 4037) @@ -0,0 +1,6 @@ +echo off +cls +echo Execution de Sinavi 3 en cours... +java.exe -jar fudaa-sinavi3.jar +cls +echo Fin d'execution de Sinavi 3 \ No newline at end of file Property changes on: trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fudaa_devel/fudaa-distrib/sinavi3/sinavi3.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fa...@us...> - 2008-10-06 14:37:50
|
Revision: 4036 http://fudaa.svn.sourceforge.net/fudaa/?rev=4036&view=rev Author: fargeix Date: 2008-10-06 14:35:50 +0000 (Mon, 06 Oct 2008) Log Message: ----------- Modifications diverses Modified Paths: -------------- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3FrameGenerationRappelDonnees.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3GenereNoteHtml.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleCategories.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleElement.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteTrajet.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsCroisementsBief.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsDureesParcours.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsTrematagesBief.java trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3TraduitHoraires.java Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3FrameGenerationRappelDonnees.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3FrameGenerationRappelDonnees.java 2008-10-06 12:46:31 UTC (rev 4035) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3FrameGenerationRappelDonnees.java 2008-10-06 14:35:50 UTC (rev 4036) @@ -2,6 +2,7 @@ import java.awt.BorderLayout; import java.awt.Color; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -33,12 +34,11 @@ import org.fudaa.ctulu.CtuluLibFile; import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; import org.fudaa.fudaa.ressource.FudaaResource; - import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuButton; import com.memoire.bu.BuDialogError; import com.memoire.bu.BuDialogMessage; -import com.memoire.bu.BuInternalFrame; +import com.memoire.bu.BuFormLayout; import com.memoire.bu.BuPanel; /** @@ -66,7 +66,7 @@ private final BuButton quitter_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_quitter"), "Quitter"); private final BuButton exportationHTML_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_generer"), - "Exportation rapport"); + "Exporter"); private final BuButton choisirCouleur_ = new BuButton("couleur sommaire"); private final BuButton apercu_ = new BuButton(FudaaResource.FUDAA.getIcon("crystal_previsualiser"),"Aper\xE7u"); /** @@ -89,24 +89,24 @@ JTextField titre_ = new JTextField(20); JTextArea ZoneText_ = new JTextArea(2, 30); - JCheckBox dg_ = new JCheckBox("Ins\xE9rer les donn\xE9es g\xE9n\xE9rales", true); + JCheckBox dg_ = new JCheckBox("Pr\xE9senter les donn\xE9es g\xE9n\xE9rales", true); JCheckBox dgNbJ_ = new JCheckBox("Afficher le nombre de jours de la simulation", true); JCheckBox dgGraine_ = new JCheckBox("Afficher la graine d'initialisation", true); - JCheckBox gare_ = new JCheckBox("Ins\xE9rer les gares", true); + JCheckBox gare_ = new JCheckBox("Pr\xE9senter les gares", true); - JCheckBox topo2_ = new JCheckBox("Ins\xE9rer les topologies des biefs", true); + JCheckBox topo2_ = new JCheckBox("Pr\xE9senter la topologie des biefs", true); - JCheckBox topo4_ = new JCheckBox("Ins\xE9rer les topologies des ecluses", true); - JCheckBox topo5_ = new JCheckBox("Ins\xE9rer le mod\xE8le du r\xE9seau", true); + JCheckBox topo4_ = new JCheckBox("Pr\xE9senter la topologie des ecluses", true); + JCheckBox topo5_ = new JCheckBox("Pr\xE9senter le mod\xE8le du r\xE9seau", true); - JCheckBox regle1_ = new JCheckBox("Ins\xE9rer les r\xE8gles de croisement des biefs", true); - JCheckBox regle2_ = new JCheckBox("Ins\xE9rer les r\xE8gles de trematage des biefs", true); - JCheckBox regle3_ = new JCheckBox("Ins\xE9rer les vitesses des bateaux dans les biefs", true); - JCheckBox regle4_ = new JCheckBox("Ins\xE9rer les dur\xE9es de manoeuvres dans les \xE9cluses", true); + JCheckBox regle1_ = new JCheckBox("Pr\xE9senter les r\xE8gles de croisement des biefs", true); + JCheckBox regle2_ = new JCheckBox("Pr\xE9senter les r\xE8gles de trematage des biefs", true); + JCheckBox regle3_ = new JCheckBox("Pr\xE9senter les vitesses des bateaux dans les biefs", true); + JCheckBox regle4_ = new JCheckBox("Pr\xE9senter les dur\xE9es de manoeuvres dans les \xE9cluses", true); - JCheckBox nav_ = new JCheckBox("Ins\xE9rer les cat\xE9gories de bateaux", true); + JCheckBox nav_ = new JCheckBox("Pr\xE9senter les cat\xE9gories de bateaux", true); JCheckBox navPrio_ = new JCheckBox("priorite", true); JCheckBox navGare_ = new JCheckBox("gare de depart", true); JCheckBox navLong_ = new JCheckBox("longueur", true); @@ -116,12 +116,12 @@ JCheckBox navCr_ = new JCheckBox("creneaux", false); JCheckBox navVitesses_ = new JCheckBox("vitesses", false); - JCheckBox chenal_ = new JCheckBox("Ins\xE9rer les biefs", true); + JCheckBox chenal_ = new JCheckBox("Pr\xE9senter les biefs", true); JCheckBox chenalPro_ = new JCheckBox("Hauteur d'eau du bief", true); JCheckBox chenalMar_ = new JCheckBox("Vitesse autorisee", true); JCheckBox chenalCr_ = new JCheckBox("inserer les creneaux", true); - JCheckBox ecluse_ = new JCheckBox("Ins\xE9rer les \xE9cluses", true); + JCheckBox ecluse_ = new JCheckBox("Pr\xE9senter les \xE9cluses", true); JCheckBox ecltaille_ = new JCheckBox("caracteristique de l ecluse", true); JCheckBox eclDur_ = new JCheckBox("duree d eclusee, fausse bassinnee", true); JCheckBox ecluseIndispo_ = new JCheckBox("les indisponibilites", true); @@ -159,12 +159,12 @@ // premiere categorie de l arbre categorie = new DefaultMutableTreeNode("Pr\xE9sentation"); sommet.add(categorie); - categorie = new DefaultMutableTreeNode("G\xE9n\xE9ralit\xE9s"); + categorie = new DefaultMutableTreeNode("Donn\xE9es g\xE9n\xE9rales"); sommet.add(categorie); - categorie = new DefaultMutableTreeNode("Saisie"); + categorie = new DefaultMutableTreeNode("Param\xE8tres"); sommet.add(categorie); - feuille = new DefaultMutableTreeNode("Gares"); + /* feuille = new DefaultMutableTreeNode("Gares"); categorie.add(feuille); feuille = new DefaultMutableTreeNode("Biefs"); categorie.add(feuille); @@ -174,19 +174,19 @@ feuille = new DefaultMutableTreeNode("Cat\xE9gories de bateaux"); categorie.add(feuille); - categorie = new DefaultMutableTreeNode("Topologie du r\xE9seau"); + */ categorie = new DefaultMutableTreeNode("R\xE9seau"); sommet.add(categorie); - feuille = new DefaultMutableTreeNode("Topologie des biefs"); + /* feuille = new DefaultMutableTreeNode("Topologie des biefs"); categorie.add(feuille); feuille = new DefaultMutableTreeNode("Topologie des \xE9cluses"); categorie.add(feuille); - feuille = new DefaultMutableTreeNode("Mod\xE8le du r\xE9seau"); + feuille = new DefaultMutableTreeNode("Mod\xE9lisation du r\xE9seau"); categorie.add(feuille); - categorie = new DefaultMutableTreeNode("R\xE8gles de navigation"); + */ categorie = new DefaultMutableTreeNode("Navigation"); sommet.add(categorie); - feuille = new DefaultMutableTreeNode("Croisement dans les biefs"); + /* feuille = new DefaultMutableTreeNode("Croisement dans les biefs"); categorie.add(feuille); feuille = new DefaultMutableTreeNode("Tr\xE9matage dans les biefs"); categorie.add(feuille); @@ -194,7 +194,7 @@ categorie.add(feuille); feuille = new DefaultMutableTreeNode("Dur\xE9es de manoeuvres dans les \xE9cluses"); categorie.add(feuille); - + */ arbre_.expandRow(0); // arbre_.expandRow(1); // arbre_.expandRow(3); @@ -211,11 +211,11 @@ /******************************************************************************************************************* * Affichage du panel de boutons ******************************************************************************************************************/ - this.quitter_.setToolTipText("Fermer la fen\xEAtre"); + this.quitter_.setToolTipText("Ferme la sous-fen\xEAtre"); this.quitter_.addActionListener(this); - exportationHTML_.setToolTipText("G\xE9n\xE9rer les donn\xE9es saisies au format HTML"); + exportationHTML_.setToolTipText("Exporte le rapport au format HTML"); exportationHTML_.setEnabled(false); - apercu_.setToolTipText("Aper\xE7u du rapport g\xE9n\xE9r\xE9 en html"); + apercu_.setToolTipText("G\xE9n\xE8re un aper\xE7u du rapport"); exportationHTML_.addActionListener(this); apercu_.addActionListener(this); choisirCouleur_.addActionListener(this); @@ -258,10 +258,10 @@ //-- splitpane --// conteneur = new JSplitPane(JSplitPane.VERTICAL_SPLIT, selectionPanel_,conteneurEditeur); - conteneur.setDividerLocation(210); + conteneur.setDividerLocation(230); conteneur.setDividerSize(1); this.getContentPane().add(conteneur, BorderLayout.CENTER); - actualiser("Pr\xE9sentation"); + actualiser("Contenu de la note"); } @@ -273,11 +273,11 @@ TitledBorder bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "personalisation"); - final JPanel table1 = new JPanel(); - final JPanel table2 = new JPanel(); - final JPanel table3 = new JPanel(); - final JPanel table4 = new JPanel(); - final JPanel table5 = new JPanel(); + final JPanel table1 = new JPanel(new FlowLayout(FlowLayout.LEFT)); + final JPanel table2 = new JPanel(new FlowLayout(FlowLayout.LEFT)); + final JPanel table3 = new JPanel(new FlowLayout(FlowLayout.LEFT)); + final JPanel table4 = new JPanel(new FlowLayout(FlowLayout.LEFT)); + final JPanel table5 = new JPanel(new FlowLayout(FlowLayout.LEFT)); final JPanel table6 = new JPanel(); final JPanel table7 = new JPanel(); final JPanel table8 = new JPanel(); @@ -295,7 +295,7 @@ selectionPanel_.add(visionneurArbre, BorderLayout.WEST); // format tableau pour affichage des caract\xE9ristiques Box table = Box.createVerticalBox(); - this.selectionPanel_.add(new JScrollPane(table), BorderLayout.CENTER); + this.selectionPanel_.add(/*new JScrollPane(*/table/*)*/, BorderLayout.CENTER); dg_.addActionListener(this); @@ -303,23 +303,46 @@ chenal_.addActionListener(this); ecluse_.addActionListener(this); - if (choix.equals("G\xE9n\xE9ralit\xE9s")) { + if (choix.equals("Donn\xE9es g\xE9n\xE9rales")) { //table.setLayout(new GridLayout(10, 1)); - table.add(dg_); - table.add(dgNbJ_); - table.add(dgGraine_); + table.add(table1); + table.add(table2); + table.add(table3); + table1.add(dg_); + table2.add(dgNbJ_); + table3.add(dgGraine_); bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Donn\xE9es g\xE9n\xE9rales"); table.setBorder(bordurea); + } else if (choix.equals("Contenu de la note")) + { + titre = "Contenu de la note"; + + //table.setLayout(new GridLayout(5, 1)); + + table1.add(new JLabel("Pr\xE9sentation")); + table.add(table1); + table2.add(new JLabel("Donn\xE9es g\xE9n\xE9rales")); + table.add(table2); + table3.add(new JLabel("Param\xE8tres")); + table.add(table3); + table4.add(new JLabel("R\xE9seau")); + table.add(table4); + table5.add(new JLabel("Navigation")); + table.add(table5); + + bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); + table.setBorder(bordurea); + } else if (choix.equals("Pr\xE9sentation")) { titre = "Pr\xE9sentation"; //table.setLayout(new GridLayout(5, 1)); - table1.add(new JLabel("Titre: ")); + table1.add(new JLabel("Titre:")); table1.add(this.titre_); table.add(table1); @@ -333,44 +356,84 @@ bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); table.setBorder(bordurea); - } else if (choix.equals("Gares"))// panel de selection des gares + } else if (choix.equals("Param\xE8tres")) { - titre = "Param\xE8tres gares"; - //table.setLayout(new GridLayout(5, 1)); + titre = "Param\xE8tres"; table.add(table1); table.add(table2); table.add(table3); table.add(table4); - table.add(table5); table1.add(gare_); + table2.add(chenal_); + table3.add(ecluse_); + table4.add(nav_); bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); - table1.setBorder(bordurea); - + table.setBorder(bordurea); + + } else if (choix.equals("R\xE9seau")) + { + titre = "R\xE9seau"; + table.add(table1); + table.add(table2); + table.add(table3); + table1.add(topo2_); + table2.add(topo4_); + table3.add(topo5_); + bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); + table.setBorder(bordurea); + + } else if (choix.equals("Navigation")) + { + titre = "Navigation"; + table.add(table1); + table.add(table2); + table.add(table3); + table1.add(regle1_); + table2.add(regle2_); + table3.add(regle3_); + bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); + table.setBorder(bordurea); + + } else if (choix.equals("Gares"))// panel de selection des gares + { + titre = "Donn\xE9es relatives aux gares"; + //table.setLayout(new GridLayout(5, 1)); + table.add(table1); + //table.add(table2); + //table.add(table3); + //table.add(table4); + //table.add(table5); + table1.add(gare_); + bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); + table.setBorder(bordurea); + } else if (choix.equals("Biefs")) { //table.setLayout(new GridLayout(10, 1)); - table.add(chenal_); + table.add(table1); + table1.add(chenal_); /* table.add(chenalPro_); table.add(chenalMar_); table.add(chenalCr_); */ bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), - "Param\xE8tres biefs"); + "Donn\xE9es relatives aux biefs"); table.setBorder(bordurea); } else if (choix.equals("Ecluses")) { //table.setLayout(new GridLayout(10, 1)); - table.add(ecluse_); + table.add(table1); + table1.add(ecluse_); /*table.add(ecltaille_); table.add(eclDur_); table.add(ecluseIndispo_); table.add(ecluseCr_); */ bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), - "Param\xE8tres \xE9cluses"); + "Donn\xE9es relatives aux \xE9cluses"); table.setBorder(bordurea); } else @@ -380,88 +443,88 @@ titre = "Topologie des biefs"; //table.setLayout(new GridLayout(5, 1)); table.add(table1); - table.add(table2); - table.add(table3); - table.add(table4); - table.add(table5); + //table.add(table2); + //table.add(table3); + //table.add(table4); + //table.add(table5); table1.add(topo2_, BorderLayout.CENTER); bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); - table1.setBorder(bordurea); + table.setBorder(bordurea); } else if (choix.equals("Topologie des \xE9cluses"))// panel de selection des gares { titre = "Topologie des \xE9cluses"; //table.setLayout(new GridLayout(5, 1)); table.add(table1); - table.add(table2); + /*table.add(table2); table.add(table3); table.add(table4); - table.add(table5); + table.add(table5);*/ table1.add(topo4_, BorderLayout.CENTER); bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); - table1.setBorder(bordurea); + table.setBorder(bordurea); } else if (choix.equals("Mod\xE8le du r\xE9seau"))// panel de selection des gares { - titre = "Mod\xE8le du r\xE9seau"; + titre = "Mod\xE9lisation du r\xE9seau"; //table.setLayout(new GridLayout(5, 1)); table.add(table1); - table.add(table2); + /*table.add(table2); table.add(table3); table.add(table4); - table.add(table5); + table.add(table5);*/ table1.add(topo5_, BorderLayout.CENTER); bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); - table1.setBorder(bordurea); + table.setBorder(bordurea); } else if (choix.equals("Tr\xE9matage dans les biefs"))// panel de selection des gares { titre = "Tr\xE9matage dans les biefs"; //table.setLayout(new GridLayout(5, 1)); table.add(table1); - table.add(table2); + /*table.add(table2); table.add(table3); table.add(table4); - table.add(table5); + table.add(table5);*/ table1.add(regle2_, BorderLayout.CENTER); bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); - table1.setBorder(bordurea); + table.setBorder(bordurea); } else if (choix.equals("Croisement dans les biefs"))// panel de selection des gares { titre = "Croisement dans les biefs"; //table.setLayout(new GridLayout(5, 1)); table.add(table1); - table.add(table2); + /*table.add(table2); table.add(table3); table.add(table4); - table.add(table5); + table.add(table5);*/ table1.add(regle1_, BorderLayout.CENTER); bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); - table1.setBorder(bordurea); + table.setBorder(bordurea); } else if (choix.equals("Dur\xE9es de manoeuvres dans les \xE9cluses"))// panel de selection des gares { titre = "Dur\xE9es de manoeuvres dans les \xE9cluses"; //table.setLayout(new GridLayout(5, 1)); table.add(table1); - table.add(table2); + /*table.add(table2); table.add(table3); table.add(table4); - table.add(table5); + table.add(table5);*/ table1.add(regle4_, BorderLayout.CENTER); bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); - table1.setBorder(bordurea); + table.setBorder(bordurea); } else if (choix.equals("Vitesse dans les biefs"))// panel de selection des gares { - titre = "Vitesse dans les biefs"; + titre = "Vitesse des bateaux dans les biefs"; //table.setLayout(new GridLayout(5, 1)); table.add(table1); - table.add(table2); + /*table.add(table2); table.add(table3); table.add(table4); - table.add(table5); + table.add(table5);*/ table1.add(regle3_, BorderLayout.CENTER); bordurea = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), titre); table1.setBorder(bordurea); @@ -482,24 +545,24 @@ table.add(navVitesses_);*/ } - final JPanel aide = new JPanel(); + final JPanel aide = new JPanel(new FlowLayout(FlowLayout.LEFT)); //aide.setLayout(new GridLayout(2, 1)); - final JPanel l1 = new JPanel(); + //final JPanel l1 = new JPanel(); ImageIcon im = new ImageIcon(); im = FudaaResource.FUDAA.getIcon("crystal_commentaire"); final JLabel image = new JLabel(im); - l1.add(image); - l1.add(new JLabel("S\xE9lectionnez les param\xE8tres \xE0 faire figurer dans le rapport")); - final JPanel l2 = new JPanel(); - l2.add(new JLabel("puis cliquez sur le bouton d'exportation.")); - aide.add(l1); - aide.add(l2); + aide.add(image); + aide.add(new JLabel("Vous pouvez ici d\xE9finir les informations \xE0 faire figurer dans le rapport.")); + //final JPanel l2 = new JPanel(); + //l2.add(new JLabel("puis cliquez sur le bouton d'exportation.")); + //aide.add(l1); + //aide.add(l2); // aide.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); this.selectionPanel_.add(aide, BorderLayout.NORTH); + - this.selectionPanel_.validate(); this.validate(); @@ -519,14 +582,14 @@ final String nodeInfo = (String) node.getUserObject(); // si c est une feuille - if (node.isLeaf()) { + // if (node.isLeaf()) { // on recherche la feuille selectionn\xE9e et on modifie le panel en cons\xE9quence: actualiser(nodeInfo); // displayURL(book.bookURL); - } + // } } public void actionPerformed(final ActionEvent ev) { Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3GenereNoteHtml.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3GenereNoteHtml.java 2008-10-06 12:46:31 UTC (rev 4035) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3GenereNoteHtml.java 2008-10-06 14:35:50 UTC (rev 4036) @@ -965,7 +965,7 @@ { chaine+="<tr>"; // nom - chaine+="<th rowspan=\"1\" bgcolor=\"AACCEE\">"+_d.listeBief_.retournerBief(i).nom_+"</th>"; + chaine+="<th rowspan=\"1\" bgcolor=\"AACCEE\">"+_d.listeEcluse_.retournerEcluse(i).nom_+"</th>"; for(int j=0;j<_d.listeBateaux_.listeNavires_.size();j++) { @@ -1008,7 +1008,7 @@ { chaine+="<tr>"; // nom - chaine+="<th rowspan=\"1\" bgcolor=\"AACCEE\">"+_d.listeBief_.retournerBief(i).nom_+"</th>"; + chaine+="<th rowspan=\"1\" bgcolor=\"AACCEE\">"+_d.listeEcluse_.retournerEcluse(i).nom_+"</th>"; for(int j=0;j<_d.listeBateaux_.listeNavires_.size();j++) { Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java 2008-10-06 12:46:31 UTC (rev 4035) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3Implementation.java 2008-10-06 14:35:50 UTC (rev 4036) @@ -444,7 +444,7 @@ newtb.addSeparator(); newtb.addToolButton("V\xE9rification", "VERIFICATIONDONNEES", FudaaResource.FUDAA.getIcon("crystal_analyser"), false); - newtb.addToolButton("Calcul", "LANCEMENTCALCUL", FudaaResource.FUDAA.getIcon("crystal_executer"), false); + newtb.addToolButton("Simulation", "LANCEMENTCALCUL", FudaaResource.FUDAA.getIcon("crystal_executer"), false); newtb.addSeparator(); newtb.addToolButton("Bateaux g\xE9n\xE9r\xE9s", "GRAPHEGENERATIONNAV", FudaaResource.FUDAA.getIcon("crystal_graphe"), false); newtb.addToolButton("Dur\xE9es de parcours", "GRAPHEDUREEPARCOURS", FudaaResource.FUDAA.getIcon("crystal_graphe"), false); @@ -561,17 +561,17 @@ b.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.SHIFT_MASK|ActionEvent.CTRL_MASK)); r.addSeparator("Simulation"); - b=r.addMenuItem("V\xE9rification", "VERIFICATIONDONNEES", FudaaResource.FUDAA.getIcon("crystal_analyser"), false); + b=r.addMenuItem("V\xE9rification des param\xE8tres de simulation", "VERIFICATIONDONNEES", FudaaResource.FUDAA.getIcon("crystal_analyser"), false); b.setMnemonic(KeyEvent.VK_V); b.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.SHIFT_MASK|ActionEvent.CTRL_MASK)); - b=r.addMenuItem("Calcul", "LANCEMENTCALCUL", FudaaResource.FUDAA.getIcon("crystal_executer"), false); + b=r.addMenuItem("Ex\xE9cution de la simulation", "LANCEMENTCALCUL", FudaaResource.FUDAA.getIcon("crystal_executer"), false); b.setMnemonic(KeyEvent.VK_L); b.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.SHIFT_MASK|ActionEvent.CTRL_MASK)); r.addSeparator("Historique"); - b= r.addMenuItem("Acc\xE8s \xE0 l'interface historique", "AUTRE2",false); + b= r.addMenuItem("Acc\xE8s au fichier historique", "AUTRE2", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); b.setMnemonic(KeyEvent.VK_H); b.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, ActionEvent.SHIFT_MASK|ActionEvent.CTRL_MASK)); @@ -694,7 +694,7 @@ r.addMenuItem("Bateaux g\xE9n\xE9r\xE9s", "GRAPHEGENERATIONNAV", FudaaResource.FUDAA.getIcon("crystal_graphe"), false); - r.addMenuItem("Historique", "HISTORIQUETABLEAU", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); + //r.addMenuItem("Historique", "HISTORIQUETABLEAU", FudaaResource.FUDAA.getIcon("crystal_arbre"), false); r.addMenuItem("Dur\xE9es de parcours", "GRAPHEDUREEPARCOURS", FudaaResource.FUDAA.getIcon("crystal_graphe"), false); @@ -1501,7 +1501,7 @@ File fic=new File(donnees_.projet_.getFichier()+".his"); if(fic.exists()){ int confirmation = new BuDialogConfirmation(donnees_.application_.getApp(), - Sinavi3Implementation.isSinavi_, "Un fichier historique existe.\nCe fichier contient les r\xE9sultats d'un pr\xE9c\xE9dent calcul.\nSouhaitez-vous relancer le noyau de calcul?\nSi vous voulez directement lire le fichier historique, cliquez sur \"non\".").activate(); + Sinavi3Implementation.isSinavi_, "Un fichier historique existe d\xE9j\xE0. Il contient les r\xE9sultats d'un pr\xE9c\xE9dent \ncalcul.\nSouhaitez-vous relancer le noyau de calcul afin de g\xE9n\xE9rer un fichier historique mis \xE0 jour?\nDans le cas contraire, Sinavi exploitera le fichier historique existant.").activate(); if (confirmation == 0) { Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleCategories.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleCategories.java 2008-10-06 12:46:31 UTC (rev 4035) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleCategories.java 2008-10-06 14:35:50 UTC (rev 4036) @@ -109,7 +109,7 @@ BuPanel optionPanel_ = new BuPanel(); JCheckBox choixNbNavires_ = new JCheckBox("Nombre bateaux", true); - JCheckBox choixTotalAttente_ = new JCheckBox("Attente totale", true); + JCheckBox choixTotalAttente_ = new JCheckBox("Attentes totales", true); JCheckBox choixSecurite_ = new JCheckBox("Attentes de s\xE9curit\xE9", true); @@ -145,7 +145,7 @@ */ BuTable tableau_; - String titreTableau_[] = { "Cat\xE9gorie", "Nombre de bateaux", "Att. s\xE9curit\xE9: total", "Att. s\xE9curit\xE9: moy./flotte", "Att. s\xE9curit\xE9: nb. bateaux", "Att. s\xE9curit\xE9: moyenne", "Att. acc\xE8s: total", "Att. acc\xE8s: moy./flotte", + String titreTableau_[] = { "El\xE9ment", "Nombre de bateaux", "Att. s\xE9curit\xE9: total", "Att. s\xE9curit\xE9: moy./flotte", "Att. s\xE9curit\xE9: nb. bateaux", "Att. s\xE9curit\xE9: moyenne", "Att. acc\xE8s: total", "Att. acc\xE8s: moy./flotte", "Att. acc\xE8s: nb. bateaux", "Att. acc\xE8s: moyenne", "Att. occup.: total", "Att. occup.: moy./flotte", "Att. occup.: nb. bateaux", "Att. occup.: moyenne", "Att. indisp.: total", "Att. indisp.: moy./flotte", "Att. indisp.: nb. bateaux", "Att. indisp.: moyenne", "Attente totale", "Attente moyenne sur flotte", "Nb. bateaux ayant attendu", "Attente moyenne" }; @@ -793,23 +793,23 @@ // attente totale data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteSecuTotale)); + .traduitMinutesEnHeuresMinutes3((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteSecuTotale)); // moyenne attentes sur la flotte data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteSecuTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteSecuTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); // nombre de navires qui attendent data[indiceTbaleau][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteSecu) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteSecu) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteSecu + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteSecu / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteSecuTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteSecu)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteSecuTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteSecu)); } } @@ -821,23 +821,23 @@ // attente totale data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float)FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteAccesTotale)); + .traduitMinutesEnHeuresMinutes3((float)FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteAccesTotale)); // moyenne attentes sur la flotte data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteAccesTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteAccesTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); // nombre de navires qui attendent data[indiceTbaleau][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteAcces) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteAcces) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteAcces + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteAcces / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteAccesTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteAcces)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteAccesTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteAcces)); } } @@ -849,23 +849,23 @@ // attente totale data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteOccupTotale)); + .traduitMinutesEnHeuresMinutes3((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteOccupTotale)); // moyenne attentes sur la flotte data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteOccupTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteOccupTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); // nombre de navires qui attendent data[indiceTbaleau][indiceColonne++] = "" - + (float)FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAtenteOccup) + + FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAtenteOccup) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAtenteOccup + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAtenteOccup / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteOccupTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAtenteOccup)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteOccupTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAtenteOccup)); } } @@ -877,23 +877,23 @@ // attente totale data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attentePanneTotale)); + .traduitMinutesEnHeuresMinutes3((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attentePanneTotale)); // moyenne attentes sur la flotte data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attentePanneTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attentePanneTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); // nombre de navires qui attendent data[indiceTbaleau][indiceColonne++] = "" - + (float)FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttentePanne) + + FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttentePanne) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttentePanne + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttentePanne / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attentePanneTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttentePanne)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attentePanneTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttentePanne)); } } @@ -905,23 +905,23 @@ // attente totale data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteMegaTotale)); + .traduitMinutesEnHeuresMinutes3((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteMegaTotale)); // moyenne attentes sur la flotte data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteMegaTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteMegaTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal)); // nombre de navires qui attendent data[indiceTbaleau][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteTotale) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteTotale) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteTotale + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteMegaTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteTotale)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].attenteMegaTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[i].tableauAttenteCategories[val].nbNaviresAttenteTotale)); } } @@ -980,9 +980,9 @@ // nombre de navires qui attendent data[0][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteSecu) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteSecu) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteSecu + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteSecu / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent @@ -1001,9 +1001,9 @@ // nombre de navires qui attendent data[0][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteAcces) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteAcces) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteAcces + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteAcces / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent @@ -1022,9 +1022,9 @@ // nombre de navires qui attendent data[0][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAtenteOccup) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAtenteOccup) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAtenteOccup + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAtenteOccup / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent @@ -1044,9 +1044,9 @@ // nombre de navires qui attendent data[0][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttentePanne) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttentePanne) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttentePanne + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttentePanne / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent @@ -1066,9 +1066,9 @@ // nombre de navires qui attendent data[0][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteTotale) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteTotale) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteTotale + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nbNaviresAttenteTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[val].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent @@ -1947,7 +1947,7 @@ this.titreTableau_ = new String[compteurColonnes + 1]; int indiceColonne = 0; - this.titreTableau_[indiceColonne++] = "Cat\xE9gorie"; + this.titreTableau_[indiceColonne++] = "El\xE9ment"; if (this.choixNbNavires_.isSelected()) { this.titreTableau_[indiceColonne++] = "Nombre de bateaux"; } Modified: trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleElement.java =================================================================== --- trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleElement.java 2008-10-06 12:46:31 UTC (rev 4035) +++ trunk/fudaa_devel/fudaa/src/org/fudaa/fudaa/sinavi3/Sinavi3ResultatsAttenteGeneraleElement.java 2008-10-06 14:35:50 UTC (rev 4036) @@ -820,23 +820,23 @@ // attente totale data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteSecuTotale)); + .traduitMinutesEnHeuresMinutes3((float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteSecuTotale)); // moyenne attentes sur la flotte data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteSecuTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nombreNaviresTotal)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteSecuTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nombreNaviresTotal)); // nombre de navires qui attendent data[indiceTbaleau][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteSecu) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteSecu) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteSecu + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteSecu / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteSecuTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteSecu)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteSecuTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteSecu)); } } @@ -848,23 +848,23 @@ // attente totale data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float)FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteAccesTotale)); + .traduitMinutesEnHeuresMinutes3((float)FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteAccesTotale)); // moyenne attentes sur la flotte data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteAccesTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nombreNaviresTotal)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteAccesTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nombreNaviresTotal)); // nombre de navires qui attendent data[indiceTbaleau][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteAcces) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteAcces) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteAcces + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteAcces / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteAccesTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteAcces)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteAccesTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAttenteAcces)); } } @@ -876,23 +876,23 @@ // attente totale data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float)FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteOccupTotale)); + .traduitMinutesEnHeuresMinutes3((float)FonctionsSimu.diviserSimu( this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteOccupTotale)); // moyenne attentes sur la flotte data[indiceTbaleau][indiceColonne++] = "" + Sinavi3TraduitHoraires - .traduitMinutesEnHeuresMinutes2((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteOccupTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nombreNaviresTotal)); + .traduitMinutesEnHeuresMinutes3((float) (this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].attenteOccupTotale / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nombreNaviresTotal)); // nombre de navires qui attendent data[indiceTbaleau][indiceColonne++] = "" - + (float) FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAtenteOccup) + + FonctionsSimu.diviserSimu(this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAtenteOccup) + " (" - + (float) ((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAtenteOccup + + Math.round((float) this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nbNaviresAtenteOccup / this.donnees_.params_.ResultatsCompletsSimulation.AttentesTousElementsToutesCategories[ELEMENTCHOISI].tableauAttenteCategories[i].nombreNaviresTotal * 100) + "%)"; // moyenne attente sur les navires qui attendent data[indiceTbaleau][indiceColonne++] = "" ... [truncated message content] |
From: <bma...@us...> - 2008-10-06 12:50:54
|
Revision: 4035 http://fudaa.svn.sourceforge.net/fudaa/?rev=4035&view=rev Author: bmarchan Date: 2008-10-06 12:46:31 +0000 (Mon, 06 Oct 2008) Log Message: ----------- Factorisation des GISZoneCollection Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionLigneBrisee.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigLineSingleModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayer.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfileSplitter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java 2008-10-05 22:05:30 UTC (rev 4034) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java 2008-10-06 12:46:31 UTC (rev 4035) @@ -83,7 +83,11 @@ } /** - * Ne peut \xEAtre utilis\xE9 que si la liste contient des objets GIS homogenes. + * Ajoute une g\xE9om\xE9trie, d\xE9finie a partir d'une sequence de coordonn\xE9es.<p> + * Attention : Ne peut \xEAtre utilis\xE9 que si la liste contient des objets GIS homogenes. + * @param _seq La sequence de coordonnees + * @param _data Les valeurs d'attribut associ\xE9es \xE0 la g\xE9om\xE9trie, dans l'ordre des attributs. + * @param _cmd Le manager de commandes. */ public void addCoordinateSequence(final CoordinateSequence _seq, final Object[] _data, final CtuluCommandContainer _cmd) { @@ -110,15 +114,21 @@ } return true; } + /** - * @todo Les poly de niveau sont mal trait\xE9es + * Ajoute un sommet a une g\xE9om\xE9trie. + * @param _idxGeom L'index de la g\xE9om\xE9trie + * @param _idxBefore L'indice du point juste avant. + * @param _x La coordonn\xE9e X du sommet ajout\xE9. + * @param _y LA coordonn\xE9e Y du sommet ajout\xE9. + * @param _cmd Le manager de commandes. */ - public void addAtomic(final int _ligneIdx, final int _idxBefore, final double _x, final double _y, + public void addAtomic(final int _idxGeom, final int _idxBefore, final double _x, final double _y, final CtuluCommandContainer _cmd) { if (!isGeomModifiable_) { return; } - Geometry geom = (Geometry)super.geometry_.getValueAt(_ligneIdx); + Geometry geom = (Geometry)super.geometry_.getValueAt(_idxGeom); final Coordinate[] oldcs = geom.getCoordinates(); final int initSize = oldcs.length; final Coordinate[] cs = new Coordinate[initSize + 1]; @@ -131,7 +141,7 @@ } geom = GISGeometryFactory.INSTANCE.createGeometry(geom.getClass(),cs); - setGeometry(_ligneIdx,geom, _cmd); + setGeometry(_idxGeom,geom, _cmd); } /** @@ -238,11 +248,15 @@ return true; } + // dans le cas polygone le dernier point n'est pas a considerer=premier point + if (old instanceof GISPolygone) { + nbPt--; + } // les nouvelles coordonnees. - final Coordinate[] newCs = new Coordinate[nbPt]; + final Coordinate[] newCs = new Coordinate[nbPt-nbSel]; // cette liste contient les indice a enlever : creee que si necessaire // si des attribute atomics existent - final TIntArrayList idxToRemove = containsAtomicAttribute() ? new TIntArrayList(nbPt) : null; + final TIntArrayList idxToRemove = containsAtomicAttribute() ? new TIntArrayList(nbPt-nbSel) : null; // compteur tempo int count = 0; @@ -252,7 +266,8 @@ idxToRemove.add(idxPt); } } else { - newCs[count++] = (Coordinate)old.getCoordinates()[idxPt].clone(); + newCs[count++] = ((GISCoordinateSequenceContainerInterface)old).getCoordinateSequence().getCoordinate(idxPt); +// newCs[count++] = (Coordinate)old.getCoordinates()[idxPt].clone(); } } Geometry newGeom = null; @@ -283,14 +298,15 @@ } } else { - final Coordinate[] coord=new Coordinate[count]; - System.arraycopy(newCs, 0, coord, 0, coord.length); - newGeom=GISGeometryFactory.INSTANCE.createGeometry(old.getClass(), coord); +// final Coordinate[] coord=new Coordinate[count]; +// System.arraycopy(newCs, 0, coord, 0, coord.length); + newGeom=GISGeometryFactory.INSTANCE.createGeometry(old.getClass(), newCs); newGeom.setUserData(old.getUserData()); } if (r) { - super.geometry_.setObject(_idxGeom, newGeom, _cmd); + final CtuluCommandComposite cmp = new CtuluCommandComposite(); + super.geometry_.setObject(_idxGeom, newGeom, cmp); // si des attributs atomics sont concerne if (idxToRemove != null && idxToRemove.size() > 0) { final int[] idx = idxToRemove.toNativeArray(); @@ -303,10 +319,12 @@ // on recupere le sous-model concerne par la modif de geometrie final GISAttributeModel atomicModel = (GISAttributeModel) m.getObjectValueAt(_idxGeom); // on le change - m.setObject(_idxGeom, atomicModel.createSubModel(idx), _cmd); + m.setObject(_idxGeom, atomicModel.createSubModel(idx), cmp); } } } + if (_cmd!=null) + _cmd.addCmd(cmp.getSimplify()); } return r; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionLigneBrisee.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionLigneBrisee.java 2008-10-05 22:05:30 UTC (rev 4034) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionLigneBrisee.java 2008-10-06 12:46:31 UTC (rev 4035) @@ -23,17 +23,15 @@ import org.fudaa.ctulu.CtuluCommandComposite; import org.fudaa.ctulu.CtuluCommandContainer; import org.fudaa.ctulu.CtuluLib; -import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.CtuluUI; -import org.fudaa.ctulu.collection.CtuluCollectionDouble; /** * @author Fred Deniger * @version $Id: GISZoneCollectionLigneBrisee.java,v 1.20.6.4 2008-04-01 07:22:47 bmarchan Exp $ */ -public class GISZoneCollectionLigneBrisee extends GISZoneCollection { +public class GISZoneCollectionLigneBrisee extends GISZoneCollectionGeometry { public GISZoneCollectionLigneBrisee() { this(null); @@ -49,18 +47,12 @@ /** * @param _listener le listener */ - public GISZoneCollectionLigneBrisee(final GISZoneListener _listener, final GISZoneCollectionLigneBrisee _br) { - this(10, _listener); - if (_br != null) { - for (int i = 0; i < _br.getNumGeometries(); i++) { - super.geometry_.add(_br.getGeometry(i), null, null); - } - } + public GISZoneCollectionLigneBrisee(final GISZoneListener _listener, final GISZoneCollectionLigneBrisee _col) { + super(_listener,_col); } public GISZoneCollectionLigneBrisee(final int _nbObject, final GISZoneListener _listener) { - super(_nbObject); - listener_ = _listener; + super(_nbObject,_listener); } private List createListForSeveralAdd(final Object[][] _att, final int _nbGeom) { @@ -76,69 +68,6 @@ return attListe; } - /** - * @param _idx l'indice de la ligne a changer - * @param _newLine la nouvelle ligne - * @param _cmd le receveur de commande - */ - private void setValueIntern(final int _idx, final LineString _newLine, final CtuluCommandContainer _cmd) { - if (!isGeomModifiable_) { - return; - } - final LineString old = (LineString) super.geometry_.getValueAt(_idx); - if (old.getNumPoints() == _newLine.getNumPoints() || !containsAtomicAttribute()) { - super.geometry_.setObject(_idx, _newLine, _cmd); - } else { - final CtuluCommandComposite cmp = new CtuluCommandComposite(); - for (int i = getNbAttributes() - 1; i >= 0; i--) { - final GISAttributeInterface att = getAttribute(i); - if (att.isAtomicValue()) { - final GISAttributeModel m = (GISAttributeModel) (getModelListener(i).getObjectValueAt(_idx)); - final GISReprojectInterpolateurI interpolateur = GISZoneAttributeFactory.create1DInterpolateur(att, - (GISCoordinateSequenceContainerInterface)old, - (GISCoordinateSequenceContainerInterface)_newLine, m); - getModelListener(i).setObject(_idx, m.deriveNewModel(_newLine.getNumPoints(), interpolateur), cmp); - } - } - super.geometry_.setObject(_idx, _newLine, cmp); - if (_cmd != null) { - _cmd.addCmd(cmp.getSimplify()); - } - } - } - - /** - * Cr\xE9e un tableau de valeurs d'attributs.<p> - * - * Les valeurs peuvent \xEAtre globales ou atomiques. - * - * @param _init Les valeurs d'initialisation, dans l'ordre et au nombre des mod\xE8les d'attributs. - * Si null, les valeurs par d\xE9faut sont affect\xE9es (voir {@link GISAttributeInterface#getDefaultValue()}) - * @param _dest La g\xE9ometrie polyligne ou polygone. - * @param _isClosed Param\xE8tre inutilis\xE9. - * @return - */ - protected Object[] createAttributeList(final Object[] _init, final Geometry _dest, final boolean _isClosed) { - final Object[] rf = new Object[getNbAttributes()]; - if (_init != null && _init.length != getNbAttributes()) { - throw new IllegalArgumentException("bad size"); - } - for (int i = getNbAttributes() - 1; i >= 0; i--) { - rf[i]=createOrAssignAttribut(i,_init==null?null:_init[i],_dest); - } - return rf; - } - - public boolean accept(final GISVisitor _v) { - final int nb = getNumGeometries(); - for (int i = 0; i < nb; i++) { - if (!((GISLigneBrisee) getGeometry(i)).accept(_v)) { - return false; - } - } - return true; - } - public void addAllLineStringClosedOrNode(final LineString[] _gs, final CtuluCommandContainer _cmd) { if (isGeomModifiable_) { @@ -186,44 +115,11 @@ public int addGeometry(final Geometry _geom, final Object[] _data, final CtuluCommandContainer _cmd) { if (!(_geom instanceof LineString)) throw new IllegalArgumentException("Bad type geometry"); - - if (isGeomModifiable_) { - geometry_.add(_geom, Arrays.asList(createAttributeList(_data, _geom, true)), _cmd); - return geometry_.getSize() - 1; - } - return -1; + + return super.addGeometry(_geom, _data, _cmd); } - /** - * @todo Les poly de niveau sont mal trait\xE9es - */ - public void addPoint(final int _ligneIdx, final int _idxBefore, final double _x, final double _y, - final CtuluCommandContainer _cmd) { - if (!isGeomModifiable_) { - return; - } - LineString str = (LineString) super.geometry_.getValueAt(_ligneIdx); - final CoordinateSequence newSeq = str.getCoordinateSequence(); - final int initSize = newSeq.size(); - final Coordinate[] cs = new Coordinate[initSize + 1]; - int idx = 0; - for (int i = 0; i < initSize; i++) { - cs[idx++] = newSeq.getCoordinateCopy(i); - if (i == _idxBefore) { - cs[idx++] = new Coordinate(_x, _y, newSeq.getOrdinate(i, 2)); - } - } - if (str/*.isClosed()*/ instanceof GISPolygone) { - str = GISGeometryFactory.INSTANCE.createLinearRing(cs); - setValue(_ligneIdx, (GISPolygone) str, _cmd); - } - else if (str instanceof GISPolyligne) { - str = GISGeometryFactory.INSTANCE.createLineString(cs); - setValue(_ligneIdx, (GISPolyligne) str, _cmd); - } - } - public void addPolygone(final CoordinateSequence _g, final CtuluCommandContainer _cmd) { addPolygone((GISPolygone) GISGeometryFactory.INSTANCE.createLinearRing(_g), _cmd); } @@ -280,15 +176,6 @@ addPolyligne((GISPolyligne) GISGeometryFactory.INSTANCE.createLineStringNiveau(_g), _cmd); } - public boolean containsAtomicAttribute() { - for (int i = getNbAttributes() - 1; i >= 0; i--) { - if (getAttribute(i).isAtomicValue()) { - return true; - } - } - return false; - } - /** * @return true si contient au moins un polygone (ligne brisee fermee). */ @@ -317,28 +204,12 @@ return false; } - public CoordinateSequence getCoordinateSequence(final int _i) { - return ((LineString) getGeometry(_i)).getCoordinateSequence(); - } - public Class getDataStoreClass() { return LineString.class; } - public double getDoubleValue(final int _idxAtt, final int _idxGeom) { - if (getAttribute(_idxAtt).isAtomicValue()) { - return CtuluLibArray.getMoyenne(((CtuluCollectionDouble) getModel(_idxAtt).getObjectValueAt(_idxGeom)).getValues()); - } - return ((CtuluCollectionDouble) getModel(_idxAtt)).getValue(_idxGeom); - } - - /** - * Supprime des sommets sur une g\xE9om\xE9trie. - * @param _idxGeom L'indice de la g\xE9om\xE9trie. - * @param _sel La liste des sommets s\xE9lectionn\xE9s. - * @param _ui L'interface utilisateur. - * @param _cmd Le manager de commandes. - * @return true si tout s'est bien pass\xE9. + /* + * Surcharge, en attendant d'etre sur que la methode m\xE8re fonctionne dans tous les cas. */ public boolean removeAtomics(final int _idxGeom, final CtuluListSelectionInterface _sel, final CtuluUI _ui, final CtuluCommandContainer _cmd) { @@ -441,58 +312,4 @@ } return r; } - - public void removeLignes(final int[] _idx, final CtuluCommandContainer _cmd) { - super.geometry_.remove(_idx, _cmd); - } - - public void setCoordinateSequence(final int _idx, final CoordinateSequence _newSeq, final CtuluCommandContainer _cmd) { - final LineString old = (LineString) super.geometry_.getValueAt(_idx); - if (_newSeq != null && _newSeq.size() == old.getNumPoints()) { - final CoordinateSequence seq = GISGeometryFactory.INSTANCE.getCoordinateSequenceFactory().create(_newSeq); - if (old/*.isClosed()*/ instanceof GISPolygone) { - geometry_.setObject(_idx, GISGeometryFactory.INSTANCE.createLinearRing(seq), _cmd); - } else { - GISPolyligne nl = (GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(seq); - geometry_.setObject(_idx, nl, _cmd); - } - } - } - - - /** - * Remplace une ancienne g\xE9om\xE9trie par un nouveau polygone, en interpolant si n\xE9cessaire les attributs. - * @param _idx L'index de la g\xE9ometrie. - * @param _newLine La nouvelle g\xE9om\xE9trie. - * @param _cmd Le container de commandes. - */ - public void setValue(final int _idx, final GISPolygone _newLine, final CtuluCommandContainer _cmd) { - setValueIntern(_idx, _newLine, _cmd); - } - - /** - * Remplace une ancienne g\xE9om\xE9trie par une nouvelle polyligne, en interpolant si n\xE9cessaire les attributs. - * @param _idx L'index de la g\xE9ometrie. - * @param _newLine La nouvelle g\xE9om\xE9trie. - * @param _cmd Le container de commandes. - */ - public void setValue(final int _idx, final GISPolyligne _newLine, final CtuluCommandContainer _cmd) { - setValueIntern(_idx, _newLine, _cmd); - } - - public void updateListeners() { - for (int i = getNbAttributes() - 1; i >= 0; i--) { - final GISAttributeModelListener m = getModelListener(i); - if (m != null) { - if (m.getAttribute().isAtomicValue()) { - for (int j = m.getSize() - 1; j >= 0; j--) { - ((GISAttributeModelListener) m.getObjectValueAt(j)).setListener(this); - } - - } else { - m.setListener(this); - } - } - } - } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java 2008-10-05 22:05:30 UTC (rev 4034) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java 2008-10-06 12:46:31 UTC (rev 4035) @@ -7,33 +7,22 @@ */ package org.fudaa.ctulu.gis; -import gnu.trove.TIntArrayList; import gnu.trove.TIntIntHashMap; -import java.util.Arrays; +import org.fudaa.ctulu.CtuluCommandComposite; +import org.fudaa.ctulu.CtuluCommandContainer; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.CoordinateSequence; import com.vividsolutions.jts.geom.Geometry; -import com.memoire.fu.FuLog; - -import org.fudaa.ctulu.CtuluCommandComposite; -import org.fudaa.ctulu.CtuluCommandContainer; -import org.fudaa.ctulu.CtuluLib; -import org.fudaa.ctulu.CtuluLibArray; -import org.fudaa.ctulu.CtuluLibString; -import org.fudaa.ctulu.CtuluListSelectionInterface; -import org.fudaa.ctulu.CtuluUI; -import org.fudaa.ctulu.collection.CtuluCollectionDouble; - /** * Une collection pour les multipoints. * * @author Bertrand Marchand * @version $Id: GISZoneCollectionMultiPoint.java,v 1.1.2.2 2008-04-01 07:22:48 bmarchan Exp $ */ -public class GISZoneCollectionMultiPoint extends GISZoneCollection { +public class GISZoneCollectionMultiPoint extends GISZoneCollectionGeometry { public GISZoneCollectionMultiPoint() { this(null); @@ -50,119 +39,13 @@ * @param _listener le listener */ public GISZoneCollectionMultiPoint(final GISZoneListener _listener, final GISZoneCollectionMultiPoint _col) { - this(10, _listener); - if (_col != null) { - for (int i = 0; i < _col.getNumGeometries(); i++) { - super.geometry_.add(_col.getGeometry(i), null, null); - } - } + super(_listener,_col); } public GISZoneCollectionMultiPoint(final int _nbObject, final GISZoneListener _listener) { - super(_nbObject); - listener_ = _listener; + super(_nbObject,_listener); } -// private List createListForSeveralAdd(final Object[][] _att, final int _nbGeom) { -// final int nbAttributes = getNbAttributes(); -// final List attListe = new ArrayList(nbAttributes); -// for (int i = 0; i < nbAttributes; i++) { -// final Object[] oi = new Object[_nbGeom]; -// for (int j = 0; j < _nbGeom; j++) { -// oi[j] = _att[j][i]; -// } -// attListe.add(oi); -// } -// return attListe; -// } -// -// /** -// * @param _idx l'indice de la ligne a changer -// * @param _newLine la nouvelle ligne -// * @param _cmd le receveur de commande -// */ -// private void setValueIntern(final int _idx, final LineString _newLine, final CtuluCommandContainer _cmd) { -// if (!isGeomModifiable_) { -// return; -// } -// final LineString old = (LineString) super.geometry_.getValueAt(_idx); -// if (old.getNumPoints() == _newLine.getNumPoints() || !containsAtomicAttribute()) { -// super.geometry_.setObject(_idx, _newLine, _cmd); -// } else { -// final CtuluCommandComposite cmp = new CtuluCommandComposite(); -// for (int i = getNbAttributes() - 1; i >= 0; i--) { -// final GISAttributeInterface att = getAttribute(i); -// if (att.isAtomicValue()) { -// final GISAttributeModel m = (GISAttributeModel) (getModelListener(i).getObjectValueAt(_idx)); -// final GISReprojectInterpolateurI interpolateur = GISZoneAttributeFactory.create1DInterpolateur(att, old, -// _newLine, m); -// getModelListener(i).setObject(_idx, m.deriveNewModel(_newLine.getNumPoints(), interpolateur), cmp); -// } -// } -// super.geometry_.setObject(_idx, _newLine, cmp); -// if (_cmd != null) { -// _cmd.addCmd(cmp.getSimplify()); -// } -// } -// } - - /** - * Cr\xE9e un tableau de valeurs d'attributs.<p> - * - * Les valeurs peuvent \xEAtre globales ou atomiques. - * - * @param _init Les valeurs d'initialisation, dans l'ordre et au nombre des mod\xE8les d'attributs. - * Si null, les valeurs par d\xE9faut sont affect\xE9es (voir {@link GISAttributeInterface#getDefaultValue()}) - * @param _dest La g\xE9ometrie. - * @param _isClosed Param\xE8tre inutilis\xE9. - * @return - */ - protected Object[] createAttributeList(final Object[] _init, final Geometry _dest, final boolean _isClosed) { - final Object[] rf = new Object[getNbAttributes()]; - if (_init != null && _init.length != getNbAttributes()) { - throw new IllegalArgumentException("bad size"); - } - for (int i = getNbAttributes() - 1; i >= 0; i--) { - rf[i]=createOrAssignAttribut(i,_init==null?null:_init[i],_dest); - } - return rf; - } - -// public void addAllLineStringClosedOrNode(final LineString[] _gs, final CtuluCommandContainer _cmd) { -// if (isGeomModifiable_) { -// -// final Object[][] att = new Object[_gs.length][]; -// for (int i = 0; i < _gs.length; i++) { -// att[i] = createAttributeList(null, _gs[i], _gs[i].isClosed()); -// } -// -// geometry_.addAll(_gs, createListForSeveralAdd(att, _gs.length), _cmd); -// } -// } - -// public void addAllPolygones(final GISPolygone[] _gs, final CtuluCommandContainer _cmd) { -// if (isGeomModifiable_) { -// final Object[][] att = new Object[_gs.length][]; -// for (int i = 0; i < _gs.length; i++) { -// att[i] = createAttributeList(null, _gs[i], true); -// } -// geometry_.addAll(_gs, createListForSeveralAdd(att, _gs.length), _cmd); -// } -// } -// -// public void addAllPolylignes(final GISPolyligne[] _gs, final CtuluCommandContainer _cmd) { -// if (isGeomModifiable_) { -// final Object[][] att = new Object[_gs.length][]; -// for (int i = 0; i < _gs.length; i++) { -// att[i] = createAttributeList(null, _gs[i], false); -// } -// geometry_.addAll(_gs, createListForSeveralAdd(att, _gs.length), _cmd); -// } -// } - - /** - * Ne peut \xEAtre utilis\xE9 que si la liste contient des objets GIS homogenes. - */ public void addCoordinateSequence(final CoordinateSequence _seq, final Object[] _data, final CtuluCommandContainer _cmd) { if (_seq == null || _seq.size() < 1) { @@ -176,25 +59,13 @@ public int addGeometry(final Geometry _geom, final Object[] _data, final CtuluCommandContainer _cmd) { if (!(_geom instanceof GISMultiPoint)) throw new IllegalArgumentException("Bad type geometry"); - - if (isGeomModifiable_) { - Object[] atts = createAttributeList(_data, _geom, true); - geometry_.add(_geom, Arrays.asList(atts), _cmd); - return geometry_.getSize() - 1; - } - return -1; + + return super.addGeometry(_geom, _data, _cmd); } - public boolean accept(final GISVisitor _v) { - final int nb = getNumGeometries(); - for (int i = 0; i < nb; i++) { - if (!((GISMultiPoint) getGeometry(i)).accept(_v)) { - return false; - } - } - return true; - } - + /* + * Le sommet est ajout\xE9 sans interpolation des valeurs atomiques. + */ public void addAtomic(final int _idxGeom, final int _idxBefore, final double _x, final double _y, final CtuluCommandContainer _cmd) { if (!isGeomModifiable_) { @@ -237,265 +108,10 @@ } } - /** - * @param _idxGeom l'indice de la g\xE9om\xE9trie a remplacer - * @param _geom la nouvelle g\xE9ometrie - * @param _cmd le receveur de commande - */ - public void setGeometry(final int _idxGeom, final Geometry _geom, final CtuluCommandContainer _cmd) { - if (!isGeomModifiable_) { - return; - } - final Geometry old = (Geometry) super.geometry_.getValueAt(_idxGeom); - if (old.getNumPoints() == _geom.getNumPoints() || !containsAtomicAttribute()) { - super.geometry_.setObject(_idxGeom, _geom, _cmd); - } else { - final CtuluCommandComposite cmp = new CtuluCommandComposite(); - for (int i = getNbAttributes() - 1; i >= 0; i--) { - final GISAttributeInterface att = getAttribute(i); - if (att.isAtomicValue()) { - final GISAttributeModel m = (GISAttributeModel) (getModelListener(i).getObjectValueAt(_idxGeom)); - final GISReprojectInterpolateurI interpolateur = GISZoneAttributeFactory.create1DInterpolateur(att, - (GISCoordinateSequenceContainerInterface)old, - (GISCoordinateSequenceContainerInterface)_geom, m); - getModelListener(i).setObject(_idxGeom, m.deriveNewModel(_geom.getNumPoints(), interpolateur), cmp); - } - } - super.geometry_.setObject(_idxGeom, _geom, cmp); - if (_cmd != null) { - _cmd.addCmd(cmp.getSimplify()); - } - } - } - - public CoordinateSequence getCoordinateSequence(final int _i) { - if (!(getGeometry(_i) instanceof GISMultiPoint)) return null; - return ((GISMultiPoint) getGeometry(_i)).getCoordinateSequence(); - } - public Class getDataStoreClass() { return GISMultiPoint.class; } - public double getDoubleValue(final int _idxAtt, final int _idxGeom) { - if (getAttribute(_idxAtt).isAtomicValue()) { - return CtuluLibArray.getMoyenne(((CtuluCollectionDouble) getModel(_idxAtt).getObjectValueAt(_idxGeom)).getValues()); - } - return ((CtuluCollectionDouble) getModel(_idxAtt)).getValue(_idxGeom); - } - - public void setCoordinateSequence(final int _idx, final CoordinateSequence _newSeq, final CtuluCommandContainer _cmd) { - final Geometry old = (Geometry) super.geometry_.getValueAt(_idx); - if (_newSeq != null && _newSeq.size() == old.getNumPoints()) { - final CoordinateSequence seq = GISGeometryFactory.INSTANCE.getCoordinateSequenceFactory().create(_newSeq); - geometry_.setObject(_idx, GISGeometryFactory.INSTANCE.createMultiPoint(seq), _cmd); - } - } - - public void updateListeners() { - for (int i = getNbAttributes() - 1; i >= 0; i--) { - final GISAttributeModelListener m = getModelListener(i); - if (m != null) { - if (m.getAttribute().isAtomicValue()) { - for (int j = m.getSize() - 1; j >= 0; j--) { - ((GISAttributeModelListener) m.getObjectValueAt(j)).setListener(this); - } - - } else { - m.setListener(this); - } - } - } - } - -// /** -// * @todo Les poly de niveau sont mal trait\xE9es -// */ -// public void addPoint(final int _ligneIdx, final int _idxBefore, final double _x, final double _y, -// final CtuluCommandContainer _cmd) { -// if (!isGeomModifiable_) { -// return; -// } -// LineString str = (LineString) super.geometry_.getValueAt(_ligneIdx); -// final CoordinateSequence newSeq = str.getCoordinateSequence(); -// final int initSize = newSeq.size(); -// final Coordinate[] cs = new Coordinate[initSize + 1]; -// int idx = 0; -// for (int i = 0; i < initSize; i++) { -// cs[idx++] = newSeq.getCoordinateCopy(i); -// if (i == _idxBefore) { -// cs[idx++] = new Coordinate(_x, _y, newSeq.getOrdinate(i, 2)); -// } -// } -// -// if (str/*.isClosed()*/ instanceof GISPolygone) { -// str = GISGeometryFactory.INSTANCE.createLinearRing(cs); -// setValue(_ligneIdx, (GISPolygone) str, _cmd); -// } -// else if (str instanceof GISPolyligne) { -// boolean breliee=((GISPolyligne)str).isReliee(); -// str = GISGeometryFactory.INSTANCE.createLineString(cs); -// ((GISPolyligne)str).setReliee(breliee); -// setValue(_ligneIdx, (GISPolyligne) str, _cmd); -// } -// } - -/* public void addPolygone(final CoordinateSequence _g, final CtuluCommandContainer _cmd) { - addPolygone((GISPolygone) GISGeometryFactory.INSTANCE.createLinearRing(_g), _cmd); - } - - public void addPolygone(final CoordinateSequence _g, final Object[] _data, final CtuluCommandContainer _cmd) { - addPolygone((GISPolygone) GISGeometryFactory.INSTANCE.createLinearRing(_g), _data, _cmd); - } - - public void addPolygone(final GISPolygone _g, final CtuluCommandContainer _cmd) { - addPolygone(_g, null, _cmd); - } - - public void addPolygone(final GISPolygone _g, final Object[] _data, final CtuluCommandContainer _cmd) { - if (isGeomModifiable_) { - super.geometry_.add(_g, Arrays.asList(createAttributeList(_data, _g, true)), _cmd); - } - } - - public void addPolygoneNiveau(final CoordinateSequence _g, final CtuluCommandContainer _cmd) { - addPolygone((GISPolygone) GISGeometryFactory.INSTANCE.createLinearRingNiveau(_g), _cmd); - }*/ - - /** - * Ajoute une polyligne sous forme d'une liste de coordonn\xE9es, avec attributs et gestionnaire de commandes. - * @param _g La liste de coordonn\xE9es, renseign\xE9e en Z. - * @param _data Les attributs, dans l'ordre dans lequel ils sont d\xE9finis dans la collection. - * @param _cmd Le gestionnaire de commandes. Peut \xEAtre null. - */ -/* public void addPolyligne(final CoordinateSequence _g, final Object[] _data, final CtuluCommandContainer _cmd) { - addPolyligne((GISPolyligne) GISGeometryFactory.INSTANCE.createLineString(_g), _data, _cmd); - } - - public void addPolyligne(final GISCoordinateSequence _g, final CtuluCommandContainer _cmd) { - addPolyligne((GISPolyligne) GISGeometryFactory.INSTANCE.createLineString(_g), _cmd); - } - - public void addPolyligne(final GISPolyligne _g, final CtuluCommandContainer _cmd) { - addPolyligne(_g, null, _cmd); - }*/ - - /** - * Ajoute une polyligne, avec attributs et gestionnaire de commandes. - * @param _g La polyligne, renseign\xE9e en Z. - * @param _data Les attributs, dans l'ordre dans lequel ils sont d\xE9finis dans la collection. - * @param _cmd Le gestionnaire de commandes. Peut \xEAtre null. - */ -/* public void addPolyligne(final GISPolyligne _g, final Object[] _data, final CtuluCommandContainer _cmd) { - if (isGeomModifiable_) { - super.geometry_.add(_g, Arrays.asList(createAttributeList(_data, _g, false)), _cmd); - } - } - - public void addMultiPoint(final GISMultiPoint _g, final Object[] _data, final CtuluCommandContainer _cmd) { - if (isGeomModifiable_) { - super.geometry_.add(_g, Arrays.asList(createAttributeList(_data, _g, false)), _cmd); - } - }*/ - -// public void addPolyligneNiveau(final GISCoordinateSequence _g, final CtuluCommandContainer _cmd) { -// addPolyligne((GISPolyligne) GISGeometryFactory.INSTANCE.createLineStringNiveau(_g), _cmd); -// } - - public boolean containsAtomicAttribute() { - for (int i = getNbAttributes() - 1; i >= 0; i--) { - if (getAttribute(i).isAtomicValue()) { - return true; - } - } - return false; - } - - /** - * Supprime des sommets sur une g\xE9om\xE9trie. - * @param _idxGeom L'indice de la g\xE9om\xE9trie. - * @param _sel La liste des sommets s\xE9lectionn\xE9s. - * @param _ui L'interface utilisateur. - * @param _cmd Le manager de commandes. - * @return true si tout s'est bien pass\xE9. - */ - public boolean removeAtomics(final int _idxGeom, final CtuluListSelectionInterface _sel, final CtuluUI _ui, - final CtuluCommandContainer _cmd) { - if (_sel == null || _sel.isEmpty()) { - return false; - } - boolean r = true; - final Geometry old = (Geometry) getGeometry(_idxGeom); - int nbPt = old.getNumPoints(); - - // Raccourci si tous les sommets sont s\xE9lectionn\xE9s. - int nbSel=_sel.getNbSelectedIndex(); - if (nbSel==nbPt) { - removeGeometries(new int[]{_idxGeom}, _cmd); - return true; - } - - // les nouvelles coordonnees. - final Coordinate[] newCs = new Coordinate[nbPt-nbSel]; - // cette liste contient les indice a enlever : creee que si necessaire - // si des attribute atomics existent - final TIntArrayList idxToRemove = containsAtomicAttribute() ? new TIntArrayList(nbPt-nbSel) : null; - - // compteur tempo - int count = 0; - for (int idxPt = 0; idxPt < nbPt; idxPt++) { - if (_sel.isSelected(idxPt)) { - if (idxToRemove != null) { - idxToRemove.add(idxPt); - } - } else { - newCs[count++] = ((GISCoordinateSequenceContainerInterface)old).getCoordinateSequence().getCoordinate(idxPt); - } - } - GISMultiPoint newGeom=null; - if (count<1) { - r=false; - if (_ui!=null) { - _ui.error(null, CtuluLib.getS("La ligne non reliee doit contenir {0} points au moins", CtuluLibString.UN), false); - } - if (FuLog.isTrace()) { - FuLog.trace("EBLI: polylignes: not enough points"); - // message - } - } - else { -// final Coordinate[] coord=new Coordinate[count]; -// System.arraycopy(newCs, 0, coord, 0, coord.length); - newGeom=(GISMultiPoint)GISGeometryFactory.INSTANCE.createMultiPoint(newCs); - newGeom.setUserData(old.getUserData()); - } - - if (r) { - CtuluCommandComposite cmp=new CtuluCommandComposite(); - super.geometry_.setObject(_idxGeom, newGeom, cmp); - // si des attributs atomics sont concerne - if (idxToRemove != null && idxToRemove.size() > 0) { - final int[] idx = idxToRemove.toNativeArray(); - Arrays.sort(idx); - for (int i = getNbAttributes() - 1; i >= 0; i--) { - // attribut atomic - if (getAttribute(i).isAtomicValue()) { - // dans ce cas on recupere le model contenant cet attribut - final GISAttributeModel m = getModelListener(i); - // on recupere le sous-model concerne par la modif de geometrie - final GISAttributeModel atomicModel = (GISAttributeModel) m.getObjectValueAt(_idxGeom); - // on le change - m.setObject(_idxGeom, atomicModel.createSubModel(idx), cmp); - } - } - } - if (_cmd!=null) { - _cmd.addCmd(cmp.getSimplify()); - } - } - return r; - } - public boolean addAll(final GISDataModel _model, final CtuluCommandContainer _cmd, final boolean _doPostImport) { if (!isGeomModifiable_ || _model == null) { return false; @@ -507,16 +123,4 @@ } return super.addAll(_model, _cmd, _doPostImport); } - -// public void removeLignes(final int[] _idx, final CtuluCommandContainer _cmd) { -// super.geometry_.remove(_idx, _cmd); -// } -// -// public void setValue(final int _idx, final GISPolygone _newLine, final CtuluCommandContainer _cmd) { -// setValueIntern(_idx, _newLine, _cmd); -// } -// -// public void setValue(final int _idx, final GISPolyligne _newLine, final CtuluCommandContainer _cmd) { -// setValueIntern(_idx, _newLine, _cmd); -// } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-05 22:05:30 UTC (rev 4034) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-06 12:46:31 UTC (rev 4035) @@ -269,7 +269,7 @@ GrPoint point = (new GrSegment(new GrPoint(g.getX(_idxBefore), g.getY(_idxBefore), 0), new GrPoint(g.getX(_idxBefore + 1), g.getY(_idxBefore + 1), 0))) .pointPlusProche(new GrPoint(_x, _y, 0)); - geometries_.addPoint(_ligneIdx, _idxBefore, point.x_, point.y_, _cmd); + geometries_.addAtomic(_ligneIdx, _idxBefore, point.x_, point.y_, _cmd); } /** @@ -333,7 +333,7 @@ } // Remplacement dans la collection. - geometries_.removeLignes(new int[]{_ligneIdx}, cmp); + geometries_.removeGeometries(new int[]{_ligneIdx}, cmp); geometries_.addPolyligne((GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(cline1), dataline1, cmp); geometries_.addPolyligne((GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(cline2), dataline2, cmp); @@ -432,7 +432,7 @@ // Remplacement dans la collection. geometries_.addPolyligne((GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(cline), dataline, cmp); - geometries_.removeLignes(_ligneIdx, cmp); + geometries_.removeGeometries(_ligneIdx, cmp); if (_cmd != null) { _cmd.addCmd(cmp.getSimplify()); @@ -526,11 +526,11 @@ if (isGeometryFermee(i)) { final GISPolygone poly = (GISPolygone) GISGeometryFactory.INSTANCE.createLinearRing(newSeq); - geometries_.setValue(i, poly, cmp); + geometries_.setGeometry(i, poly, cmp); } else { final GISPolyligne poly = (GISPolyligne) GISGeometryFactory.INSTANCE.createLineString(newSeq); - geometries_.setValue(i, poly, cmp); + geometries_.setGeometry(i, poly, cmp); } } } @@ -605,7 +605,7 @@ } return false; } - geometries_.setValue(idx, poly, cmp); + geometries_.setGeometry(idx, poly, cmp); } else { final GISPolyligne poly = (GISPolyligne) GISGeometryFactory.INSTANCE.createLineString(newSeq); @@ -615,7 +615,7 @@ } return false; } - geometries_.setValue(idx, poly, cmp); + geometries_.setGeometry(idx, poly, cmp); } if (newvals!=null) @@ -661,11 +661,11 @@ } if (isGeometryFermee(i)) { final GISPolygone poly = (GISPolygone) GISGeometryFactory.INSTANCE.createLinearRing(newSeq); - geometries_.setValue(i, poly, cmp); + geometries_.setGeometry(i, poly, cmp); } else { final GISPolyligne poly = (GISPolyligne) GISGeometryFactory.INSTANCE.createLineString(newSeq); - geometries_.setValue(i, poly, cmp); + geometries_.setGeometry(i, poly, cmp); } } } @@ -727,7 +727,7 @@ } return false; } - geometries_.setValue(idx, poly, cmp); + geometries_.setGeometry(idx, poly, cmp); } else { final GISPolyligne poly = (GISPolyligne) GISGeometryFactory.INSTANCE.createLineString(newSeq); @@ -737,7 +737,7 @@ } return false; } - geometries_.setValue(idx, poly, cmp); + geometries_.setGeometry(idx, poly, cmp); } } } @@ -758,7 +758,7 @@ if (geometries_ == null) { return false; } - geometries_.removeLignes(_idx, _cmd); + geometries_.removeGeometries(_idx, _cmd); for(int i=0 ; i<_idx.length;i++) setGeomModif(_idx[i], _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie return true; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java 2008-10-05 22:05:30 UTC (rev 4034) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java 2008-10-06 12:46:31 UTC (rev 4035) @@ -225,7 +225,7 @@ } GISPolyligne newgeom=(GISPolyligne)GISGeometryFactory.INSTANCE.createLineString((Coordinate[])coords.toArray(new Coordinate[0])); - geometries_.setValue(_idxGeom, newgeom, _cmd); + geometries_.setGeometry(_idxGeom, newgeom, _cmd); setGeomModif(_idxGeom, _cmd); // Modification de l'etat de la g\xE9om\xE9trie return true; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigLineSingleModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigLineSingleModel.java 2008-10-05 22:05:30 UTC (rev 4034) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigLineSingleModel.java 2008-10-06 12:46:31 UTC (rev 4035) @@ -53,7 +53,7 @@ public final void setLine(final LineString _r) { if (geom_.getNumGeometries() > 0) { - geom_.removeLignes(new int[] { 0 }, null); + geom_.removeGeometries(new int[] { 0 }, null); } r_ = _r; geom_.addCoordinateSequence(r_.getCoordinateSequence(), null, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayer.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayer.java 2008-10-05 22:05:30 UTC (rev 4034) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayer.java 2008-10-06 12:46:31 UTC (rev 4035) @@ -364,7 +364,7 @@ } if (!l.containsLegend(this)) { l.ajoute(this, buildPanel(null), getTitle()); - if (getModelePoly().getNombre() == 0) { + if (modeleDonnees().getNombre() == 0) { l.setVisible(this, false); } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfileSplitter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfileSplitter.java 2008-10-05 22:05:30 UTC (rev 4034) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfileSplitter.java 2008-10-06 12:46:31 UTC (rev 4035) @@ -346,7 +346,7 @@ zonei = GISGeometryFactory.INSTANCE.createPolygon(ringi, null); } else { final int idx = _zone.indexOf(ringi.lit_); - _zone.removeLignes(new int[] { idx }, null); + _zone.removeGeometries(new int[] { idx }, null); zonei = GISGeometryFactory.INSTANCE.createPolygon(ringi.lit_, null); envi = ringi.lit_.getEnvelopeInternal(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-10-05 22:05:37
|
Revision: 4034 http://fudaa.svn.sourceforge.net/fudaa/?rev=4034&view=rev Author: deniger Date: 2008-10-05 22:05:30 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersection.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddPointsAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSource.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceAbstract.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostWizardCourbeTemporelle.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -26,17 +26,12 @@ import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.LookAndFeel; -import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; import javax.swing.plaf.IconUIResource; import javax.swing.plaf.metal.MetalTheme; -import org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel; - - - import com.memoire.fu.FuFactoryInteger; import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/gis/GISGeometryFactory.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -9,7 +9,6 @@ import com.vividsolutions.jts.geom.*; - /** * @author Fred Deniger * @version $Id: GISGeometryFactory.java,v 1.10 2007-04-20 16:20:17 deniger Exp $ @@ -26,15 +25,15 @@ super(new PrecisionModel(10E6), 0, new GISCoordinateSequenceFactory()); } - public Point createPoint(final Coordinate _coordinate){ + public Point createPoint(final Coordinate _coordinate) { return new GISPoint(_coordinate); } - public Point createPoint(final double _x,final double _y,final double _z){ + public Point createPoint(final double _x, final double _y, final double _z) { return new GISPoint(_x, _y, _z); } - public CoordinateSequence createLinearRingDefaultSequence(){ + public CoordinateSequence createLinearRingDefaultSequence() { final CoordinateSequence seq = getCoordinateSequenceFactory().create(4, 2); seq.setOrdinate(0, 0, 0); seq.setOrdinate(0, 1, 0); @@ -46,10 +45,8 @@ seq.setOrdinate(3, 1, 0); return seq; } - - - public GISPolygone createLinearRing(final double _xMin,final double _xMax,final double _yMin,final double _yMax){ + public GISPolygone createLinearRing(final double _xMin, final double _xMax, final double _yMin, final double _yMax) { final CoordinateSequence seq = getCoordinateSequenceFactory().create(5, 2); seq.setOrdinate(0, 0, _xMin); seq.setOrdinate(0, 1, _yMin); @@ -64,36 +61,39 @@ return (GISPolygone) createLinearRing(seq); } - public Point createPoint(final CoordinateSequence _coordinates){ + public Point createPoint(final CoordinateSequence _coordinates) { return createPoint(_coordinates.getCoordinate(0)); } - public LinearRing createLinearRing(final Coordinate[] _coordinates){ + public LinearRing createLinearRing(final Coordinate[] _coordinates) { return new GISPolygone(getCoordinateSequenceFactory().create(_coordinates)); } - public LinearRing createLinearRingImmutable(final Coordinate[] _coordinates){ + public GISPolyligne createSegment(final double _x1, final double _y1, final double _x2, final double _y2) { + final CoordinateSequence seq = getCoordinateSequenceFactory().create(2, 2); + seq.setOrdinate(0, 0, _x1); + seq.setOrdinate(0, 1, _y1); + seq.setOrdinate(1, 0, _x2); + seq.setOrdinate(1, 1, _y2); + return (GISPolyligne) createLineString(seq); + } + + public LinearRing createLinearRingImmutable(final Coordinate[] _coordinates) { return new GISPolygone(((GISCoordinateSequenceFactory) getCoordinateSequenceFactory()) .createImmutable(_coordinates)); } - public LinearRing createLinearRing(final CoordinateSequence _coordinates){ + public LinearRing createLinearRing(final CoordinateSequence _coordinates) { return new GISPolygone(_coordinates); } - public LinearRing transformToLinearRing(final LineString _s){ - if(_s==null) { - return null; - } - if (_s instanceof LinearRing) { - return (LinearRing) _s; - } - if (_s.isClosed()) { - return createLinearRing(_s.getCoordinateSequence()); - } + public LinearRing transformToLinearRing(final LineString _s) { + if (_s == null) { return null; } + if (_s instanceof LinearRing) { return (LinearRing) _s; } + if (_s.isClosed()) { return createLinearRing(_s.getCoordinateSequence()); } final CoordinateSequence seq = _s.getCoordinateSequence(); - final CoordinateSequence newSeq = GISGeometryFactory.INSTANCE.getCoordinateSequenceFactory().create( - seq.size() + 1, 3); + final CoordinateSequence newSeq = GISGeometryFactory.INSTANCE.getCoordinateSequenceFactory().create(seq.size() + 1, + 3); final int oldSize = seq.size(); for (int i = oldSize - 1; i >= 0; i--) { newSeq.setOrdinate(i, 0, seq.getX(i)); @@ -104,26 +104,24 @@ return createLinearRing(newSeq); } - public LineString createLineString(final Coordinate[] _coordinates){ + public LineString createLineString(final Coordinate[] _coordinates) { return new GISPolyligne(getCoordinateSequenceFactory().create(_coordinates)); } - public LineString createLineString(final CoordinateSequence _coordinates){ + public LineString createLineString(final CoordinateSequence _coordinates) { return new GISPolyligne(_coordinates); } - public LineString createLineStringNiveau(final CoordinateSequence _coordinates){ + public LineString createLineStringNiveau(final CoordinateSequence _coordinates) { return new GISPolyligneNiveau(_coordinates); } - public LinearRing createLinearRingNiveau(final CoordinateSequence _coordinates){ + public LinearRing createLinearRingNiveau(final CoordinateSequence _coordinates) { return new GISPolygoneNiveau(_coordinates); } - public MultiPoint createMultiPoint(final Coordinate[] _coordinates){ - if (_coordinates == null) { - return null; - } + public MultiPoint createMultiPoint(final Coordinate[] _coordinates) { + if (_coordinates == null) { return null; } final int n = _coordinates.length; final GISPoint[] pt = new GISPoint[_coordinates.length]; for (int i = 0; i < n; i++) { @@ -132,27 +130,25 @@ return new GISMultiPoint(pt); } - public MultiPoint createMultiPoint(final Point[] _point){ + public MultiPoint createMultiPoint(final Point[] _point) { return new GISMultiPoint(_point); } - public GeometryCollection createGeometryCollection(final Geometry[] _geometries){ + public GeometryCollection createGeometryCollection(final Geometry[] _geometries) { return super.createGeometryCollection(_geometries); } - public MultiLineString createMultiLineString(final LineString[] _lineStrings){ + public MultiLineString createMultiLineString(final LineString[] _lineStrings) { return new GISMultiPolyligne(_lineStrings); } - public MultiPoint createMultiPoint(final CoordinateSequence _coordinates){ - if (_coordinates == null) { - return null; - } + public MultiPoint createMultiPoint(final CoordinateSequence _coordinates) { + if (_coordinates == null) { return null; } final int n = _coordinates.size(); final GISPoint[] pt = new GISPoint[n]; for (int i = 0; i < n; i++) { - pt[i] = (GISPoint) createPoint(_coordinates.getX(i), _coordinates.getY(i), _coordinates - .getOrdinate(i, CoordinateSequence.Z)); + pt[i] = (GISPoint) createPoint(_coordinates.getX(i), _coordinates.getY(i), _coordinates.getOrdinate(i, + CoordinateSequence.Z)); } return new GISMultiPoint(pt); } @@ -160,30 +156,26 @@ /** * Renvoie un GISPolygone si non vide. */ - public Geometry toGeometry(final Envelope _envelope){ - if (_envelope.isNull()) { - return createPoint((CoordinateSequence) null); - } - if (_envelope.getMinX() == _envelope.getMaxX() && _envelope.getMinY() == _envelope.getMaxY()) { - return createPoint(new Coordinate(_envelope.getMinX(), _envelope.getMinY())); - } - return createLinearRing(new Coordinate[] { - new Coordinate(_envelope.getMinX(), _envelope.getMinY()), + public Geometry toGeometry(final Envelope _envelope) { + if (_envelope.isNull()) { return createPoint((CoordinateSequence) null); } + if (_envelope.getMinX() == _envelope.getMaxX() && _envelope.getMinY() == _envelope.getMaxY()) { return createPoint(new Coordinate( + _envelope.getMinX(), _envelope.getMinY())); } + return createLinearRing(new Coordinate[] { new Coordinate(_envelope.getMinX(), _envelope.getMinY()), new Coordinate(_envelope.getMaxX(), _envelope.getMinY()), new Coordinate(_envelope.getMaxX(), _envelope.getMaxY()), new Coordinate(_envelope.getMinX(), _envelope.getMaxY()), - new Coordinate(_envelope.getMinX(), _envelope.getMinY())}); + new Coordinate(_envelope.getMinX(), _envelope.getMinY()) }); } - public Polygon createPolygon(final LinearRing _shell,final LinearRing[] _holes){ + public Polygon createPolygon(final LinearRing _shell, final LinearRing[] _holes) { return new GISPolygoneWithHole(_shell, _holes); } - public MultiPolygon createMultiPolygon(final Polygon[] _polygons){ + public MultiPolygon createMultiPolygon(final Polygon[] _polygons) { return super.createMultiPolygon(_polygons); } - public Geometry createGeometry(final Geometry _g){ + public Geometry createGeometry(final Geometry _g) { return super.createGeometry(_g); } } \ No newline at end of file Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -29,9 +29,7 @@ public class EfNeighborMesh { public static EfNeighborMesh compute(final EfGridInterface _grid, final ProgressionInterface _prog) { - if (_grid == null) { - return null; - } + if (_grid == null) { return null; } final ProgressionUpdater up = new ProgressionUpdater(_prog); up.majProgessionStateOnly(DodicoLib.getS("Recherche des mailles voisines")); final int nbPt = _grid.getPtsNb(); @@ -120,12 +118,8 @@ public int[] getAdjacentMeshes(final int _idxPt1, final int _idxPt2) { final TIntHashSet set = new TIntHashSet(neighbor_[_idxPt1]); set.retainAll(neighbor_[_idxPt2]); - if (set.size() > 2) { - throw new IllegalStateException("maillage non conforme"); - } - if (set.size() == 1) { - return new int[] { set.iterator().next(), -1 }; - } + if (set.size() > 2) { throw new IllegalStateException("maillage non conforme"); } + if (set.size() == 1) { return new int[] { set.iterator().next(), -1 }; } return set.toArray(); } @@ -133,23 +127,15 @@ public int getAdjacentMeshes(final int _idxPt1, final int _idxPt2, final int _idxEltToAvoid) { final TIntHashSet set = new TIntHashSet(neighbor_[_idxPt1]); set.retainAll(neighbor_[_idxPt2]); - if (set.size() > 2) { - throw new IllegalStateException("maillage non conforme"); - } + if (set.size() > 2) { throw new IllegalStateException("maillage non conforme"); } final TIntIterator it = set.iterator(); - if (!it.hasNext()) { - return -1; - } + if (!it.hasNext()) { return -1; } int first = it.next(); - if (first != _idxEltToAvoid) { - return first; - } + if (first != _idxEltToAvoid) { return first; } if (it.hasNext()) { first = it.next(); - if (first != _idxEltToAvoid) { - return first; - } + if (first != _idxEltToAvoid) { return first; } } return -1; @@ -176,8 +162,7 @@ public double getAverageForNode(final CtuluVariable _var, final int _idxPt, final int _tIdx, final EfData _dataElement, EfGridData _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, _datas, _vects); + if (_vects.isVect(_var)) { return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, _datas, _vects); } return getAverageForNodeDanger(_idxPt, _dataElement); @@ -185,9 +170,8 @@ public double getAverageForNode(final CtuluVariable _var, final int _idxPt, final int _tIdx, final EfData _dataElement, EfGridDataInterpolator _datas) { - if (_datas.getInterpolator().getVect().isVect(_var)) { - return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, _datas.getGridData(), _datas.getInterpolator() - .getVect()); + if (_datas.getInterpolator().getVect().isVect(_var)) { return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, + _datas.getGridData(), _datas.getInterpolator().getVect()); } return getAverageForNodeDanger(_idxPt, _dataElement); @@ -206,25 +190,19 @@ public double getAverageForNode(final CtuluVariable _var, final int _idxPt, InterpolationSupportValuesMultiI _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getAverageForVect(_var, _idxPt, _datas.getValues(_var), _datas, _vects); - } + if (_vects.isVect(_var)) { return getAverageForVect(_var, _idxPt, _datas.getValues(_var), _datas, _vects); } return getAverageForNodeDanger(_idxPt, _datas.getValues(_var)); } public double getAverageForNode(final CtuluVariable _var, final int _idxPt, CtuluCollectionDouble _data, InterpolationSupportValuesMultiI _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getAverageForVect(_var, _idxPt, _data, _datas, _vects); - } + if (_vects.isVect(_var)) { return getAverageForVect(_var, _idxPt, _data, _datas, _vects); } return getAverageForNodeDanger(_idxPt, _data); } public EfDataNode getDataNode(final CtuluVariable _var, final CtuluCollectionDouble _data, InterpolationSupportValuesMultiI _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getDataNodeVecteur(_var, _data, _datas, _vects); - } + if (_vects.isVect(_var)) { return getDataNodeVecteur(_var, _data, _datas, _vects); } return getDataNodeSimple(_data); } @@ -241,9 +219,7 @@ public EfDataNode getDataNode(final CtuluVariable _var, InterpolationSupportValuesMultiI _datas, InterpolationVectorContainer _vects) { - if (_vects.isVect(_var)) { - return getDataNodeVecteur(_var, _datas.getValues(_var), _datas, _vects); - } + if (_vects.isVect(_var)) { return getDataNodeVecteur(_var, _datas.getValues(_var), _datas, _vects); } return getDataNodeSimple(_datas.getValues(_var)); } @@ -259,4 +235,13 @@ public int getNeighborMesh(final int _idxPt, final int _idxMesh) { return neighbor_[_idxPt][_idxMesh]; } + + /** + * @param _idxPt l'indice du noeud + * @param _idxMeshes la liste des indices des \xE9l\xE9ments a remplir + */ + public void fillWithAdjacentMeshes(final int _idxPt, TIntHashSet _idxMeshes) { + _idxMeshes.addAll(neighbor_[_idxPt]); + + } } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersection.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersection.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/operation/EfLineIntersection.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -7,6 +7,8 @@ */ package org.fudaa.dodico.ef.operation; +import gnu.trove.TIntHashSet; + import java.io.IOException; import java.util.Collection; @@ -18,11 +20,127 @@ import org.fudaa.dodico.ef.EfData; import org.fudaa.dodico.ef.EfElement; import org.fudaa.dodico.ef.EfGridInterface; +import org.fudaa.dodico.ef.EfNeighborMesh; import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; import org.fudaa.dodico.ef.interpolation.EfInterpolator; public abstract class EfLineIntersection implements EfLineIntersectionI { + /** + * Definie une intersection sur une arete. + * + * @author fred deniger + * @version $Id: EfLineIntersection.java,v 1.5 2007-06-13 12:55:42 deniger Exp $ + */ + public final static class ItemEdge extends EfLineIntersection { + + int[] adjacentMesh_; + final int i1_; + final int i2_; + final double x_; + final double y_; + + public ItemEdge(final int _i1, final int _i2, final double _x, double _y) { + super(); + i1_ = _i1; + i2_ = _i2; + x_ = _x; + y_ = _y; + } + + @Override + public void fillWithAdjacentMeshes(TIntHashSet _idxMeshes) { + buildAdjacentMeshes(); + if (adjacentMesh_[0] >= 0) _idxMeshes.add(adjacentMesh_[0]); + if (adjacentMesh_[1] >= 0) _idxMeshes.add(adjacentMesh_[1]); + + } + + private double getD1() { + return 1 / CtuluLibGeometrie.getDistance(x_, y_, parent_.getGrid().getPtX(i1_), parent_.getGrid().getPtY(i1_)); + } + + private double getD2() { + return 1 / CtuluLibGeometrie.getDistance(x_, y_, parent_.getGrid().getPtX(i2_), parent_.getGrid().getPtY(i2_)); + } + + public int getI1() { + return i1_; + } + + public int getI2() { + return i2_; + } + + public double getValue(CtuluVariable _var, int _tIdx) { + if (parent_ == null) throw new IllegalAccessError("pas de parent"); + EfGridDataInterpolator data = parent_.getGridData(); + try { + if (data.getGridData().isElementVar(_var)) { + + buildAdjacentMeshes(); + if (adjacentMesh_[1] < 0) return data.getGridData().getData(_var, _tIdx, adjacentMesh_[0]); + return data.getInterpolator().getMidValue(adjacentMesh_[0], adjacentMesh_[1], _var, _tIdx); + } + + double d1 = getD1(); + double d2 = getD2(); + return data.getInterpolator().getValue(i1_, i2_, d1 / (d1 + d2), d2 / (d1 + d2), _var, _tIdx); + } catch (IllegalAccessError _evt) { + FuLog.error(_evt); + + } catch (IOException _evt) { + FuLog.error(_evt); + + } + return 0; + } + + private void buildAdjacentMeshes() { + parent_.buildNeighbor(null); + if (adjacentMesh_ == null) adjacentMesh_ = parent_.getNeighbor().getAdjacentMeshes(i1_, i2_); + } + + public double getValueBadInterpolation(EfData _d) { + if (_d.isElementData()) { + + buildAdjacentMeshes(); + if (adjacentMesh_[1] < 0) return _d.getValue(adjacentMesh_[0]); + return (_d.getValue(adjacentMesh_[0]) + _d.getValue(adjacentMesh_[1])) / 2D; + } + + double d1 = getD1(); + double d2 = getD2(); + return (d1 * _d.getValue(i1_) + d2 * _d.getValue(i2_)) / (d1 + d2); + } + + public double getX() { + return x_; + } + + public double getY() { + return y_; + } + + public boolean isEdgeIntersection() { + return true; + } + + public int isMeshIntersection() { + return -1; + } + + public boolean isOnSameEfObject(EfLineIntersectionI _other) { + if (_other == null) return false; + if (_other.isEdgeIntersection()) { + ItemEdge edge = (ItemEdge) _other; + return (edge.i1_ == i1_ && edge.i2_ == i2_) || (edge.i1_ == i2_ && edge.i2_ == i1_); + } + return false; + } + + } + static class ItemInitial { int ielt_ = -1; @@ -55,9 +173,7 @@ // priorit\xE9 // au point issu du profil - if (item2_ == null && item1_.isNodeIntersection() && !item1_.isAPointProfileIntersection()) { - return; - } + if (item2_ == null && item1_.isNodeIntersection() && !item1_.isAPointProfileIntersection()) { return; } if (item2_ != null && item2_.isAPointProfileIntersection()) { if (_dest.contains(item2_)) _dest.remove(item2_); @@ -148,109 +264,6 @@ } /** - * Definie une intersection sur une arete. - * - * @author fred deniger - * @version $Id: EfLineIntersection.java,v 1.5 2007-06-13 12:55:42 deniger Exp $ - */ - public final static class ItemEdge extends EfLineIntersection { - - int[] adjacentMesh_; - final int i1_; - final int i2_; - final double x_; - final double y_; - - public ItemEdge(final int _i1, final int _i2, final double _x, double _y) { - super(); - i1_ = _i1; - i2_ = _i2; - x_ = _x; - y_ = _y; - } - - public int getI1() { - return i1_; - } - - public int getI2() { - return i2_; - } - - public boolean isOnSameEfObject(EfLineIntersectionI _other) { - if (_other == null) return false; - if (_other.isEdgeIntersection()) { - ItemEdge edge = (ItemEdge) _other; - return (edge.i1_ == i1_ && edge.i2_ == i2_) || (edge.i1_ == i2_ && edge.i2_ == i1_); - } - return false; - } - - public double getValue(CtuluVariable _var, int _tIdx) { - if (parent_ == null) throw new IllegalAccessError("pas de parent"); - EfGridDataInterpolator data = parent_.getGridData(); - try { - if (data.getGridData().isElementVar(_var)) { - - parent_.buildNeighbor(null); - if (adjacentMesh_ == null) adjacentMesh_ = parent_.getNeighbor().getAdjacentMeshes(i1_, i2_); - if (adjacentMesh_[1] < 0) return data.getGridData().getData(_var, _tIdx, adjacentMesh_[0]); - return data.getInterpolator().getMidValue(adjacentMesh_[0], adjacentMesh_[1], _var, _tIdx); - } - - double d1 = getD1(); - double d2 = getD2(); - return data.getInterpolator().getValue(i1_, i2_, d1 / (d1 + d2), d2 / (d1 + d2), _var, _tIdx); - } catch (IllegalAccessError _evt) { - FuLog.error(_evt); - - } catch (IOException _evt) { - FuLog.error(_evt); - - } - return 0; - } - - public double getValueBadInterpolation(EfData _d) { - if (_d.isElementData()) { - parent_.buildNeighbor(null); - if (adjacentMesh_ == null) adjacentMesh_ = parent_.getNeighbor().getAdjacentMeshes(i1_, i2_); - if (adjacentMesh_[1] < 0) return _d.getValue(adjacentMesh_[0]); - return (_d.getValue(adjacentMesh_[0]) + _d.getValue(adjacentMesh_[1])) / 2D; - } - - double d1 = getD1(); - double d2 = getD2(); - return (d1 * _d.getValue(i1_) + d2 * _d.getValue(i2_)) / (d1 + d2); - } - - private double getD2() { - return 1 / CtuluLibGeometrie.getDistance(x_, y_, parent_.getGrid().getPtX(i2_), parent_.getGrid().getPtY(i2_)); - } - - private double getD1() { - return 1 / CtuluLibGeometrie.getDistance(x_, y_, parent_.getGrid().getPtX(i1_), parent_.getGrid().getPtY(i1_)); - } - - public double getX() { - return x_; - } - - public double getY() { - return y_; - } - - public boolean isEdgeIntersection() { - return true; - } - - public int isMeshIntersection() { - return -1; - } - - } - - /** * Une intersection definie sur un \xE9l\xE9ment: utilise pour Rubar et pour un point a interpoler. * * @author fred deniger @@ -270,12 +283,10 @@ } - public boolean isOnSameEfObject(EfLineIntersectionI _other) { - if (_other != null && !_other.isRealIntersection() && !_other.isNodeIntersection()) { - return isMeshIntersection() == _other.isMeshIntersection(); + @Override + public void fillWithAdjacentMeshes(TIntHashSet _idxMeshes) { + _idxMeshes.add(ielt_); - } - return false; } public ItemMesh(final ItemInitial _init) { @@ -321,6 +332,14 @@ return ielt_; } + public boolean isOnSameEfObject(EfLineIntersectionI _other) { + if (_other != null && !_other.isRealIntersection() && !_other.isNodeIntersection()) { return isMeshIntersection() == _other + .isMeshIntersection(); + + } + return false; + } + public boolean isRealIntersection() { return ielt_ >= 0; } @@ -342,18 +361,6 @@ ptIdx_ = _ptIdx; } - public boolean isOnSameEfObject(EfLineIntersectionI _other) { - if (_other == null) return false; - if (_other.isNodeIntersection()) { - return ((ItemNode) _other).ptIdx_ == ptIdx_; - } - return false; - } - - public String toString() { - return getClass().getName() + " " + ptIdx_; - } - public double getValue(CtuluVariable _var, int _tIdx) { EfGridDataInterpolator data = parent_.getGridData(); try { @@ -373,6 +380,14 @@ return 0; } + @Override + public void fillWithAdjacentMeshes(TIntHashSet _idxMeshes) { + // on construit au cas ou... + getParent().buildNeighbor(null); + getParent().getNeighbor().fillWithAdjacentMeshes(ptIdx_, _idxMeshes); + + } + public double getValueBadInterpolation(EfData _d) { if (_d.isElementData()) { parent_.buildNeighbor(null); @@ -406,6 +421,16 @@ return ptIdx_ == _ptIdx; } + public boolean isOnSameEfObject(EfLineIntersectionI _other) { + if (_other == null) return false; + if (_other.isNodeIntersection()) { return ((ItemNode) _other).ptIdx_ == ptIdx_; } + return false; + } + + public String toString() { + return getClass().getName() + " " + ptIdx_; + } + } /** @@ -417,6 +442,7 @@ public final static class ItemNoIntersect extends EfLineIntersection { final double x_; + final double y_; public ItemNoIntersect(final double _x, final double _y) { @@ -425,8 +451,10 @@ y_ = _y; } - public boolean isOnSameEfObject(EfLineIntersectionI _other) { - return false; + @Override + public void fillWithAdjacentMeshes(TIntHashSet _idxMeshes) { + // ne renvoie rien + } public double getValue(CtuluVariable _var, int _tIdx) { @@ -449,6 +477,10 @@ return -1; } + public boolean isOnSameEfObject(EfLineIntersectionI _other) { + return false; + } + public boolean isRealIntersection() { return false; } @@ -461,6 +493,15 @@ protected EfLineIntersection() {} + /** + * Remplit la set avec les indices de tous les \xE9l\xE9mnents adjacents. Si l'intersection est dans un \xE9l\xE9ment seul + * l'indice de l'\xE9l\xE9ment est renvoye. + * + * @param _idxMeshes ne doit pas etre vide et sera rempli avec les indices de tous les \xE9l\xE9ments adjacents \xE0 cette + * intersection. + */ + public abstract void fillWithAdjacentMeshes(TIntHashSet _idxMeshes); + public double getD2From(double _x, double _y) { return CtuluLibGeometrie.getD2(getX(), getY(), _x, _y); } @@ -473,14 +514,20 @@ return parent_; } - public boolean isEdgeIntersection() { - return false; - } + /** + * @param _d les donn\xE9es en accord avec le maillage (meme nombre de point) + * @return la valeur non interpol\xE9e correction + */ + public abstract double getValueBadInterpolation(EfData _d); public boolean isAPointProfileIntersection() { return extremiteIntersect_; } + public boolean isEdgeIntersection() { + return false; + } + public boolean isNodeIntersection() { return false; } @@ -489,18 +536,12 @@ return false; } - /** - * @param _d les donn\xE9es en accord avec le maillage (meme nombre de point) - * @return la valeur non interpol\xE9e correction - */ - public abstract double getValueBadInterpolation(EfData _d); + public abstract boolean isOnSameEfObject(EfLineIntersectionI _other); public boolean isRealIntersection() { return true; } - public abstract boolean isOnSameEfObject(EfLineIntersectionI _other); - public void setParent(EfLineIntersectionParent _parent) { parent_ = _parent; } Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -106,6 +106,14 @@ return _c.getFriction(); } }; + + public static final H2dVariableType SANS = new H2dVariableType(H2dResource.getS("Sans"), null, "sans") { + + public double getValue(final H2dVariableTypeContainer _c) { + return 0; + } + }; + public static final H2dVariableType COEF_DIFFUSION = new H2dVariableType(H2dResource.getS("Coefficient diffusion"), null, "dif") { @@ -450,9 +458,7 @@ */ public static H2dVariableType getVarFromShortName(final String _shortName, final Map _shortNameVarCreated) { final H2dVariableType t = (H2dVariableType) shortNameVar.get(_shortName); - if (t == null && _shortNameVarCreated != null) { - return (H2dVariableType) _shortNameVarCreated.get(_shortName); - } + if (t == null && _shortNameVarCreated != null) { return (H2dVariableType) _shortNameVarCreated.get(_shortName); } return t; } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeImporter.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -122,7 +122,7 @@ * a utiliser pour les formats scope * */ - void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog); +// void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog); public boolean isSpatial(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -9,24 +9,19 @@ import java.io.File; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import javax.swing.AbstractAction; -import javax.swing.AbstractListModel; import javax.swing.BorderFactory; import javax.swing.DefaultListModel; -import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.JTextField; import javax.swing.ListSelectionModel; import javax.swing.filechooser.FileFilter; -import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluIOOperationSynthese; import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibArray; @@ -38,20 +33,13 @@ import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.mesure.EvolutionFileFormat; import org.fudaa.dodico.mesure.EvolutionReguliere; -import org.fudaa.dodico.reflux.io.CLTransitoireFileFormat; -import org.fudaa.dodico.reflux.io.CrbFileFormat; -import org.fudaa.dodico.rubar.io.RubarCLIFileFormat; -import org.fudaa.dodico.rubar.io.RubarTARFileFormat; import org.fudaa.dodico.telemac.io.ScopeGENEFileFormat; import org.fudaa.dodico.telemac.io.ScopeSFileFormat; import org.fudaa.dodico.telemac.io.ScopeStructure; import org.fudaa.dodico.telemac.io.ScopeTFileFormat; -import org.fudaa.dodico.telemac.io.TelemacLiquideFileFormat; import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.fudaa.commun.FudaaLib; -import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter; -import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporterScope; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; import org.fudaa.fudaa.commun.impl.FudaaGuiLib; import org.fudaa.fudaa.ressource.FudaaResource; @@ -61,7 +49,6 @@ import com.memoire.bu.BuButtonPanel; import com.memoire.bu.BuCharValidator; import com.memoire.bu.BuFileFilter; -import com.memoire.bu.BuIcon; import com.memoire.bu.BuResource; import com.memoire.bu.BuStringValidator; import com.memoire.bu.BuTextField; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrCourbeTemporelleManager.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -462,8 +462,6 @@ fireGlobalChanged(); } - public void importCourbes(ScopeStructure _crb, CtuluCommandManager _mng, ProgressionInterface _prog) { - } public boolean isSpatial() { return false; Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -253,7 +253,7 @@ /** - * Recherche le point qui peut contenir la sonde pour bien initialiser la var. + * Recherche l'\xE9l\xE9ment qui peut contenir la sonde pour bien initialiser la var. * * @param _prReel * @param grid Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddPointsAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddPointsAction.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddPointsAction.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -39,23 +39,24 @@ addNewPoints(impl_, panel_, model_); } - public static void addNewPoints(final FudaaCommonImplementation _impl, final TrPostVisuPanel _panel, final EGGraphe _model) { + public static void addNewPoints(final FudaaCommonImplementation _impl, final TrPostVisuPanel _panel, + final EGGraphe _model) { if (_panel.isSelectionOkForEvolution()) { final int[] idx = _panel.getSelectionForEvolution(); - startImportIdx(_impl, _model, idx); + startImportIdx(_impl, _panel.getSource(),_model, idx); } else if (_panel.isSelectionOkForEvolutionSonde()) { final TrPostInterpolatePoint pt = _panel.getInterpolePointForEvol(); - startImportInterpolate(_impl, _model, pt); + startImportInterpolate(_impl, _panel.getSource(), _model, pt); } } - public static void startImportInterpolate(final FudaaCommonImplementation _impl, final EGGraphe _model, - final TrPostInterpolatePoint _pt) { + public static void startImportInterpolate(final FudaaCommonImplementation _impl, final TrPostSource _src, + final EGGraphe _model, final TrPostInterpolatePoint _pt) { new CtuluTaskOperationGUI(_impl, TrResource.getS("Courbes temporelles")) { public void act() { final TrPostCourbeTreeModel model = (TrPostCourbeTreeModel) _model.getModel(); - model.addPoints(_pt, _model.getCmd(), new ProgressionBuAdapter(this), null); + model.addPoints(_src, _pt, _model.getCmd(), new ProgressionBuAdapter(this), null); BuLib.invokeLater(new Runnable() { public void run() { @@ -67,12 +68,13 @@ }.start(); } - public static void startImportIdx(final FudaaCommonImplementation _impl, final EGGraphe _model, final int[] _idx) { + public static void startImportIdx(final FudaaCommonImplementation _impl, final TrPostSource _src, + final EGGraphe _model, final int[] _idx) { new CtuluTaskOperationGUI(_impl, TrResource.getS("Courbes temporelles")) { public void act() { final TrPostCourbeTreeModel model = (TrPostCourbeTreeModel) _model.getModel(); - model.addPoints(_idx, _model.getCmd(), new ProgressionBuAdapter(this), null); + model.addPoints(_src, _idx, _model.getCmd(), new ProgressionBuAdapter(this), null); BuLib.invokeLater(new Runnable() { public void run() { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeAddVariableAction.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -24,6 +24,7 @@ import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; import org.fudaa.dodico.h2d.type.H2dVariableType; import org.fudaa.ebli.commun.EbliActionSimple; +import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; @@ -47,7 +48,7 @@ model_ = _model; } - + public static Object[] select(final Object[] _init, final String _title, final Component _parent) { Arrays.sort(_init, FuComparator.STRING_COMPARATOR); final BuList l = CtuluLibSwing.createBuList(_init); @@ -56,15 +57,20 @@ pn.setBorder(BuBorders.EMPTY3333); pn.add(new BuLabel(CtuluLib.getS("S\xE9lectionner les variables \xE0 ajouter")), BuBorderLayout.NORTH); pn.add(new BuScrollPane(l)); - if (CtuluDialogPanel.isOkResponse(pn.afficheModale(_parent, _title))) { - return l.getSelectedValues(); - } + if (CtuluDialogPanel.isOkResponse(pn.afficheModale(_parent, _title))) { return l.getSelectedValues(); } return null; } public void actionPerformed(final ActionEvent _e) { final TrPostCourbeTreeModel model = (TrPostCourbeTreeModel) model_.getModel(); - final Set var = new HashSet(Arrays.asList(model.src_.getAllVariablesNonVec())); + EGCourbe selectedComponent = model_.getSelectedComponent(); + TrPostSource src = null; + if (selectedComponent != null && selectedComponent.getModel() instanceof TrPostCourbeModel) { + src = ((TrPostCourbeModel) selectedComponent.getModel()).getSource(); + } + if (src == null) return; + final TrPostSource finalSrc = src; + final Set var = new HashSet(Arrays.asList(src.getAllVariablesNonVec())); var.removeAll(model.varSupported_); final H2dVariableType[] vars = (H2dVariableType[]) var.toArray(new H2dVariableType[var.size()]); final Object[] selected = select(vars, (String) getValue(Action.NAME), impl_.getFrame()); @@ -72,7 +78,7 @@ new CtuluTaskOperationGUI(impl_, (String) getValue(Action.NAME)) { public void act() { - model.addVariables(Arrays.asList(selected), new ProgressionBuAdapter(this), model_.getCmd()); + model.addVariables(finalSrc,Arrays.asList(selected), new ProgressionBuAdapter(this), model_.getCmd()); EventQueue.invokeLater(new Runnable() { public void run() { Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeBuilder.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -28,15 +28,13 @@ public final class TrPostCourbeBuilder { private TrPostCourbeBuilder() {} - public static TrPostCourbeTreeModel build(TrPostProjet projet, final TrPostSource _src, final int[] _tidx, - final H2dVariableType[] _vars, final int[] _idxPtArray, final ProgressionInterface _prog) { + public static TrPostCourbeTreeModel build(TrPostProjet _proj, final TrPostSource _src, final H2dVariableType[] _vars, + final int[] _idxPtArray, final ProgressionInterface _prog) { if (_prog != null) { _prog.setDesc(TrResource.getS("Construction des courbes")); } - final TrPostCourbeTreeModel treeModel = new TrPostCourbeTreeModel(projet.impl_, _src, /* - * _tidx, - */_idxPtArray, _vars, projet); - treeModel.addAllCourbes(_prog, null); + final TrPostCourbeTreeModel treeModel = new TrPostCourbeTreeModel(_idxPtArray, _vars, _proj); + treeModel.addAllCourbes(_src, _prog, null); return treeModel; } @@ -63,7 +61,7 @@ } final TrPostCourbeTreeModel treeModel = new TrPostCourbeTreeModel(projet.impl_, _src, _tidx, _idxPtArray, _vars, projet); - treeModel.addAllCourbes(_prog, null); + treeModel.addAllCourbes(_src, _prog, null); return treeModel; } @@ -85,7 +83,7 @@ } final TrPostCourbeTreeModel treeModel = new TrPostCourbeTreeModel(projet.impl_, _src, _tidx, _idxPtArray, _vars, projet); - treeModel.addAllCourbes(_prog, null); + treeModel.addAllCourbes(_src, _prog, null); return treeModel; } 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 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeModel.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -7,6 +7,7 @@ */ package org.fudaa.fudaa.tr.post; +import java.io.IOException; import java.util.Set; import org.fudaa.ctulu.CtuluCommandContainer; @@ -26,52 +27,50 @@ */ public abstract class TrPostCourbeModel extends FudaaCourbeTimeModel { - /** + * @return the source + */ + public TrPostSource getSource() { + return source_; + } + + /** * source utilisee par la courbe */ public TrPostSource source_; - + public final static class Interpolated extends TrPostCourbeModel { final TrPostInterpolatePoint ptIdx_; - - - /** * @param _ptIdx * @param _varIdx * @param _timeIdx */ - public Interpolated(TrPostSource _src, final TrPostInterpolatePoint _ptIdx, final H2dVariableType _varIdx, - final double[] _timeIdx) { - super(_src, _varIdx, _timeIdx); + public Interpolated(TrPostSource _src, final TrPostInterpolatePoint _ptIdx, final H2dVariableType _varIdx) { + super(_src, _varIdx, _src.getTime().getTimeListModel().getTimesInSec()); ptIdx_ = _ptIdx; } - - @Override public double getPtX() { return ptIdx_.getX(); } - - @Override public double getPtY() { return ptIdx_.getY(); } - - - protected void updateY(final int _timeIdx, H2dVariableType _var) { - final EfData data = source_.getData(_var, _timeIdx); - if (data == null) { - FuLog.warning("TRP: data is null for " + _var); + protected void updateY() { + for (int i = 0; i < y_.length; i++) { + final EfData data = source_.getData(var_, i); + if (data == null) { + FuLog.warning("TRP: data is null for " + var_); + super.y_[i] = ptIdx_.getInterpolateValue(getVar(), data, i, source_); + } } - super.y_[_timeIdx] = ptIdx_.getInterpolateValue(getVar(), data, _timeIdx, source_); } public TrPostInterpolatePoint getInterpolatePt() { @@ -102,27 +101,37 @@ ptIdx_ = _ptIdx; } - protected void updateY(final int _timeIdx, H2dVariableType _var) { - - final EfData data = source_.getData(_var, _timeIdx); - if (data == null) { - FuLog.warning("TRP: data is null for " + _var); + protected void updateY() { + for (int i = 0; i < y_.length; i++) { + // final EfData data = source_.getData(var_, i); + // if (data == null) { + // FuLog.warning("TRP: data is null for " + var_); + try { + super.y_[i] = source_.getData(var_, i, ptIdx_); + } catch (IOException e) { + FuLog.error(e); + } + // } } - super.y_[_timeIdx] = data.getValue(ptIdx_); + // final EfData data = source_.getData(_var, _timeIdx); + // if (data == null) { + // FuLog.warning("TRP: data is null for " + _var); + // } + // super.y_[_timeIdx] = data.getValue(ptIdx_); } - - @Override public double getPtX() { // FIXME RUBAR - return source_.getGrid().getPtX(ptIdx_); + return source_.isElementVar(getVar()) ? source_.getGrid().getCentreXElement(ptIdx_) : source_.getGrid().getPtX( + ptIdx_); } @Override public double getPtY() { - return source_.getGrid().getPtY(ptIdx_); + return source_.isElementVar(getVar()) ? source_.getGrid().getCentreYElement(ptIdx_) : source_.getGrid().getPtY( + ptIdx_); } public int getPtIdx() { @@ -139,10 +148,11 @@ } - public static EGCourbeChild buildCourbeModel(final H2dVariableType _var, final int _idxPt, final double[] _ts, - final EGGroup _group, final TrPostSource _src) { - final TrPostCourbeModel model = new TrPostCourbeModel.Node(_src, _idxPt, _var, _ts); - + public static EGCourbeChild buildCourbeModel(final H2dVariableType _var, final int _idxPt, final EGGroup _group, + final TrPostSource _src) { + final TrPostCourbeModel model = new TrPostCourbeModel.Node(_src, _idxPt, _var, _src.getTime().getTimeListModel() + .getTimesInSec()); + final EGCourbeChild courbe = new FudaaCourbeTime(_group, model, _src.getNewTimeListModel()); _group.addEGComponent(courbe); courbe.getModel().setTitle(courbe.getModel().getTitle() + CtuluLibString.ESPACE + (_idxPt + 1)); @@ -150,8 +160,8 @@ } public static EGCourbeChild buildCourbeModel(final H2dVariableType _var, final TrPostInterpolatePoint _idxPt, - final double[] _ts, final EGGroup _group, final TrPostSource _src) { - final TrPostCourbeModel model = new TrPostCourbeModel.Interpolated(_src, _idxPt, _var, _ts); + final EGGroup _group, final TrPostSource _src) { + final TrPostCourbeModel model = new TrPostCourbeModel.Interpolated(_src, _idxPt, _var); final EGCourbeChild courbe = new FudaaCourbeTime(_group, model, _src.getNewTimeListModel()); _group.addEGComponent(courbe); courbe.getModel().setTitle( @@ -160,7 +170,7 @@ return courbe; } - private H2dVariableType var_; + H2dVariableType var_; public TrPostCourbeModel(TrPostSource _src, final H2dVariableType _varIdx, final double[] _timeIdx) { super(_timeIdx); @@ -185,7 +195,7 @@ return false; } - protected abstract void updateY(final int _timeIdx, H2dVariableType _var); + protected abstract void updateY(); public String getTitle() { return nom_ == null ? var_.getName() : nom_; @@ -194,7 +204,7 @@ public final H2dVariableType getVar() { return var_; } - + public abstract double getPtX(); public abstract double getPtY(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-05 20:43:37 UTC (rev 4033) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCourbeTreeModel.java 2008-10-05 22:05:30 UTC (rev 4034) @@ -23,11 +23,14 @@ import org.fudaa.ctulu.CtuluCommand; import org.fudaa.ctulu.CtuluCommandComposite; import org.fudaa.ctulu.CtuluCommandContainer; +import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluLibArray; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.ctulu.ProgressionUpdater; import org.fudaa.ctulu.gis.GISPrecision; import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.dodico.mesure.EvolutionReguliere; +import org.fudaa.dodico.mesure.EvolutionReguliereInterface; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbe; import org.fudaa.ebli.courbe.EGCourbeChild; @@ -35,7 +38,10 @@ import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeModel; +import org.fudaa.fudaa.commun.courbe.FudaaCourbeImporter.Target; import org.fudaa.fudaa.commun.impl.FudaaCommonImplementation; +import org.fudaa.fudaa.tr.common.TrLib; import org.fudaa.fudaa.tr.common.TrResource; import com.memoire.bu.BuDialogChoice; @@ -43,156 +49,95 @@ import com.memoire.fu.FuComparator; import com.memoire.fu.FuEmptyArrays; -public class TrPostCourbeTreeModel extends EGGrapheTreeModel implements TrPostTimeContentListener { +public class TrPostCourbeTreeModel extends EGGrapheTreeModel implements TrPostTimeContentListener, Target { - private final boolean isAllTimeStep_; - final FudaaCommonImplementation impl_; - // private int[] tidx_; - - private EGGroup updating_; - Set intepolPt_; - public Set getIntepolPt() { - return intepolPt_; - } + private final boolean isAllTimeStep_; int[] objIdx_; - public int[] getObjIdx() { - return objIdx_; - } + // private int[] tidx_; - // les sources devront etre affectees au CourbeModel - final TrPostSource src_; + TrPostProjet projet_; - double[] timeSteps_; + private EGGroup updating_; final Map varGroup_; Set varSupported_; - TrPostProjet projet_; - - public Set getVarSupported() { - return varSupported_; - } - /** * NE PAS UTILISER POUR L'INSTANT SAUVEGARDE. */ protected TrPostCourbeTreeModel() { - src_ = null; + // src_ = null; varGroup_ = new HashMap(); impl_ = null; isAllTimeStep_ = true; } - /** - * @param _src - */ - public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src/* - * , - * final - * int - * [ - * ] - * _timeIdx - */, - final H2dVariableType[] _vars, TrPostProjet _projet) { - src_ = _src; - varGroup_ = new HashMap(); - // tidx_ = _timeIdx; - // Arrays.sort(tidx_); - objIdx_ = FuEmptyArrays.INT0; - intepolPt_ = new HashSet(); - varSupported_ = new HashSet(Arrays.asList(_vars)); - impl_ = _impl; - isAllTimeStep_ = true;// tidx_.length == _src.getNbTimeStep(); - projet_ = _projet; - } + // les sources devront etre affectees au CourbeModel + // final TrPostSource src_; - public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src,/* - * final - * int - * [ - * ] - * _timeIdx - * , - */ - final int[] _objIdx, final H2dVariableType[] _vars, TrPostProjet _projet) { - this(_impl, _src/* , _timeIdx */, _vars, _projet); - objIdx_ = _objIdx; - Arrays.sort(objIdx_); - } + // double[] timeSteps_; public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src, final int[] _timeIdx, final TrPostInterpolatePoint _interpol, final H2dVariableType[] _vars, TrPostProjet _projet) { - this(_impl, _src/* , _timeIdx */, _vars, _projet); + this(_vars, _projet); intepolPt_.add(_interpol); } /** - * Constructeur permettant de creer un treemodel avec plusieurs point - * interpol\xE9s + * Constructeur permettant de creer un treemodel avec plusieurs point interpol\xE9s * * @param _impl * @param _src * @param _timeIdx - * @param _interpol - * : le tableau de points interpoles + * @param _interpol : le tableau de points interpoles * @param _vars * @param _projet - * * @author Adrien Hadoux */ public TrPostCourbeTreeModel(final FudaaCommonImplementation _impl, final TrPostSource _src, final int[] _timeIdx, final TrPostInterpolatePoint[] _interpol, final H2dVariableType[] _vars, TrPostProjet _projet) { - this(_impl, _src/* , _timeIdx */, _vars, _projet); - + this(_vars, _projet); + for (int i = 0; i < _interpol.length; i++) intepolPt_.add(_interpol[i]); } - - private void buildUpdating() { - if (updating_ == null) { - updating_ = new EGGroup(); - updating_.setTitle(TrResource.getS("Mise \xE0 jour")); - } + + /** + * @param _src + */ + public TrPostCourbeTreeModel(final H2dVariableType[] _vars, TrPostProjet _projet) { + // src_ = _src; + varGroup_ = new HashMap(); + // tidx_ = _timeIdx; + // Arrays.sort(tidx_); + objIdx_ = FuEmptyArrays.INT0; + intepolPt_ = new HashSet(); + varSupported_ = new HashSet(Arrays.asList(_vars)); + impl_ = projet_.getImpl(); + isAllTimeStep_ = true;// tidx_.length == _src.getNbTimeStep(); + projet_ = _projet; } - public void updateTimeStep(final int[] _idx, final ProgressionInterface _prog) { - if (!isAllTimeStep()) { - return; - } - // if (CtuluLibArray.isEmpty(_idx)) { - // return; - // } - timeSteps_ = null; - // tidx_ = _idx; - buildTimeSteps(); - final EGCourbe[] cs = getCourbes(); - - if (cs != null) { - final TrPostCourbeModel[] model = new TrPostCourbeModel[cs.length]; - for (int i = cs.length - 1; i >= 0; i--) { - model[i] = (TrPostCourbeModel) cs[i].getModel(); - model[i].setY(null); - model[i].setTidx(timeSteps_); - } - updateCurves(model, _prog); - fireCourbeContentChanged(null); - } + public TrPostCourbeTreeModel(final int[] _objIdx, final H2dVariableType[] _vars, TrPostProjet _projet) { + this(/* _src , _timeIdx */_vars, _projet); + objIdx_ = _objIdx; + Arrays.sort(objIdx_); } - protected void addAllCourbes(final ProgressionInterface _prog, final CtuluCommandContainer _cmd) { - buildTimeSteps(); + protected void addAllCourbes(TrPostSource _src, final ProgressionInterface _prog, final CtuluCommandContainer _cmd) { + // buildTimeSteps(); startUpdating(); final List modelToUpdate = new ArrayList(); final List courbeToMem = _cmd == null ? null : new ArrayList(); final List groupToMem = _cmd == null ? null : new ArrayList(); + // double[] timesInSec = _src.getTime().getTimeListModel().getTimesInSec(); for (final Iterator it = varSupported_.iterator(); it.hasNext();) { final H2dVariableType t = (H2dVariableType) it.next(); final EGGroup g = getGroupFor(t); @@ -201,7 +146,8 @@ final int idx = objIdx_[i]; final TrPostCourbeModel c = containsCourbeFor(t, g, idx); if (c == null) { - final EGCourbeChild courbe = TrPostCourbeModel.buildCourbeModel(t, idx, timeSteps_, g, src_); + + final EGCourbeChild courbe = TrPostCourbeModel.buildCourbeModel(t, idx, g, _src); if (courbeToMem != null) { courbeToMem.add(courbe); groupToMem.add(g); @@ -215,7 +161,7 @@ final TrPostInterpolatePoint element = (TrPostInterpolatePoint) iter.next(); final TrPostCourbeModel c = containsCourbeFor(t, g, element); if (c == null) { - final EGCourbeChild courbe = TrPostCourbeModel.buildCourbeModel(t, element, timeSteps_, g, src_); + final EGCourbeChild courbe = TrPostCourbeModel.buildCourbeModel(t, element, g, _src); if (courbeToMem != null) { courbeToMem.add(courbe); groupToMem.add(g); @@ -236,236 +182,18 @@ } - protected void addVariables(final List _var, final ProgressionInterface _prog, final CtuluCommandContainer _cmd) { - buildTimeSteps(); - startUpdating(); - //fusion graphes - _var.removeAll(varSupported_); - final int nbPt = objIdx_.length; - final TrPostCourbeModel[] model = new TrPostCourbeModel[_var.size() * (nbPt + intepolPt_.size())]; - int idx = 0; - final List courbeToMem = _cmd == null ? null : new ArrayList(); - final List groupToMem = _cmd == null ? null : new ArrayList(); - for (int i = 0; i < _var.size(); i++) { - final H2dVariableType var = (H2dVariableType) _var.get(i); - final EGGroup g = getGroupFor(var); - for (int idxPt = 0; idxPt < nbPt; idxPt++) { - final EGCourbeChild c = TrPostCourbeModel.buildCourbeModel(var, objIdx_[idxPt], timeSteps_, g, src_); - courbeToMem.add(c); - groupToMem.add(g); - model[idx++] = (TrPostCourbeModel) c.getModel(); - } - for (final Iterator iter = intepolPt_.iterator(); iter.hasNext();) { - final TrPostInterpolatePoint element = (TrPostInterpolatePoint) iter.next(); - final EGCourbeChild c = TrPostCourbeModel.buildCourbeModel(var, element, timeSteps_, g, src_); - courbeToMem.add(c); - groupToMem.add(... [truncated message content] |
From: <de...@us...> - 2008-10-05 20:43:42
|
Revision: 4033 http://fudaa.svn.sourceforge.net/fudaa/?rev=4033&view=rev Author: deniger Date: 2008-10-05 20:43:37 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java 2008-10-03 21:29:46 UTC (rev 4032) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java 2008-10-05 20:43:37 UTC (rev 4033) @@ -1,14 +1,22 @@ package org.fudaa.fudaa.tr.post; +import gnu.trove.TIntHashSet; +import gnu.trove.TIntIterator; + import java.awt.Point; +import java.io.IOException; import java.util.ArrayList; +import java.util.List; +import org.fudaa.ctulu.CtuluVariable; import org.fudaa.ctulu.ProgressionInterface; import org.fudaa.dodico.ef.EfData; +import org.fudaa.dodico.ef.EfElement; import org.fudaa.dodico.ef.EfGridData; import org.fudaa.dodico.ef.EfGridInterface; import org.fudaa.dodico.ef.EfNeighborMesh; import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; +import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolatorDefault; import org.fudaa.dodico.ef.interpolation.EfInterpolator; import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestElt; import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestNode; @@ -25,329 +33,345 @@ import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.PrecisionModel; - /** - * Algorithme de Calcul les lignes de courants + * Algorithme de Calcul les lignes de courants TODO mettre la classe dans EF il y a la classe qui est charge de faire le + * calcul qui doit implementer CtulActivity et la classe qui implemente EfLineIntersectionParent. + * * @author Adrien Hadoux - * */ -public class TrComputeLigneCourantTrajectoire implements EfLineIntersectionParent{ +public class TrComputeLigneCourantTrajectoire implements EfLineIntersectionParent { + /** + * data + */ + TrPostVisuPanel calque_; + final TrPostSource data_; - /** - * data - */ - TrPostVisuPanel calque_; - final TrPostSource data_; + /** + * pour interpoler les valeur + */ + final EfInterpolator interpolator_; - /** - * pour interpoler les valeur - */ - final EfInterpolator interpolator_; + final EfLineIntersectorActivity lineIntersect_; + ProgressionInterface prog_; + List<Coordinate> listePointsARepartir_ = new ArrayList<Coordinate>(); // les GrPoint ne sont utilisee que pour + // l'affichage - final EfLineIntersectorActivity lineIntersect_; - ProgressionInterface prog_; + /** + * Liste des intersections r\xE9sultats + */ + ArrayList<EfLineIntersection> listeIntersection_ = null; - - ArrayList<GrPoint> listePointsARepartir_=new ArrayList<GrPoint>(); - - /** - * Liste des intersections r\xE9sultats - */ - ArrayList<EfLineIntersection> listeIntersection_=null; + public TrComputeLigneCourantTrajectoire(TrPostVisuPanel calque) { + super(); + calque_ = calque; + this.data_ = calque.getSource(); + this.interpolator_ = data_.getInterpolator(); + this.lineIntersect_ = new EfLineIntersectorActivity(data_); + } + /** + * Methode qui permet de repartir uniformement un nombre d points nb sur un segment. + * + * @param point1 extremites 1 du segment + * @param point2 extremite 2 du segment + * @param nbPointsARepartir nombre entier de points a repartir + * @return la liste des points repartis + */ + public static ArrayList<Coordinate> repartirUniformementPointsSurSegment(GrPoint point1, GrPoint point2, + int nbPointsARepartir) { - public TrComputeLigneCourantTrajectoire(TrPostVisuPanel calque) { - super(); - calque_=calque; - this.data_ =calque.getSource(); - this.interpolator_ = data_.getInterpolator(); - this.lineIntersect_ = new EfLineIntersectorActivity(data_); - } + // on calcul leur droite d'equation + double coeff = 0; + if (point1.x_ - point2.x_ != 0) coeff = (point1.y_ - point2.y_) / (point1.x_ - point2.x_); + double ordonneeOrigine = point1.y_ - coeff * point1.x_; - - - /** - * Methode qui permet de repartir uniformement un nombre d points nb sur un segment. - * @param point1 extremites 1 du segment - * @param point2 extremite 2 du segment - * @param nbPointsARepartir nombre entier de points a repartir - * @return la liste des points repartis - */ - public static ArrayList<GrPoint> repartirUniformementPointsSurSegment(GrPoint point1, GrPoint point2, int nbPointsARepartir){ - - //on calcul leur droite d'equation - double coeff=0; - if(point1.x_-point2.x_!=0) - coeff=(point1.y_-point2.y_)/(point1.x_-point2.x_); - double ordonneeOrigine=point1.y_-coeff*point1.x_; - - - - int nbPoints=nbPointsARepartir; - if(nbPoints<2) - //on en met au moins 2 qui seront les extremites - nbPoints=2; - - - //on part du principe que le point 1 est le plus a gauche (abscisse plus petite) - if(point1.x_>point2.x_){ - GrPoint temp=new GrPoint(); - temp.initialiseAvec(point1); - point1.initialiseAvec(point2); - point2.initialiseAvec(temp); - } - - double distanceToAddEachPoint=Math.sqrt((point1.y_-point2.y_)*(point1.y_-point2.y_)+ (point1.x_-point2.x_)*(point1.x_-point2.x_))/nbPoints; - - ArrayList<GrPoint> listePointsARepartir=new ArrayList<GrPoint>(nbPoints); - - //ajout du point 1 dans la liste - listePointsARepartir.add(point1); - - // ajout des nbPoints-2 autre points - for(int i=0;i<nbPoints-2;i++){ - if(point1.x_-point2.x_!=0){ - double x=point1.x_+distanceToAddEachPoint*(i+1); - double y=coeff*x+ordonneeOrigine; - GrPoint newpoint=new GrPoint(x,y,0); - listePointsARepartir.add(newpoint); - } - else{ - //car droite perpendiculaire a l axe des x - double x=point1.x_; - double y=Math.min(point1.y_,point2.y_)+distanceToAddEachPoint*(i+1); - GrPoint newpoint=new GrPoint(x,y,0); - listePointsARepartir.add(newpoint); - } - } - - //ajout du point autre extremite - listePointsARepartir.add(point2); - - return listePointsARepartir; - } - - - - - public void progression(String desc, int completionRate){ - if(prog_==null) - return; - prog_.setDesc(TrResource.getS(desc)); - prog_.setProgression(5); + int nbPoints = nbPointsARepartir; + if (nbPoints < 2) + // on en met au moins 2 qui seront les extremites + nbPoints = 2; - } - /** - * Methode appel\xE9e par l'interface de calcul des lignes de courant. - * @param init point de depart - * @param dureeIntegration duree totale de l'integration en secondes - * @param indicePdt indice du pas de temps - * @param finesse coefficient de finesse double - * @param variable la variable a utiliser - * @param prog l'interface de progression, peut etre null - * @return - */ - public ArrayList<EfLineIntersection> computeLigneCourant(GrPoint extrem1segment,GrPoint extrem2segment, int nbPointsARepartirUniformement, double dureeIntegration, int indicePdt,double finesse ,H2dVariableType variable, ProgressionInterface prog){ - prog_=prog; - - - //on repartit les points uniform\xE9ment sur le segment - listePointsARepartir_=repartirUniformementPointsSurSegment(extrem1segment, extrem2segment, nbPointsARepartirUniformement); - - //test de l'algo avec le premier point - GrPoint init=listePointsARepartir_.get(0); - - - //on init le temps total avec l'indice du pas de temps fourni au depart - double tempsTotal=data_.getTimeStep(indicePdt); - double oldTempsTotal; - boolean termine=false; + // on part du principe que le point 1 est le plus a gauche (abscisse plus petite) + if (point1.x_ > point2.x_) { + GrPoint temp = new GrPoint(); + temp.initialiseAvec(point1); + point1.initialiseAvec(point2); + point2.initialiseAvec(temp); + } + // TODO pour calculer une distance utilise getDistanceXY + double distanceToAddEachPoint = Math.sqrt((point1.y_ - point2.y_) * (point1.y_ - point2.y_) + + (point1.x_ - point2.x_) * (point1.x_ - point2.x_)) + / nbPoints; - //-- variables d'initialisation - //point courant tout au long de l'algo - GrPoint pointCourant=init; - //element sur lequel on se situe a l'iteration i - int elementCourant; - //intersection courante - EfLineIntersection intersectionCourante; - //donn\xE9es r\xE9cup\xE9r\xE9es fixe pour les lignes de courants - EfData dataX; + ArrayList<Coordinate> listePointsARepartir = new ArrayList<Coordinate>(nbPoints); - //initialisation - progression("Recherche \xE9l\xE9ment englobant",5); - elementCourant=elementEnglobant(pointCourant); - //creation de l'intersection avec l'\xE9l\xE9ment courant - progression("Recherche des intersection",7); - intersectionCourante=new EfLineIntersection.ItemMesh(elementCourant,pointCourant.x_,pointCourant.y_); + // ajout du point 1 dans la liste + listePointsARepartir.add(new Coordinate(point1.x_, point1.y_)); - //recup des datas a partir de la var et du pas de temps initial - dataX=data_.getData(variable, indicePdt); + // ajout des nbPoints-2 autre points + for (int i = 0; i < nbPoints - 2; i++) { + if (point1.x_ - point2.x_ != 0) { + double x = point1.x_ + distanceToAddEachPoint * (i + 1); + double y = coeff * x + ordonneeOrigine; + Coordinate newpoint = new Coordinate(x, y, 0); + listePointsARepartir.add(newpoint); + } else { + // car droite perpendiculaire a l axe des x + double x = point1.x_; + double y = Math.min(point1.y_, point2.y_) + distanceToAddEachPoint * (i + 1); + Coordinate newpoint = new Coordinate(x, y, 0); + listePointsARepartir.add(newpoint); + } + } + // ajout du point autre extremite + listePointsARepartir.add(new Coordinate(point2.x_, point2.y_)); + return listePointsARepartir; + } - //-- Algo principal --// + public void progression(String desc, int completionRate) { + if (prog_ == null) return; + prog_.setDesc(TrResource.getS(desc)); + prog_.setProgression(5); - if(elementCourant !=-1){ + } - while(!termine && tempsTotal<=dureeIntegration){ - oldTempsTotal=tempsTotal; + EfNeighborMesh voisinage_; - //ajout de l'intersection dans la liste r\xE9sultats - listeIntersection_.add(intersectionCourante); + /** + * Methode appel\xE9e par l'interface de calcul des lignes de courant. + * + * @param init point de depart + * @param dureeIntegration duree totale de l'integration en secondes + * @param indicePdt indice du pas de temps + * @param finesse coefficient de finesse double + * @param vx la variable a utiliser + * @param prog l'interface de progression, peut etre null + * @return + */ + public ArrayList<EfLineIntersection> computeLigneCourant(GrPoint extrem1segment, GrPoint extrem2segment, + int nbPointsARepartirUniformement, double dureeIntegration, int indicePdt, double finesse, CtuluVariable vx, + CtuluVariable vy, ProgressionInterface prog) {// FIXME trop de variable faire une classe + prog_ = prog; - //recherche des vitesses - double vitesseX=intersectionCourante.getDistanceFrom(pointCourant.x_, pointCourant.y_); - double vitesseY=intersectionCourante.getValueBadInterpolation(dataX); + // on repartit les points uniform\xE9ment sur le segment + listePointsARepartir_ = repartirUniformementPointsSurSegment(extrem1segment, extrem2segment, + nbPointsARepartirUniformement); + // test de l'algo avec le premier point + Coordinate init = listePointsARepartir_.get(0); - //calcul des distances avec son voisinage - progression("Calcul des distances avec le voisinage",10); - EfNeighborMesh voisinage=EfNeighborMesh.compute(data_.getGrid(), prog_); - double distanceMaxEntrePoints=0; - int[] listeEltVoisins=null; - int voisinChoisi=0; - //cas sur un noeud - if(intersectionCourante.isNodeIntersection()){ - int nbVoisins=voisinage.getNbNeighborMeshes(elementCourant); - listeEltVoisins=new int[nbVoisins]; - for(int i=0;i<nbVoisins;i++){ - //On calcule la distance avec lequel de ces points??? - listeEltVoisins[i] =voisinage.getNeighborMesh(elementCourant, i); - } + // on init le temps total avec l'indice du pas de temps fourni au depart + double tempsTotal = data_.getTimeStep(indicePdt); + double oldTempsTotal; + boolean termine = false; - }else { - //comment faire en fudaa pour les autres cas??? - //cas des arretes + // -- variables d'initialisation + // point courant tout au long de l'algo + Coordinate pointCourant = init; + // element sur lequel on se situe a l'iteration i + int elementCourant; + // intersection courante + EfLineIntersection intersectionCourante; + // initialisation + progression("Recherche \xE9l\xE9ment englobant", 5); + elementCourant = elementEnglobant(pointCourant); + // creation de l'intersection avec l'\xE9l\xE9ment courant + progression("Recherche des intersection", 7); + intersectionCourante = new EfLineIntersection.ItemMesh(elementCourant, pointCourant.x, pointCourant.y); - } + // recup des datas a partir de la var et du pas de temps initial + // donn\xE9es r\xE9cup\xE9r\xE9es fixe pour les lignes de courants + EfData dataX=null; + EfData dataY=null; + try { + dataX = data_.getData(vx, indicePdt); + dataY = data_.getData(vy, indicePdt); + } catch (IOException e) { + e.printStackTrace();//erreur de lecteur arrrete le tout + } + // -- Algo principal --// +Coordinate c=new Coordinate(); + if (elementCourant != -1) { + TIntHashSet elementsAdjacent=new TIntHashSet(); + while (!termine && tempsTotal <= dureeIntegration) {//FIXME faux comparaison d'une duree et d'un temps. En fait la duree initiale (tempsTotal) vaut zero + //il faut faire attention: si la dureeIntegration est negative. Il faut comparer les valeurs absolues + oldTempsTotal = tempsTotal; + + // ajout de l'intersection dans la liste r\xE9sultats + listeIntersection_.add(intersectionCourante); - //calcul de la distance max - if(listeEltVoisins!=null && listeEltVoisins.length>0) - voisinChoisi=listeEltVoisins[0]; - for(int i=0;i<listeEltVoisins.length;i++){ - int eltVoisin=listeEltVoisins[i]; + // recherche des vitesses + // double vitesseX = intersectionCourante.getDistanceFrom(pointCourant.x, pointCourant.y);//FIXME la vitesse + // c'est pas la distance depuis le debut + // mais la valeur de vx + //FIXME attention pour les trajectoires les valeurs dataX et dataY doivent etre recalcule au vrai temps + //il faudra surement interpoler en temps ! + double vitesseX = intersectionCourante.getValueBadInterpolation(dataX); + double vitesseY = intersectionCourante.getValueBadInterpolation(dataY); - // coordonn\xE9es de l'\xE9l\xE9ment voisin - double x= getCoordonnees(eltVoisin).x_; - double y=getCoordonnees(eltVoisin).y_; - double distance=Math.sqrt((pointCourant.x_-x)*(pointCourant.x_-x) + (pointCourant.y_-y)*(pointCourant.y_-y) ); - if(distanceMaxEntrePoints>distance){ - //candidat potentiel + // calcul des distances avec son voisinage + progression("Calcul des distances avec le voisinage", 10); + // FIXME ce calcul est long il faut le faire en dehors de la boucld ! + // EfNeighborMesh voisinage = EfNeighborMesh.compute(data_.getGrid(), prog_); + elementsAdjacent.clear(); + //la set elementAdjacent comporte tous les \xE9l\xE9ements adjacents \xE0 l'intersection courante + intersectionCourante.fillWithAdjacentMeshes(elementsAdjacent); + double distanceMaxEntrePoints = 0; + int[] listeEltVoisins = null; + int voisinChoisi = 0;//ne sert a rien + //ATTENTION: pour calcul le prochain point il faut partir du point en cours, + //et se d\xE9placer selon les vitesses x2=x1*vx*delta T + //REATTENTION: il faut prendre en compte le fait que la duree d'integration peut etre negative + // cas sur un noeud + //FIXME inutile desormais +// if (intersectionCourante.isNodeIntersection()) { +// int nbVoisins = voisinage_.getNbNeighborMeshes(elementCourant); +// listeEltVoisins = new int[nbVoisins]; +// for (int i = 0; i < nbVoisins; i++) { +// // On calcule la distance avec lequel de ces points??? +// // avec tous +// listeEltVoisins[i] = voisinage_.getNeighborMesh(elementCourant, i); +// } +// +// } else { +// // comment faire en fudaa pour les autres cas??? +// // cas des arretes +// +// } - //ACHTUNG!! VERIFIER QUE LE t+ deltaT<dureeIntegration si on choisit cette distance - if(vitesseY!=0 && (tempsTotal+ distance/vitesseY<=dureeIntegration)){ - distanceMaxEntrePoints=distance; - voisinChoisi=eltVoisin; - } - } - } + // calcul de la distance max + //pour calculer la distance max, il faut parcourir tous les \xE9l\xE9ments trouve et tous les noeuds des \xE9l\xE9ments + for(TIntIterator it=elementsAdjacent.iterator();it.hasNext();){ + int idxElt=it.next(); + EfElement elt=data_.getGrid().getElement(idxElt); + for (int i = 0; i < elt.getPtNb(); i++) { + data_.getGrid().getCoord(elt.getPtIndex(i), c); + distanceMaxEntrePoints=Math.max(distanceMaxEntrePoints, intersectionCourante.getDistanceFrom(c.x, c.y)); + } + } + //maintenant, on a la distance max, on calcul la duree du d\xE9placement. On a la vitesse qui vaut sqrt(vx*vx+vy*vy) + //Attenion. si la duree d'integration est negative il faut avoir une duree de deplacement n\xE9gative + //y=y1+vy*(delta t) et meme chose pour x + + //le reste est faux: on calcule une trajectoire et donc il faut se deplacer selon vx et vy et ne pas prendre le noeud du voisinage le plus loin ! + if (listeEltVoisins != null && listeEltVoisins.length > 0) voisinChoisi = listeEltVoisins[0];// pourquoi le + // premier ? + for (int i = 0; i < listeEltVoisins.length; i++) { + int eltVoisin = listeEltVoisins[i]; + // coordonn\xE9es de l'\xE9l\xE9ment voisin + double x = 123456789;//getCoordonnees(eltVoisin).x_;//FAUX + double y = 123456789;//getCoordonnees(eltVoisin).y_;//FAUX + double distance = Math.sqrt((pointCourant.x - x) * (pointCourant.x - x) + (pointCourant.y - y) + * (pointCourant.y - y)); + if (distanceMaxEntrePoints > distance) { + // candidat potentiel + // ACHTUNG!! VERIFIER QUE LE t+ deltaT<dureeIntegration si on choisit cette distance + if (vitesseY != 0 && (tempsTotal + distance / vitesseY <= dureeIntegration)) {//FIXME pourquoi seulement la vitesse y. Il faut faire sqrt(vx*vx+vy*vy) + distanceMaxEntrePoints = distance; + voisinChoisi = eltVoisin; + } + } + } - //on calcul le nouveau temps total - if(vitesseY !=0) - tempsTotal+=distanceMaxEntrePoints/vitesseY; + // on calcul le nouveau temps total + if (vitesseY != 0) tempsTotal += distanceMaxEntrePoints / vitesseY;//FIXME pour calcul le - //on verifie que l'on n'est pas inactif - if(oldTempsTotal==tempsTotal ){ - termine=true; - }else{ + // on verifie que l'on n'est pas inactif: pas necessaire + if (oldTempsTotal == tempsTotal) { + termine = true; + } else { - //on a ondc un segment form\xE9 par element courant vers element choisi - GrPoint pointchoisi=new GrPoint(data_.getGrid().getCoor(voisinChoisi).x,data_.getGrid().getCoor(voisinChoisi).y,0); + // on a ondc un segment form\xE9 par element courant vers element choisi + GrPoint pointchoisi = new GrPoint(data_.getGrid().getCoor(voisinChoisi).x, data_.getGrid().getCoor( + voisinChoisi).y, 0); - //recherche des intersection entre les points - Coordinate[] listeCoor=new Coordinate[2]; - listeCoor[0]=new Coordinate(pointCourant.x_,pointCourant.y_); - listeCoor[1]=new Coordinate(pointchoisi.x_,pointchoisi.y_); + // recherche des intersection entre les points + Coordinate[] listeCoor = new Coordinate[2]; + listeCoor[0] = new Coordinate(pointCourant.x, pointCourant.y);//FIXME non on recherche le point le plus eloigne pour savoir sur combien de temps on doit bouge + +// listeCoor[1] = new Coordinate(pointchoisi.x, pointchoisi.y); - LineString ligne=new LineString(listeCoor,new PrecisionModel(),0); - progression("Recherche des intersections",50); - EfLineIntersectionsResultsMng res= lineIntersect_.computeForMeshes(ligne, prog_); + LineString ligne = new LineString(listeCoor, new PrecisionModel(), 0);//utilse GISGeometryFactory.createSegment + progression("Recherche des intersections", 50); + EfLineIntersectionsResultsMng res = lineIntersect_.computeForMeshes(ligne, prog_); + if (res.isSegmentOut(0)) { + // particules est sortie du maillage, le calcul s'arrete + termine = true; + } else { + // recuperationde la nouvelle intersection aui devien courante + intersectionCourante = res.getFoundIntersect(0);//Je crois qu'il faut prendre l'intersection 1 car la 0 est le point de d\xE9part - if(res.isSegmentOut(0)){ - //particules est sortie du maillage, le calcul s'arrete - termine=true; - } - else{ - //recuperationde la nouvelle intersection aui devien courante - intersectionCourante=res.getFoundIntersect(0); + // cette intersection sera automatiquement ajout\xE9e a la liste solution a la prochaine it\xE9ration (premiere + // instruction du while) - // cette intersection sera automatiquement ajout\xE9e a la liste solution a la prochaine it\xE9ration (premiere instruction du while) + } - } + } - } + }// fin du while + } + return listeIntersection_; + } - }//fin du while - - } - return listeIntersection_; - } + /** + * Retourne les coordonn\xE9es associ\xE9es a l \xE9l\xE9ment du point FIXME faux + * + * @param element + * @return + */ + // GrPoint getCoordonnees(int element) { + // GrPoint point = new GrPoint(); + // calque_.getIsoLayer().getIsoModel().point(element, point);// FIXME Faux on passe un element et on renvoie un point + // ! + // return point; + // } + /** + * Recherche l'\xE9l\xE9lment englobant pour un point donn\xE9 + * + * @param _prReel + * @param grid + * @return + */ + public int elementEnglobant(final Coordinate _prReel) { + EfGridInterface grid = data_.getGrid(); + if (grid.getIndex() != null) { + final EfIndexVisitorNearestElt visitor = new EfIndexVisitorNearestElt(grid, _prReel.x, _prReel.y, 0); + grid.getIndex().query(EfIndexVisitorNearestNode.getEnvelope(_prReel.x, _prReel.y, 0), visitor); + return visitor.isIn() ? visitor.getSelected() : -1; + } else return -1; + } + public void buildNeighbor(ProgressionInterface _prog) { + if (voisinage_ == null) { + voisinage_ = EfNeighborMesh.compute(data_.getGrid(), _prog); + } + // TODO Auto-generated method stub + } - /** - * Retourne les coordonn\xE9es associ\xE9es a l \xE9l\xE9ment du point - * @param element - * @return - */ - GrPoint getCoordonnees(int element){ - GrPoint point =new GrPoint(); - calque_.getIsoLayer().getIsoModel().point(element, point); - return point; - } - + public EfGridInterface getGrid() { + // TODO Auto-generated method stub + return data_.getGrid(); + } - /** - * Recherche l'\xE9l\xE9lment englobant pour un point donn\xE9 - * @param _prReel - * @param grid - * @return - */ - public int elementEnglobant(final GrPoint _prReel) { - EfGridInterface grid=data_.getGrid(); - if (grid.getIndex() != null) { - final EfIndexVisitorNearestElt visitor = new EfIndexVisitorNearestElt(grid, _prReel.x_, _prReel.y_, 0); - grid.getIndex().query(EfIndexVisitorNearestNode.getEnvelope(_prReel.x_, _prReel.y_, 0), visitor); - return visitor.isIn() ? visitor.getSelected() : -1; - } - else - return -1; - } + public EfGridDataInterpolator getGridData() { + // TODO le stocker dans un champ prive + return new EfGridDataInterpolatorDefault(data_, interpolator_); + } - @Override - public void buildNeighbor(ProgressionInterface _prog) { - // TODO Auto-generated method stub + public EfNeighborMesh getNeighbor() { + return voisinage_; + } - } - - @Override - public EfGridInterface getGrid() { - // TODO Auto-generated method stub - return data_.getGrid(); - } - - @Override - public EfGridDataInterpolator getGridData() { - // TODO Auto-generated method stub - return null; - } - - @Override - public EfNeighborMesh getNeighbor() { - // TODO Auto-generated method stub - return null; - } - - - - } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-10-03 21:29:56
|
Revision: 4032 http://fudaa.svn.sourceforge.net/fudaa/?rev=4032&view=rev Author: bmarchan Date: 2008-10-03 21:29:46 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Accepte des objets String et pas seulement Boolean Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/collection/CtuluListBoolean.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/collection/CtuluListBoolean.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/collection/CtuluListBoolean.java 2008-10-03 15:32:59 UTC (rev 4031) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/collection/CtuluListBoolean.java 2008-10-03 21:29:46 UTC (rev 4032) @@ -544,6 +544,8 @@ public boolean addObject(final Object _data, final CtuluCommandContainer _c) { if (_data instanceof Boolean) { return add((Boolean) _data, _c); + } else if (_data != null) { + return add(Boolean.valueOf(_data.toString()), _c); } return false; } @@ -551,6 +553,8 @@ public boolean insertObject(final int _i, final Object _data, final CtuluCommandContainer _c) { if (_data instanceof Boolean) { return insert(_i, (Boolean) _data, _c); + } else if (_data != null) { + return insert(_i,Boolean.valueOf(_data.toString()), _c); } return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-10-03 15:33:15
|
Revision: 4031 http://fudaa.svn.sourceforge.net/fudaa/?rev=4031&view=rev Author: hadouxad Date: 2008-10-03 15:32:59 +0000 (Fri, 03 Oct 2008) Log Message: ----------- 1) Cr?\195?\169ation de toutes les ihm d'import scop et des algos de cr?\195?\169ation des evolutionRegulieres. Il ne manque plus que tu cr?\195?\169er et donne le bon target en entr?\195?\169e et le tour est jou?\195?\169! 2)D?\195?\169but d'algorithme sur les lignes de courant, il manque des choses car je n'ai pas saisi toutes les nuances je pense Uniformisation des points sur le segment saisi. 3)Cr?\195?\169ation de l'interface et de l'action qui lance le calcul des lignes de courant, a peaufiner, notamment pour la saisie des points. Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/tr_en.fr_txt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutFille.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance.jar branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/substance.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/com/memoire/bu/BuPreferences.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -26,12 +26,17 @@ import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.LookAndFeel; +import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; import javax.swing.plaf.IconUIResource; import javax.swing.plaf.metal.MetalTheme; +import org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel; + + + import com.memoire.fu.FuFactoryInteger; import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; @@ -110,6 +115,19 @@ else if (lnfname.equals("ASPECT_GTK")) lnfclass = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; else if (lnfname.equals("ASPECT_KUNSTSTOFF")) lnfclass = "com.incors.plaf.kunststoff.KunststoffLookAndFeel"; else if (lnfname.equals("ASPECT_LIQUID")) lnfclass = "com.birosoft.liquid.LiquidLookAndFeel"; +// else if (lnfname.equals("ASPECT_SUBSTANCE")){ +// lnfclass = "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"; +// +// try { +// UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"); +// forced = false; +// } catch (Exception ex) { +// FuLog.error("BPR: could not set substance theme", ex); +// } +// +// +// } + else if (lnfname.equals("ASPECT_MAC")) { FuLib.setSystemProperty("os.name", "Mac OS"); lnfclass = "com.sun.java.swing.plaf.mac.MacLookAndFeel"; Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/telemac/io/ScopeStructure.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -402,6 +402,13 @@ } + public int getVariablePosition(String nomVar){ + for(int i=0;i<getNbVariables();i++) + if(getVariable(i).equals(nomVar)) + return i; + return -1; + } + public void addValueForVariableAtSeparator(double value, int indexVariable, String nameSeparator) { ArrayList<Double> listeValueOfVar = getListValueForVariableForSeparator(nameSeparator, indexVariable); // if (listeValueOfVar == null) @@ -436,6 +443,9 @@ ArrayList<Double> listeValueOfVar = getListValueForVariableForSeparator(separator, i); if (i != 0) ligneBrochette += " "; + if(listeValueOfVar.size()<=indiceValue) + ligneBrochette += KEY.SYMBOL_VALUE_UNDEFINED; + else if (listeValueOfVar.get(indiceValue) != KEY.VALUE_UNDEFINED) ligneBrochette += listeValueOfVar.get(indiceValue); else Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/GraphePersist.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -0,0 +1,13 @@ +package org.fudaa.ebli.courbe; + + +/** + * Classe qui r\xE9cup\xE8re les donn\xE9es courbes d'un graphe et enregistre les parametres + * @author Adrien Hadoux + * + */ +public class GraphePersist { + + + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -21,6 +21,7 @@ import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; +import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.ListSelectionModel; import javax.swing.filechooser.FileFilter; @@ -388,12 +389,32 @@ } /** + * donne la description du fonctionnement de l'import gene specifique + * @return + */ + public String getDescriptionImportGENE(){ + switch(comBoChoixTypeGraphe_.getSelectedIndex()){ + case 0: return "<html><body>"+TrResource.getS("S\xE9lectionnez des couples variable/valeurs num\xE9riques de s\xE9parateur. <br /> Cliquez sur ajouter pour le prendre en compte. On peut ajouter plusieurs couples.<br /> Chaque couple g\xE9n\xE9rera une courbe en prenant les valeurs num\xE9riques du s\xE9parateur choisi.")+"</body></html> "; + case 1: return "<html><body>"+TrResource.getS("S\xE9lectionner toutes les variables voulues ainsi q'une plage de d\xE9part et une plage de fin.<br /> Cela g\xE9n\xE9rera une courbe par variables. Chaque courbe prendra pour Y une interpolation par rapport au x choisi. <br />Il y aura donc autant de couples (x,y) que de s\xE9parateurs dans l'intervalle d\xE9but/fin choisi.")+"</body></html> "; + case 2: return TrResource.getS("S\xE9lectionner une variable et une plage de valeur num\xE9rique pour repr\xE9senter les valeurs de X. Idem pour Y."); + + } + return ""; + + } + + /** * Creation du panel scopGene pour choisir ses parametres * @return */ JPanel buildPanelScopeGENE(){ + final JPanel content2=new JPanel(new BorderLayout()); + content2.add(comBoChoixTypeGraphe_,BorderLayout.NORTH); final JPanel content=new JPanel(new BorderLayout()); - content.add(comBoChoixTypeGraphe_,BorderLayout.NORTH); + content2.add(content,BorderLayout.CENTER); + final JLabel description=new JLabel(getDescriptionImportGENE()); + + content.add(description,BorderLayout.NORTH); final JPanel container=new JPanel(layoutParamGene); content.add(container,BorderLayout.CENTER); comBoChoixTypeGraphe_.setAction(new AbstractAction(){ @@ -403,6 +424,7 @@ //layoutParamGene.next(container); // content.revalidate(); // container.revalidate(); + description.setText(getDescriptionImportGENE()); } }); @@ -416,7 +438,6 @@ listeVar[i-1]=dataG().getVariable(i); listVariablesGENE_=new JList(listeVar); listVariablesGENE_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listVariablesGENE_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); //-- creation de la liste des separators --// listeVar=new String[dataG().getNbSeparator()]; @@ -425,21 +446,26 @@ listeVar[i]=dataG().getSeparator(i); listSeparator_=new JList(listeVar); listSeparator_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparator_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Valeurs num\xE9riques du s\xE9parateur de bloc"))); - + //-- panel reserv\xE9 aux profils spatiaux --// JPanel paramProfils=new JPanel(new BorderLayout()); container.add(paramProfils, TrResource.getS("Profil Spatial")); JPanel choixVar=new JPanel(new GridLayout(1,2)); - choixVar.add(listVariablesGENE_); - choixVar.add(listSeparator_); + JScrollPane pane=new JScrollPane(listVariablesGENE_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); + choixVar.add(pane); + pane=new JScrollPane(listSeparator_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Valeurs num\xE9riques du s\xE9parateur de bloc"))); + + choixVar.add(pane); paramProfils.add(choixVar,BorderLayout.NORTH); //--panel du milieu: liste de couples VAR/SEPARATOR --// modelCoupleSpatiauxGENE_=new DefaultListModel(); listCoupleSpatiauxGENE_=new JList(modelCoupleSpatiauxGENE_); - listCoupleSpatiauxGENE_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Liste des couples variable/separateur"))); - paramProfils.add(listCoupleSpatiauxGENE_,BorderLayout.CENTER); + pane=new JScrollPane(listCoupleSpatiauxGENE_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Liste des couples variable/separateur"))); + paramProfils.add(pane,BorderLayout.CENTER); //-- boutons du bas d'ajout/supression dans la liste --// BuButton ajouter=new BuButton(FudaaResource.FUDAA.getIcon("crystal_ajouter"), TrResource.getS("Ajouter")); ajouter.addActionListener(new ActionListener(){ @@ -485,25 +511,29 @@ listeVar[i-1]=dataG().getVariable(i); listVariablesGENE2_=new JList(listeVar); listVariablesGENE2_.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - listVariablesGENE2_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); listeVar=new String[dataG().getNbSeparator()]; for(int i=0;i<dataG().getNbSeparator();i++) listeVar[i]=dataG().getSeparator(i); listSeparatorDebPlage_=new JList(listeVar); listSeparatorDebPlage_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparatorDebPlage_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage d\xE9part du s\xE9parateur de bloc"))); listSeparatorDebPlage_.setSelectedIndex(0); listSeparatorFinPlage_=new JList(listeVar); listSeparatorFinPlage_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparatorFinPlage_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage fin du s\xE9parateur de bloc"))); listSeparatorFinPlage_.setSelectedIndex(listSeparatorDebPlage_.getModel().getSize()-1); JPanel listData=new JPanel(new GridLayout(1,2)); JPanel listData2=new JPanel(new GridLayout(2,1)); - listData.add(listVariablesGENE2_); + pane=new JScrollPane(listVariablesGENE2_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection des variables"))); + + listData.add(pane); listData.add(listData2); - listData2.add(listSeparatorDebPlage_); - listData2.add(listSeparatorFinPlage_); + pane=new JScrollPane(listSeparatorDebPlage_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage d\xE9part du s\xE9parateur de bloc"))); + listData2.add(pane); + pane=new JScrollPane(listSeparatorFinPlage_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage fin du s\xE9parateur de bloc"))); + listData2.add(pane); paramTempo.add(listData,BorderLayout.CENTER); //textField contenant le x choisi @@ -529,10 +559,8 @@ listeVar[i-1]=dataG().getVariable(i); listVariablesGENECorrlX_=new JList(listeVar); listVariablesGENECorrlX_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listVariablesGENECorrlX_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection la variable pour l'axe X"))); listVariablesGENECorrlY_=new JList(listeVar); listVariablesGENECorrlY_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listVariablesGENECorrlY_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection la variable pour l'axe Y"))); listeVar=new String[dataG().getNbSeparator()]; @@ -540,20 +568,26 @@ listeVar[i]=dataG().getSeparator(i); listSeparatorCorrel1_=new JList(listeVar); listSeparatorCorrel1_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparatorCorrel1_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage associ\xE9e \xE0 la variable X"))); listSeparatorCorrel1_.setSelectedIndex(0); listSeparatorCorrel2_=new JList(listeVar); listSeparatorCorrel2_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listSeparatorCorrel2_.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage associ\xE9e \xE0 la variable Y"))); listSeparatorCorrel2_.setSelectedIndex(0); - paramCorrel.add(listVariablesGENECorrlX_); - paramCorrel.add(listSeparatorCorrel1_); - paramCorrel.add(listVariablesGENECorrlY_); - paramCorrel.add(listSeparatorCorrel2_); + pane=new JScrollPane(listVariablesGENECorrlX_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection la variable pour l'axe X"))); + paramCorrel.add(pane); + pane=new JScrollPane(listSeparatorCorrel1_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage associ\xE9e \xE0 la variable X"))); + paramCorrel.add(pane); + pane=new JScrollPane(listVariablesGENECorrlY_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("S\xE9lection la variable pour l'axe Y"))); + paramCorrel.add(pane); + pane=new JScrollPane(listSeparatorCorrel2_); + pane.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Plage associ\xE9e \xE0 la variable Y"))); + paramCorrel.add(pane); - return content; + return content2; } JPanel buildPanelParametresImportation(){ Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaWriterScopeGENE.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -65,37 +65,46 @@ EGGraphe graphe_ = data.getGraphe(); EGCourbe[] listeChoixUser = data.getCourbes(); - //-- on ajoute un pas de temps qui decrit le graphe --// - String keyPDt="X=contenu graphe"; - structure_.addSeparator(keyPDt); + //--on ajoute tous les x donn\xE9s de la courbe= UNION DE TOUTES LES COURBES--// - final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); - for (int i = listeChoixUser.length - 1; i >= 0; i--) { - final EGCourbe c = listeChoixUser[i]; - for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { - final double x = c.getModel().getX(j); - // if ( (h.containsPoint(x))) { - // -- on ajoute le x pour les variables x si il n existe pas deja --// - structure_.insertNewX(x,keyPDt); - // } - } +// final EGAxeHorizontal h = graphe_.getTransformer().getXAxe(); +// for (int i = listeChoixUser.length - 1; i >= 0; i--) { +// final EGCourbe c = listeChoixUser[i]; +// for (int j = c.getModel().getNbValues() - 1; j >= 0; j--) { +// final double x = c.getModel().getX(j); +// // if ( (h.containsPoint(x))) { +// // -- on ajoute le x pour les variables x si il n existe pas deja --// +// structure_.insertNewX(x,keyPDt); +// // } +// } +// } + + //on recherche toutes les variables pr\xE9sentes dans le graphe + for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { + final EGObject ci = graphe_.getModel().getEGObject(i); + if (ci instanceof EGGroup) { + EGGroup groupe = (EGGroup) ci; + structure_.addVariable(groupe.getTitle()); + + } } - //-- ON INSERE LES Y CORRESPONDANTS POUR CHAQUE VARIABLES--// + + + + + //-- ON Cree un separator pour chaque courbe de chaque variables--// for (int i = 0; i < graphe_.getModel().getNbEGObject(); i++) { final EGObject ci = graphe_.getModel().getEGObject(i); if (ci instanceof EGGroup) { EGGroup groupe = (EGGroup) ci; - boolean hasAlreadyRegistered=false; - - for (int k = 0; k < groupe.getChildCount(); k++) { EGCourbeChild courbe = groupe.getCourbeAt(k); - + boolean selected = false; for (int j = 0; !selected && j < listeChoixUser.length; j++) if (listeChoixUser[j] == courbe) @@ -103,39 +112,43 @@ if (selected) { - // -- il y a au moins une courbe selectionnee pour la variable, on - // va donc enregistrer la variable dans la structure - if (!hasAlreadyRegistered) { - hasAlreadyRegistered = true; - structure_.addVariable(groupe.getTitle()); - //ACHTUNG IL FAUT AJOUTER CETTE LISTE QUI PERMETTRA AU VARIABLE D INITIALISER LEUR DATA. - structure_.getListeVarForSeparator(keyPDt).add(new ArrayList<Double>()); - } + //-- on ajoute un pas de temps qui decrit le graphe --// + String keyPDt="X= "+groupe.getTitle()+": "+courbe.getTitle(); + structure_.addSeparator(keyPDt); + + + // --ajout d toutes les valeurs X et Y--/ + for(int g = 0; g < courbe.getModel().getNbValues(); g++) { + + //on ajoute le x + structure_.insertNewX(courbe.getModel().getX(g), keyPDt); + //on ajoute le y associ\xE9 a la bonne variable + int variableEnCours=structure_.getVariablePosition(groupe.getTitle()); + structure_.addValueForVariableAtSeparator(courbe.getModel().getY(g),variableEnCours , keyPDt); - // --ajout des valeurs pour chaque X--/ - for (int g = 0; g < structure_.getAllX(keyPDt).size(); g++) { - //-- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis --// - double x = structure_.getX(g,keyPDt); + +// //-- on ajoute la valeur interpol\xE9e pour les x pr\xE9cemment saisis --// +// double x = structure_.getX(g,keyPDt); +// +// //-- on v\xE9rifie que le x existe pour la courbe actuelle --// +// boolean xExistForCourbe = false; +// int emplacementYcorrespondant = -1; +// for (int l = 0; !xExistForCourbe && l < courbe.getModel().getNbValues(); l++) { +// if (courbe.getModel().getX(l) == x) { +// xExistForCourbe = true; +// emplacementYcorrespondant = l; +// } +// } - //-- on v\xE9rifie que le x existe pour la courbe actuelle --// - boolean xExistForCourbe = false; - int emplacementYcorrespondant = -1; - for (int l = 0; !xExistForCourbe && l < courbe.getModel().getNbValues(); l++) { - if (courbe.getModel().getX(l) == x) { - xExistForCourbe = true; - emplacementYcorrespondant = l; - } - } - //double yInterpole = courbe.interpol(x); // -- si le x existe dans la courbe alors on inscrit son y // correspondant pour la bonne variable--// - if (xExistForCourbe) - structure_.addValueForVariableAtSeparator(courbe.getModel().getY(emplacementYcorrespondant), structure_.getNbVariables()-1, keyPDt); - else - // -- on enregistre une valeure foireuse. - structure_.addValueForVariableAtSeparator(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables()-1, keyPDt); +// if (xExistForCourbe) +// structure_.addValueForVariableAtSeparator(courbe.getModel().getY(emplacementYcorrespondant), structure_.getNbVariables()-1, keyPDt); +// else +// // -- on enregistre une valeure foireuse. +// structure_.addValueForVariableAtSeparator(ScopeKeyWord.VALUE_UNDEFINED, structure_.getNbVariables()-1, keyPDt); } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/common/TrPostActionLigneCourants.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -7,7 +7,7 @@ import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; import org.fudaa.fudaa.tr.post.TrPostCommonImplementation; import org.fudaa.fudaa.tr.post.TrPostDialogBilan; -import org.fudaa.fudaa.tr.post.TrPostDialogCurrentLine; +import org.fudaa.fudaa.tr.post.TrPostDialogLigneCourants; import org.fudaa.fudaa.tr.post.TrPostProjet; import org.fudaa.fudaa.tr.post.TrPostVisuPanel; @@ -15,11 +15,12 @@ // final MvProfileTarget src_; TrPostProjet projet_; - + TrPostVisuPanel calque_; - public TrPostActionLigneCourants(TrPostProjet projet) { - super(MvResource.getS("Calcul des bilans"), MvResource.MV.getIcon("profile"), "BILAN"); + public TrPostActionLigneCourants(TrPostProjet projet, TrPostVisuPanel panel) { + super(MvResource.getS("Calcul des lignes de courants/trajectoires"), MvResource.MV.getIcon("profile"), "BILAN"); projet_=projet; + calque_=panel; } @@ -28,7 +29,7 @@ public void actionPerformed(final ActionEvent _e) { // -- creation du wizard depusi le calque --// - new TrPostDialogCurrentLine(projet_,projet_.getImpl()); + new TrPostDialogLigneCourants(projet_,projet_.getImpl(),calque_); } Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -1,198 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import java.awt.Point; -import java.util.ArrayList; - -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.dodico.ef.EfData; -import org.fudaa.dodico.ef.EfGridData; -import org.fudaa.dodico.ef.EfGridInterface; -import org.fudaa.dodico.ef.EfNeighborMesh; -import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; -import org.fudaa.dodico.ef.interpolation.EfInterpolator; -import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestElt; -import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestNode; -import org.fudaa.dodico.ef.operation.EfLineIntersection; -import org.fudaa.dodico.ef.operation.EfLineIntersectionParent; -import org.fudaa.dodico.h2d.type.H2dVariableType; -import org.fudaa.ebli.geometrie.GrPoint; -import org.fudaa.ebli.geometrie.GrPolygone; -import org.fudaa.fudaa.tr.common.TrResource; - - -/** - * Algorithme de Calcul les lignes de courants - * @author Adrien Hadoux - * - */ -public class TrComputeCurrentLine implements EfLineIntersectionParent{ - - -/** - * data - */ -final TrPostSource data_; - -/** - * pour interpoler les valeur - */ -final EfInterpolator interpolator_; - -ProgressionInterface prog_; - -/** - * Liste des intersections r\xE9sultats - */ -ArrayList<EfLineIntersection> listeIntersection_=null; - - -public TrComputeCurrentLine(TrPostSource data_) { - super(); - this.data_ = data_; - this.interpolator_ = data_.getInterpolator(); -} - -public void progression(String desc, int completionRate){ - if(prog_==null) - return; - prog_.setDesc(TrResource.getS(desc)); - prog_.setProgression(5); - -} -/** - * Methode appel\xE9e par l'interface de calcul des lignes de courant. - * @param init point de depart - * @param dureeIntegration duree totale de l'integration en secondes - * @param indicePdt indice du pas de temps - * @param finesse coefficient de finesse double - * @param variable la variable a utiliser - * @param prog l'interface de progression, peut etre null - * @return - */ -public ArrayList<EfLineIntersection> computeLine(GrPoint init, double dureeIntegration, int indicePdt,double finesse ,H2dVariableType variable, ProgressionInterface prog){ - prog_=prog; - //on init le temps total avec l'indice du pas de temps fourni au depart - double tempsTotal=data_.getTimeStep(indicePdt); - double oldTempsTotal; - boolean inactif=false; - - - - - while(!inactif && tempsTotal<=dureeIntegration){ - oldTempsTotal=tempsTotal; - - //etape 1 \xE9l\xE9ment englobant de init - progression("Recherche \xE9l\xE9ment englobant",5); - int eltEnglob=elementEnglobant(init); - if(eltEnglob !=-1){ - //creation de la premiere intersection - EfLineIntersection.ItemMesh intersection=new EfLineIntersection.ItemMesh(eltEnglob,init.x_,init.y_); - //recup des datas - EfData dataX=data_.getData(variable, indicePdt); - double vx=intersection.getDistanceFrom(init.x_, init.y_); - double vy=intersection.getValueBadInterpolation(dataX); - - //calcul des distances avec son voisinage - EfNeighborMesh voisinage=EfNeighborMesh.compute(data_.getGrid(), prog_); - double distanceMaxEntrePoints=0; - int[] listeEltVoisins=null; - int voisinChoisi=0; - //cas sur un noeud - if(intersection.isNodeIntersection()){ - int nbVoisins=voisinage.getNbNeighborMeshes(eltEnglob); - listeEltVoisins=new int[nbVoisins]; - for(int i=0;i<nbVoisins;i++){ - //On calcule la distance avec lequel de ces points??? - listeEltVoisins[i] =voisinage.getNeighborMesh(eltEnglob, i); - } - - }else { - //comment faire en fudaa pour les autres cas??? - } - - //calcul de la distance max - if(listeEltVoisins!=null && listeEltVoisins.length>0) - voisinChoisi=listeEltVoisins[0]; - for(int i=0;i<listeEltVoisins.length;i++){ - int eltVoisin=listeEltVoisins[i]; - // comment je fais pour avoir les coordonn\xE9es x et y du point eltVoisin??? - double x=0 ;//a remplacer par les coordonn\xE9es de eltVoisin - double y=0; - double distance=Math.sqrt((init.x_-x)*(init.x_-x) + (init.y_-y)*(init.y_-y) ); - if(distanceMaxEntrePoints>distance){ - - //ACHTUNG!! VERIFIER QUE LE t+ deltaT<dureeIntegration si on choisit cette distance - if(vy!=0 && (tempsTotal+ distance/vy<=dureeIntegration)){ - distanceMaxEntrePoints=distance; - voisinChoisi=eltVoisin; - } - } - } - - //on calcul le nouveau temps total - if(vy !=0) - tempsTotal+=distanceMaxEntrePoints/vy; - - - - - - - - } - //on verifie que l'on n'est pas inactif - if(oldTempsTotal==tempsTotal) - inactif=true; - } - - return listeIntersection_; -} - - - - -/** - * Recherche l'\xE9l\xE9lment englobant pour un point donn\xE9 - * @param _prReel - * @param grid - * @return - */ -public int elementEnglobant(final GrPoint _prReel) { - EfGridInterface grid=data_.getGrid(); - if (grid.getIndex() != null) { - final EfIndexVisitorNearestElt visitor = new EfIndexVisitorNearestElt(grid, _prReel.x_, _prReel.y_, 0); - grid.getIndex().query(EfIndexVisitorNearestNode.getEnvelope(_prReel.x_, _prReel.y_, 0), visitor); - return visitor.isIn() ? visitor.getSelected() : -1; - } - else - return -1; - } - -@Override -public void buildNeighbor(ProgressionInterface _prog) { - // TODO Auto-generated method stub - -} - -@Override -public EfGridInterface getGrid() { - // TODO Auto-generated method stub - return data_.getGrid(); -} - -@Override -public EfGridDataInterpolator getGridData() { - // TODO Auto-generated method stub - return null; -} - -@Override -public EfNeighborMesh getNeighbor() { - // TODO Auto-generated method stub - return null; -} - - - -} Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java (from rev 4025, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeCurrentLine.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -0,0 +1,353 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.Point; +import java.util.ArrayList; + +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.dodico.ef.EfData; +import org.fudaa.dodico.ef.EfGridData; +import org.fudaa.dodico.ef.EfGridInterface; +import org.fudaa.dodico.ef.EfNeighborMesh; +import org.fudaa.dodico.ef.interpolation.EfGridDataInterpolator; +import org.fudaa.dodico.ef.interpolation.EfInterpolator; +import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestElt; +import org.fudaa.dodico.ef.operation.EfIndexVisitorNearestNode; +import org.fudaa.dodico.ef.operation.EfLineIntersection; +import org.fudaa.dodico.ef.operation.EfLineIntersectionParent; +import org.fudaa.dodico.ef.operation.EfLineIntersectionsResultsMng; +import org.fudaa.dodico.ef.operation.EfLineIntersectorActivity; +import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.ebli.geometrie.GrPolygone; +import org.fudaa.fudaa.tr.common.TrResource; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.PrecisionModel; + + +/** + * Algorithme de Calcul les lignes de courants + * @author Adrien Hadoux + * + */ +public class TrComputeLigneCourantTrajectoire implements EfLineIntersectionParent{ + + + /** + * data + */ + TrPostVisuPanel calque_; + final TrPostSource data_; + + /** + * pour interpoler les valeur + */ + final EfInterpolator interpolator_; + + + final EfLineIntersectorActivity lineIntersect_; + ProgressionInterface prog_; + + + ArrayList<GrPoint> listePointsARepartir_=new ArrayList<GrPoint>(); + + /** + * Liste des intersections r\xE9sultats + */ + ArrayList<EfLineIntersection> listeIntersection_=null; + + + public TrComputeLigneCourantTrajectoire(TrPostVisuPanel calque) { + super(); + calque_=calque; + this.data_ =calque.getSource(); + this.interpolator_ = data_.getInterpolator(); + this.lineIntersect_ = new EfLineIntersectorActivity(data_); + } + + + + /** + * Methode qui permet de repartir uniformement un nombre d points nb sur un segment. + * @param point1 extremites 1 du segment + * @param point2 extremite 2 du segment + * @param nbPointsARepartir nombre entier de points a repartir + * @return la liste des points repartis + */ + public static ArrayList<GrPoint> repartirUniformementPointsSurSegment(GrPoint point1, GrPoint point2, int nbPointsARepartir){ + + //on calcul leur droite d'equation + double coeff=0; + if(point1.x_-point2.x_!=0) + coeff=(point1.y_-point2.y_)/(point1.x_-point2.x_); + double ordonneeOrigine=point1.y_-coeff*point1.x_; + + + + int nbPoints=nbPointsARepartir; + if(nbPoints<2) + //on en met au moins 2 qui seront les extremites + nbPoints=2; + + + //on part du principe que le point 1 est le plus a gauche (abscisse plus petite) + if(point1.x_>point2.x_){ + GrPoint temp=new GrPoint(); + temp.initialiseAvec(point1); + point1.initialiseAvec(point2); + point2.initialiseAvec(temp); + } + + double distanceToAddEachPoint=Math.sqrt((point1.y_-point2.y_)*(point1.y_-point2.y_)+ (point1.x_-point2.x_)*(point1.x_-point2.x_))/nbPoints; + + ArrayList<GrPoint> listePointsARepartir=new ArrayList<GrPoint>(nbPoints); + + //ajout du point 1 dans la liste + listePointsARepartir.add(point1); + + // ajout des nbPoints-2 autre points + for(int i=0;i<nbPoints-2;i++){ + if(point1.x_-point2.x_!=0){ + double x=point1.x_+distanceToAddEachPoint*(i+1); + double y=coeff*x+ordonneeOrigine; + GrPoint newpoint=new GrPoint(x,y,0); + listePointsARepartir.add(newpoint); + } + else{ + //car droite perpendiculaire a l axe des x + double x=point1.x_; + double y=Math.min(point1.y_,point2.y_)+distanceToAddEachPoint*(i+1); + GrPoint newpoint=new GrPoint(x,y,0); + listePointsARepartir.add(newpoint); + } + } + + //ajout du point autre extremite + listePointsARepartir.add(point2); + + return listePointsARepartir; + } + + + + + public void progression(String desc, int completionRate){ + if(prog_==null) + return; + prog_.setDesc(TrResource.getS(desc)); + prog_.setProgression(5); + + } + /** + * Methode appel\xE9e par l'interface de calcul des lignes de courant. + * @param init point de depart + * @param dureeIntegration duree totale de l'integration en secondes + * @param indicePdt indice du pas de temps + * @param finesse coefficient de finesse double + * @param variable la variable a utiliser + * @param prog l'interface de progression, peut etre null + * @return + */ + public ArrayList<EfLineIntersection> computeLigneCourant(GrPoint extrem1segment,GrPoint extrem2segment, int nbPointsARepartirUniformement, double dureeIntegration, int indicePdt,double finesse ,H2dVariableType variable, ProgressionInterface prog){ + prog_=prog; + + + //on repartit les points uniform\xE9ment sur le segment + listePointsARepartir_=repartirUniformementPointsSurSegment(extrem1segment, extrem2segment, nbPointsARepartirUniformement); + + //test de l'algo avec le premier point + GrPoint init=listePointsARepartir_.get(0); + + + //on init le temps total avec l'indice du pas de temps fourni au depart + double tempsTotal=data_.getTimeStep(indicePdt); + double oldTempsTotal; + boolean termine=false; + + //-- variables d'initialisation + //point courant tout au long de l'algo + GrPoint pointCourant=init; + //element sur lequel on se situe a l'iteration i + int elementCourant; + //intersection courante + EfLineIntersection intersectionCourante; + //donn\xE9es r\xE9cup\xE9r\xE9es fixe pour les lignes de courants + EfData dataX; + + //initialisation + progression("Recherche \xE9l\xE9ment englobant",5); + elementCourant=elementEnglobant(pointCourant); + //creation de l'intersection avec l'\xE9l\xE9ment courant + progression("Recherche des intersection",7); + intersectionCourante=new EfLineIntersection.ItemMesh(elementCourant,pointCourant.x_,pointCourant.y_); + + //recup des datas a partir de la var et du pas de temps initial + dataX=data_.getData(variable, indicePdt); + + + + //-- Algo principal --// + + if(elementCourant !=-1){ + + while(!termine && tempsTotal<=dureeIntegration){ + oldTempsTotal=tempsTotal; + + //ajout de l'intersection dans la liste r\xE9sultats + listeIntersection_.add(intersectionCourante); + + //recherche des vitesses + double vitesseX=intersectionCourante.getDistanceFrom(pointCourant.x_, pointCourant.y_); + double vitesseY=intersectionCourante.getValueBadInterpolation(dataX); + + + //calcul des distances avec son voisinage + progression("Calcul des distances avec le voisinage",10); + EfNeighborMesh voisinage=EfNeighborMesh.compute(data_.getGrid(), prog_); + double distanceMaxEntrePoints=0; + int[] listeEltVoisins=null; + int voisinChoisi=0; + //cas sur un noeud + if(intersectionCourante.isNodeIntersection()){ + int nbVoisins=voisinage.getNbNeighborMeshes(elementCourant); + listeEltVoisins=new int[nbVoisins]; + for(int i=0;i<nbVoisins;i++){ + //On calcule la distance avec lequel de ces points??? + listeEltVoisins[i] =voisinage.getNeighborMesh(elementCourant, i); + } + + }else { + //comment faire en fudaa pour les autres cas??? + //cas des arretes + + + } + + + + + //calcul de la distance max + if(listeEltVoisins!=null && listeEltVoisins.length>0) + voisinChoisi=listeEltVoisins[0]; + for(int i=0;i<listeEltVoisins.length;i++){ + int eltVoisin=listeEltVoisins[i]; + + // coordonn\xE9es de l'\xE9l\xE9ment voisin + double x= getCoordonnees(eltVoisin).x_; + double y=getCoordonnees(eltVoisin).y_; + double distance=Math.sqrt((pointCourant.x_-x)*(pointCourant.x_-x) + (pointCourant.y_-y)*(pointCourant.y_-y) ); + if(distanceMaxEntrePoints>distance){ + //candidat potentiel + + //ACHTUNG!! VERIFIER QUE LE t+ deltaT<dureeIntegration si on choisit cette distance + if(vitesseY!=0 && (tempsTotal+ distance/vitesseY<=dureeIntegration)){ + distanceMaxEntrePoints=distance; + voisinChoisi=eltVoisin; + } + } + } + + + + //on calcul le nouveau temps total + if(vitesseY !=0) + tempsTotal+=distanceMaxEntrePoints/vitesseY; + + //on verifie que l'on n'est pas inactif + if(oldTempsTotal==tempsTotal ){ + termine=true; + }else{ + + //on a ondc un segment form\xE9 par element courant vers element choisi + GrPoint pointchoisi=new GrPoint(data_.getGrid().getCoor(voisinChoisi).x,data_.getGrid().getCoor(voisinChoisi).y,0); + + //recherche des intersection entre les points + Coordinate[] listeCoor=new Coordinate[2]; + listeCoor[0]=new Coordinate(pointCourant.x_,pointCourant.y_); + listeCoor[1]=new Coordinate(pointchoisi.x_,pointchoisi.y_); + + LineString ligne=new LineString(listeCoor,new PrecisionModel(),0); + progression("Recherche des intersections",50); + EfLineIntersectionsResultsMng res= lineIntersect_.computeForMeshes(ligne, prog_); + + + if(res.isSegmentOut(0)){ + //particules est sortie du maillage, le calcul s'arrete + termine=true; + } + else{ + //recuperationde la nouvelle intersection aui devien courante + intersectionCourante=res.getFoundIntersect(0); + + // cette intersection sera automatiquement ajout\xE9e a la liste solution a la prochaine it\xE9ration (premiere instruction du while) + + } + + } + + + }//fin du while + + } + return listeIntersection_; + } + + + + /** + * Retourne les coordonn\xE9es associ\xE9es a l \xE9l\xE9ment du point + * @param element + * @return + */ + GrPoint getCoordonnees(int element){ + GrPoint point =new GrPoint(); + calque_.getIsoLayer().getIsoModel().point(element, point); + return point; + } + + + /** + * Recherche l'\xE9l\xE9lment englobant pour un point donn\xE9 + * @param _prReel + * @param grid + * @return + */ + public int elementEnglobant(final GrPoint _prReel) { + EfGridInterface grid=data_.getGrid(); + if (grid.getIndex() != null) { + final EfIndexVisitorNearestElt visitor = new EfIndexVisitorNearestElt(grid, _prReel.x_, _prReel.y_, 0); + grid.getIndex().query(EfIndexVisitorNearestNode.getEnvelope(_prReel.x_, _prReel.y_, 0), visitor); + return visitor.isIn() ? visitor.getSelected() : -1; + } + else + return -1; + } + + @Override + public void buildNeighbor(ProgressionInterface _prog) { + // TODO Auto-generated method stub + + } + + @Override + public EfGridInterface getGrid() { + // TODO Auto-generated method stub + return data_.getGrid(); + } + + @Override + public EfGridDataInterpolator getGridData() { + // TODO Auto-generated method stub + return null; + } + + @Override + public EfNeighborMesh getNeighbor() { + // TODO Auto-generated method stub + return null; + } + + + + } Property changes on: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrComputeLigneCourantTrajectoire.java ___________________________________________________________________ Added: svn:mergeinfo + Deleted: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java 2008-10-03 15:29:59 UTC (rev 4030) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -1,392 +0,0 @@ -package org.fudaa.fudaa.tr.post; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.util.ArrayList; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.DefaultListModel; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTree; -import javax.swing.ListModel; -import javax.swing.ListSelectionModel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.table.DefaultTableModel; - -import org.fudaa.ctulu.CtuluAnalyze; -import org.fudaa.ctulu.CtuluLib; -import org.fudaa.ctulu.CtuluListSelection; -import org.fudaa.ctulu.ProgressionInterface; -import org.fudaa.ctulu.gui.CtuluLibSwing; -import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; -import org.fudaa.dodico.ef.EfComputeVolumeSeuil; -import org.fudaa.dodico.ef.EfData; -import org.fudaa.dodico.ef.EfDataIntegrale; -import org.fudaa.dodico.ef.EfFilter; -import org.fudaa.dodico.ef.EfFilterSelectedElement; -import org.fudaa.dodico.h2d.type.H2dVariableType; -import org.fudaa.ebli.calque.ZCalqueLigneBrisee; -import org.fudaa.ebli.calque.find.CalqueFindCourbeTreeModel; -import org.fudaa.ebli.commun.EbliSelectionMode; -import org.fudaa.ebli.geometrie.GrPoint; -import org.fudaa.ebli.ressource.EbliResource; -import org.fudaa.fudaa.commun.FudaaLib; -import org.fudaa.fudaa.meshviewer.layer.MvElementLayer; -import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; -import org.fudaa.fudaa.tr.common.TrResource; - -import com.memoire.bu.BuCharValidator; -import com.memoire.bu.BuStringValidator; -import com.memoire.bu.BuTextField; -import com.memoire.bu.BuValueValidator; -import com.vividsolutions.jts.geom.LinearRing; - -public class TrPostDialogCurrentLine { -/** - * booleen qui indique si le wizard a \xE9t\xE9t lanc\xE9 depuis un calque - */ - - -ArrayList<TrPostSource> source_; -TrPostCommonImplementation impl_; -TrComputeCurrentLine algoCalcul_; - -// donnees graphiques -JDialog dialog_; - -// variables et pdt -private JPanel panelVariables_; -ListModel modelVariables_; -JList listVar_; -ListModel modelPdt_; -JList listPdt_; - -// finesse et duree et point -private JPanel panelSeuil_; -BuTextField finesse_ = new BuTextField(5); -BuTextField duree_ = new BuTextField(5); -BuTextField x_ = new BuTextField(5); -BuTextField y_ = new BuTextField(5); - -// results -JPanel panelResults_; -JLabel results_; -JButton ajouter_ = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); -DefaultTableModel modelResult_; - -/** - * Constructeur reserv\xE9 au calques - * - * @param _builderParams - * @param _calque - * @param _modelGraphe - * @param _panelVariables - * @param _source - */ -public TrPostDialogCurrentLine(TrPostProjet projet,TrPostCommonImplementation impl) { - impl_ = impl; - source_ = projet.listeSrc_; - modelVariables_ = source_.get(0).getNewVarListModel(); - modelPdt_ = source_.get(0).getNewTimeListModel(); - - // -- construction de la dialog --// - buildDialog(); -} - - - - - - - -private JPanel buildresults() { - JPanel conteneur = new JPanel(new BorderLayout()); - - JPanel content = new JPanel(new FlowLayout(FlowLayout.CENTER)); - - results_ = new JLabel(""); - content.add(ajouter_); - // content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); - content.add(results_); - - conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("R\xE9sultats"))); - - // -- action relatives aux resultats --// - ajouter_.addActionListener(new ActionListener() { - - public void actionPerformed(ActionEvent _e) { - if (controleDataOk()) { - computeResults(); - } - } - - }); - - modelResult_ = new DefaultTableModel(); - - JTable tableauRes = new JTable(modelResult_); - conteneur.add(tableauRes.getTableHeader(), BorderLayout.NORTH); - conteneur.add(tableauRes, BorderLayout.CENTER); - conteneur.add(content, BorderLayout.SOUTH); - return conteneur; -} - -public boolean controleDataOk() { - - - if (finesse_.getText().equals("")) { - impl_.error(TrResource.getS("La finesse doit \xEAtre d\xE9fini par un r\xE9el ")); - return false; - } - if (duree_.getText().equals("")) { - impl_.error(TrResource.getS("La dur\xE9e doit \xEAtre d\xE9fini par un r\xE9el en secondes ")); - return false; - } - if (x_.getText().equals("")) { - impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); - return false; - } - if (y_.getText().equals("")) { - impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); - return false; - } - if (listVar_.getSelectedIndex() == -1) { - impl_.error(TrResource.getS("Il faut choisir une variable")); - return false; - } - if (listPdt_.getSelectedIndex() == -1) { - impl_.error(TrResource.getS("Il faut choisir un pas de temps")); - return false; - } - return true; -} - -/** - * retourne la variable selectionnee - * - * @return - */ -protected H2dVariableType getSelectedVariable() { - - return (H2dVariableType) modelVariables_.getElementAt(listVar_.getSelectedIndex()); -} - -/** - * retourne l indice du pas de temps. - * - * @return - */ -protected int getSelectedTimeStep() { - return listPdt_.getSelectedIndex(); -} - -JList listeSources_; -DefaultListModel modelSources_; -private JPanel buildSources() { - JPanel conteneur = new JPanel(new BorderLayout()); - JPanel content = new JPanel(new GridLayout(1, 2)); - modelSources_=new DefaultListModel(); - for(TrPostSource source:source_) - modelSources_.addElement(source.getFile().getPath()); - listeSources_ = new JList(modelSources_); - listeSources_.setSelectedIndex(0); - listeSources_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - content.add(new JScrollPane(listeSources_)); - content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix du source"))); - conteneur.add(content, BorderLayout.CENTER); - - listeSources_.addListSelectionListener(new ListSelectionListener(){ - - @Override - public void valueChanged(ListSelectionEvent e) { - //reconstruction des models de var et de pdt - if(listeSources_.getSelectedIndex()!=-1){ - modelVariables_ = source_.get(listeSources_.getSelectedIndex()).getNewVarListModel(); - modelPdt_ = source_.get(listeSources_.getSelectedIndex()).getNewTimeListModel(); - listPdt_.setModel(modelPdt_); - listVar_.setModel(modelVariables_); - } - } - - }); - - return content; - } - - -private JPanel buildVariables() { - JPanel conteneur = new JPanel(new BorderLayout()); - JPanel content = new JPanel(new GridLayout(1, 2)); - listVar_ = new JList(modelVariables_); - listVar_.setSelectedIndex(0); - listPdt_ = new JList(modelPdt_); - listPdt_.setSelectedIndex(0); - listVar_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - listPdt_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - content.add(new JScrollPane(listVar_)); - content.add(new JScrollPane(listPdt_)); - content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix des variables et pas de temps"))); - conteneur.add(content, BorderLayout.CENTER); - conteneur.add(new JLabel(TrResource.getS("Veuillez s\xE9lectionner la variable et pas de temps")), BorderLayout.NORTH); - return content; -} - - -private JPanel buildParams() { - finesse_.setCharValidator(BuCharValidator.FLOAT); - finesse_.setStringValidator(BuStringValidator.FLOAT); - finesse_.setValueValidator(BuValueValidator.FLOAT); - duree_.setCharValidator(BuCharValidator.FLOAT); - duree_.setStringValidator(BuStringValidator.FLOAT); - duree_.setValueValidator(BuValueValidator.FLOAT); - - x_.setCharValidator(BuCharValidator.FLOAT); - x_.setStringValidator(BuStringValidator.FLOAT); - x_.setValueValidator(BuValueValidator.FLOAT); - - y_.setCharValidator(BuCharValidator.FLOAT); - y_.setStringValidator(BuStringValidator.FLOAT); - y_.setValueValidator(BuValueValidator.FLOAT); - - JPanel conteneur = new JPanel(new GridLayout(2,1)); - conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Choix de la finesse et dur\xE9e"))); - JPanel conteneur1 = new JPanel(new FlowLayout(FlowLayout.CENTER)); - conteneur1.add(new JLabel(TrResource.getS("Finesse:"))); - conteneur1.add(finesse_); - conteneur1.add(new JLabel(TrResource.getS("Dur\xE9e d'int\xE9gration:"))); - conteneur1.add(duree_); - JPanel conteneur2 = new JPanel(new FlowLayout(FlowLayout.CENTER)); - conteneur2.add(new JLabel(TrResource.getS("Point de d\xE9part:"))); - conteneur2.add(x_); - conteneur2.add(new JLabel(TrResource.getS("-"))); - conteneur2.add(y_); - conteneur.add(conteneur1); - conteneur.add(conteneur2); - - - return conteneur; - } - -/** - * Creation du panel graphique. - * - * @return - */ -JPanel panelSources_; -public Box buildContent() { - - Box content = Box.createVerticalBox(); - -//-- panel des sources --// - if(panelSources_==null) - panelSources_=buildSources(); - content.add(panelSources_); - - // -- panel des variables --// - if (panelVariables_ == null) panelVariables_ = buildVariables(); - content.add(panelVariables_); - - // -- panelSeuil - if (panelSeuil_ == null) panelSeuil_ = buildParams(); - content.add(panelSeuil_); - - // -- panel des resultats --// - if (panelResults_ == null) panelResults_ = buildresults(); - content.add(panelResults_); - - return content; -} - -public void buildDialog() { - - // CtuluUIDialog ui_ = new - // CtuluUIDialog(listeWidgetCalque_.get(0).getCalqueController - // ().getVisuPanel()); - - final Frame f = CtuluLibSwing.getFrameAncestorHelper(impl_.getCurrentInternalFrame()); - dialog_ = new JDialog(f); - - dialog_.addWindowListener(new WindowAdapter() { - public void windowClosed(WindowEvent _e) { - // on desactive l action de suivi sur le graphe - dialog_ = null; - } - - public void windowClosing(WindowEvent _e) { - dialog_ = null; - } - }); - - dialog_.setModal(true); - dialog_.pack(); - dialog_.setTitle(getTitle()); - JPanel container = new JPanel(new BorderLayout()); - container.add(buildContent(), BorderLayout.CENTER); - container.add(new JLabel("<html> <body><b><center>" + getTitle() + "</center></b> </body></html>"), - BorderLayout.NORTH); - dialog_.setContentPane(container); - dialog_.setSize(400, 450); - dialog_.setLocationRelativeTo(CtuluLibSwing.getFrameAncestor(impl_.getCurrentInternalFrame())); - dialog_.setVisible(true); - -} - -public String getTitle() { - return TrResource.getS("Lignes de courants"); - -} - - -protected double getFinesse() { - return Double.parseDouble(finesse_.getText()); -} - -protected double getX() { - return Double.parseDouble(x_.getText()); - } -protected double getY() { - return Double.parseDouble(y_.getText()); - } - - -protected double getDuree() { - return Double.parseDouble(duree_.getText()); - } -/** - * Methode qui realise les calculs d'int\xE9grale par rapport aux donn\xE9es - */ -private void computeResults() { - - new CtuluTaskOperationGUI(impl_, FudaaLib.getS("Calcul Bilan")) { - public void act() { - final ProgressionInterface prog = getMainStateReceiver(); - - - //creqtion de l algo - algoCalcul_=new TrComputeCurrentLine(source_.get(listeSources_.getSelectedIndex())); - GrPoint point =new GrPoint(getX(),getY(),0); - algoCalcul_.computeLine(point, getDuree(), getSelectedTimeStep(), getFinesse(), getSelectedVariable(), null); - - // -- mise a jour du tableau de res --// - modelResult_.fireTableDataChanged(); - impl_.unsetMainMessage(); - impl_.unsetMainProgression(); - } - }.start(); -} - -} Copied: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java (from rev 4025, branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogCurrentLine.java) =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostDialogLigneCourants.java 2008-10-03 15:32:59 UTC (rev 4031) @@ -0,0 +1,474 @@ +package org.fudaa.fudaa.tr.post; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.ArrayList; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.DefaultListModel; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTree; +import javax.swing.ListModel; +import javax.swing.ListSelectionModel; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.table.DefaultTableModel; + +import org.fudaa.ctulu.CtuluAnalyze; +import org.fudaa.ctulu.CtuluLib; +import org.fudaa.ctulu.CtuluListSelection; +import org.fudaa.ctulu.ProgressionInterface; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.ctulu.gui.CtuluTaskOperationGUI; +import org.fudaa.dodico.ef.EfComputeVolumeSeuil; +import org.fudaa.dodico.ef.EfData; +import org.fudaa.dodico.ef.EfDataIntegrale; +import org.fudaa.dodico.ef.EfFilter; +import org.fudaa.dodico.ef.EfFilterSelectedElement; +import org.fudaa.dodico.h2d.type.H2dVariableType; +import org.fudaa.ebli.calque.ZCalqueLigneBrisee; +import org.fudaa.ebli.calque.find.CalqueFindCourbeTreeModel; +import org.fudaa.ebli.commun.EbliSelectionMode; +import org.fudaa.ebli.geometrie.GrPoint; +import org.fudaa.ebli.ressource.EbliResource; +import org.fudaa.fudaa.commun.FudaaLib; +import org.fudaa.fudaa.meshviewer.layer.MvElementLayer; +import org.fudaa.fudaa.meshviewer.profile.MvProfileTreeModel; +import org.fudaa.fudaa.tr.common.TrResource; + +import com.memoire.bu.BuCharValidator; +import com.memoire.bu.BuStringValidator; +import com.memoire.bu.BuTextField; +import com.memoire.bu.BuValueValidator; +import com.vividsolutions.jts.geom.LinearRing; + +public class TrPostDialogLigneCourants { + /** + * booleen qui indique si le wizard a \xE9t\xE9t lanc\xE9 depuis un calque + */ + + + //ArrayList<TrPostSource> source_; + TrPostVisuPanel calque_; + TrPostSource source_; + TrPostCommonImplementation impl_; + TrComputeLigneCourantTrajectoire algoCalcul_; + +// donnees graphiques + JDialog dialog_; + + +// choix mode + JComboBox choixMode_=new JComboBox(new String[]{"Lignes de courant","Trajectoires"}); + + +// choix segment + BuTextField x_ = new BuTextField(5); + BuTextField y_ = new BuTextField(5); + BuTextField x2_ = new BuTextField(5); + BuTextField y2_ = new BuTextField(5); + BuTextField nbPoints_ = new BuTextField(5); + + +// variables et pdt + private JPanel panelVariables_; + ListModel modelVariables_; + JList listVar_; + ListModel modelPdt_; + JList listPdt_; + +// finesse et duree et point + private JPanel panelSeuil_; + BuTextField finesse_ = new BuTextField(5); + BuTextField duree_ = new BuTextField(5); + + +// results + JPanel panelResults_; + JLabel results_; + JButton ajouter_ = new JButton("Valider", EbliResource.EBLI.getIcon("crystal_valider")); + DefaultTableModel modelResult_; + + /** + * Constructeur reserv\xE9 au calques + * + * @param _builderParams + * @param _calque + * @param _modelGraphe + * @param _panelVariables + * @param _source + */ + public TrPostDialogLigneCourants(TrPostProjet projet,TrPostCommonImplementation impl,TrPostVisuPanel calque) { + impl_ = impl; + calque_=calque; + source_ = calque.getSource(); + modelVariables_ = source_.getNewVarListModel(); + modelPdt_ = source_.getNewTimeListModel(); + + // -- construction de la dialog --// + buildDialog(); + } + + + + + + + + private JPanel buildresults() { + JPanel conteneur = new JPanel(new BorderLayout()); + + JPanel content = new JPanel(new FlowLayout(FlowLayout.CENTER)); + + results_ = new JLabel(""); + content.add(ajouter_); + // content.add(new JLabel(TrResource.getS("R\xE9sultat:"))); + content.add(results_); + + conteneur.setBorder(BorderFactory.createTitledBorder(TrResource.getS("R\xE9sultats"))); + + // -- action relatives aux resultats --// + ajouter_.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent _e) { + if (controleDataOk()) { + computeResults(); + } + } + + }); + + modelResult_ = new DefaultTableModel(); + + JTable tableauRes = new JTable(modelResult_); + conteneur.add(tableauRes.getTableHeader(), BorderLayout.NORTH); + conteneur.add(tableauRes, BorderLayout.CENTER); + conteneur.add(content, BorderLayout.SOUTH); + return conteneur; + } + + public boolean controleDataOk() { + + + if (finesse_.getText().equals("")) { + impl_.error(TrResource.getS("La finesse doit \xEAtre d\xE9fini par un r\xE9el ")); + return false; + } + if (duree_.getText().equals("")) { + impl_.error(TrResource.getS("La dur\xE9e doit \xEAtre d\xE9fini par un r\xE9el en secondes ")); + return false; + } + if (x_.getText().equals("")) { + impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); + return false; + } + if (nbPoints_.getText().equals("")) { + impl_.error(TrResource.getS("Le nombre de points \xE0 r\xE9partir manquant")); + return false; + } + if (y_.getText().equals("")) { + impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); + return false; + } + if (x2_.getText().equals("")) { + impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); + return false; + } + if (y2_.getText().equals("")) { + impl_.error(TrResource.getS("Le point doit etre form\xE9 de 2 r\xE9els ")); + return false; + } + + if (listVar_.getSelectedIndex() == -1) { + impl_.error(TrResource.getS("Il faut choisir une variable")); + return false; + } + if (listPdt_.getSelectedIndex() == -1) { + impl_.error(TrResource.getS("Il faut choisir un pas de temps")); + return false; + } + + if(getNbPoints()<2){ + nbPoints_.setText(""+2); + } + + return true; + } + + /** + * retourne la variable selectionnee + * + * @return + */ + protected H2dVariableType getSelectedVariable() { +... [truncated message content] |
From: <emm...@us...> - 2008-10-03 15:30:10
|
Revision: 4030 http://fudaa.svn.sourceforge.net/fudaa/?rev=4030&view=rev Author: emmanuel_martin Date: 2008-10-03 15:29:59 +0000 (Fri, 03 Oct 2008) Log Message: ----------- L'attribut ETAT_GEOM existe par defaut et passe automatiquement ?\195?\160 modifi?\195?\169 losqu'une action est faite sur la g?\195?\169ometrie. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionLigneBrisee.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionPoint.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/model/Mv3DFrontierData.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/layer/MdlModel2dLine.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dMultiPoint.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -10,10 +10,11 @@ import java.util.ArrayList; import java.util.List; -import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; -import org.fudaa.ctulu.gui.CtuluValueEditorStringRestricted; +import org.fudaa.ctulu.gui.CtuluValueEditorChoice; +import org.fudaa.ctulu.CtuluLib; + import com.memoire.fu.FuLib; /** @@ -153,9 +154,7 @@ /** * Un attribut etat, global a la g\xE9om\xE9trie. */ - public final static GISAttributeString ETAT_GEOM=new GISAttributeString(new CtuluValueEditorStringRestricted(new String[]{ - ATT_VAL_ETAT_ORIG, ATT_VAL_ETAT_MODI}, new String[]{CtuluLib.getS("Origine"), CtuluLib.getS("Modifi\xE9")}), CtuluLib - .getS("Etat"), false) { + public final static GISAttributeString ETAT_GEOM=new GISAttributeString(new CtuluValueEditorChoice(new String[]{ATT_VAL_ETAT_ORIG, ATT_VAL_ETAT_MODI}, new String[]{CtuluLib.getS("Origine"), CtuluLib.getS("Modifi\xE9")}), CtuluLib.getS("Etat"), false) { public String getID() { return "ATTRIBUTE_ETAT_GEOM"; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -270,8 +270,9 @@ * @param _geom La g\xE9om\xE9trie. * @param _datas Les valeurs d'attributs, dans l'ordre. * @param _cmd Le manager de commandes. + * @return l'index de l'attribut cr\xE9e, -1 si rien n'est cr\xE9e */ - public abstract void addGeometry(Geometry _geom, Object[] _datas, CtuluCommandContainer _cmd); + public abstract int addGeometry(Geometry _geom, Object[] _datas, CtuluCommandContainer _cmd); public void removeGeometries(final int[] _idx, CtuluCommandContainer _cmd) { super.geometry_.remove(_idx, _cmd); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionGeometry.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -90,13 +90,15 @@ throw new IllegalAccessError("Can't call this method"); } - public void addGeometry(final Geometry _geom, final Object[] _data, final CtuluCommandContainer _cmd) { + public int addGeometry(final Geometry _geom, final Object[] _data, final CtuluCommandContainer _cmd) { if (!(_geom instanceof GISCoordinateSequenceContainerInterface)) throw new IllegalArgumentException("Bad type geometry"); if (isGeomModifiable_) { geometry_.add(_geom, Arrays.asList(createAttributeList(_data, _geom, true)), _cmd); + return geometry_.getSize() - 1; } + return -1; } public boolean accept(final GISVisitor _v) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionLigneBrisee.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionLigneBrisee.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionLigneBrisee.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -183,13 +183,15 @@ } } - public void addGeometry(final Geometry _geom, final Object[] _data, final CtuluCommandContainer _cmd) { + public int addGeometry(final Geometry _geom, final Object[] _data, final CtuluCommandContainer _cmd) { if (!(_geom instanceof LineString)) throw new IllegalArgumentException("Bad type geometry"); if (isGeomModifiable_) { geometry_.add(_geom, Arrays.asList(createAttributeList(_data, _geom, true)), _cmd); + return geometry_.getSize() - 1; } + return -1; } /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionMultiPoint.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -173,13 +173,16 @@ addGeometry(geom,_data,_cmd); } - public void addGeometry(final Geometry _geom, final Object[] _data, final CtuluCommandContainer _cmd) { + public int addGeometry(final Geometry _geom, final Object[] _data, final CtuluCommandContainer _cmd) { if (!(_geom instanceof GISMultiPoint)) throw new IllegalArgumentException("Bad type geometry"); if (isGeomModifiable_) { - geometry_.add(_geom, Arrays.asList(createAttributeList(_data, _geom, true)), _cmd); + Object[] atts = createAttributeList(_data, _geom, true); + geometry_.add(_geom, Arrays.asList(atts), _cmd); + return geometry_.getSize() - 1; } + return -1; } public boolean accept(final GISVisitor _v) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionPoint.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionPoint.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollectionPoint.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -242,10 +242,11 @@ return geometry_.add(new GISPoint(_x, _y, _z), _o, _c); } - public void addGeometry(final Geometry _seq, final Object[] _datas, final CtuluCommandContainer _cmd) { + public int addGeometry(final Geometry _seq, final Object[] _datas, final CtuluCommandContainer _cmd) { final Point p = (Point) _seq; add(p.getX(), p.getY(), p.getCoordinateSequence().getOrdinate(0, 2), _datas == null ? null : Arrays.asList(_datas), _cmd); + return size() - 1; } public void addCoordinateSequence(final CoordinateSequence _seq, final Object[] _datas, Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gui/CtuluValueEditorChoice.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -11,6 +11,7 @@ import java.util.Arrays; import javax.swing.DefaultCellEditor; +import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.table.TableCellEditor; @@ -25,37 +26,65 @@ */ public class CtuluValueEditorChoice implements CtuluValueEditorI { - final String[] choices_; + /** + * Les deux tableaux existent pour permettre un affichage diff\xE9rent des + * valeurs r\xE9els retourn\xE9es. Le cas d'utilisation \xE9tant + * l'internationnalisation : on poss\xE8de des infomations au sujet d'un \xE9l\xE9ment + * quelconque, par exemple les couleurs primaires ; on veut afficher ces + * couleurs dans la langue de l'utilisateur, mais poss\xE9der les m\xEAmes + * d\xE9nominations dans le code. Ainsi reelChoices poss\xE9dera les valeurs + * constantes (exemple BLUE, RED, GREEN) et displayChoices poss\xE9dera les + * traductions dans la langue de l'utilisateur (Bleu, Rouge, Vert). Dans le + * cas o\xF9 displayChoices n'est pas renseign\xE9 \xE0 l'instanciation, reelChoice + * sera consid\xE9r\xE9 comme valeur reel et d'affichage. + */ + private String[] displayChoices_; + private String[] reelChoices_; + + private boolean useInteger_; - public boolean useInteger_; - - public CtuluValueEditorChoice(final String[] _choices) { + /** + * Dans le cas o\xF9 dChoices est null, reelChoices sera \xE9galement affich\xE9. + * @param _reelChoices Les choix retourn\xE9s lors des getValue + * @param _dChoices Les choix affich\xE9s par la comboBox + */ + public CtuluValueEditorChoice(final String[] _reelChoices, final String[] _dChoices) { super(); - choices_ = _choices; + useInteger_ = false; + reelChoices_ = _reelChoices; + displayChoices_ = _dChoices; + if(displayChoices_!=null && reelChoices_.length!=displayChoices_.length) + throw new IllegalArgumentException("reelChoices_ and displayChoices_ must have the same size."); } private BuComboBox getCb() { - return new BuComboBox(choices_); + if(displayChoices_!=null) + return new BuComboBox(displayChoices_); + else + return new BuComboBox(reelChoices_); } - - - public Class getDataClass() { + public Class<Arrays> getDataClass() { return Arrays.class; } private boolean isMixteComponent(final BuComboBox _buComboBox) { - return _buComboBox.getModel().getSize() > choices_.length; + return _buComboBox.getModel().getSize() > reelChoices_.length; } private boolean isMixteValuesSelected(final BuComboBox _buComboBox) { - return isMixteComponent(_buComboBox) && _buComboBox.getSelectedIndex() >= choices_.length; + return isMixteComponent(_buComboBox) && _buComboBox.getSelectedIndex() >= reelChoices_.length; } public JComponent createCommonEditorComponent() { - final String[] extendedChoices = new String[choices_.length + 1]; - extendedChoices[choices_.length] = "< " + CtuluLib.getS("Ind\xE9fini") + " >"; - System.arraycopy(choices_, 0, extendedChoices, 0, choices_.length); + String[] elements; + if(displayChoices_!=null) + elements = displayChoices_; + else + elements=reelChoices_; + final String[] extendedChoices = new String[elements.length + 1]; + extendedChoices[elements.length] = "< " + CtuluLib.getS("Ind\xE9fini") + " >"; + System.arraycopy(elements, 0, extendedChoices, 0, elements.length); return new BuComboBox(extendedChoices); } @@ -90,7 +119,7 @@ /* * if (useInteger_) { return CtuluLibString.getString(buComboBox.getSelectedIndex()); } */ - return (String) buComboBox.getSelectedItem(); + return reelChoices_[buComboBox.getSelectedIndex()]; } /** @@ -104,7 +133,7 @@ if (useInteger_) { return new Integer(buComboBox.getSelectedIndex()); } - return buComboBox.getSelectedItem(); + return reelChoices_[buComboBox.getSelectedIndex()]; } public boolean isEditable() { @@ -131,16 +160,16 @@ public void setValue(final Object _s, final Component _comp) { if (useInteger_) { if (_s == null && isMixteComponent((BuComboBox) _comp)) { - ((BuComboBox) _comp).setSelectedIndex(choices_.length); + ((BuComboBox) _comp).setSelectedIndex(reelChoices_.length); } else if (_s != null) { ((BuComboBox) _comp).setSelectedIndex(((Integer) _s).intValue()); } } else { - final int idx = CtuluLibArray.findObject(choices_, _s); + final int idx = CtuluLibArray.findObject(reelChoices_, _s); if (idx >= 0) { ((BuComboBox) _comp).setSelectedIndex(idx); } else if (isMixteComponent(((BuComboBox) _comp))) { - ((BuComboBox) _comp).setSelectedIndex(choices_.length); + ((BuComboBox) _comp).setSelectedIndex(reelChoices_.length); } } @@ -148,7 +177,7 @@ public String toString(final Object _o) { if (useInteger_) { - return _o == null ? "null" : choices_[((Integer) _o).intValue()]; + return _o == null ? "null" : reelChoices_[((Integer) _o).intValue()]; } return _o == null ? "null" : _o.toString(); } @@ -160,5 +189,4 @@ public void setReturnInteger(final boolean _returnInteger) { useInteger_ = _returnInteger; } - } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -185,15 +185,7 @@ modele_.point(seg.e_, i, j); modele_.point(seg.o_, i, j-1); if (seg.distanceXY(ptToTest)<distanceReel) { - // Modification de l'etat de la geometrie - boolean found=false; - int k=-1; - while (!found&&++k<modele_.getGeomData().getNbAttributes()) - found=modele_.getGeomData().getAttribute(k)==GISAttributeConstants.ETAT_GEOM; - if (found) - modele_.getGeomData().getDataModel(k).setObject(i, GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); - // Fin de la modification de l'etat de la geometrie - addPoint(i, k-1, ptToTest.x_, ptToTest.y_, _cmd); + addPoint(i, j-1, ptToTest.x_, ptToTest.y_, _cmd); return true; } } @@ -201,14 +193,6 @@ modele_.point(seg.e_, i, 0); modele_.point(seg.o_, i, modele_.getNbPointForGeometry(i)-1); if (seg.distanceXY(ptToTest)<distanceReel) { - // Modification de l'etat de la geometrie - boolean found=false; - int j=-1; - while (!found&&++j<modele_.getGeomData().getNbAttributes()) - found=modele_.getGeomData().getAttribute(j)==GISAttributeConstants.ETAT_GEOM; - if (found) - modele_.getGeomData().getDataModel(j).setObject(i, GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); - // Fin de la modification de l'etat de la geometrie addPoint(i, modele_.getNbPointForGeometry(i)-1, ptToTest.x_, ptToTest.y_, _cmd); return true; } @@ -380,5 +364,4 @@ public final void setEditor(final ZEditorInterface _editor) { editor_ = _editor; } - } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -114,6 +114,7 @@ iterator.advance(); //l'indice de la ligne final int idxLigne = iterator.key(); + setGeomModif(idxLigne, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie //les points a enlever final CtuluListSelectionInterface sel = (CtuluListSelectionInterface) iterator.value(); geometries_.removeAtomics(idxLigne, sel, _ui, cmp); @@ -261,6 +262,8 @@ } final CoordinateSequence g = ((LineString) geometries_.getGeometry(_ligneIdx)) .getCoordinateSequence(); + // Modification de l'\xE9tat de la g\xE9om\xE9trie + setGeomModif(_ligneIdx, _cmd); // Cr\xE9ation du segment d\xE9fini par les deux point de la forme // Construction du point projet\xE9 grace \xE0 'pointPlusProche' GrPoint point = (new GrSegment(new GrPoint(g.getX(_idxBefore), g.getY(_idxBefore), 0), @@ -317,6 +320,11 @@ dataline1[i]=name+"_1"; dataline2[i]=name+"_2"; } + // CAs particulier de l'attribut ETAT_GEOM => ATT_VAL_ETAT_MODI + else if(attmodel.getAttribute()==GISAttributeConstants.ETAT_GEOM) { + dataline1[i]=GISAttributeConstants.ATT_VAL_ETAT_MODI; + dataline2[i]=GISAttributeConstants.ATT_VAL_ETAT_MODI; + } else { dataline1[i]=attmodel.getAttribute().createDataForGeom(attmodel.getObjectValueAt(_ligneIdx),1); dataline2[i]=attmodel.getAttribute().createDataForGeom(attmodel.getObjectValueAt(_ligneIdx),1); @@ -413,6 +421,10 @@ String name2=(String)geometries_.getModel(att).getObjectValueAt(_ligneIdx[1]); dataline[att]=name1+"_"+name2; } + // Cas particulier de l'attribut ETAT_GEOM => ATT_VAL_ETAT_MODI + else if (geometries_.getModel(att).getAttribute()==GISAttributeConstants.ETAT_GEOM) { + dataline[att]=GISAttributeConstants.ATT_VAL_ETAT_MODI; + } else dataline[att]=geometries_.getModel(att).getAttribute().createDataForGeom(geometries_.getModel(att).getObjectValueAt(_ligneIdx[0]),1); } @@ -480,6 +492,7 @@ final int min = _selection.getMinIndex(); for (int i = _selection.getMaxIndex(); i >= min; i--) { if (_selection.isSelected(i)) { + setGeomModif(i, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie r = true; final CoordinateSequence newSeq = ((LineString) geometries_.getGeometry(i).clone()).getCoordinateSequence(); for (int j = newSeq.size() - 1; j >= 0; j--) { @@ -550,6 +563,7 @@ if (!s.isEmpty()) { r = true; final int idx = it.key(); + setGeomModif(idx, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie final CoordinateSequence newSeq = ((LineString) geometries_.getGeometry(idx).clone()) .getCoordinateSequence(); @@ -632,6 +646,7 @@ final int min = _selection.getMinIndex(); for (int i = _selection.getMaxIndex(); i >= min; i--) { if (_selection.isSelected(i)) { + setGeomModif(i, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie r = true; final CoordinateSequence newSeq = ((LineString) geometries_.getGeometry(i).clone()).getCoordinateSequence(); for (int j = newSeq.size() - 1; j >= 0; j--) { @@ -684,6 +699,7 @@ if (!s.isEmpty()) { r = true; final int idx = it.key(); + setGeomModif(idx, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie final CoordinateSequence newSeq = ((LineString) geometries_.getGeometry(idx).clone()) .getCoordinateSequence(); final int min = s.getMinIndex(); @@ -743,6 +759,8 @@ return false; } geometries_.removeLignes(_idx, _cmd); + for(int i=0 ; i<_idx.length;i++) + setGeomModif(_idx[i], _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie return true; } @@ -767,6 +785,7 @@ for (int iatt=0; iatt<geometries_.getNbAttributes(); iatt++) { Object val=geometries_.getValue(iatt,idx); if (geometries_.getAttribute(iatt).equals(GISAttributeConstants.TITRE)) val=CtuluLib.getS("Copie de")+" "+val; + if (geometries_.getAttribute(iatt).equals(GISAttributeConstants.ETAT_GEOM)) val=GISAttributeConstants.ATT_VAL_ETAT_MODI; int nbpt=geom.getNumPoints(); vals[iatt]=geometries_.getAttribute(iatt).createDataForGeom(val, nbpt); } @@ -777,4 +796,14 @@ if (_cmd!=null) _cmd.addCmd(cmp.getSimplify()); return true; } + + /** + * Fait passer la g\xE9om\xE9trie en Modifier + * @param _idx : index de la geom\xE9trie + * @param _cmd : + */ + public void setGeomModif(int _idx, CtuluCommandContainer _cmd) { + getGeomData().getDataModel(getGeomData().getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(_idx, + GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -413,6 +413,7 @@ */ public void addAtomic(final int _idxGeom,final int _idxBefore,final double _x,final double _y,final CtuluCommandContainer _cmd){ if (geometries_ == null) return; + setGeomModif(_idxGeom, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie geometries_.addAtomic(_idxGeom, _idxBefore, _x, _y, _cmd); } @@ -502,6 +503,7 @@ final int min = _selection.getMinIndex(); for (int i = _selection.getMaxIndex(); i >= min; i--) { if (_selection.isSelected(i)) { + setGeomModif(i, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie r = true; Coordinate[] newSeq = ((Geometry) geometries_.getGeometry(i).clone()).getCoordinates(); for (int j = newSeq.length - 1; j >= 0; j--) { @@ -603,6 +605,11 @@ datageom1[i]=name+"_1"; datageom2[i]=name+"_2"; } + // CAs particulier de l'attribut ETAT_GEOM => ATT_VAL_ETAT_MODI + else if(attmodel.getAttribute()==GISAttributeConstants.ETAT_GEOM) { + datageom1[i]=GISAttributeConstants.ATT_VAL_ETAT_MODI; + datageom2[i]=GISAttributeConstants.ATT_VAL_ETAT_MODI; + } else { datageom1[i]=attmodel.getAttribute().createDataForGeom(attmodel.getObjectValueAt(_geomIdx),1); datageom2[i]=attmodel.getAttribute().createDataForGeom(attmodel.getObjectValueAt(_geomIdx),1); @@ -644,6 +651,7 @@ if (!s.isEmpty()) { r = true; final int idx = it.key(); + setGeomModif(idx, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie Coordinate[] newSeq = ((Geometry) geometries_.getGeometry(idx).clone()).getCoordinates(); // Translation suivant Z si attribut Z non null et atomic. @@ -700,6 +708,7 @@ iterator.advance(); //l'indice de la ligne final int idxLigne = iterator.key(); + setGeomModif(idxLigne, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie //les points a enlever final CtuluListSelectionInterface sel = (CtuluListSelectionInterface) iterator.value(); geometries_.removeAtomics(idxLigne, sel, _ui, cmp); @@ -714,6 +723,8 @@ if (geometries_ == null) { return false; } + for(int i=0 ; i<_idx.length;i++) + setGeomModif(_idx[i], _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie geometries_.removeGeometries(_idx, _cmd); return true; } @@ -736,6 +747,7 @@ final int min = _selection.getMinIndex(); for (int i = _selection.getMaxIndex(); i >= min; i--) { if (_selection.isSelected(i)) { + setGeomModif(i, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie r = true; final Coordinate[] newSeq = ((Geometry) geometries_.getGeometry(i).clone()).getCoordinates(); for (int j = newSeq.length - 1; j >= 0; j--) { @@ -782,6 +794,7 @@ if (!s.isEmpty()) { r = true; final int idx = it.key(); + setGeomModif(idx, _cmd); // Modification de l'\xE9tat de la g\xE9om\xE9trie final Coordinate[] newSeq = ((Geometry) geometries_.getGeometry(idx).clone()).getCoordinates(); final int min = s.getMinIndex(); for (int j = s.getMaxIndex(); j >= min; j--) { @@ -834,6 +847,7 @@ for (int iatt=0; iatt<geometries_.getNbAttributes(); iatt++) { Object val=geometries_.getValue(iatt,idx); if (geometries_.getAttribute(iatt).equals(GISAttributeConstants.TITRE)) val=CtuluLib.getS("Copie de")+" "+val; + if (geometries_.getAttribute(iatt).equals(GISAttributeConstants.ETAT_GEOM)) val=GISAttributeConstants.ATT_VAL_ETAT_MODI; int nbpt=geom.getNumPoints(); vals[iatt]=geometries_.getAttribute(iatt).createDataForGeom(val, nbpt); } @@ -856,4 +870,14 @@ public final boolean isGeometryVisible(final int _idxLigne) { return true; } + + /** + * Fait passer la g\xE9om\xE9trie en Modifier + * @param _idx : index de la geom\xE9trie + * @param _cmd : + */ + public void setGeomModif(int _idx, CtuluCommandContainer _cmd) { + getGeomData().getDataModel(getGeomData().getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(_idx, + GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -165,12 +165,14 @@ * @return true si ok. */ public boolean removePoint(final int[] _idx, final CtuluCommandContainer _cmd) { + for(int i=0;i<_idx.length;i++) + setGeomModif(_idx[i], _cmd); // Modification de l'etat de la g\xE9om\xE9trie return pts_.remove(_idx, _cmd); } public boolean setPoint(final int _idx, final double _newX, final double _newY, final CtuluCommandContainer _cmd) { + setGeomModif(_idx, _cmd); // Modification de l'etat de la g\xE9om\xE9trie return pts_.set(_idx, _newX, _newY, _cmd); - } public boolean point(final GrPoint _p, final int _i, final boolean _force) { @@ -248,6 +250,7 @@ for (int iatt=0; iatt<pts_.getNbAttributes(); iatt++) { Object val=pts_.getValue(iatt,idx); if (pts_.getAttribute(iatt).equals(GISAttributeConstants.TITRE)) val=CtuluLib.getS("Copie de")+" "+val; + if (pts_.getAttribute(iatt).equals(GISAttributeConstants.ETAT_GEOM)) val=GISAttributeConstants.ATT_VAL_ETAT_MODI; int nbpt=geom.getNumPoints(); vals[iatt]=pts_.getAttribute(iatt).createDataForGeom(val, nbpt); } @@ -298,4 +301,14 @@ _pt.y_=getY(_idxGeom); return true; } + + /** + * Fait passer la g\xE9om\xE9trie en Modifier + * @param _idx : index de la geom\xE9trie + * @param _cmd : + */ + public void setGeomModif(int _idx, CtuluCommandContainer _cmd) { + getGeomData().getDataModel(getGeomData().getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(_idx, + GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/model/Mv3DFrontierData.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/model/Mv3DFrontierData.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/model/Mv3DFrontierData.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -154,7 +154,7 @@ } } selectionIntern.sort(); - final CtuluValueEditorChoice type = new CtuluValueEditorChoice(new String[] { getStrNone(), getStrBuilding() }); + final CtuluValueEditorChoice type = new CtuluValueEditorChoice(new String[] { getStrNone(), getStrBuilding() }, null); type.setReturnInteger(true); final CtuluValueEditorDouble db = new CtuluValueEditorDouble(true); final CtuluValuesEditorPanel pn = new CtuluValuesEditorPanel(new String[] { MvResource.getS("Type"), 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 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlSceneEditor.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -144,7 +144,12 @@ GISZoneCollection colsrc=((ZModeleGeometry)getScene().getLayerForId(idxGeom[i]).modeleDonnees()).getGeomData(); for (int iatt=0; iatt<datadest.length; iatt++) { int idxAtt=colsrc.getIndiceOf(coldest.getAttribute(iatt)); - if (idxAtt!=-1) datadest[iatt]=colsrc.getValue(idxAtt,getScene().sceneId2LayerId(idxGeom[i])); + if (idxAtt!=-1) { + datadest[iatt]=colsrc.getValue(idxAtt, getScene().sceneId2LayerId(idxGeom[i])); + // Les nouvelles g\xE9om\xE9tries sont modifi\xE9s, pas d'origine + if (colsrc.getAttribute(idxAtt)==GISAttributeConstants.ETAT_GEOM) + datadest[iatt]=GISAttributeConstants.ATT_VAL_ETAT_MODI; + } } // La g\xE9om\xE9trie @@ -315,6 +320,8 @@ int idx=getScene().sceneId2LayerId(idxGeom[i]); if (zatt!=-1) col.setAttributValue(zatt, idx, vals, cmp); + // Changement de l'attribut ETAT_GEOM en modifi\xE9 + col.getDataModel(col.getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, null); } if (mng_ != null) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dLine.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -67,7 +67,9 @@ coords[coords.length-1]=(Coordinate)_coords[1].clone(); GISPolyligne poly = (GISPolyligne)GISGeometryFactory.INSTANCE.createLineString(coords); - geometries_.addGeometry(poly, null, _cmd); + int idx = geometries_.addGeometry(poly, null, _cmd); + if(idx!=-1) + getGeomData().getDataModel(geometries_.getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); return true; } @@ -163,6 +165,7 @@ CtuluListSelectionInterface ids = new CtuluListSelection(list.toNativeArray()); geometries_.removeAtomics(_idxGeom, ids, null, _cmd); // L'UI est null, le cas ou moins de 2 points ne peut pas arriver. + setGeomModif(_idxGeom, _cmd); // Modification de l'etat de la g\xE9om\xE9trie return true; } @@ -223,6 +226,7 @@ GISPolyligne newgeom=(GISPolyligne)GISGeometryFactory.INSTANCE.createLineString((Coordinate[])coords.toArray(new Coordinate[0])); geometries_.setValue(_idxGeom, newgeom, _cmd); + setGeomModif(_idxGeom, _cmd); // Modification de l'etat de la g\xE9om\xE9trie return true; } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dMultiPoint.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dMultiPoint.java 2008-10-03 14:37:38 UTC (rev 4029) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dMultiPoint.java 2008-10-03 15:29:59 UTC (rev 4030) @@ -58,7 +58,10 @@ coords[coords.length-1]=(Coordinate)_coords[1].clone(); GISMultiPoint poly = (GISMultiPoint) GISGeometryFactory.INSTANCE.createMultiPoint(coords); - geometries_.addGeometry(poly, null, _cmd); + int idx = geometries_.addGeometry(poly, null, _cmd); + // Modification de l'etat de la g\xE9ometrie en modifi\xE9e + if(idx != -1) + getGeomData().getDataModel(geometries_.getIndiceOf(GISAttributeConstants.ETAT_GEOM)).setObject(idx, GISAttributeConstants.ATT_VAL_ETAT_MODI, _cmd); return true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-10-03 14:37:46
|
Revision: 4029 http://fudaa.svn.sourceforge.net/fudaa/?rev=4029&view=rev Author: bmarchan Date: 2008-10-03 14:37:38 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Simplification de l'arborescence des modeles, ZModeleGeom et ZModeleGeometry sont fusionn?\195?\169s. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.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/ZModeleGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelClassLayerFilter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.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/MdlSceneEditor.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigGeomDataClosedLayerFilter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigEditor.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerGroup.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerPointPersistence.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardVariableModifier.java Removed Paths: ------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeom.java Property Changed: ---------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.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/ZModeleGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelClassLayerFilter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleEditable.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.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/MdlSceneEditor.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigGeomDataClosedLayerFilter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigEditor.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerGroup.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerPointPersistence.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardVariableModifier.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 21 nov. 06 - * @modification $Date: 2007-05-04 13:49:46 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -50,7 +50,7 @@ * Ce mod\xE8le est automatiquement mis a jour si une instance de l'arbre des calque lui est fourni. * * @author Fred Deniger, Bertrand Marchand - * @version $Id: CalqueFindCourbeTreeModel.java,v 1.5 2007-05-04 13:49:46 deniger Exp $ + * @version $Id$ */ public class CalqueGISTreeModel extends DefaultTreeModel implements Observer { @@ -229,7 +229,7 @@ */ public void fillWithGeometries(LayerNode _nd, final List<Geometry> _dest) { if (_nd.idxGeom_ >= 0) { - final ZModeleGeom md=(ZModeleGeom)((ZCalqueAffichageDonneesAbstract)_nd.getUserObject()).modeleDonnees(); + final ZModeleGeometry md=(ZModeleGeometry)((ZCalqueAffichageDonneesAbstract)_nd.getUserObject()).modeleDonnees(); _dest.add(md.getGeomData().getGeometry(_nd.idxGeom_)); } else if (((BCalque) _nd.getUserObject()).isGroupeCalque()) { final BCalque[] cqs = ((BCalque) _nd.getUserObject()).getTousCalques(); @@ -247,7 +247,7 @@ private void fillWithLayerGeometries(final List<Geometry> _dest, final BCalque _cq) { if (_cq instanceof ZCalqueAffichageDonneesAbstract) { - final GISZoneCollection collec = ((ZModeleGeom)((ZCalqueAffichageDonneesAbstract)_cq).modeleDonnees()).getGeomData(); + final GISZoneCollection collec = ((ZModeleGeometry)((ZCalqueAffichageDonneesAbstract)_cq).modeleDonnees()).getGeomData(); final GISVisitorGeometryCollector visitor = new GISVisitorGeometryCollector(finder_.getMask()); collec.accept(visitor); _dest.addAll(visitor.getGeometries()); @@ -273,7 +273,7 @@ } void addGeometries(final LayerNode _parent, final ZCalqueAffichageDonneesAbstract _cq) { - final GISZoneCollection collec = ((ZModeleGeom)_cq.modeleDonnees()).getGeomData(); + final GISZoneCollection collec = ((ZModeleGeometry)_cq.modeleDonnees()).getGeomData(); final GISAttributeModelObjectInterface nameAtt = (GISAttributeModelObjectInterface) collec.getModel(GISAttributeConstants.TITRE); final int nb = collec.getNumGeometries(); for (int i = 0; i < nb; i++) { Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id 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 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 31 mars 2005 - * @modification $Date: 2008-04-01 17:05:16 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -63,13 +63,13 @@ * {@link ZModeleGeometry}. * * @author Bertrand Marchand - * @version $Id: ZCalqueMultiPoint.java,v 1.1.2.2 2008-04-01 17:05:16 bmarchan Exp $ + * @version $Id$ */ public class ZCalqueGeometry extends ZCalqueAffichageDonneesLineAbstract { /** * @author Fred Deniger - * @version $Id: ZCalqueMultiPoint.java,v 1.1.2.2 2008-04-01 17:05:16 bmarchan Exp $ + * @version $Id$ */ private class VariableNonAtomicFindExpression extends CalqueFindExpression { @@ -81,7 +81,7 @@ public void initialiseExpr(final CtuluExpr _expr) { super.initialiseExpr(_expr); - final GISZoneCollection coll = ((ZModeleGeom) super.data_).getGeomData(); + final GISZoneCollection coll = ((ZModeleGeometry) super.data_).getGeomData(); final int nb = coll.getNbAttributes(); if (nb > 0) { if (varAtt_ == null) { @@ -102,7 +102,7 @@ public void majVariable(final int _idx, final Variable[] _varToUpdate) { super.majVariable(_idx, _varToUpdate); if (varAtt_ != null && !CtuluLibArray.isEmpty(_varToUpdate)) { - final GISZoneCollection coll = ((ZModeleGeom) super.data_).getGeomData(); + final GISZoneCollection coll = ((ZModeleGeometry) super.data_).getGeomData(); for (int i = _varToUpdate.length - 1; i >= 0; i--) { if (varAtt_.containsKey(_varToUpdate[i])) { _varToUpdate[i].setValue(CtuluLib.getDouble(((Number) coll.getDataModel(varAtt_.get(_varToUpdate[i])) Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueGeometry.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Deleted: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeom.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeom.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeom.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,30 +0,0 @@ -/* - * @creation 25 mai 2005 - * @modification $Date: 2008-01-24 10:18:59 $ - * @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.GISZoneCollection; - -/** - * Une interface mod\xE8le de donn\xE9es comportant des objets de type GIS. Ces objets sont exportables. - * - * @author Fred Deniger - * @version $Id: ZModeleGeom.java,v 1.2.8.1 2008-01-24 10:18:59 bmarchan Exp $ - */ -public interface ZModeleGeom extends ZModeleDonnees { - - /** - * Retourne la g\xE9ometrie GIS. - * @return la geometrie - */ - GISZoneCollection getGeomData(); - - /** - * Prepare l'exportation des donn\xE9es. - */ - void prepareExport(); -} Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeometry.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeometry.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,12 +1,13 @@ /* * @creation 31 mars 2005 - * @modification $Date: 2008-03-26 16:46:43 $ + * @modification $Date$ * @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.GISZoneCollection; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.geometrie.GrPoint; @@ -14,14 +15,26 @@ * Un mod\xE8le contenant toutes sortes de GIS g\xE9om\xE9tries (non sp\xE9cialis\xE9). * @see org.fudaa.ebli.calque.ZCalqueGeometry * @author Bertrand Marchand - * @version $Id: ZModeleMultiPoint.java,v 1.1.2.1 2008-03-26 16:46:43 bmarchan Exp $ + * @version $Id$ */ -public interface ZModeleGeometry extends ZModeleGeom{ +public interface ZModeleGeometry extends ZModeleDonnees { /** + * Retourne la collection qui associe les g\xE9om\xE9tries du mod\xE8le \xE0 des atrributs. + * @return la collection. + */ + GISZoneCollection getGeomData(); + + /** + * Prepare l'exportation des donn\xE9es, en particulier le Z des g\xE9om\xE9tries est rempli depuis + * l'attribut Z. + */ + void prepareExport(); + + /** * Retourne le nombre de points de la g\xE9om\xE9trie d'indice donn\xE9. * @param _idxGeom l'indice de la g\xE9om\xE9trie - * @return le nombre de point pour cette frontiere + * @return le nombre de point pour cette g\xE9om\xE9trie */ int getNbPointForGeometry(int _idxGeom); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeometry.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 1 avr. 2005 - * @modification $Date: 2008-05-13 12:10:24 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -39,7 +39,7 @@ import org.fudaa.ebli.calque.ZCalqueClickInteraction; import org.fudaa.ebli.calque.ZCalqueClikInteractionListener; import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; import org.fudaa.ebli.calque.ZScene; import org.fudaa.ebli.calque.dessin.DeForme; import org.fudaa.ebli.commun.EbliActionInterface; @@ -62,7 +62,7 @@ * objets manipul\xE9s, met \xE0 jour le panneau des outils, contient les actions possibles, etc. * * @author Fred Deniger - * @version $Id: ZEditorDefault.java,v 1.20.6.5 2008-05-13 12:10:24 bmarchan Exp $ + * @version $Id$ */ public class ZEditorDefault implements ZCalqueEditionInteractionTargetI, ZEditorInterface, PropertyChangeListener, ZCalqueDeplacementTargetInterface { @@ -794,7 +794,7 @@ if (!(cq instanceof ZCalqueAffichageDonnees) || ((ZCalqueAffichageDonnees) cq).isSelectionEmpty()) { return; } - if (!(((ZCalqueAffichageDonnees) cq).modeleDonnees() instanceof ZModeleGeom)) { + if (!(((ZCalqueAffichageDonnees) cq).modeleDonnees() instanceof ZModeleGeometry)) { return; } final ZCalqueAffichageDonnees cqDonnees = (ZCalqueAffichageDonnees) cq; @@ -817,7 +817,7 @@ if (idxGeom < 0) { return; } - final EbliSingleGeomVisuPanel ed = new EbliSingleGeomVisuPanel(((ZModeleGeom) cqDonnees.modeleDonnees()) + final EbliSingleGeomVisuPanel ed = new EbliSingleGeomVisuPanel(((ZModeleGeometry) cqDonnees.modeleDonnees()) .getGeomData(), idxGeom, idxVertex, getXYFormatter()); ed.afficheModale(getFrame(), cqDonnees.getTitle()); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelClassLayerFilter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelClassLayerFilter.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelClassLayerFilter.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 26 mai 2005 - * @modification $Date: 2006-07-13 13:35:47 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -18,11 +18,11 @@ import org.fudaa.ebli.calque.BCalqueVisitor; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.calque.ZModeleDonnees; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; /** * @author Fred Deniger - * @version $Id: ZModelClassLayerFilter.java,v 1.3 2006-07-13 13:35:47 deniger Exp $ + * @version $Id$ */ public class ZModelClassLayerFilter implements BCalqueVisitor { @@ -51,14 +51,14 @@ */ public void fillArray(final GISZoneCollection[] _dest){ for (int i = res_.size() - 1; i >= 0; i--) { - _dest[i] = ((ZModeleGeom) (((ZCalqueAffichageDonneesInterface) res_.get(i)).modeleDonnees())) + _dest[i] = ((ZModeleGeometry) (((ZCalqueAffichageDonneesInterface) res_.get(i)).modeleDonnees())) .getGeomData(); } } public void fillArrayModel(final GISDataModel[] _dest){ for (int i = res_.size() - 1; i >= 0; i--) { - _dest[i] = new GISDataModelZoneAdapter(((ZModeleGeom) (((ZCalqueAffichageDonneesInterface) res_ + _dest[i] = new GISDataModelZoneAdapter(((ZModeleGeometry) (((ZCalqueAffichageDonneesInterface) res_ .get(i)).modeleDonnees())).getGeomData(), null); } } @@ -66,8 +66,8 @@ public boolean visit(final BCalque _cq){ if (!res_.contains(_cq) && _cq instanceof ZCalqueAffichageDonneesInterface) { final ZModeleDonnees data = ((ZCalqueAffichageDonneesInterface) _cq).modeleDonnees(); - if (data instanceof ZModeleGeom - && model_.isAssignableFrom(((ZModeleGeom) data).getGeomData().getClass())) { + if (data instanceof ZModeleGeometry + && model_.isAssignableFrom(((ZModeleGeometry) data).getGeomData().getClass())) { res_.add(_cq); } } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelClassLayerFilter.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleEditable.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleEditable.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 15 avr. 2005 - * @modification $Date: 2006-04-12 15:28:02 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -11,14 +11,14 @@ import org.fudaa.ctulu.CtuluAnalyze; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry ; /** * @author Fred Deniger - * @version $Id: ZModeleEditable.java,v 1.3 2006-04-12 15:28:02 deniger Exp $ + * @version $Id$ */ -public interface ZModeleEditable extends ZModeleGeom{ +public interface ZModeleEditable extends ZModeleGeometry { /** Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleEditable.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 4 avr. 2005 - * @modification $Date: 2007-04-16 16:35:08 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -40,13 +40,13 @@ /** * @author Fred Deniger - * @version $Id: ZModelePointEditable.java,v 1.17 2007-04-16 16:35:08 deniger Exp $ + * @version $Id$ */ public class ZModelePointEditable implements ZModelePointEditableInterface { /** * @author Fred Deniger - * @version $Id: ZModelePointEditable.java,v 1.17 2007-04-16 16:35:08 deniger Exp $ + * @version $Id$ */ public class PointTableModel extends AbstractTableModel { @@ -264,6 +264,38 @@ } public Object getObject(final int _ind) { - return null; + return pts_ == null ? null : pts_.getGeometry(_ind); } + + public void getDomaineForGeometry(int _idxGeom, GrBoite _target) { + _target.o_.x_=getX(_idxGeom); + _target.o_.y_=getY(_idxGeom); + _target.e_.x_=_target.o_.x_; + _target.e_.y_=_target.o_.y_; + } + + public int getNbPointForGeometry(int _idxGeom) { + return 1; + } + + public boolean isGeometryFermee(int _idxGeom) { + return false; + } + + public boolean isGeometryReliee(int _idxGeom) { + return false; + } + + public boolean isGeometryVisible(int _idxGeom) { + int iattVisibility=pts_.getIndiceOf(GISAttributeConstants.VISIBILITE); + if (iattVisibility==-1) return true; + + return (Boolean)pts_.getValue(iattVisibility, _idxGeom); + } + + public boolean point(GrPoint _pt, int _idxGeom, int _pointIdx) { + _pt.x_=getX(_idxGeom); + _pt.y_=getY(_idxGeom); + return true; + } } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModelePointEditable.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id 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 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 8 sept. 06 - * @modification $Date: 2008/05/13 12:10:21 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -28,7 +28,7 @@ import org.fudaa.ebli.calque.ZCalqueAffichageDonneesAbstract; import org.fudaa.ebli.calque.ZCalqueGeometry; import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.trace.TraceIcon; import org.fudaa.ebli.trace.TraceIconModel; @@ -48,7 +48,7 @@ /** * Un panneau de saisie des g\xE9om\xE9tries supports de projection suivant Z. * @author Bertrand Marchand - * @version $Id: MdlProjectImportPanel.java,v 1.1.2.1 2008/05/13 12:10:21 bmarchan Exp $ + * @version $Id$ */ public class MdlProjectionPanel extends CtuluDialogPanel { @@ -92,7 +92,7 @@ for (int i=0; i<selpaths.length; i++) { final CalqueGISTreeModel.LayerNode node=(CalqueGISTreeModel.LayerNode)selpaths[i].getLastPathComponent(); final ZCalqueAffichageDonneesAbstract cq = (ZCalqueAffichageDonneesAbstract) node.getUserObject(); - GISZoneCollection col=((ZModeleGeom)cq.modeleDonnees()).getGeomData(); + GISZoneCollection col=((ZModeleGeometry)cq.modeleDonnees()).getGeomData(); // Pour le transport du Z. col.initZCoordinate(node.getIdxGeom()); geoms[i]=col.getGeometry(node.getIdxGeom()); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlProjectionPanel.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id 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 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlSceneEditor.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 25 avr. 08 - * @modification $Date: 2008-05-13 12:10:19 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -29,7 +29,7 @@ import org.fudaa.ctulu.interpolation.bilinear.InterpolatorBilinear; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.calque.ZModeleDonnees; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; import org.fudaa.ebli.calque.ZScene; import org.fudaa.ebli.calque.edition.ZSceneEditor; import org.fudaa.fudaa.commun.FudaaLib; @@ -44,7 +44,7 @@ /** * L'\xE9diteur effectuant les traitements sur la scene sp\xE9cifiques au modeleur. * @author Bertrand Marchand - * @version $Id: MdlSceneEditor.java,v 1.1.2.1 2008-05-13 12:10:19 bmarchan Exp $ + * @version $Id$ */ public class MdlSceneEditor extends ZSceneEditor { // Pour l'affichage des boites de dialogue. @@ -115,7 +115,7 @@ * D\xE9place les g\xE9om\xE9tries s\xE9lectionn\xE9es dans le calque cible. */ public void moveInLayerSelectedGeometries() { - ZModeleGeom mdldest=(ZModeleGeom)((ZCalqueAffichageDonneesInterface)getScene().getCalqueActif()).modeleDonnees(); + ZModeleGeometry mdldest=(ZModeleGeometry)((ZCalqueAffichageDonneesInterface)getScene().getCalqueActif()).modeleDonnees(); GISZoneCollection coldest=mdldest.getGeomData(); int[] idxGeom=getScene().getLayerSelection().getSelectedIndex(); @@ -141,7 +141,7 @@ // Les attributs Object[] datadest=new Object[coldest.getNbAttributes()]; - GISZoneCollection colsrc=((ZModeleGeom)getScene().getLayerForId(idxGeom[i]).modeleDonnees()).getGeomData(); + GISZoneCollection colsrc=((ZModeleGeometry)getScene().getLayerForId(idxGeom[i]).modeleDonnees()).getGeomData(); for (int iatt=0; iatt<datadest.length; iatt++) { int idxAtt=colsrc.getIndiceOf(coldest.getAttribute(iatt)); if (idxAtt!=-1) datadest[iatt]=colsrc.getValue(idxAtt,getScene().sceneId2LayerId(idxGeom[i])); @@ -307,7 +307,7 @@ for (int i=0; i<idxGeom.length; i++) { Object vals=targetGeoms.getValue(0,i); - GISZoneCollection colTmp=((ZModeleGeom)getScene().getLayerForId(idxGeom[i]).modeleDonnees()).getGeomData(); + GISZoneCollection colTmp=((ZModeleGeometry)getScene().getLayerForId(idxGeom[i]).modeleDonnees()).getGeomData(); if (col!=colTmp) { col=colTmp; zatt=col.getIndiceOf(col.getAttributeIsZ()); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/MdlSceneEditor.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigGeomDataClosedLayerFilter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigGeomDataClosedLayerFilter.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigGeomDataClosedLayerFilter.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 26 mai 2005 - * @modification $Date: 2007-05-04 14:00:26 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -25,11 +25,11 @@ import org.fudaa.ebli.calque.BCalque; import org.fudaa.ebli.calque.BCalqueVisitor; import org.fudaa.ebli.calque.ZCalqueLigneBrisee; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; /** * @author Fred Deniger - * @version $Id: FSigGeomDataClosedLayerFilter.java,v 1.8 2007-05-04 14:00:26 deniger Exp $ + * @version $Id$ */ public class FSigGeomDataClosedLayerFilter implements BCalqueVisitor { @@ -125,7 +125,7 @@ } if (_cq instanceof ZCalqueLigneBrisee) { counter_.init(); - final ZModeleGeom geom = ((ZCalqueLigneBrisee) _cq).getModele(); + final ZModeleGeometry geom = ((ZCalqueLigneBrisee) _cq).getModele(); geom.getGeomData().accept(counter_); nbPointTotal_ += counter_.nbPoint_; if (counter_.nbPolygones_ > 0) { Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigGeomDataClosedLayerFilter.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigEditor.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigEditor.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigEditor.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 5 avr. 2005 - * @modification $Date: 2008-05-13 12:11:01 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -45,7 +45,7 @@ import org.fudaa.ebli.calque.ZCalqueAffichageDonnees; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; import org.fudaa.ebli.calque.edition.ZCalqueEditable; import org.fudaa.ebli.calque.edition.ZCalqueEditionGroup; import org.fudaa.ebli.calque.edition.ZCalqueLigneBriseeEditable; @@ -60,7 +60,7 @@ /** * @author Fred Deniger - * @version $Id: FSigEditor.java,v 1.7.4.6 2008-05-13 12:11:01 bmarchan Exp $ + * @version $Id$ */ public class FSigEditor extends ZEditorDefault implements GISZoneListener { @@ -267,7 +267,7 @@ public void updateStateBeforeShow() { final BCalque cq = FSigEditor.this.getPanel().getArbreCalqueModel().getSelectedCalque(); super.setEnabled((cq instanceof ZCalqueAffichageDonnees) && (!((ZCalqueAffichageDonnees) cq).isSelectionEmpty()) - && ((((ZCalqueAffichageDonnees) cq).modeleDonnees() instanceof ZModeleGeom))); + && ((((ZCalqueAffichageDonnees) cq).modeleDonnees() instanceof ZModeleGeometry))); } public String getEnableCondition() { Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigEditor.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 10 juin 2005 - * @modification $Date: 2007-04-30 14:22:39 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -25,12 +25,12 @@ import org.fudaa.ebli.calque.BCalque; import org.fudaa.ebli.calque.BCalqueVisitor; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; /** * Un filtre sur les calques a exporter. Les calques a exporter peuvent \xEAtre uniquement les calques visibles. * @author Fred Deniger - * @version $Id: FSigLayerFilter.java,v 1.4 2007-04-30 14:22:39 deniger Exp $ + * @version $Id$ */ public class FSigLayerFilter implements BCalqueVisitor { @@ -68,7 +68,7 @@ } final GISZoneCollection getCollect(final ZCalqueAffichageDonneesInterface _o) { - final GISZoneCollection geomData = ((ZModeleGeom) _o.modeleDonnees()).getGeomData(); + final GISZoneCollection geomData = ((ZModeleGeometry) _o.modeleDonnees()).getGeomData(); geomData.prepareExport(); return geomData; } @@ -90,9 +90,9 @@ if (bonlyVisible_ && !_cq.isVisible()) return true; if (!cqs_.contains(_cq) && _cq instanceof ZCalqueAffichageDonneesInterface - && ((ZCalqueAffichageDonneesInterface) _cq).modeleDonnees() instanceof ZModeleGeom) { + && ((ZCalqueAffichageDonneesInterface) _cq).modeleDonnees() instanceof ZModeleGeometry) { cqs_.add(_cq); - final ZModeleGeom geom = (ZModeleGeom) ((ZCalqueAffichageDonneesInterface) _cq).modeleDonnees(); + final ZModeleGeometry geom = (ZModeleGeometry) ((ZCalqueAffichageDonneesInterface) _cq).modeleDonnees(); if (geom.getGeomData().getDataStoreClass().equals(Point.class)) { pointCq_.add(_cq); } else if (LineString.class.isAssignableFrom(geom.getGeomData().getDataStoreClass())) { Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerFilter.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerGroup.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerGroup.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerGroup.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 18 mai 2005 - * @modification $Date: 2008-01-17 11:38:59 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -37,7 +37,7 @@ import org.fudaa.ebli.calque.ZCalqueAffichageDonnees; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; import org.fudaa.ebli.calque.ZCalqueLigneBrisee; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; import org.fudaa.ebli.calque.edition.ZCalqueEditionGroup; import org.fudaa.ebli.calque.edition.ZCalqueLigneBriseeEditable; import org.fudaa.ebli.calque.edition.ZCalquePointEditable; @@ -55,13 +55,13 @@ * avec attributs. * * @author Fred Deniger - * @version $Id: FSigLayerGroup.java,v 1.6.2.1 2008-01-17 11:38:59 bmarchan Exp $ + * @version $Id$ */ public class FSigLayerGroup extends ZCalqueEditionGroup { /** * @author fred deniger - * @version $Id: FSigLayerGroup.java,v 1.6.2.1 2008-01-17 11:38:59 bmarchan Exp $ + * @version $Id$ */ static final class CommandForLayerCreation implements CtuluCommand { private final BCalque parent_; @@ -87,7 +87,7 @@ /** * @author fred deniger - * @version $Id: FSigLayerGroup.java,v 1.6.2.1 2008-01-17 11:38:59 bmarchan Exp $ + * @version $Id$ */ static final class NewNamePanel extends CtuluDialogPanel { /** @@ -383,8 +383,8 @@ }; for (int i = 0; i < cq.length; i++) { if (cq[i] instanceof ZCalqueAffichageDonneesInterface - && ((ZCalqueAffichageDonneesInterface) cq[i]).modeleDonnees() instanceof ZModeleGeom) { - final ZModeleGeom donnees = (ZModeleGeom) ((ZCalqueAffichageDonneesInterface) cq[i]).modeleDonnees(); + && ((ZCalqueAffichageDonneesInterface) cq[i]).modeleDonnees() instanceof ZModeleGeometry) { + final ZModeleGeometry donnees = (ZModeleGeometry) ((ZCalqueAffichageDonneesInterface) cq[i]).modeleDonnees(); donnees.getGeomData().setAttributes(att, cmp); } } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/layer/FSigLayerGroup.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerPointPersistence.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerPointPersistence.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerPointPersistence.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 26 ao\xFBt 2005 - * @modification $Date: 2008-01-22 09:58:16 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... @@ -45,7 +45,7 @@ import org.fudaa.ebli.calque.BCalqueSaverSingle; import org.fudaa.ebli.calque.BCalqueSaverTargetInterface; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; import org.fudaa.ebli.calque.edition.ZCalqueEditionGroup; import org.fudaa.fudaa.commun.save.FudaaSaveLib; @@ -53,7 +53,7 @@ /** * @author Fred Deniger - * @version $Id: FSigLayerPointPersistence.java,v 1.9.6.1 2008-01-22 09:58:16 bmarchan Exp $ + * @version $Id$ */ public class FSigLayerPointPersistence extends BCalquePersistenceSingle { @@ -99,7 +99,7 @@ } private GISZoneCollection getGeomData(final BCalque _cqToSave) { - return ((ZModeleGeom) ((ZCalqueAffichageDonneesInterface) _cqToSave).modeleDonnees()).getGeomData(); + return ((ZModeleGeometry) ((ZCalqueAffichageDonneesInterface) _cqToSave).modeleDonnees()).getGeomData(); } protected GISZoneCollection createInitCollection() { Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/persistence/FSigLayerPointPersistence.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardVariableModifier.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardVariableModifier.java 2008-10-03 13:08:56 UTC (rev 4028) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardVariableModifier.java 2008-10-03 14:37:38 UTC (rev 4029) @@ -1,6 +1,6 @@ /* * @creation 25 mai 2005 - * @modification $Date: 2008-02-22 16:27:43 $ + * @modification $Date$ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -52,7 +52,7 @@ import org.fudaa.ebli.calque.BArbreCalqueModel; import org.fudaa.ebli.calque.BCalque; import org.fudaa.ebli.calque.ZCalqueAffichageDonneesInterface; -import org.fudaa.ebli.calque.ZModeleGeom; +import org.fudaa.ebli.calque.ZModeleGeometry; import org.fudaa.ebli.calque.edition.ZCalqueEditionGroup; import org.fudaa.fudaa.sig.FSigGeomSrcData; @@ -63,7 +63,7 @@ /** * Un wizard pour la modification d'une variable. * @author Fred Deniger - * @version $Id: FSigWizardVariableModifier.java,v 1.3.6.1 2008-02-22 16:27:43 bmarchan Exp $ + * @version $Id$ */ public class FSigWizardVariableModifier extends BuWizardTask implements TreeSelectionListener { @@ -162,7 +162,7 @@ /** * @author fred deniger - * @version $Id: FSigWizardVariableModifier.java,v 1.3.6.1 2008-02-22 16:27:43 bmarchan Exp $ + * @version $Id$ */ static final class VariableCellTextRenderer extends CtuluCellTextRenderer { protected void setValue(Object _value) { @@ -567,8 +567,8 @@ if (_cqToScan instanceof ZCalqueEditionGroup) { res = ((ZCalqueEditionGroup) _cqToScan).getAttributes(); } else if (_cqToScan instanceof ZCalqueAffichageDonneesInterface - && ((ZCalqueAffichageDonneesInterface) _cqToScan).modeleDonnees() instanceof ZModeleGeom) { - res = ((ZModeleGeom) ((ZCalqueAffichageDonneesInterface) _cqToScan).modeleDonnees()).getGeomData() + && ((ZCalqueAffichageDonneesInterface) _cqToScan).modeleDonnees() instanceof ZModeleGeometry) { + res = ((ZModeleGeometry) ((ZCalqueAffichageDonneesInterface) _cqToScan).modeleDonnees()).getGeomData() .getAttributes(); } return res == null ? nullAtt_ : res; Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardVariableModifier.java ___________________________________________________________________ Added: svn:keywords + Date Revision Author URL Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2008-10-03 13:09:02
|
Revision: 4028 http://fudaa.svn.sourceforge.net/fudaa/?rev=4028&view=rev Author: bmarchan Date: 2008-10-03 13:08:56 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Introduction de l'attribut VISIBILITY de g?\195?\169om?\195?\169trie. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleLigneBrisee.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileLayerModelForCourbe.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModelGeometry.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigLineSingleModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayer.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfileSplitter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISAttributeConstants.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -170,6 +170,23 @@ }; /** + * Un attribut visibilit\xE9, global a la g\xE9om\xE9trie. + */ + public final static GISAttributeBoolean VISIBILITE = new GISAttributeBoolean(CtuluLib.getS("Visibilit\xE9")) { + public String getID() { + return "ATTRIBUTE_VISIBILITY"; + } + + public boolean isEditable() { + return true; + } + + public Object getDefaultValue() { + return Boolean.TRUE; + } + }; + + /** * Un attribut bathy, atomique. */ public final static GISAttributeDouble BATHY = new GISAttributeDouble(CtuluLib.getS("z"), true) { Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISZoneCollection.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -37,7 +37,9 @@ /** La liste ordonn\xE9e des mod\xE8les d'attributs associ\xE9es \xE0 la collection. */ protected GISAttributeModelListener[] attr_; - /** La valeur de la nature pour pour cette collection si elle est impos\xE9e. null : non impos\xE9e. */ + /** L'acc\xE8s direct \xE0 l'indice de mod\xE8le depuis un type d'attribut */ + protected Map<GISAttributeInterface,Integer> att2Idx_=new HashMap<GISAttributeInterface, Integer>(); + /** La valeur de la nature pour cette collection si elle est impos\xE9e. null : non impos\xE9e. */ protected Map<GISAttributeInterface,Object> fixedAttributes_=new HashMap<GISAttributeInterface,Object>(); /** L'attribut utilis\xE9 pour Z */ protected GISAttributeDouble attributeIsZ_=null; @@ -46,6 +48,8 @@ private int idxAttZ_=-1; /** L'indice de l'attribut pris pour Z doit \xEAtre remis a jour */ protected boolean badIdxAttZ_=true; + /** La liste d'attribut a chang\xE9 : L'acc\xE8s direct \xE0 l'indice de mod\xE8le depuis un type doit \xEAtre remis \xE0 jour. */ + protected boolean attListHasChanged_=true; protected boolean isGeomModifiable_ = true; @@ -132,6 +136,7 @@ protected void initAttributes(final GISAttributeInterface[] _att) { if (_att != null) { badIdxAttZ_=true; + attListHasChanged_=true; attr_ = new GISAttributeModelListener[_att.length]; for (int i = _att.length - 1; i >= 0; i--) { attr_[i] = (GISAttributeModelListener) GISZoneAttributeFactory.createModel(this, _att[i]); @@ -146,6 +151,7 @@ protected void initAttributes(final GISAttributeModelListener[] _att) { badIdxAttZ_=true; + attListHasChanged_=true; attr_ = _att; } @@ -158,6 +164,7 @@ protected void initAttributes(final GISAttributeModelListener[] _att, final CtuluCommandContainer _cmd) { if (!Arrays.equals(_att, attr_)) { badIdxAttZ_=true; + attListHasChanged_=true; final GISAttributeModelListener[] old = attr_; attr_ = _att; fireAttributesChanged(null); @@ -323,13 +330,21 @@ public abstract Class getDataStoreClass(); public int getIndiceOf(final GISAttributeInterface _att) { - if (attr_ != null && _att != null) { - for (int i = attr_.length - 1; i >= 0; i--) { - if (_att.equals(getAttribute(i))) { - return i; - } - } + if (attListHasChanged_) { + att2Idx_.clear(); + for (int i=0; i<attr_.length; i++) + att2Idx_.put(attr_[i].getAttribute(),new Integer(i)); + attListHasChanged_=false; } + Integer idx=att2Idx_.get(_att); + if (idx!=null) return idx.intValue(); +// if (attr_ != null && _att != null) { +// for (int i = attr_.length - 1; i >= 0; i--) { +// if (_att.equals(getAttribute(i))) { +// return i; +// } +// } +// } return -1; } @@ -338,13 +353,15 @@ * @return le modele correspondant ou null si aucun. */ public GISAttributeModel getModel(final GISAttributeInterface _att) { - if (attr_ != null) { - for (int i = attr_.length - 1; i >= 0; i--) { - if (attr_[i].getAttribute() == _att || attr_[i].getAttribute().equals(_att)) { - return attr_[i]; - } - } - } + int idx=getIndiceOf(_att); + if (idx!=-1) return attr_[idx]; +// if (attr_ != null) { +// for (int i = attr_.length - 1; i >= 0; i--) { +// if (attr_[i].getAttribute() == _att || attr_[i].getAttribute().equals(_att)) { +// return attr_[i]; +// } +// } +// } return null; } @@ -551,6 +568,7 @@ return; } badIdxAttZ_=true; + attListHasChanged_=true; // on sauvegarde les anciens attributs final GISAttributeModelListener[] old = attr_; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -60,7 +60,7 @@ // } else if (_cq instanceof ZCalqueLigneBrisee && (mask_&GISLib.MASK_POLYLINE)!=0) { boolean bok=((ZCalqueLigneBrisee) _cq).modeleDonnees().getNombre() > 0; - return bok && ((ZCalqueLigneBrisee)_cq).getModele().getNbLigneBrisee()!=0; + return bok && ((ZCalqueLigneBrisee)_cq).getModele().getNbPolyligne()!=0; } else if (_cq instanceof ZCalqueLigneBrisee && (mask_&GISLib.MASK_POLYGONE)!=0) { boolean bok=((ZCalqueLigneBrisee)_cq).modeleDonnees().getNombre() > 0; 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 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -335,8 +335,6 @@ return "calque." + BSelecteurIconModel.getProperty(_i); } - public void inverseSelection() {} - /** * @return false */ @@ -367,10 +365,6 @@ return true; } - public boolean isSelectionEmpty() { - return false; - } - public boolean isSpecialSelectionAllowed() { return false; } @@ -494,8 +488,6 @@ return res; } - public void selectAll() {} - public void setForeground(final Color _v) { for (int i = getNbSet() - 1; i >= 0; i--) { final TraceIconModel ic = getIconModel(i); 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 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLigneBrisee.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -144,7 +144,7 @@ } - protected EbliListeSelectionMulti creeSelectionMutli() { + protected EbliListeSelectionMulti creeSelectionMulti() { return new EbliListeSelectionMulti(modeleDonnees().getNombre() / 2); } @@ -236,7 +236,7 @@ // Si la selection de modif est nulle, seule l'action de remplacement // est concernee. if (selectionMulti_ == null) { - selectionMulti_ = creeSelectionMutli(); + selectionMulti_ = creeSelectionMulti(); } boolean sentEvent = false; switch (_action) { @@ -347,8 +347,8 @@ final EbliListeSelectionMultiInterface multi = getLayerSelectionMulti(); int nb = 0; // 20 points par lignes - final TIntArrayList list = new TIntArrayList(modele_.getNbLigneBrisee() * 20); - final int nbLigne = modele_.getNbLigneBrisee(); + final TIntArrayList list = new TIntArrayList(modele_.getNombre() * 20); + final int nbLigne = modele_.getNombre(); for (int i = 0; i < nbLigne; i++) { final CtuluListSelectionInterface sel = multi.getSelection(i); if (sel != null) { @@ -430,7 +430,7 @@ if (isSelectionEmpty()) { return; } - for (int i = modele_.getNbLigneBrisee() - 1; i >= 0; i--) { + for (int i = modele_.getNombre() - 1; i >= 0; i--) { CtuluListSelection s = selectionMulti_.get(i); if (s == null) { s = new CtuluListSelection(); @@ -445,13 +445,23 @@ public void inverseSelection() { if (!isAtomicMode_) { - super.inverseSelection(); +// super.inverseSelection(); + if (isSelectionEmpty()) { + return; + } + initSelection(); + selection_.inverse(modeleDonnees().getNombre()); + for (int i=0; i<modele_.getNombre(); i++) { + if (!modele_.isGeometryVisible(i)) selection_.remove(i); + } + fireSelectionEvent(); return; } if (isSelectionEmpty()) { return; } - for (int i = modele_.getNbLigneBrisee() - 1; i >= 0; i--) { + for (int i = modele_.getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; final CtuluListSelection s = selectionMulti_.get(i); if (s != null) { s.inverse(modele_.getNbPointForGeometry(i)); @@ -533,6 +543,9 @@ 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 @@ -573,6 +586,10 @@ 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) { @@ -630,7 +647,7 @@ _g.setColor(cs); final TraceLigne tlSelection = _trace.getLigne(); final TraceIcon ic = _trace.getIcone(); - final int nb = Math.min(_containers.getMaxIndex(), modele_.getNbLigneBrisee() - 1); + final int nb = Math.min(_containers.getMaxIndex(), modele_.getNombre() - 1); final GrBoite bPoly = new GrBoite(); bPoly.e_ = new GrPoint(); @@ -671,13 +688,21 @@ if (!isVisible()) return; if (!isAtomicMode_) { - super.selectAll(); +// super.selectAll(); + initSelection(); + selection_.addInterval(0, modele_.getNombre() - 1); + for (int i=0; i<modele_.getNombre(); i++) { + if (!modele_.isGeometryVisible(i)) selection_.remove(i); + } + fireSelectionEvent(); return; } if (selectionMulti_ == null) { - selectionMulti_ = creeSelectionMutli(); + selectionMulti_ = creeSelectionMulti(); } - for (int i = modele_.getNbLigneBrisee() - 1; i >= 0; i--) { + for (int i = modele_.getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + CtuluListSelection s = selectionMulti_.get(i); if (s == null) { s = new CtuluListSelection(modele_.getNbPointForGeometry(i)); @@ -689,7 +714,7 @@ } public CtuluListSelection selection(final GrPoint _pt, final int _tolerance) { - if (modele_.getNbLigneBrisee() == 0) { + if (modele_.getNombre() == 0) { return null; } final GrBoite bClip = getDomaine(); @@ -704,7 +729,9 @@ // bClip = getClipReel(getGraphics()); final GrSegment poly = new GrSegment(new GrPoint(), new GrPoint()); final GrBoite bPoly = new GrBoite(new GrPoint(), new GrPoint()); - for (int i = modele_.getNbLigneBrisee() - 1; i >= 0; i--) { + for (int i = modele_.getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + modele_.getDomaineForGeometry(i, bPoly); if (bPoly.contientXY(_pt)||bPoly.distanceXY(_pt)<distanceReel) { for (int j=modele_.getNbPointForGeometry(i)-1; j>0; j--) { @@ -749,7 +776,9 @@ final CtuluListSelection r = creeSelection(); final GrPoint p = new GrPoint(); final GrBoite bPoly = new GrBoite(new GrPoint(), new GrPoint()); - for (int i = getModele().getNombre() - 1; i >= 0; i--) { + for (int i = modele_.getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + modele_.getDomaineForGeometry(i, bPoly); // si le poly est dans dans le poly de selection boolean selected = false; @@ -812,7 +841,9 @@ bClip = getClipReel(getGraphics()); final GrPoint p = new GrPoint(); final GrBoite btLigne = new GrBoite(); - for (int i = modele_.getNbLigneBrisee() - 1; i >= 0; i--) { + for (int i = modele_.getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + modele_.getDomaineForGeometry(i, btLigne); if (btLigne.contientXY(_pt) || btLigne.distanceXY(_pt) < distanceReel) { for (int j = modele_.getNbPointForGeometry(i) - 1; j >= 0; j--) { @@ -841,11 +872,13 @@ if (!polyEnv.intersects(domaine)) { return null; } - final EbliListeSelectionMulti r = creeSelectionMutli(); + final EbliListeSelectionMulti r = creeSelectionMulti(); final GrPoint p = new GrPoint(); final SIRtreePointInRing tester = new SIRtreePointInRing(_poly); final Coordinate c = new Coordinate(); - for (int i = modele_.getNbLigneBrisee() - 1; i >= 0; i--) { + for (int i = modele_.getNombre() - 1; i >= 0; i--) { + if (!modele_.isGeometryVisible(i)) continue; + CtuluListSelection l = null; final int nbPt = modele_.getNbPointForGeometry(i); for (int j = nbPt - 1; j >= 0; j--) { @@ -897,6 +930,7 @@ } public boolean setSelection(final int[] _idx) { + // Pas de controle sur la visibilit\xE9 ou non des objets d'indices pass\xE9s. if (!isAtomicMode_) { return super.setSelection(_idx); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeometry.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleGeometry.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -10,9 +10,6 @@ import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.geometrie.GrPoint; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.LineString; - /** * Un mod\xE8le contenant toutes sortes de GIS g\xE9om\xE9tries (non sp\xE9cialis\xE9). * @see org.fudaa.ebli.calque.ZCalqueGeometry @@ -59,4 +56,11 @@ * @return True : Si la g\xE9om\xE9trie est ferm\xE9e. */ public boolean isGeometryFermee(int _idxGeom); + + /** + * La g\xE9om\xE9trie est-elle visible. + * @param _idxGeom L'indice de la g\xE9om\xE9trie dans le mod\xE8le. + * @return True : Si la g\xE9om\xE9trie est visible. + */ + public boolean isGeometryVisible(int _idxGeom); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleLigneBrisee.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleLigneBrisee.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZModeleLigneBrisee.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -20,10 +20,10 @@ public interface ZModeleLigneBrisee extends ZModeleGeometry { /** - * Retourne le nombre de lignes brisees contenues dans le mod\xE8le. - * @return Le nombre de lignes bris\xE9es. + * Retourne le nombre de polylignes (ligne bris\xE9e ouvertes) contenues dans le mod\xE8le. + * @return Le nombre de poylignes. */ - int getNbLigneBrisee(); + int getNbPolyligne(); /** Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -29,6 +29,7 @@ import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ctulu.CtuluListSelectionInterface; import org.fudaa.ctulu.collection.CtuluCollection; +import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeInterface; import org.fudaa.ctulu.gis.GISAttributeModel; import org.fudaa.ctulu.gis.GISLib; @@ -277,7 +278,7 @@ return; } - final int nbLigneTotal = getNbLigneBrisee(); + final int nbLigneTotal = getNombre(); final ZCalqueLigneBrisee layer = (ZCalqueLigneBrisee) _layer; if (layer.isAtomicMode()) { final int nb = layer.getLayerSelectionMulti().getNbListSelected(); @@ -376,8 +377,8 @@ return geometries_; } - public final int getNbLigneBrisee() { - return getNombre(); + public final int getNbPolyligne() { + return getNombre()-getNbPolygone(); } public final int getNbPointForGeometry(final int _idxLigne) { @@ -423,6 +424,13 @@ return true; } + public final boolean isGeometryVisible(final int _idxGeom) { + int iattVisibility=geometries_.getIndiceOf(GISAttributeConstants.VISIBILITE); + if (iattVisibility==-1) return true; + + return (Boolean)geometries_.getValue(iattVisibility, _idxGeom); + } + public boolean isValuesTableAvailable() { return true; } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileLayerModelForCourbe.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileLayerModelForCourbe.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/profile/MvProfileLayerModelForCourbe.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -42,7 +42,7 @@ _target.ajuste(domaine_); } - public int getNbLigneBrisee() { + public int getNbPolyligne() { return res_ == null ? 0 : 1; } @@ -62,6 +62,10 @@ return true; } + public boolean isGeometryVisible(int _idxGeom) { + return true; + } + public boolean point(GrPoint _pt, int _ligneIdx, int _pointIdx) { if (res_ == null) return false; _pt.x_ = res_.getIntersect(_pointIdx).getX(); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModel2dProfile.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -33,7 +33,8 @@ GISAttributeConstants.BATHY, GISAttributeConstants.ETAT_GEOM, GISAttributeConstants.TITRE, - GISAttributeConstants.NATURE + GISAttributeConstants.NATURE, + GISAttributeConstants.VISIBILITE }; // Pas de container de commande pour cette op\xE9ration, sinon conserv\xE9 en undo/redo. getGeomData().setAttributes(attrs, null); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModelGeometry.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModelGeometry.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/modeleur/layer/MdlModelGeometry.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -85,6 +85,10 @@ return (g instanceof LineString && ((LineString)g).isClosed()); } + public boolean isGeometryVisible(int _idxGeom) { + return true; + } + public boolean point(GrPoint _pt, int _idxGeom, int _pointIdx) { final CoordinateSequence g=((GISCoordinateSequenceContainerInterface)geometries_.getGeometry(_idxGeom)).getCoordinateSequence(); _pt.x_ = g.getX(_pointIdx); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigLineSingleModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigLineSingleModel.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/FSigLineSingleModel.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -86,7 +86,7 @@ _target.e_.y_ = env_.getMaxY(); } - public int getNbLigneBrisee() { + public int getNbPolyligne() { return isClosed_ ? 0 : 1; } @@ -127,4 +127,8 @@ public boolean isGeometryReliee(int geom) { return true; } + + public boolean isGeometryVisible(int geom) { + return true; + } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayer.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayer.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilLayer.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -232,7 +232,7 @@ } public void actionPerformed(final ActionEvent _e) { - if (getProfilModel().getNbLigneBrisee() == 0 || !getProfilModel().isProfilLineDefined()) { + if (getProfilModel().getNombre() == 0 || !getProfilModel().isProfilLineDefined()) { editor_.getUi().error(CtuluUIAbstract.getDefaultErrorTitle(), TrResource.getS("Aucun profil n'est d\xE9fini"), false); return; @@ -364,7 +364,7 @@ } if (!l.containsLegend(this)) { l.ajoute(this, buildPanel(null), getTitle()); - if (getModelePoly().getNbLigneBrisee() == 0) { + if (getModelePoly().getNombre() == 0) { l.setVisible(this, false); } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilModel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilModel.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfilModel.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -328,7 +328,7 @@ } final TIntArrayList list = new TIntArrayList(); final GISAttributeModel model = geometries_.getModel(type_); - for (int i = getNbLigneBrisee() - 1; i >= 0; i--) { + for (int i = getNombre() - 1; i >= 0; i--) { if (BERGE_ID.equals(model.getObjectValueAt(i)) && GISLib.intesects(((LineString) super.geometries_.getGeometry(i)), l)) { list.add(i); @@ -510,7 +510,7 @@ return false; } final GISAttributeModel model = geometries_.getModel(type_); - for (int i = getNbLigneBrisee() - 1; i >= 0; i--) { + for (int i = getNombre() - 1; i >= 0; i--) { if (BERGE_ID.equals(model.getObjectValueAt(i)) && GISLib.intesects(((LineString) super.geometries_.getGeometry(i)), l)) { return true; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfileSplitter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfileSplitter.java 2008-10-03 13:06:52 UTC (rev 4027) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiProfileSplitter.java 2008-10-03 13:08:56 UTC (rev 4028) @@ -410,11 +410,11 @@ private void computeBerges(final Zone _zones) { // il y a seulement un profil ou pas de zones: pas la peine - if (model_.getNbLigneBrisee() == 1 || _zones == null || _zones.getNumGeometries() == 0) { + if (model_.getNombre() == 1 || _zones == null || _zones.getNumGeometries() == 0) { return; } // final LineString l = getProfilLine(); - for (int i = model_.getNbLigneBrisee() - 1; i >= 0; i--) { + for (int i = model_.getNombre() - 1; i >= 0; i--) { // on parcourt uniquement les berges if (!model_.isProfile(i)) { computeBerge(_zones, model_.getLine(i)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |